Bug 89682 - Throw SYNTAX_ERR instead of NAMESPACE_ERR from querySelector(All)
Summary: Throw SYNTAX_ERR instead of NAMESPACE_ERR from querySelector(All)
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pablo Flouret
URL: http://dev.w3.org/2006/webapi/selecto...
Keywords: WebExposed
Depends on:
Blocks:
 
Reported: 2012-06-21 11:37 PDT by Pablo Flouret
Modified: 2023-12-18 04:26 PST (History)
6 users (show)

See Also:


Attachments
Patch (10.23 KB, patch)
2012-06-21 12:02 PDT, Pablo Flouret
no flags Details | Formatted Diff | Diff
Rebased patch (8.36 KB, patch)
2012-06-21 14:05 PDT, Pablo Flouret
eric: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pablo Flouret 2012-06-21 11:37:45 PDT
The spec now says:

[[
If the group of selectors include namespace prefixes that need to be resolved, the implementation must raise a SYNTAX_ERR exception
]]

http://dev.w3.org/2006/webapi/selectors-api/#resolving-namespaces

Thread here: http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1225.html

Mozilla already changed it: https://bugzilla.mozilla.org/show_bug.cgi?id=766798
Comment 1 Pablo Flouret 2012-06-21 11:50:47 PDT
It seems i linked to the email with the decision, the first email in the thread shows the problem: http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1207.html

Basically, in some cases where both SyntaxError and NamespaceErr applied, webkit found the namespace error first, whereas other browsers found the syntax error first, leading to different exceptions being thrown.
Comment 2 Pablo Flouret 2012-06-21 12:02:49 PDT
Created attachment 148855 [details]
Patch
Comment 3 Pablo Flouret 2012-06-21 12:03:53 PDT
(In reply to comment #2)
> Created an attachment (id=148855) [details]
> Patch

I modified Element::webkitMatchesSelector as well, let me know if it's better to keep that one as is.
Comment 4 Pablo Flouret 2012-06-21 14:05:09 PDT
Created attachment 148884 [details]
Rebased patch
Comment 5 Erik Arvidsson 2012-06-21 15:13:47 PDT
Comment on attachment 148884 [details]
Rebased patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148884&action=review

Looks good to me but I'm not a reviewer.

> Source/WebCore/ChangeLog:14
> +        [[
> +        If the group of selectors include namespace prefixes that need to be
> +        resolved, the implementation must raise a SYNTAX_ERR exception
> +        ]]

I'm not sure we should use trac wiki markup here?
Comment 6 Ryosuke Niwa 2012-06-21 15:18:41 PDT
Comment on attachment 148884 [details]
Rebased patch

View in context: https://bugs.webkit.org/attachment.cgi?id=148884&action=review

>> Source/WebCore/ChangeLog:14
>> +        ]]
> 
> I'm not sure we should use trac wiki markup here?

Yeah, we don't normally do that.

> Source/WebCore/ChangeLog:20
> +        Thread here:
> +        http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1225.html
> +

Are you sure the spec is stable enough for us to change the behavior?
I would not want us end up flip-flopping between different behaviors.
Comment 7 Pablo Flouret 2012-06-21 15:36:22 PDT
(In reply to comment #6)
> (From update of attachment 148884 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=148884&action=review
> 
> >> Source/WebCore/ChangeLog:14
> >> +        ]]
> > 
> > I'm not sure we should use trac wiki markup here?
> 
> Yeah, we don't normally do that.

It's sometimes used to refer to spec excerpts, i didn't realize it was wiki markup as well. I can use quotes if it'll bring trouble.

> > Source/WebCore/ChangeLog:20
> > +        Thread here:
> > +        http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1225.html
> > +
> 
> Are you sure the spec is stable enough for us to change the behavior?
> I would not want us end up flip-flopping between different behaviors.

Mozilla made the change already, and multiple Opera people are the ones that suggested this change.

Lachy also argues that the distinction is probably not very useful anymore (and that at least Sizzle doesn't seem to care about it):
http://lists.w3.org/Archives/Public/public-webapps/2012AprJun/1215.html

The spec is going to last call soon, and moving straight to PR if nothing comes up, if i understood correctly. I don't think it's very urgent, so it's probably ok to wait for a while before landing if you prefer.
Comment 8 Eric Seidel (no email) 2012-08-12 03:56:23 PDT
Comment on attachment 148884 [details]
Rebased patch

Looks like reviewers are askign for another round.
Comment 9 Pablo Flouret 2013-02-05 14:49:28 PST
The spec moved to PR a while ago. http://lists.w3.org/Archives/Public/public-webapps/2012OctDec/0682.html
Comment 10 Anne van Kesteren 2023-12-18 04:26:21 PST
Document::selectorQueryForString() appears to handle this correctly.