Bug Tracker

Changes between Initial Version and Version 1 of Ticket #6491, comment 4


Ignore:
Timestamp:
Nov 21, 2010, 9:23:11 PM (12 years ago)
Author:
snover
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #6491, comment 4

    initial v1  
    1 So this appears like this may be a spec bug—or at least a kinda nasty, poorly-defined incompatibility between the css3-namespace spec and Selectors API spec.
     1So this the Selectors API spec doesn’t do a great job of defining its behaviour here, but I think I figured this out.
    22
    3 The [http://www.w3.org/TR/css3-namespace/#prefixes CSS3 namespace spec, prefixes section] states that if a namespace prefix is omitted, the namespace selected is the default namespace, and that the default namespace contains all elements with no explicitly defined namespace. Elements with explicitly defined namespaces are not part of the default namespace.
     3The [http://www.w3.org/TR/css3-namespace/#prefixes CSS3 namespace spec] states that if a namespace prefix is omitted from a selector, the namespace to select from is the null (default) namespace. It also states that the null namespace contains all elements with no ''explicitly'' defined namespace (namespaces here are defined using CSS @namespace rules and are '''not''' based on the namespace prefixes used in the XML).
    44
    5 The [http://www.w3.org/TR/selectors-api/ Selectors API], in contrast, implies (but does not state explicitly) that if a namespace prefix is omitted, the namespace to select from is ALL namespaces. This is based on the last example in Section 8. The spec itself only specifies that it should throw an Error if someone tries to use a namespace other than the null (default) namespace or the “all namespaces” selector.
     5The [http://www.w3.org/TR/selectors-api/ Selectors API] specifies that it should throw an Error if someone tries to select from a namespace other than the null (default) namespace, and does not provide any mechanism for defining non-default namespaces. As such, the null namespace selector is always equivalent to the all namespaces selector in the Selectors API.
    66
    7 Given that the limitations in Selectors API § 6.3 would make it impossible to select some elements if the null namespace was used, it would seem that Firefox is violating the spec here by not returning media-namespaced elements. This is not strictly a jQuery bug, and since namespaces are not something that people use very often, I’m going to close this as patchwelcome.
     7It would seem that Firefox is violating the spec here by not returning  XML-namespaced elements, even though they belong to the null namespace. This is not a jQuery bug, and since namespaces are not something that people use very often, I’m going to close this as patchwelcome—though I am not actually convinced this can even be worked around.