script: Implement creating and running classic scripts according to spec#41109
Merged
TimvdLippe merged 5 commits intoservo:mainfrom Dec 7, 2025
Merged
script: Implement creating and running classic scripts according to spec#41109TimvdLippe merged 5 commits intoservo:mainfrom
TimvdLippe merged 5 commits intoservo:mainfrom
Conversation
follow more closely spec Signed-off-by: Gae24 <[email protected]>
…obal Signed-off-by: Gae24 <[email protected]>
Signed-off-by: Gae24 <[email protected]>
|
🔨 Triggering try run (#19992460906) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19992460906): Flaky unexpected result (36)
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (1)
|
|
|
Signed-off-by: Gae24 <[email protected]>
TimvdLippe
requested changes
Dec 7, 2025
Contributor
TimvdLippe
left a comment
There was a problem hiding this comment.
Mostly adding some more spec comments to make it clear where they are coming from. The rest LGTM and make sense to me, thanks for tackling this! I only have 1 question about a missing step, but maybe we already handle that in a different way.
components/script/dom/globalscope.rs
Outdated
|
|
||
| // Step 11. If result is a list of errors, then: | ||
| let record = if compiled_script.get().is_null() { | ||
| // Set script's parse error and its error to rethrow to result[0]. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Set script's parse error and its error to rethrow to result[0]. | |
| // Step 11.1. Set script's parse error and its error to rethrow to result[0]. |
What about step 11.2? The algorithm appears to return the script, but we throw an error here.
Contributor
Author
There was a problem hiding this comment.
If parsing the script fails we set ClassicScript's record field to the error to rethrow, otherwise to the result of Compile1.
Signed-off-by: Gae24 <[email protected]>
github-merge-queue bot
pushed a commit
that referenced
this pull request
Dec 10, 2025
…0938) Use the algorithms introduced in #41109 in more places. Follow more closely the spec when executing classic scripts, introducing the concepts of rethrowing and muting errors. Muting errors is not actually implemented, and will be done in a followup. Testing: More tests start passing Fixes #34199 Fixes #27260 Fixes #15188 --------- Signed-off-by: Gae24 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented spec algorithms create a classic script and run a classic script.
Classic script now gets unminified on creation.
Testing: Behaviour hasn't changed much, but we pass a new test instead of crashing.