Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Issue 983123003: Add [TypeChecking=Interface] to XPath interfaces (Closed)

Created:
5 years, 9 months ago by Jens Widell
Modified:
5 years, 9 months ago
Reviewers:
haraken, philipj_slow
CC:
blink-reviews, eustas+blink_chromium.org, caseq+blink_chromium.org, arv+blink, vivekg_samsung, malch+blink_chromium.org, vivekg, yurys+blink_chromium.org, lushnikov+blink_chromium.org, loislo+blink_chromium.org, pfeldman+blink_chromium.org, blink-reviews-bindings_chromium.org, Inactive, devtools-reviews_chromium.org, apavlov+blink_chromium.org, sergeyv+blink_chromium.org, aandrey+blink_chromium.org, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Add [TypeChecking=Interface] to XPath interfaces Also make all arguments non-optional, make some nullable, change the type of XPathResult input arguments to "object?" and drop the custom bindings for DocumentXPathEvaluator.evaluate() (which did nothing special at all). All this matches Firefox's behavior, and the informal "specification" at https://wiki.whatwg.org/wiki/DOM_XPath as well as, to some degree, the older specification at http://www.w3.org/TR/DOM-Level-3-XPath. The changed type of XPathResult input arguments means that any object can be used for those arguments, but the value is not used at all in our implementation anyway, so strictly checking that an XPathResult is passed serves little purpose in practice. BUG=462561 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=191546

Patch Set 1 #

Total comments: 3

Patch Set 2 : make some arguments optional again #

Patch Set 3 : fix CG for any/object argument with default value #

Total comments: 6

Patch Set 4 : revert test change; no longer needed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -141 lines) Patch
M LayoutTests/fast/xpath/evaluator-exceptions-expected.txt View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/xpath/invalid-resolver.html View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/xpath/invalid-resolver-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M LayoutTests/fast/xpath/xpath-empty-string.html View 1 2 3 1 chunk +3 lines, -4 lines 0 comments Download
D Source/bindings/core/v8/custom/V8DocumentCustom.cpp View 1 chunk +0 lines, -86 lines 0 comments Download
M Source/bindings/core/v8/custom/custom.gypi View 1 chunk +0 lines, -1 line 0 comments Download
M Source/bindings/scripts/v8_types.py View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/inspector/InspectorDOMAgent.cpp View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/DocumentXPathEvaluator.h View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/xml/DocumentXPathEvaluator.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/xml/DocumentXPathEvaluator.idl View 1 1 chunk +8 lines, -9 lines 0 comments Download
M Source/core/xml/XPathEvaluator.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/xml/XPathEvaluator.cpp View 2 chunks +2 lines, -7 lines 0 comments Download
M Source/core/xml/XPathEvaluator.idl View 1 1 chunk +5 lines, -9 lines 0 comments Download
M Source/core/xml/XPathExpression.h View 2 chunks +2 lines, -1 line 0 comments Download
M Source/core/xml/XPathExpression.cpp View 1 chunk +1 line, -6 lines 0 comments Download
M Source/core/xml/XPathExpression.idl View 1 1 chunk +3 lines, -5 lines 0 comments Download
M Source/core/xml/XPathResult.idl View 1 chunk +2 lines, -3 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
Jens Widell
PTAL This might be risky, I suppose. Document.evalate() is used on 0.1 % of page ...
5 years, 9 months ago (2015-03-06 12:43:24 UTC) #2
haraken
Can you probably get IE results? If IE also follows the behavior, we can be ...
5 years, 9 months ago (2015-03-06 13:03:13 UTC) #3
Jens Widell
On 2015/03/06 13:03:13, haraken wrote: > Can you probably get IE results? If IE also ...
5 years, 9 months ago (2015-03-06 13:04:22 UTC) #4
haraken
On 2015/03/06 13:04:22, Jens Widell wrote: > On 2015/03/06 13:03:13, haraken wrote: > > Can ...
5 years, 9 months ago (2015-03-06 13:08:04 UTC) #5
philipj_slow
It's unfortunate that there's no proper spec to consult here, but if I think that ...
5 years, 9 months ago (2015-03-06 15:53:13 UTC) #6
Jens Widell
On 2015/03/06 15:53:13, philipj_UTC7 wrote: > It's unfortunate that there's no proper spec to consult ...
5 years, 9 months ago (2015-03-09 07:21:31 UTC) #7
philipj_slow
Thanks, optional arguments looks good and conservative. Some doubt about that unused argument, but LGTM ...
5 years, 9 months ago (2015-03-09 08:17:31 UTC) #8
Jens Widell
https://codereview.chromium.org/983123003/diff/40001/Source/core/xml/XPathExpression.idl File Source/core/xml/XPathExpression.idl (right): https://codereview.chromium.org/983123003/diff/40001/Source/core/xml/XPathExpression.idl#newcode25 Source/core/xml/XPathExpression.idl:25: [RaisesException] XPathResult evaluate(Node contextNode, optional unsigned short type = ...
5 years, 9 months ago (2015-03-09 08:30:22 UTC) #9
philipj_slow
https://codereview.chromium.org/983123003/diff/40001/Source/core/xml/XPathExpression.idl File Source/core/xml/XPathExpression.idl (right): https://codereview.chromium.org/983123003/diff/40001/Source/core/xml/XPathExpression.idl#newcode25 Source/core/xml/XPathExpression.idl:25: [RaisesException] XPathResult evaluate(Node contextNode, optional unsigned short type = ...
5 years, 9 months ago (2015-03-09 10:10:47 UTC) #10
Jens Widell
https://codereview.chromium.org/983123003/diff/40001/LayoutTests/fast/xpath/xpath-empty-string.html File LayoutTests/fast/xpath/xpath-empty-string.html (right): https://codereview.chromium.org/983123003/diff/40001/LayoutTests/fast/xpath/xpath-empty-string.html#newcode8 LayoutTests/fast/xpath/xpath-empty-string.html:8: document.evaluate("//a[@id='']", document, null, XPathResult.ANY_TYPE, null); On 2015/03/09 08:17:30, philipj_UTC7 ...
5 years, 9 months ago (2015-03-09 11:05:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/983123003/60001
5 years, 9 months ago (2015-03-09 11:05:46 UTC) #14
philipj_slow
FWIW, Gecko also seems to use the result object.
5 years, 9 months ago (2015-03-09 11:22:34 UTC) #15
commit-bot: I haz the power
5 years, 9 months ago (2015-03-09 13:50:34 UTC) #16
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=191546

Powered by Google App Engine
This is Rietveld 408576698