Repository navigation
script: Introduce end of loading phases - #46059
Conversation
Since the steps for https://html.spec.whatwg.org/multipage/parsing.html#the-end are scattered throughout various pieces, it has been difficult to figure out when to run what. To remedy that, introduce the concept of phases. These phases are checked in every method that needs to "Spin the event loop" to know whether 1. It is the appropriate time to continue with #the-end 2. It has fully achieved its goal For example, when processing deferred scripts, we need to do this after a deferred script has finished loading. But we also need to do it at the start of parsing, since we might not have any deferred scripts at all. Therefore, each previous step sets the appropriate phase and calls the corresponding next step. Each step then verifies its conditions and continues if required. The code is not in effect until document replacement is implemented, which comes in a follow-up. Fixes servo#41972 Signed-off-by: Tim van der Lippe <[email protected]>
|
🔨 Triggering try run (#28323662688) for Linux (WPT) |
|
Test results for linux-wpt from try job (#28323662688): Flaky unexpected result (36)
Stable unexpected results that are known to be intermittent (22)
|
|
✨ Try run (#28323662688) succeeded. |
mrobinson
left a comment
There was a problem hiding this comment.
Nice to see us moving closer to the loading specification. I understand that this is a transitional change. A couple questions here:
|
|
||
| ScriptThread::mark_document_with_no_blocked_loads(self); | ||
|
|
||
| // END TODO(43149): Remove when document replacement is implemented |
There was a problem hiding this comment.
What does END indicate here? There is nothing below this line of code, so what should be removed when document replacement is implemented?
There was a problem hiding this comment.
It ends the TODO of line 2047. Will add START to that to make it clearer
| self.current_the_end_loading_phase | ||
| .set(TheEndLoadingPhase::Done); | ||
| // TODO(43149): Add when document replacement is implemented | ||
| // self.queue_document_completion(cx); |
There was a problem hiding this comment.
I think instead of having commented out code here, it would be better to just describe what needs to happen and why.
There was a problem hiding this comment.
Yeah I would prefer this too. However, in this case it was part of the original patch and it is the only line that would turn the whole thing on. The rest are all "this can be removed once we merge it". So I prefer to keep just this one line, assuming that Josh' patch lands soon and it activates.
|
🔨 Triggering try run (#28328040823) for Linux (WPT) |
|
|
|
Already had a successful run in https://github.com/servo/servo/actions/runs/28323662688 Unsure if you wanted to rerun for flake detection or you missed it, so cancelled the run. I don't think this will introduce any flake, as the code is essentially a noop. |
Signed-off-by: Tim van der Lippe <[email protected]>
Co-authored-by: Josh Matthews <[email protected]> Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Signed-off-by: Tim van der Lippe <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Testing: new WPT passes Fixes: Part of servo#46859 --------- Signed-off-by: Tim van der Lippe <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Testing: new WPT passes Fixes: Part of servo#46859 --------- Signed-off-by: Tim van der Lippe <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
This is a reland of servo#46059 which now reliably works thanks to the changes in servo#46975. The tests that I updated I all verified locally that they run correct with `--repeat-until-unexpected` for at least 20 runs. Testing: new WPT passes Fixes: Part of servo#46859 --------- Signed-off-by: Tim van der Lippe <[email protected]> Co-authored-by: Martin Robinson <[email protected]>
Since the steps for https://html.spec.whatwg.org/multipage/parsing.html#the-end are scattered throughout various pieces, it has been difficult to figure out when to run what.
To remedy that, introduce the concept of phases. These phases are checked in every method that needs to
"Spin the event loop" to know whether
For example, when processing deferred scripts, we need to do this after a deferred script has finished loading. But we also need to do it at the start of parsing, since we might not have any deferred scripts at all.
Therefore, each previous step sets the appropriate phase and calls the corresponding next step. Each step then verifies its conditions and continues if required.
The code is not in effect until document replacement is implemented, which comes in a follow-up.
Fixes #41972
Testing: no observable behavior, only preparation plumbing