Bug 17213 - The querySelectorAll method on an element node does not search only the element's descendants
Summary: The querySelectorAll method on an element node does not search only the eleme...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Major
Assignee: Sam Weinig
URL: http://andrewdupont.net/test/test_que...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2008-02-07 22:03 PST by Andrew Dupont
Modified: 2008-02-08 12:22 PST (History)
1 user (show)

See Also:


Attachments
patch (6.18 KB, patch)
2008-02-08 11:57 PST, Sam Weinig
hyatt: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Dupont 2008-02-07 22:03:10 PST
From the W3C Selectors API draft:

"The querySelectorAll() methods on the ElementSelector interface must, when invoked, return a StaticNodeList of all the Element nodes, in document order, that are descendants of the element on which the method was invoked and matches the group of selectors (selectors), if any. Otherwise it must return an empty StaticNodeList."

The testcase shows that anyElement.querySelectorAll always behaves like document.querySelectorAll — it'll search document-wide. This is incorrect.
Comment 1 Sam Weinig 2008-02-08 11:57:36 PST
Created attachment 19006 [details]
patch
Comment 2 Sam Weinig 2008-02-08 11:58:33 PST
<rdar://problem/5732491>
Comment 3 Dave Hyatt 2008-02-08 12:00:23 PST
Comment on attachment 19006 [details]
patch

r=me
Comment 4 Sam Weinig 2008-02-08 12:22:03 PST
Fixed in r30096.