Closed Bug 1339853 Opened 4 years ago Closed 3 years ago

Make XPathExpression/XPathEvaluator arguments optional

Categories

(Core :: XSLT, defect, P3)

All
Unspecified
defect

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox54 --- affected
firefox58 --- fixed

People

(Reporter: gsnedders, Assigned: peterv)

Details

Attachments

(1 file)

In landing tests for DOM XPath's IDL in web-platform-tests, I came across disagreement cross-browser about whether the majority of arguments in the XPath DOM API are optional or not. These tests are now in domxpath/interfaces.html.

Blink gets away (and has, as far as can I tell, since WebKit days) with making most of them optional, and this makes the API far easier to use. As such, https://wiki.whatwg.org/wiki/DOM_XPath now lists many of these as optional. It would be good for Gecko to align here.

WebKit, FWIW, makes them *all* optional, which makes no sense whatsoever as who wants "undefined" as a XPath expression and null as a context node.
I recently filed https://bugs.chromium.org/p/chromium/issues/detail?id=690608 about the fact that Blink doesn't match the spec and there is no modern spec.

Lots of arguments on lots of methods are optional in Blink and WebKit due to, it seems, bindings historically being maximally permissive. If there are arguments around XPath that make no sense to leave as optional, maybe we can fix that without waiting for a spec to come around.
Component: DOM → XSLT
Priority: -- → P3
Attached patch v1Splinter Review
Assignee: nobody → peterv
Status: NEW → ASSIGNED
Attachment #8914765 - Flags: review?(bzbarsky)
Comment on attachment 8914765 [details] [diff] [review]
v1

r=me, but I filed https://github.com/w3c/web-platform-tests/issues/7562 on the fact that this shouldn't be a WPT (or should be clearly labeled as testing non-standardized bits).
Attachment #8914765 - Flags: review?(bzbarsky) → review+
Pushed by pvanderbeken@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b668425e2914
Make XPathExpression/XPathEvaluator arguments optional. r=bz.
https://hg.mozilla.org/mozilla-central/rev/b668425e2914
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.