Bug 123538

Summary: iOS 7 Element.querySelectorAll does not obey element scope with ID
Product: WebKit Reporter: Nick Williams <nick.williams>
Component: DOMAssignee: Ryosuke Niwa <rniwa>
Status: RESOLVED FIXED    
Severity: Normal CC: ahmad.saleem792, ap, benjamin, bfulgham, ews-watchlist, gsnedders, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Other   
URL: http://jsfiddle.net/tfS83/2/
Attachments:
Description Flags
Patch
sam: review+, ews-watchlist: commit-queue-
Archive of layout-test-results from ews101 for mac-sierra
none
Archive of layout-test-results from ews105 for mac-sierra-wk2
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Archive of layout-test-results from ews114 for mac-sierra
none
Archive of layout-test-results from ews200 for win-future none

Nick Williams
Reported 2013-10-30 16:25:10 PDT
See http://jsfiddle.net/tfS83/2/ for demonstration. This is new with iOS 7; tested on 7.0 and 7.0.3. It occurs in Chrome as well as Safari. When using .querySelectorAll on an element, where the selector is an ID selector, the scope of the element is not taken in to account. This is contrary to the behavior of iOS 6 and desktop Safari OSX and Windows, Android, etc.
Attachments
Patch (10.02 KB, patch)
2015-02-01 17:53 PST, Benjamin Poulain
sam: review+
ews-watchlist: commit-queue-
Archive of layout-test-results from ews101 for mac-sierra (2.23 MB, application/zip)
2018-04-13 19:12 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews105 for mac-sierra-wk2 (2.59 MB, application/zip)
2018-04-13 19:16 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (8.38 MB, application/zip)
2018-04-13 19:38 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (2.95 MB, application/zip)
2018-04-13 19:56 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews200 for win-future (12.76 MB, application/zip)
2018-04-13 21:10 PDT, EWS Watchlist
no flags
Benjamin Poulain
Comment 1 2015-02-01 17:53:33 PST
Benjamin Poulain
Comment 2 2015-02-01 17:56:50 PST
The bug was fixed last year: https://bugs.webkit.org/show_bug.cgi?id=119780 The problem was that documents with duplicates ids were not scoping the search correctly. This patch is to add a variant of your tests to improve the test coverage.
EWS Watchlist
Comment 3 2018-04-13 19:12:22 PDT
Comment on attachment 245850 [details] Patch Attachment 245850 [details] did not pass mac-ews (mac): Output: http://webkit-queues.webkit.org/results/7311328 New failing tests: fast/selectors/querySelector-scoped-by-element.html
EWS Watchlist
Comment 4 2018-04-13 19:12:23 PDT
Created attachment 337943 [details] Archive of layout-test-results from ews101 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews101 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 5 2018-04-13 19:16:32 PDT
Comment on attachment 245850 [details] Patch Attachment 245850 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/7311331 New failing tests: fast/selectors/querySelector-scoped-by-element.html
EWS Watchlist
Comment 6 2018-04-13 19:16:33 PDT
Created attachment 337944 [details] Archive of layout-test-results from ews105 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 7 2018-04-13 19:38:53 PDT
Comment on attachment 245850 [details] Patch Attachment 245850 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/7311417 New failing tests: fast/selectors/querySelector-scoped-by-element.html
EWS Watchlist
Comment 8 2018-04-13 19:38:54 PDT
Created attachment 337947 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
EWS Watchlist
Comment 9 2018-04-13 19:56:37 PDT
Comment on attachment 245850 [details] Patch Attachment 245850 [details] did not pass mac-debug-ews (mac): Output: http://webkit-queues.webkit.org/results/7311446 New failing tests: fast/selectors/querySelector-scoped-by-element.html
EWS Watchlist
Comment 10 2018-04-13 19:56:38 PDT
Created attachment 337950 [details] Archive of layout-test-results from ews114 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews114 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 11 2018-04-13 21:10:24 PDT
Comment on attachment 245850 [details] Patch Attachment 245850 [details] did not pass win-ews (win): Output: http://webkit-queues.webkit.org/results/7312201 New failing tests: fast/selectors/querySelector-scoped-by-element.html
EWS Watchlist
Comment 12 2018-04-13 21:10:35 PDT
Created attachment 337956 [details] Archive of layout-test-results from ews200 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews200 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Ahmad Saleem
Comment 13 2022-08-09 08:33:54 PDT
I can only find these two test cases while searching for "querySelectorAll": https://wpt.fyi/results/dom/nodes?label=master&label=experimental&aligned&view=subtest&q=queryselectorall%20 Do we need to add this test for our coverage or this can be marked as "RESOLVED WONTFIX" at this point since as mentioned in Comment 02 that it was already fixed. Further, I tested this JSBin across all browsers (Chrome Canary 106, Firefox Nightly 105 and Safari 15.6) and they have same output as below: ID Div 1 ID Div 2 1 items. Should always be 1. Class Div 1 Class Div 2 1 items. Should always be 1.
Radar WebKit Bug Importer
Comment 14 2022-08-10 11:02:54 PDT
Ryosuke Niwa
Comment 15 2022-08-10 11:41:54 PDT
EWS
Comment 16 2022-08-10 19:38:18 PDT
Committed 253315@main (09386b2b402b): <https://commits.webkit.org/253315@main> Reviewed commits have been landed. Closing PR #3197 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.