This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25958 - TypeError or SyntaxError for querySelector() and querySelectorAll()
Summary: TypeError or SyntaxError for querySelector() and querySelectorAll()
Status: RESOLVED FIXED
Alias: None
Product: WebAppsWG
Classification: Unclassified
Component: DOM (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Anne
QA Contact: public-webapps-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-03 10:26 UTC by Arkadiusz Michalski (Spirit)
Modified: 2014-06-05 09:01 UTC (History)
4 users (show)

See Also:


Attachments

Description Arkadiusz Michalski (Spirit) 2014-06-03 10:26:23 UTC
If matches() was changed:

https://www.w3.org/Bugs/Public/show_bug.cgi?id=24028

then what about querySelector() and querySelectorAll()? This methods are older than matches(), but still in "scope-match a selectors string " algo we have:

2. If s is failure, throw a JavaScript TypeError. 

Firefox, Chrome and IE return DOMException "SyntaxError", not JavaScript TypeError (query() and queryAll() still not supported so skipping them). This behaviour is correct per Selectors API Level 1/Selectors API Level 2:

http://www.w3.org/TR/selectors-api/#parse-a-selector
http://dev.w3.org/2006/webapi/selectors-api2/#parse-a-selector

so really any implementators wants/plans change this?
Comment 1 Anne 2014-06-05 09:01:54 UTC
Yeah, not my battle. TC39 can sort this out. https://github.com/whatwg/dom/commit/1bb586f40753b5030b043c364f8eecee1e3e3d58