REGRESSION(r150187): Safari fails to render allrecipe.com comment popups
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 02:16:56 +0000 (02:16 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Aug 2013 02:16:56 +0000 (02:16 +0000)
commitd06e34d4b165db5a3315073172dc6a9b767f4b0f
treee45206590e621df716a2f9b7c3279c9c7336d128
parent7dc4e10240831890a0a1164352470903782a892a
REGRESSION(r150187): Safari fails to render allrecipe.com comment popups
https://bugs.webkit.org/show_bug.cgi?id=119780

Reviewed by Benjamin Poulain.

Source/WebCore:

The bug was caused by SelectorDataList::executeFastPathForIdSelector not verifying that
elements found by getAllElementsById are descendents of rootNode when there are multiple
elements of the same id. This resulted in querySelector and querySelectorAll of an element
returning nodes outside of the element.

Fixed the bug by checking this condition when we have multiple elements of the same id.

Test: fast/selectors/querySelector-id-with-multiple-elements-with-same-id.html

* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeFastPathForIdSelector):

LayoutTests:

* fast/selectors/querySelector-id-with-multiple-elements-with-same-id-expected.txt: Added.
* fast/selectors/querySelector-id-with-multiple-elements-with-same-id.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154037 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/selectors/querySelector-id-with-multiple-elements-with-same-id-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/querySelector-id-with-multiple-elements-with-same-id.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/SelectorQuery.cpp