Bug 142167

Summary: querySelectorAll throws SyntaxError for attribute selector with missing ']'
Product: WebKit Reporter: C Snover <bugs.webkit.org>
Component: CSSAssignee: Emilio Cobos Álvarez (:emilio) <emilio>
Status: RESOLVED FIXED    
Severity: Normal CC: annevk, benjamin, cdumez, commit-queue, emilio, enmi.lee, ews-watchlist, koivisto, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews102 for mac-highsierra
none
Archive of layout-test-results from ews107 for mac-highsierra-wk2
none
Archive of layout-test-results from ews201 for win-future
none
Archive of layout-test-results from ews115 for mac-highsierra
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch none

C Snover
Reported 2015-03-02 08:35:41 PST
Steps to reproduce: 1. http://jsfiddle.net/k0wfsv3f/ Expected results: Displays PASS Actual results: Displays Error: SyntaxError: DOM Exception 12 Chrome 40: PASS IE 11: PASS Saf 8: FAIL Saf 7: FAIL Firefox 38: FAIL (patch available) More information: https://code.google.com/p/chromium/issues/detail?id=460399#c6 Related Web compat issue: https://github.com/webcompat/web-bugs/issues/676 Related Mozilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1137984
Attachments
Patch (4.65 KB, patch)
2019-03-31 18:17 PDT, Emilio Cobos Álvarez (:emilio)
no flags
Archive of layout-test-results from ews102 for mac-highsierra (2.53 MB, application/zip)
2019-03-31 19:20 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews107 for mac-highsierra-wk2 (2.99 MB, application/zip)
2019-03-31 19:34 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews201 for win-future (12.90 MB, application/zip)
2019-03-31 20:08 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews115 for mac-highsierra (2.33 MB, application/zip)
2019-03-31 21:33 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.88 MB, application/zip)
2019-03-31 23:19 PDT, EWS Watchlist
no flags
Patch (63.47 KB, patch)
2019-04-01 02:19 PDT, Emilio Cobos Álvarez (:emilio)
no flags
Anne van Kesteren
Comment 1 2018-01-08 08:04:16 PST
https://github.com/w3c/web-platform-tests/pull/8951 makes sure this is covered by web-platform-tests.
Emilio Cobos Álvarez (:emilio)
Comment 2 2019-02-27 22:56:07 PST
FWIW, spec text: https://drafts.csswg.org/css-syntax/#parse-error: > Certain points in the parsing algorithm are said to be parse errors. The error handling for parse errors is well-defined: user agents must either act as described below when encountering such problems, or must abort processing at the first error that they encounter for which they do not wish to apply the rules described below. https://drafts.csswg.org/css-syntax/#consume-simple-block: > <EOF-token> > This is a parse error. Return the block. (So the block is returned, and thus auto-closed) Same happens on `data:text/html,<style>:root { background: rgb(0, 255, 0`, where all browsers do the right thing. I guess Safari is not technically non-compliant, in the sense that they're technically "abort processing at the first error that they encounter for which they do not wish to apply the rules described below", but...
Emilio Cobos Álvarez (:emilio)
Comment 3 2019-03-31 17:55:38 PDT
This is trivial to fix. I'll give it a shot as soon as my WebKit build finishes... :) http://webkit.crisal.io/webkit/rev/6cc00baaf9835dc4abdf7b16e72cff60ecd7bb88/Source/WebCore/css/parser/CSSSelectorParser.cpp#402
Emilio Cobos Álvarez (:emilio)
Comment 4 2019-03-31 17:57:37 PDT
Well actually my WebKit build fails in some random GTK dependency... I guess it's EWS-based test updates then :)
Emilio Cobos Álvarez (:emilio)
Comment 5 2019-03-31 18:17:43 PDT
EWS Watchlist
Comment 6 2019-03-31 19:20:11 PDT
Comment on attachment 366380 [details] Patch Attachment 366380 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/11723836 New failing tests: fast/css/parsing-css-attribute-case-insensitive-value-3.html imported/w3c/web-platform-tests/dom/nodes/Element-matches.html imported/w3c/web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html imported/w3c/web-platform-tests/css/selectors/missing-right-token.html fast/selectors/invalid-functional-pseudo-class.html
EWS Watchlist
Comment 7 2019-03-31 19:20:13 PDT
Created attachment 366381 [details] Archive of layout-test-results from ews102 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 8 2019-03-31 19:34:50 PDT
Comment on attachment 366380 [details] Patch Attachment 366380 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/11723876 New failing tests: fast/selectors/invalid-functional-pseudo-class.html imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht.xht imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All.html imported/w3c/web-platform-tests/css/selectors/missing-right-token.html fast/css/parsing-css-attribute-case-insensitive-value-3.html imported/w3c/web-platform-tests/dom/nodes/Element-matches.html imported/w3c/web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html
EWS Watchlist
Comment 9 2019-03-31 19:34:52 PDT
Created attachment 366382 [details] Archive of layout-test-results from ews107 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 10 2019-03-31 20:08:39 PDT
Comment on attachment 366380 [details] Patch Attachment 366380 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/11724014 New failing tests: fast/css/parsing-css-attribute-case-insensitive-value-3.html fast/selectors/invalid-functional-pseudo-class.html
EWS Watchlist
Comment 11 2019-03-31 20:08:51 PDT
Created attachment 366383 [details] Archive of layout-test-results from ews201 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews201 Port: win-future Platform: CYGWIN_NT-6.1-2.10.0-0.325-5-3-x86_64-64bit
EWS Watchlist
Comment 12 2019-03-31 21:33:49 PDT
Comment on attachment 366380 [details] Patch Attachment 366380 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/11724337 New failing tests: fast/css/parsing-css-attribute-case-insensitive-value-3.html imported/w3c/web-platform-tests/dom/nodes/Element-matches.html imported/w3c/web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html imported/w3c/web-platform-tests/css/selectors/missing-right-token.html fast/selectors/invalid-functional-pseudo-class.html
EWS Watchlist
Comment 13 2019-03-31 21:33:51 PDT
Created attachment 366385 [details] Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 14 2019-03-31 23:19:39 PDT
Comment on attachment 366380 [details] Patch Attachment 366380 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/11724830 New failing tests: fast/selectors/invalid-functional-pseudo-class.html imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht.xht imported/w3c/web-platform-tests/dom/nodes/ParentNode-querySelector-All.html imported/w3c/web-platform-tests/css/selectors/missing-right-token.html fast/css/parsing-css-attribute-case-insensitive-value-3.html imported/w3c/web-platform-tests/dom/nodes/Element-matches.html imported/w3c/web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html
EWS Watchlist
Comment 15 2019-03-31 23:19:41 PDT
Created attachment 366388 [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.6
Emilio Cobos Álvarez (:emilio)
Comment 16 2019-04-01 02:19:53 PDT
Antti Koivisto
Comment 17 2019-04-01 02:44:56 PDT
Comment on attachment 366392 [details] Patch r=me
WebKit Commit Bot
Comment 18 2019-04-01 05:50:50 PDT
Comment on attachment 366392 [details] Patch Clearing flags on attachment: 366392 Committed r243691: <https://trac.webkit.org/changeset/243691>
WebKit Commit Bot
Comment 19 2019-04-01 05:50:52 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 20 2019-04-01 05:51:25 PDT
Note You need to log in before you can comment on or make changes to this bug.