W3C home > Mailing lists > Public > public-qt-comments@w3.org > April 2009

[Bug 6777] New: In HTML documents, no-namespace expression must match http://www.w3.org/1999/xhtml nodes

From: <bugzilla@wiggum.w3.org>
Date: Mon, 06 Apr 2009 08:31:20 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-6777-523@http.www.w3.org/Bugs/Public/>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=6777

           Summary: In HTML documents, no-namespace expression must match
                    http://www.w3.org/1999/xhtml nodes
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XPath
        AssignedTo: jonathan.robie@redhat.com
        ReportedBy: hsivonen@iki.fi
         QAContact: public-qt-comments@w3.org


HTML 5 harmonizes the DOM representation of HTML and XHTML so that HTML element
nodes parsed from text/html streams are assigned into the
http://www.w3.org/1999/xhtml namespace. 

http://www.w3.org/TR/html5/tree-construction.html#creating-and-inserting-elements
http://www.w3.org/TR/html5/tree-construction.html#namespaces

(CSS has previously harmonized selector
namespace-sensitivity behavior so that HTML nodes are treated as if they were
in the http://www.w3.org/1999/xhtml namespace.)

Existing content expects to be able to use document.evaluate() to run XPath
expressions on DOM tree parsed from text/html in such a way that name
expressions that are in no namespace match against HTML elements that have the
local name specified in the expression. (Note that existing browsers already
store the local name in lower case internally, and HTML 5 exposes this through
the DOM localName property as well, so the local name is a non-issue here.)

Thus, to support existing content, implementations must during XPath evaluation
consider a name expression to match is the following case in addition to the
cases where it is already specified to match:
 * The name expression has no namespace.
AND
 * The name expression has local name l.
AND
 * The expression is being tested against an element node.
AND
 * The element node has local name l.
AND
 * The element node has namespace http://www.w3.org/1999/xhtml
AND
 * The owner document of the element node is an "HTML document", where "HTML
document" is a term of the art defined in HTML 5:
http://www.w3.org/TR/html5/dom.html#html-documents

I think the XPath specification should specify this behavior.

The relevant WebKit changeset is
http://trac.webkit.org/changeset/19564

The relevant Gecko bug is
https://bugzilla.mozilla.org/show_bug.cgi?id=468708


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Monday, 6 April 2009 08:31:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:27 UTC