Closed Bug 402129 Opened 17 years ago Closed 15 years ago

DOM document fragments are unsuccessful as XPath context nodes

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: WeirdAl, Unassigned)

References

Details

Spin off from xpath generator bug, and from DOM Range bug 332148.  When a document fragment node is the context node of an XPath, evaluating the XPath fails, even when it's a "." path.

The test is currently in this file, but disabled:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/extensions/xpath-generator/test/unit/test_bug319768.js&rev=1.1&mark=286-308#286
From http://www.w3.org/TR/2004/NOTE-DOM-Level-3-XPath-20040226/xpath.html#XPathEvaluator-evaluate :

contextNode of type Node
... must be a Document, Element, Attribute, Text, CDATASection, Comment, ProcessingInstruction, or XPathNamespace node.
Well, that stinks.  It basically means this bug is invalid.  It also means that my test for xpathgen needs fixing.  Patch coming to fix the test.
On second thought, this bug probably is valid, but against XPath Generator for allowing document fragment context nodes.

Also, adding a simple check for what type of error it throws causes me lots of grief... moments like this I wish I really had done this as a mochitest...
Component: DOM: Core → DOM: Core & HTML
Marking wontfix - XPath Generator didn't survive into 1.9.1 code, and I don't see anyone resurrecting it in Mozilla code.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.