script: Bring creating and running classic scripts closer to spec#40938
script: Bring creating and running classic scripts closer to spec#40938TimvdLippe merged 11 commits intoservo:mainfrom
Conversation
|
Needs more work, there are a couple of timeouts and fails to fix. |
f30fe12 to
a3edc36
Compare
|
08a7fd6 to
5003237
Compare
|
🔨 Triggering try run (#19804858069) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19804858069): Flaky unexpected result (26)
Stable unexpected results that are known to be intermittent (30)
Stable unexpected results (46)
|
|
|
b0ce79b to
a323e99
Compare
|
🔨 Triggering try run (#19821266017) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19821266017): Flaky unexpected result (32)
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (46)
|
|
|
|
Here's a breakdown of tests with errors Tests that require
Tests that use module scripts inside Worker
Tests that require
Tests that require
Test that require
The remaining tests include tests that we actually pass, but still fail harness like Firefox, this is due to errors inside tests. |
a323e99 to
bb1262d
Compare
|
🔨 Triggering try run (#19891780352) for Linux (WPT) |
|
Test results for linux-wpt from try job (#19891780352): Flaky unexpected result (39)
Stable unexpected results that are known to be intermittent (20)
|
|
✨ Try run (#19891780352) succeeded. |
|
I hope to have some time this weekend to start reviewing. If anybody else has time before, they are welcome to review as well. It's a tad big PR |
TimvdLippe
left a comment
There was a problem hiding this comment.
All right, I took a stab at this. Unfortunately this PR is too large to review at this current stage. I do understand the rough direction it is going on and I think it's moving in the right direction. Therefore, I do appreciate the effort, but we need to chunk the work to make it reviewable.
You did nicely separate your work in separate commits, which I also tried to use during reviewing. Unfortunately some commits fix work that early commits did. Therefore, I propose two options to continue with this work:
- You split up the commits in logical steps that all completely finish a piece of work. For example, first you introduce structs and new methods in a commit, that are unused. Then, in a second commit you update the signature of
evaluate_js_on_global_with_resultwith all of its usages. Lastly, you make the actual changes to align with the spec - You prepare separate PRs that all build on their own and move in the right direction. This would be easiest to review, but I am not sure how familiar you are with this workflow.
I left some general comments that you need to keep into account. Most notably, the lack of spec comments make it difficult to figure out if what the spec says is implemented correctly, or how the pieces are put together. I do see you put spec comments in several place, which is great, but we also need that for methods such as the ones I commented on.
Thanks again for the effort and I am eager to see these fixes land. Let's figure out a way to do so which works both for you and for reviewers.
tests/wpt/meta/content-security-policy/generic/generic-0_8_1.sub.html.ini
Outdated
Show resolved
Hide resolved
…ad of using ScriptOrigin Signed-off-by: Gae24 <[email protected]>
Signed-off-by: Gae24 <[email protected]>
bb1262d to
fc41c8e
Compare
Signed-off-by: Gae24 <[email protected]>
fc41c8e to
621f7f6
Compare
TimvdLippe
left a comment
There was a problem hiding this comment.
Nice work! Super glad to see all these test improvements and this was a lot easier for me to review compared to the previous version. It's still quite a lot and I have some minor comments, but overall approach LGTM.
| match script.type_ { | ||
| ScriptType::Classic => (), | ||
| ScriptType::Module => { | ||
| document.set_current_script(None); |
There was a problem hiding this comment.
Since you haven't changed these files, you don't need to change this now. But would be good in a follow-up PR to follow the spec here. Instead of this line, it should be an assert:
// Step 6."module".1. Assert: document's currentScript attribute is null.
There was a problem hiding this comment.
Since it's a single line, I suppose it's fine including it in this PR.
There was a problem hiding this comment.
Seems I was wrong, reverting it.
Making more clear the desired behavior at call site Signed-off-by: Gae24 <[email protected]>
Signed-off-by: Gae24 <[email protected]>
5b15a5f to
db6ac00
Compare
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