<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>19928</bug_id>
          
          <creation_ts>2008-07-07 09:59:31 -0700</creation_ts>
          <short_desc>querySelectorAll handling of namespaces poisons the functionality</short_desc>
          <delta_ts>2008-07-07 21:25:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>525.x (Safari 3.1)</version>
          <rep_platform>Mac (Intel)</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>gavin.sharp</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85350</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2008-07-07 09:59:31 -0700</bug_when>
    <thetext>As far as I can tell, there is no exception thrown when CSS3 Namespaces syntax is used in the string passed to querySelectorAll, and at the same time the second argument (the NSResolver) is completely ignored.

The latter means the selector has no way to work correctly.

The former means that the page can&apos;t detect this.

I would have expected either correct use of the NSResolver or a SYNTAX_ERR or NAMESPACE_ERR on the attempt to use namespace selectors if they&apos;re not supported, so that pages can fallback as needed.

As currently implemented this makes it easy for pages to start relying on the incorrect behavior, causing problems for other UAs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85351</commentid>
    <comment_count>1</comment_count>
      <attachid>22134</attachid>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2008-07-07 10:01:02 -0700</bug_when>
    <thetext>Created attachment 22134
Testcase showing the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85386</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-07-07 14:32:04 -0700</bug_when>
    <thetext>As of r35041, we now throw a NOT_SUPPORTED_ERR when passing in an NSResolver as the second argument as per spec.  We still have to deal with the issue of CSS3 Namespaces syntax in the selector string.  I will have to read the spec more closely to figure out what to do in that case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85398</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2008-07-07 16:23:47 -0700</bug_when>
    <thetext>As a data point, IE8 beta 1 in standards mode (doesn&apos;t support this in quirks) completely ignores the second argument, and throws SYNTAX_ERR on uses of namespaces syntax.  The SYNTAX_ERR is certainly what I&apos;d expect if your CSS parser doesn&apos;t do namespaces.  NAMESPACE_ERR is what I&apos;d expect per current draft text if it does and there is no NSResolver (as in all cases now that you&apos;re throwing NOT_SUPPORTED_ERR).

In any case, it&apos;s not as important what exception is thrown as that an exception is thrown if there is no NSResolver and the string includes namespaces syntax.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85415</commentid>
    <comment_count>4</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-07-07 17:50:19 -0700</bug_when>
    <thetext>Right now I am trying to determine what the behavior should be in the face of a selector such as &quot;*|div&quot; which uses namespace syntax but should not require a NSResolver.  </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85429</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2008-07-07 19:37:03 -0700</bug_when>
    <thetext>I think if your parser parses it, it should work without an NSResolver (since there is nothing to resolve in this case).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85434</commentid>
    <comment_count>6</comment_count>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-07-07 21:25:43 -0700</bug_when>
    <thetext>Fixed in r35056.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>22134</attachid>
            <date>2008-07-07 10:01:02 -0700</date>
            <delta_ts>2008-07-07 10:01:02 -0700</delta_ts>
            <desc>Testcase showing the problem</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>389</size>
            <attacher name="Boris Zbarsky">bzbarsky</attacher>
            
              <data encoding="base64">PGh0bWw+CjxoZWFkPgogIDxzY3JpcHQ+CiAgICBmdW5jdGlvbiB0ZXN0KCkgewogICAgICB0cnkg
ewogICAgICAgIGFsZXJ0KGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoImJiYnxpbnB1dCIsIGZ1
bmN0aW9uKHByZWZpeCkgeyByZXR1cm4gImFhYSI7IH0pWzBdKTsKICAgICAgfSBjYXRjaChleCkg
ewogICAgICAgIGFsZXJ0KCJFeGNlcHRpb24gdGhyb3duOiAiICsgZXgpOwogICAgICB9CiAgICB9
CiAgPC9zY3JpcHQ+CjwvaGVhZD4KPGJvZHk+CjxpbnB1dCB0eXBlPSJidXR0b24iIG9uY2xpY2s9
InRlc3QoKSIgdmFsdWU9IlJ1biB0aGUgdGVzdC4gIFRoZSBhbGVydCBzaG91bGQgaW5kaWNhdGUg
dGhhdCBhbiBleGNlcHRpb24gd2FzIHRocm93biI+CjwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>