DOMTokenList::add can add duplicated values if arguments had duplicated values
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2013 23:16:26 +0000 (23:16 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Nov 2013 23:16:26 +0000 (23:16 +0000)
commitabdb893f2f9c230c09fcefde0e7a747ad4767c0a
treeefff39e6dfcb280fca5f45e529019fd676213725
parent4bc004000cd90c2be378e5bb18aea36dbd585351
DOMTokenList::add can add duplicated values if arguments had duplicated values
https://bugs.webkit.org/show_bug.cgi?id=123962

Reviewed by Benjamin Poulain.

Source/WebCore:

Merge https://chromium.googlesource.com/chromium/blink/+/bd3822ad4ae3fc5d8f89f433a7bf04f697334305

In case we do element.classList.add('a', 'a') we need to ensure that we do not add the same token twice.
See http://dom.spec.whatwg.org/#dom-domtokenlist-add

* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::add): Make sure filtered tokens are unique among themselves.

LayoutTests:

* fast/dom/HTMLElement/class-list-expected.txt:
* fast/dom/HTMLElement/class-list-quirks-expected.txt:
* fast/dom/HTMLElement/script-tests/class-list.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/HTMLElement/class-list-expected.txt
LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt
LayoutTests/fast/dom/HTMLElement/script-tests/class-list.js
Source/WebCore/ChangeLog
Source/WebCore/html/DOMTokenList.cpp