Skip to content

wdspec tests: Check correct node type instead of asserting error for script execution#39988

Merged
jdm merged 12 commits intomainfrom
update-wpt
Oct 23, 2025
Merged

wdspec tests: Check correct node type instead of asserting error for script execution#39988
jdm merged 12 commits intomainfrom
update-wpt

Conversation

@yezhizhen
Copy link
Copy Markdown
Member

@yezhizhen yezhizhen commented Oct 19, 2025

These tests suggest that attribute nodes, document etc. are invalid node. That is simply not true based on spec.

Only Firefox pass these tests, while Chrome/Safari fails.
https://wpt.fyi/results/webdriver/tests/classic/execute_script?label=master

There is an ongoing discussion: w3c/webdriver#1687 (comment)

--
EDIT: Instead of removing these tests, we check

  1. whether the node type returned is correct
  2. whether the serialization for enumerable properties for fallback plain object is correct.

@yezhizhen yezhizhen requested a review from xiaochengh October 19, 2025 14:19
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 19, 2025
@yezhizhen yezhizhen changed the title webdriver: Remove outdated script execution tests to align spec webdriver: Remove outdated script execution tests to align with spec Oct 19, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

Signed-off-by: Euclid <[email protected]>
@jgraham
Copy link
Copy Markdown
Contributor

jgraham commented Oct 20, 2025

The WebDriver spec seems very clear here, in the serializer we explicitly switch on whether the input object is an Element, not any Node:https://w3c.github.io/webdriver/#dfn-internal-json-clone and there's an assert in the get or create a web element reference that the input is in fact an Element: https://w3c.github.io/webdriver/#dfn-get-or-create-a-web-element-reference

The spec could change here of course, but as it stands at present these tests are correct.

@whimboo
Copy link
Copy Markdown

whimboo commented Oct 20, 2025

The WebDriver spec seems very clear here, in the serializer we explicitly switch on whether the input object is an Element, not any Node:https://w3c.github.io/webdriver/#dfn-internal-json-clone and there's an assert in the get or create a web element reference that the input is in fact an Element: https://w3c.github.io/webdriver/#dfn-get-or-create-a-web-element-reference

Please note that the changes for the wpt tests are related to enumerable properties. This code we only hit in the fallback code for plain objects which are not considered Elements.

2. Remove test unrelated to node
Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
Signed-off-by: Euclid Ye <[email protected]>
@yezhizhen yezhizhen changed the title webdriver: Remove outdated script execution tests to align with spec webdriver: Check correct node type instead of asserting error Oct 21, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@yezhizhen yezhizhen changed the title webdriver: Check correct node type instead of asserting error wdspec tests: Check correct node type instead of asserting error Oct 21, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@servo servo deleted a comment from servo-wpt-sync Oct 21, 2025
@servo servo deleted a comment from servo-wpt-sync Oct 21, 2025
@servo servo deleted a comment from servo-wpt-sync Oct 21, 2025
@servo servo deleted a comment from servo-wpt-sync Oct 21, 2025
Copy link
Copy Markdown
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

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

Why are the two test files testing different things now?

@yezhizhen
Copy link
Copy Markdown
Member Author

Why are the two test files testing different things now?

Oh because I forgot to update the other one!
Will change later...

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@yezhizhen yezhizhen changed the title wdspec tests: Check correct node type instead of asserting error wdspec tests: Check correct node type instead of asserting error for script execution Oct 21, 2025
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@whimboo
Copy link
Copy Markdown

whimboo commented Oct 21, 2025

Hm, what is the difference to #39988 which I just reviewed? It seems to map to web-platform-tests/wpt#55534 as well.

@yezhizhen
Copy link
Copy Markdown
Member Author

Hm, what is the difference to #39988 which I just reviewed? It seems to map to web-platform-tests/wpt#55534 as well.

It is the same, except some internal Servo manifest file update, which would be excluded by wpt-export bot.

Once you are satisifed and approve the upstream, I can find someone to stamp this which automatically merge the upstream as well.

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

1 similar comment
@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

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

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

@servo-wpt-sync
Copy link
Copy Markdown
Collaborator

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

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

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

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 23, 2025
@jdm jdm added this pull request to the merge queue Oct 23, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 23, 2025
Merged via the queue into main with commit 8a81848 Oct 23, 2025
30 checks passed
@jdm jdm deleted the update-wpt branch October 23, 2025 03:27
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 23, 2025
github-merge-queue bot pushed a commit that referenced this pull request Oct 30, 2025
#39988 replaced these faulty tests with another set of tests and we've
been fully passing them. Somehow this is not caught by CI/expectation
update script.

Signed-off-by: Euclid Ye <[email protected]>
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.

6 participants