mirror of
https://github.com/servo/servo.git
synced 2025-09-30 08:39:16 +01:00
Add XPath parser/evaluator (#34463)
* Add XPath parser/evaluator Signed-off-by: Ville Lindholm <ville@lindholm.dev> * Correctly annotate XPathEvaluator IDL Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: have bindings pass in `can_gc` Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: implement PartialEq for Value for readability Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add docstrings for CoreFunctions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: simplify node test code Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: add unit tests for string handling xpath functions Signed-off-by: Ville Lindholm <ville@lindholm.dev> * put xpath features behind dom.xpath.enabled pref Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review] remove rstest and insta dev-deps Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations Signed-off-by: Ville Lindholm <ville@lindholm.dev> * [PR review]: tweak metadata files Signed-off-by: Ville Lindholm <ville@lindholm.dev> * update wpt test expectations AGAIN Signed-off-by: Ville Lindholm <ville@lindholm.dev> --------- Signed-off-by: Ville Lindholm <ville@lindholm.dev>
This commit is contained in:
parent
264c0f972f
commit
bc7fe41a02
36 changed files with 6426 additions and 314 deletions
3
tests/wpt/meta/domxpath/document.tentative.html.ini
vendored
Normal file
3
tests/wpt/meta/domxpath/document.tentative.html.ini
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[document.tentative.html]
|
||||
[XPath parent of documentElement]
|
||||
expected: FAIL
|
21
tests/wpt/meta/domxpath/fn-lang.html.ini
vendored
Normal file
21
tests/wpt/meta/domxpath/fn-lang.html.ini
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
[fn-lang.html]
|
||||
[lang("en"): <root><match lang="en"></match></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("en"): <root><match lang="EN"></match></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("en"): <root><match lang="en-us"></match></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("en"): <root><unmatch></unmatch></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("ja"): <root lang="ja"><match></match></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("ja"): <root lang="ja-jp"><unmatch lang="ja_JP"></unmatch></root>]
|
||||
expected: FAIL
|
||||
|
||||
[lang("ko"): <root><unmatch lang="Ko"></unmatch></root>]
|
||||
expected: FAIL
|
6
tests/wpt/meta/domxpath/lexical-structure.html.ini
vendored
Normal file
6
tests/wpt/meta/domxpath/lexical-structure.html.ini
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[lexical-structure.html]
|
||||
[Literal: Only ' and " should be handled as literal quotes.]
|
||||
expected: FAIL
|
||||
|
||||
[ExprWhitespace: Only #x20 #x9 #xD or #xA must be handled as a whitespace.]
|
||||
expected: FAIL
|
3
tests/wpt/meta/domxpath/node-sets.html.ini
vendored
Normal file
3
tests/wpt/meta/domxpath/node-sets.html.ini
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[node-sets.html]
|
||||
[| operator should evaluate both sides of expressions with the same context node]
|
||||
expected: FAIL
|
3
tests/wpt/meta/domxpath/predicates.html.ini
vendored
Normal file
3
tests/wpt/meta/domxpath/predicates.html.ini
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[predicates.html]
|
||||
[An expression in a predicate should not change the context node]
|
||||
expected: FAIL
|
15
tests/wpt/meta/domxpath/resolver-callback-interface-cross-realm.tentative.html.ini
vendored
Normal file
15
tests/wpt/meta/domxpath/resolver-callback-interface-cross-realm.tentative.html.ini
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
[resolver-callback-interface-cross-realm.tentative.html]
|
||||
[XPathNSResolver is cross-realm plain object without 'lookupNamespaceURI' property]
|
||||
expected: FAIL
|
||||
|
||||
[XPathNSResolver is cross-realm plain object with non-callable 'lookupNamespaceURI' property]
|
||||
expected: FAIL
|
||||
|
||||
[XPathNSResolver is cross-realm non-callable revoked Proxy]
|
||||
expected: FAIL
|
||||
|
||||
[XPathNSResolver is cross-realm callable revoked Proxy]
|
||||
expected: FAIL
|
||||
|
||||
[XPathNSResolver is cross-realm plain object with revoked Proxy as 'lookupNamespaceURI' property]
|
||||
expected: FAIL
|
30
tests/wpt/meta/domxpath/resolver-callback-interface.html.ini
vendored
Normal file
30
tests/wpt/meta/domxpath/resolver-callback-interface.html.ini
vendored
Normal file
|
@ -0,0 +1,30 @@
|
|||
[resolver-callback-interface.html]
|
||||
[callable resolver]
|
||||
expected: FAIL
|
||||
|
||||
[callable resolver: result is not cached]
|
||||
expected: FAIL
|
||||
|
||||
[callable resolver: abrupt completion from Call]
|
||||
expected: FAIL
|
||||
|
||||
[callable resolver: no 'lookupNamespaceURI' lookups]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver: this value and `prefix` argument]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver: 'lookupNamespaceURI' is not cached]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver: abrupt completion from Get]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver: 'lookupNamespaceURI' is thruthy and not callable]
|
||||
expected: FAIL
|
||||
|
||||
[object resolver: 'lookupNamespaceURI' is falsy and not callable]
|
||||
expected: FAIL
|
18
tests/wpt/meta/domxpath/resolver-non-string-result.html.ini
vendored
Normal file
18
tests/wpt/meta/domxpath/resolver-non-string-result.html.ini
vendored
Normal file
|
@ -0,0 +1,18 @@
|
|||
[resolver-non-string-result.html]
|
||||
[undefined]
|
||||
expected: FAIL
|
||||
|
||||
[null]
|
||||
expected: FAIL
|
||||
|
||||
[number]
|
||||
expected: FAIL
|
||||
|
||||
[boolean]
|
||||
expected: FAIL
|
||||
|
||||
[symbol]
|
||||
expected: FAIL
|
||||
|
||||
[object coercion (abrupt completion)]
|
||||
expected: FAIL
|
39
tests/wpt/meta/domxpath/text-html-attributes.html.ini
vendored
Normal file
39
tests/wpt/meta/domxpath/text-html-attributes.html.ini
vendored
Normal file
|
@ -0,0 +1,39 @@
|
|||
[text-html-attributes.html]
|
||||
[Select html element based on attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Select html element based on attribute mixed case]
|
||||
expected: FAIL
|
||||
|
||||
[Select both HTML and SVG elements based on attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Select HTML element with non-ascii attribute 1]
|
||||
expected: FAIL
|
||||
|
||||
[Select HTML element with non-ascii attribute 2]
|
||||
expected: FAIL
|
||||
|
||||
[Select HTML element with non-ascii attribute 3]
|
||||
expected: FAIL
|
||||
|
||||
[Select SVG element based on mixed case attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Select both HTML and SVG elements based on mixed case attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Select SVG elements with refX attribute]
|
||||
expected: FAIL
|
||||
|
||||
[Select SVG element with non-ascii attribute 1]
|
||||
expected: FAIL
|
||||
|
||||
[Select SVG element with non-ascii attribute 2]
|
||||
expected: FAIL
|
||||
|
||||
[xmlns attribute]
|
||||
expected: FAIL
|
||||
|
||||
[svg element with XLink attribute]
|
||||
expected: FAIL
|
24
tests/wpt/meta/domxpath/text-html-elements.html.ini
vendored
Normal file
24
tests/wpt/meta/domxpath/text-html-elements.html.ini
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
[text-html-elements.html]
|
||||
[HTML elements namespace prefix]
|
||||
expected: FAIL
|
||||
|
||||
[HTML elements mixed use of prefix]
|
||||
expected: FAIL
|
||||
|
||||
[SVG elements namespace prefix]
|
||||
expected: FAIL
|
||||
|
||||
[HTML elements mixed case]
|
||||
expected: FAIL
|
||||
|
||||
[SVG elements mixed case selector]
|
||||
expected: FAIL
|
||||
|
||||
[Non-ascii HTML element]
|
||||
expected: FAIL
|
||||
|
||||
[Non-ascii HTML element3]
|
||||
expected: FAIL
|
||||
|
||||
[Throw with invalid prefix]
|
||||
expected: FAIL
|
3072
tests/wpt/meta/domxpath/xml_xpath_runner.html.ini
vendored
Normal file
3072
tests/wpt/meta/domxpath/xml_xpath_runner.html.ini
vendored
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue