adoptNode() changes css class to lowercase for document loaded with XHR responseType...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2016 02:24:27 +0000 (02:24 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 9 Jul 2016 02:24:27 +0000 (02:24 +0000)
commit57ceed009fced1428e19c187d4f3bcac6dcdd5b3
tree90d0bc81d38b2cc75ed2ff22a691f5d920d293c2
parentf629215d4660c9a3ba17c7f683691677ddf2db0a
adoptNode() changes css class to lowercase for document loaded with XHR responseType = "document"
https://bugs.webkit.org/show_bug.cgi?id=159555
<rdar://problem/27252541>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When adopting an Element from another document which has a different quirks mode,
case-sensitivity for id and class attributes differs and we need to correctly
update members such as ElementData::m_classNames or ElementData::m_idForStyleResolution.

To address the issue, have Element override didMoveToNewDocument() and call
attributeChanged() for id and class attributes.

Test: fast/dom/Document/adoptNode-quirks-mismatch.html

* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
* dom/Element.h:

LayoutTests:

Add test coverage for id and class attributes.

* fast/dom/Document/adoptNode-quirks-mismatch-expected.txt: Added.
* fast/dom/Document/adoptNode-quirks-mismatch.html: Added.
* fast/dom/Document/resources/document-quirks-class.html: Added.
* fast/dom/Document/resources/document-quirks-id.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/Document/adoptNode-quirks-mismatch-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/Document/adoptNode-quirks-mismatch.html [new file with mode: 0644]
LayoutTests/fast/dom/Document/resources/document-quirks-class.html [new file with mode: 0644]
LayoutTests/fast/dom/Document/resources/document-quirks-id.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h