From 1e2643a920ad7919cb8cd3977bd1cdafe6147b88 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ga=CC=81bor=20Hojtsy?= <gabor@hojtsy.hu>
Date: Thu, 31 Oct 2019 14:28:55 +0100
Subject: [PATCH] Issue #3090010 by zrpnr, bnjmnm: Remove classList in Drupal 9

---
 core/assets/vendor/classList/LICENSE.md              |  2 --
 core/assets/vendor/classList/classList.min.js        |  2 --
 core/core.libraries.yml                              | 12 ------------
 .../Tests/Listeners/DeprecationListenerTrait.php     |  1 -
 4 files changed, 17 deletions(-)
 delete mode 100644 core/assets/vendor/classList/LICENSE.md
 delete mode 100644 core/assets/vendor/classList/classList.min.js

diff --git a/core/assets/vendor/classList/LICENSE.md b/core/assets/vendor/classList/LICENSE.md
deleted file mode 100644
index cb518af7825d..000000000000
--- a/core/assets/vendor/classList/LICENSE.md
+++ /dev/null
@@ -1,2 +0,0 @@
-This software is dedicated to the public domain. No warranty is expressed or implied.
-Use this software at your own risk.
diff --git a/core/assets/vendor/classList/classList.min.js b/core/assets/vendor/classList/classList.min.js
deleted file mode 100644
index 99b828c1ef94..000000000000
--- a/core/assets/vendor/classList/classList.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
-if("document" in self){if(!("classList" in document.createElement("_"))){(function(j){"use strict";if(!("Element" in j)){return}var a="classList",f="prototype",m=j.Element[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.getAttribute("class")||""),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.setAttribute("class",this.toString())}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(){var s=arguments,r=0,p=s.length,q,o=false;do{q=s[r]+"";if(g(this,q)===-1){this.push(q);o=true}}while(++r<p);if(o){this._updateClassName()}};e.remove=function(){var t=arguments,s=0,p=t.length,r,o=false,q;do{r=t[s]+"";q=g(this,r);while(q!==-1){this.splice(q,1);o=true;q=g(this,r)}}while(++s<p);if(o){this._updateClassName()}};e.toggle=function(p,q){p+="";var o=this.contains(p),r=o?q!==true&&"remove":q!==false&&"add";if(r){this[r](p)}if(q===true||q===false){return q}else{return !o}};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))}else{(function(){var b=document.createElement("_");b.classList.add("c1","c2");if(!b.classList.contains("c2")){var c=function(e){var d=DOMTokenList.prototype[e];DOMTokenList.prototype[e]=function(h){var g,f=arguments.length;for(g=0;g<f;g++){h=arguments[g];d.call(this,h)}}};c("add");c("remove")}b.classList.toggle("c3",false);if(b.classList.contains("c3")){var a=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(d,e){if(1 in arguments&&!this.contains(d)===!e){return e}else{return a.call(this,d)}}}b=null}())}};
\ No newline at end of file
diff --git a/core/core.libraries.yml b/core/core.libraries.yml
index f8cdc7533e42..d82185010e12 100644
--- a/core/core.libraries.yml
+++ b/core/core.libraries.yml
@@ -12,17 +12,6 @@ backbone:
   dependencies:
     - core/underscore
 
-classList:
-  remote: https://github.com/eligrey/classList.js
-  version: "2014-12-13"
-  license:
-    name: Public Domain
-    url: https://github.com/eligrey/classList.js/blob/2014-12-13/LICENSE.md
-    gpl-compatible: true
-  js:
-    assets/vendor/classList/classList.min.js: { weight: -21, browsers: { IE: 'lte IE 9', '!IE': false }, minified: true }
-  deprecated: The "%library_id%" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the the native browser implementation instead. See https://www.drupal.org/node/3089511
-
 ckeditor:
   remote: https://github.com/ckeditor/ckeditor-dev
   version: "4.11.4"
@@ -79,7 +68,6 @@ drupal.active-link:
   dependencies:
     - core/drupal
     - core/drupalSettings
-    - core/classList
 
 drupal.ajax:
   version: VERSION
diff --git a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
index 7d66a6ae622b..1be70ba4862b 100644
--- a/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
+++ b/core/tests/Drupal/Tests/Listeners/DeprecationListenerTrait.php
@@ -192,7 +192,6 @@ public static function getSkippedDeprecations() {
       'Drupal\Tests\BrowserTestBase::$defaultTheme is required in drupal:9.0.0 when using an install profile that does not set a default theme. See https://www.drupal.org/node/2352949, which includes recommendations on which theme to use.',
       'The "core/matchmedia" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3086653',
       'The "core/matchmedia.addListener" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. See https://www.drupal.org/node/3086653',
-      'The "core/classList" asset library is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use the the native browser implementation instead. See https://www.drupal.org/node/3089511',
       // The following deprecation is listed for Twig 2 compatibility when unit
       // testing using \Symfony\Component\ErrorHandler\DebugClassLoader.
       'The "Twig\Environment::getTemplateClass()" method is considered internal. It may change without further notice. You should not extend it from "Drupal\Core\Template\TwigEnvironment".',
-- 
GitLab