Skip to content

script: Fix two issues in the XPath parser to pass all xml_xpath_tests.xml tests#37279

Merged
mrobinson merged 3 commits intoservo:mainfrom
vlindhol:pass-xml-xpath-tests
Jun 6, 2025
Merged

script: Fix two issues in the XPath parser to pass all xml_xpath_tests.xml tests#37279
mrobinson merged 3 commits intoservo:mainfrom
vlindhol:pass-xml-xpath-tests

Conversation

@vlindhol
Copy link
Copy Markdown
Contributor

@vlindhol vlindhol commented Jun 5, 2025

  1. Better handling of namespaces for element and attribute names in XML mode (read: non-HTML mode)
  2. While parsing, pass along context on whether we are in an absolute (/) or descendant (//) part of the query, and use it to correctly enumerate descendants according to where we are in the evaluation of the AST.

Testing: All 1024 tests in xml_xpath_tests.xml (actually xml_xpath_runner.html) pass, as well as some random tests in text-html-attributes.html.
Fixes: #37278

@vlindhol vlindhol requested a review from gterzian as a code owner June 5, 2025 19:43
vlindhol added 2 commits June 5, 2025 22:50
Signed-off-by: Ville Lindholm <[email protected]>
Signed-off-by: Ville Lindholm <[email protected]>
@mrobinson mrobinson changed the title [XPath] Pass all xml_xpath_tests.xml tests script: Fix two issues in the XPath parser to pass all xml_xpath_tests.xml tests Jun 6, 2025
@mrobinson mrobinson added this pull request to the merge queue Jun 6, 2025
Merged via the queue into servo:main with commit 475a3df Jun 6, 2025
25 checks passed
@vlindhol vlindhol deleted the pass-xml-xpath-tests branch June 6, 2025 08:04
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] Pass all xml_xpath_tests.xml tests

2 participants