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
https://github.com/w3c/web-platform-tests/pull/8951 makes sure this is covered by web-platform-tests.
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...
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
Well actually my WebKit build fails in some random GTK dependency... I guess it's EWS-based test updates then :)
Created attachment 366380 [details] Patch
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
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
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
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
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
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
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
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
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
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
Created attachment 366392 [details] Patch
Comment on attachment 366392 [details] Patch r=me
Comment on attachment 366392 [details] Patch Clearing flags on attachment: 366392 Committed r243691: <https://trac.webkit.org/changeset/243691>
All reviewed patches have been landed. Closing bug.
<rdar://problem/49476626>