Repository navigation
script: Introduce end of loading phases - #42446
Conversation
|
🔨 Triggering try run (#21797922190) for Linux (WPT) |
|
|
bc63ef2 to
2fe629d
Compare
|
🔨 Triggering try run (#21799255009) for Linux (WPT) |
|
Test results for linux-wpt from try job (#21799255009): Flaky unexpected result (79)
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (70)
|
|
|
2fe629d to
656e441
Compare
|
🔨 Triggering try run (#21831860369) for Linux (WPT) |
|
Test results for linux-wpt from try job (#21831860369): Flaky unexpected result (80)
Stable unexpected results that are known to be intermittent (21)
Stable unexpected results (3)
|
|
|
656e441 to
d0c2494
Compare
| @@ -1,4 +1,5 @@ | |||
| [media-loading-pseudo-classes-in-has.html] | |||
| expected: ERROR | |||
There was a problem hiding this comment.
It fails on the assert_implements(CSS.supports("selector(:stalled)"), ":stalled is not supported"); but I think that's actually good?
| is_in_delaying_load_events_mode || | ||
| // In case we have already aborted this document and receive a | ||
| // a subsequent message to load the document | ||
| self.loader.borrow().events_inhibited(); |
There was a problem hiding this comment.
This is the main benefit: we don't have these convulated checks for various pieces anymore. Additionally, we no longer need to go via the script_thread, which had different preconditions which were also wrong.
| // https://html.spec.whatwg.org/multipage/#the-end | ||
| pub(crate) fn maybe_queue_document_completion(&self) { | ||
| // https://html.spec.whatwg.org/multipage/#delaying-load-events-mode | ||
| let is_in_delaying_load_events_mode = match self.window.undiscarded_window_proxy() { |
There was a problem hiding this comment.
Per #41972 (comment) we should instead fix the logic for the LoadBlocker of an iframe. I have made the first steps on that, but will need to continue that in a follow-up PR.
| // processing this load. Otherwise, any subsequent interaction with the document will panic. | ||
| // The underlying problem might actually be that layout exits while it should be kept alive. | ||
| // See https://github.com/servo/servo/issues/22507 | ||
| if !runtime_is_alive() { |
There was a problem hiding this comment.
This is the same comment/check as we had before, but now in a different place. And rather than using self.is_fully_active(), we actually fix the check. The scenario here is when all structs are dropped, including LoadBlocker. At that point, this code here runs, but we shouldn't continue.
| fn queue_document_completion(&self) { | ||
| self.loader.borrow_mut().inhibit_events(); | ||
|
|
||
| // The rest will ever run only once per document. |
There was a problem hiding this comment.
I am fairly certain this is now the case and we can add the missing assertions in the task. Will check that in a follow-up PR.
mrobinson
left a comment
There was a problem hiding this comment.
Looks like a nice cleanup. Just a couple comments:
94e7698 to
9e613a0
Compare
|
Test results for linux-wpt from try job (#21838060686): Flaky unexpected result (61)
Stable unexpected results that are known to be intermittent (23)
Stable unexpected results (18)
|
|
|
47e4f8b to
343dcfb
Compare
|
🔨 Triggering try run (#21875084350) for Linux (WPT) |
|
Test results for linux-wpt from try job (#21875084350): Flaky unexpected result (74)
Stable unexpected results that are known to be intermittent (26)
Stable unexpected results (3)
|
|
|
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. Fixes servo#41972 Signed-off-by: Tim van der Lippe <[email protected]>
343dcfb to
160a6e6
Compare
|
I am fairly certain that these 3 new test failures are legitimate. They are related to features that we aren't passing right now ( Therefore, I consider this PR ready for review. Further iterations can be made in follow-up PRs. |
| @@ -1,31 +1,12 @@ | |||
| [inheriting-csp-for-local-schemes.html] | |||
There was a problem hiding this comment.
I think these test fixes show that this change is correct. These tests should have always been running, but never were because of timing problems.
jdm
left a comment
There was a problem hiding this comment.
Thanks for reorganizibg this code!
Signed-off-by: Tim van der Lippe <[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.
Part of #41972