Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js

Issue 1411123004: Handle extra whitespaces in the DOM token list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
index 4aed0c6e0af23d378847e6d123675930fa3dbcd9..2b80e4f6f0757ce28c8cd706873a55b1a074fb75 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
@@ -70,7 +70,7 @@ shouldBeEqualToString('element.className', '');
// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/011.htm
createElement(' y x y ');
element.classList.remove('x');
-shouldBeEqualToString('element.className', ' y y ');
+shouldBeEqualToString('element.className', 'y y');
// http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/getting/012.htm
createElement(' x y x ');
@@ -324,13 +324,24 @@ observer.observe(element, {attributes: true});
element.classList.add('a', 'c');
shouldBe('observer.takeRecords().length', '1');
+createElement(' a b c ');
+element.classList.remove('a');
+shouldBeEqualToString("element.className", "b c");
+
+createElement(' a b c ');
+element.classList.remove('b');
+shouldBeEqualToString("element.className", "a c");
+
+createElement(' a b c ');
+element.classList.remove('c');
+shouldBeEqualToString("element.className", "a b");
createElement('a b c d ');
element.classList.remove('a', 'c');
-shouldBeEqualToString('element.className', 'b d ');
+shouldBeEqualToString('element.className', 'b d');
element.classList.remove('b', 'b');
-shouldBeEqualToString('element.className', 'd ');
+shouldBeEqualToString('element.className', 'd');
createElement('a b c null d undefined 0 false');
element.classList.remove(null, {toString: function() { return 'd' }}, undefined, 0, false);

Powered by Google App Engine
This is Rietveld 408576698