Skip to content

XPath: implement lang() and id() core functions#34594

Merged
jdm merged 13 commits intoservo:mainfrom
vlindhol:xpath-lang
Jun 2, 2025
Merged

XPath: implement lang() and id() core functions#34594
jdm merged 13 commits intoservo:mainfrom
vlindhol:xpath-lang

Conversation

@vlindhol
Copy link
Copy Markdown
Contributor

@vlindhol vlindhol commented Dec 12, 2024

XPath's lang() and id() functions were still unimplemented.

Also:

  • Add WPT tests for id().
  • Fix uniqueness check in NodesetHelpers::document_order_unique.
  • Tweak the AST a bit to make it clearer to express "no predicates".
  • Fix a parsing bug where "/" was attempted before "//", leaving the "//" branch as always unused.

@vlindhol vlindhol requested a review from mrobinson December 12, 2024 19:06
@simonwuelker
Copy link
Copy Markdown
Contributor

Are there no web platform tests for the id function?

@vlindhol
Copy link
Copy Markdown
Contributor Author

Are there no web platform tests for the id function?

You are correct! I should probably add at least one smoke test. If I understood correctly, tests/wpt/mozilla is for our own tests, right? Ooooh or should I be making a PR to the actual WPT test suite?

@simonwuelker
Copy link
Copy Markdown
Contributor

simonwuelker commented Dec 12, 2024

If I understood correctly, tests/wpt/mozilla is for our own tests, right?

Yes, but tests for id can easily be upstreamed, so we should add them to WPT. That way other browsers can benefit from them too.

Ooooh or should I be making a PR to the actual WPT test suite?

You don't need to make a separate PR for web platform tests (though you can, of course), an upstream PR will be opened automatically if you add the tests here.

The book has some info on adding new tests: https://book.servo.org/hacking/testing.html#writing-new-web-tests.

Signed-off-by: Ville Lindholm <[email protected]>
@simonwuelker
Copy link
Copy Markdown
Contributor

Are you still working on this?

@vlindhol
Copy link
Copy Markdown
Contributor Author

vlindhol commented Mar 6, 2025

Are you still working on this?

@simonwuelker yes, I've dropped off from OSS work for a few months due to personal reasons, but still very much am planning to continue this. Should be back in action in a week or two by the looks of it!

vlindhol added 3 commits April 5, 2025 12:16
Signed-off-by: Ville Lindholm <[email protected]>
Signed-off-by: Ville Lindholm <[email protected]>
* main: (510 commits)
  DevTools: Fix empty `debugger > source` panel (servo#37197)
  dom: implement signal abort on controller and signal (servo#37192)
  build(deps): bump parking_lot from 0.12.3 to 0.12.4 (servo#37199)
  layout: Split overflow calculation after fragment tree construction (servo#37203)
  build(deps): bump parking_lot_core from 0.9.10 to 0.9.11 (servo#37202)
  build(deps): bump lock_api from 0.4.12 to 0.4.13 (servo#37201)
  build(deps): bump cc from 1.2.24 to 1.2.25 (servo#37198)
  Constellation can now optionally report memory usage when the page is loaded. (servo#37151)
  Implement Input `type=text` UA Shadow DOM (servo#37065)
  constellation: Wait for canvas thread to shut down before shutting down system font service (servo#37182)
  Add slot default display style test (servo#37189)
  Send synthetic keydown/keyup at ime_insert_text (servo#37175)
  script: Let canvas serialization to image fail gracefully (servo#37184)
  Implement basics of link preloading (servo#37036)
  compositor: Add an initial RefreshDriver (servo#37169)
  pixels: Add limitation to max image total bytes length (servo#37172)
  Chore: Remove unused variable in `transition-zero-duration-with-delay.html` (servo#37179)
  build(deps): bump ohos-ime from 0.2.0 to 0.3.0 (servo#37180)
  Add a user agent style for the `<slot>` element (servo#37174)
  build(deps): bump hitrace from 0.1.4 to 0.1.5 (servo#37170)
  ...
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#52891) with upstreamable changes.

Signed-off-by: Ville Lindholm <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#52891).

Signed-off-by: Ville Lindholm <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#52891).

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#52891) title and body.

Signed-off-by: Ville Lindholm <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#52891).

@vlindhol
Copy link
Copy Markdown
Contributor Author

vlindhol commented Jun 1, 2025

@mrobinson @simonwuelker sorry for the longer-than-anticipated break, the PR is now up-to-date with tests for id() and AFAICT all other PR review things fixed!

Copy link
Copy Markdown
Contributor

@simonwuelker simonwuelker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM with two nits (:

Signed-off-by: Ville Lindholm <[email protected]>
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#52891).

@simonwuelker
Copy link
Copy Markdown
Contributor

Just one more ./mach update-manifest and we can merge this ^^

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#52891).

@simonwuelker simonwuelker enabled auto-merge June 2, 2025 09:13
@simonwuelker
Copy link
Copy Markdown
Contributor

simonwuelker commented Jun 2, 2025

this needs a re-review from @mrobinson to be able to merge

@simonwuelker simonwuelker disabled auto-merge June 2, 2025 15:04
@jdm
Copy link
Copy Markdown
Member

jdm commented Jun 2, 2025

Given mrobinson's previous review comments, I'm going to mark it as addressed.

@jdm jdm dismissed mrobinson’s stale review June 2, 2025 19:00

Addressed.

@jdm jdm added this pull request to the merge queue Jun 2, 2025
Merged via the queue into servo:main with commit 8cfb6e3 Jun 2, 2025
21 checks passed
@vlindhol vlindhol deleted the xpath-lang branch June 3, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

XPath: implement lang() and id() core functions

5 participants