REGRESSION(r149652): accessing items in .children via id doesn't work when element...
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jun 2013 03:50:47 +0000 (03:50 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jun 2013 03:50:47 +0000 (03:50 +0000)
commitc2df9d55f5b2281a5ffcfb84c88a631512be6f1d
tree116e653b614c049a8e959ea067e0fe217160fa22
parent521ca2cf32236204a616f1cfd0f1fc361fcb2a6b
REGRESSION(r149652): accessing items in .children via id doesn't work when element is not rooted in DOM tree
https://bugs.webkit.org/show_bug.cgi?id=117836

Reviewed by Benjamin Poulain.

Source/WebCore:

When the root node of a HTML collection is not in the document or in a shadow tree,
we shouldn't use its tree scope's id and name maps to find name getters.

Always use the slow path in such cases.

Test: fast/dom/htmlallcollection-detached-node-children.html

* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::namedItem):

LayoutTests:

Add a regression test for named getter for a detached element.

* fast/dom/htmlallcollection-detached-node-children-expected.txt: Added.
* fast/dom/htmlallcollection-detached-node-children.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@151821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/htmlallcollection-detached-node-children-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/htmlallcollection-detached-node-children.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCollection.cpp