Closed Bug 2070948 Opened 2 months ago Closed 2 months ago

[wpt-sync] Sync PR 62533 - xpath: Fix `name`, `local-name` and `namespace-uri` to correctly process attributes

Categories

(Core :: XSLT, task, P4)

task

Tracking

()

RESOLVED FIXED
158 Branch
Tracking Status
firefox158 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 62533 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/62533
Details from upstream follow.

Leo Watts <leowatts34@gmail.com> wrote:

xpath: Fix name, local-name and namespace-uri to correctly process attributes

Changed the implementation of each relevant function to include attributes as well as elements. Wasn't sure whether to introduce a new struct or just use tuples in name_parts. Advice from reviewers much appreciated.

Advice also appreciated on use of shadowing in if let Some(prefix) = prefix.

Testing: Added a WPT in domxpath to cover these name-related functions. I don't know anything about the WPT upstreaming process but I assume this could be upstreamed?
Fixes: #<!-- nolink -->47798

Behaviour before code change:

  ▶ OK /domxpath/fns-name-related.html
  │   ▶ FAIL [expected PASS] fns-name-related 3
  │   │   → assert_equals: expected "gamma:delta" but got ""
  │   │ 
  │   │ testFunction/<@http://web-platform.test:8000/domxpath/fns-name-related.html:15:18
  │   │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
  │   │ test@http://web-platform.test:8000/resources/testharness.js:633:30
  │   │ testFunction@http://web-platform.test:8000/domxpath/fns-name-related.html:12:7
  │   └ @http://web-platform.test:8000/domxpath/fns-name-related.html:24:13
  │   ▶ FAIL [expected PASS] fns-name-related 4
  │   │   → assert_equals: expected "delta" but got ""
  │   │ 
  │   │ testFunction/<@http://web-platform.test:8000/domxpath/fns-name-related.html:15:18
  │   │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
  │   │ test@http://web-platform.test:8000/resources/testharness.js:633:30
  │   │ testFunction@http://web-platform.test:8000/domxpath/fns-name-related.html:12:7
  │   └ @http://web-platform.test:8000/domxpath/fns-name-related.html:25:13
  │   ▶ FAIL [expected PASS] fns-name-related 5
  │   │   → assert_equals: expected "http://example.com/gamma" but got ""
  │   │ 
  │   │ testFunction/<@http://web-platform.test:8000/domxpath/fns-name-related.html:15:18
  │   │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
  │   │ test@http://web-platform.test:8000/resources/testharness.js:633:30
  │   │ testFunction@http://web-platform.test:8000/domxpath/fns-name-related.html:12:7
  └   └ @http://web-platform.test:8000/domxpath/fns-name-related.html:26:13

Reviewed in servo/servo#47912

Component: web-platform-tests → XSLT
Product: Testing → Core

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 35 tests

Status Summary

Firefox

OK : 1[GitHub] 33[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 2[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 6[GitHub] 1141[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 21

Chrome

OK : 1
PASS: 6

Safari

OK : 1
PASS: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /domxpath/evaluator-different-document.tentative.html [wpt.fyi]
    • evaluate operation on XML document, context node in HTML document, no namespace resolver: FAIL
    • evaluate operation on HTML document, context node in XML document, no namespace resolver: FAIL
    • evaluate operation on XML document, context node in HTML document, with namespace resolver: FAIL
    • evaluate operation on HTML document, context node in XML document, with namespace resolver: FAIL
  • /domxpath/expression-cross-realm.tentative.html [wpt.fyi]
    • expression from realm with XML associated document, context node in XML document, no namespace resolver: FAIL
    • expression from realm with XML associated document, context node in HTML document, no namespace resolver: FAIL
    • expression from realm with HTML associated document, context node in XML document, no namespace resolver: FAIL
    • expression from realm with HTML associated document, context node in HTML document, no namespace resolver: FAIL
  • /domxpath/expression-different-document.tentative.html [wpt.fyi]
    • expression from XML document, context node in HTML document, no namespace resolver: FAIL
    • expression from HTML document, context node in XML document, no namespace resolver: FAIL
    • expression from XML document, context node in HTML document, with namespace resolver: FAIL
    • expression from HTML document, context node in XML document, with namespace resolver: FAIL
  • /domxpath/fn-lang.html [wpt.fyi]
    • lang("ko"): <root><unmatch xml:lang="Ko"/></root>: FAIL
  • /domxpath/resolver-callback-interface-cross-realm.tentative.html [wpt.fyi]
    • XPathNSResolver is cross-realm plain object without 'lookupNamespaceURI' property: FAIL
    • XPathNSResolver is cross-realm plain object with non-callable 'lookupNamespaceURI' property: FAIL
    • XPathNSResolver is cross-realm non-callable revoked Proxy: FAIL
    • XPathNSResolver is cross-realm callable revoked Proxy: FAIL
    • XPathNSResolver is cross-realm plain object with revoked Proxy as 'lookupNamespaceURI' property: FAIL
  • /domxpath/text-html-attributes.html [wpt.fyi]
    • Select SVG element based on mixed case attribute: FAIL
    • Select both HTML and SVG elements based on mixed case attribute: FAIL
    • Select SVG elements with refX attribute: FAIL
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bfd88b88b30c https://hg.mozilla.org/integration/autoland/rev/593baffe152b [wpt PR 62533] - xpath: Fix `name`, `local-name` and `namespace-uri` to correctly process attributes, a=testonly
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 158 Branch
You need to log in before you can comment on or make changes to this bug.