HTMLElement.classList cannot remove classnames with uppercase characters
authorarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 02:26:35 +0000 (02:26 +0000)
committerarv@chromium.org <arv@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 Aug 2012 02:26:35 +0000 (02:26 +0000)
commit80df3689e20bc1b52f2cd705a5cd5397a41d6e36
treeab71a03efa6bd64b6e8b88815bda54077d89c683
parent851be5698a1098e7589043f79a1643487fb0f3f9
HTMLElement.classList cannot remove classnames with uppercase characters
https://bugs.webkit.org/show_bug.cgi?id=93628

Reviewed by Alexey Proskuryakov.

Before this patch we were trying to be smart and determine whether we needed the update m_classNamesForQuirksMode
based on whether m_classNamesForQuirksMode.isNull(), however, m_classNamesForQuirksMode.isNull() is true when the
class name is the empty string.

We also did not update m_classNamesForQuirksMode when the class attribute was cleared.

Source/WebCore:

Updated tests.

* dom/StyledElement.cpp:
(WebCore::StyledElement::classAttributeChanged):
* html/ClassList.cpp:
(WebCore::ClassList::reset):
(WebCore::ClassList::classNames):

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@125239 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/dom/StyledElement.cpp
Source/WebCore/html/ClassList.cpp