Repository navigation
script: Replace initial about:blank document - #46975
Conversation
|
This is a draft right now because the change introduces a number of new intermittent results that we need to figure out how to address. Latest try push: https://github.com/servo/servo/actions/runs/30235058042 |
TimvdLippe
left a comment
There was a problem hiding this comment.
Seems like document.domain is a good area to investigate as a follow-up. However, since that's API already has plenty of other issues, I don't consider that blocking.
My comments are mostly to make links to the spec more explicit and for my own understanding of how things are tied together.
Mostly looking good, let's see what the state of affairs is after #46988
| LayoutValue::new(self.layout_marker.borrow().clone(), value) | ||
| } | ||
|
|
||
| pub(crate) fn prepare_for_document_replacement( |
There was a problem hiding this comment.
This looks to vaguely match https://html.spec.whatwg.org/multipage/nav-history-apis.html#set-up-a-window-environment-settings-object While it isn't a full match, since the window already exists, it does perform similar steps as is done in the spec
If you agree, lets add it in the doc and name it set_up_a_window_environment_settings_object.
| self.top_level_creation_url.borrow().clone() | ||
| } | ||
|
|
||
| pub(crate) fn set_top_level_creation_url(&self, url: ServoUrl) { |
There was a problem hiding this comment.
If I understand the spec correctly, it doesn't differentiate between top-level documents and child documents. Therefore, that would mean that the top_level_creation_url shouldn't change. I understand that for now this is required to set it after the initial replacement, but ideally we remove this setter to make top_level_creation_url immutable. Can you add a TODO for that?
| @@ -1,31 +1,12 @@ | |||
| [inheriting-csp-for-local-schemes.html] | |||
…s. (servo#46988) The initial about:blank document is intended to be synchronously available. Our current implementation is too tied to our asynchronous navigation infrastructure, and this gets in the way of the work happening in servo#46975. This change removes one source of intermittent failures due to timing when a test attempts to navigate the initial about:blank shortly after it is created—when the constellation observes that there is a pending navigation approval for the about:blank, it will silently discard any navigation attempt for the pipeline. I expect to revisit this later after we have decoupled about:blank from our asynchronous navigation infrastructure. Testing: Not observable behaviour within WPT except via timing changes in tests that involve navigating about:blank iframes/windows. Fixes: part of servo#43149 --------- Signed-off-by: Josh Matthews <[email protected]>
…s. (servo#46988) The initial about:blank document is intended to be synchronously available. Our current implementation is too tied to our asynchronous navigation infrastructure, and this gets in the way of the work happening in servo#46975. This change removes one source of intermittent failures due to timing when a test attempts to navigate the initial about:blank shortly after it is created—when the constellation observes that there is a pending navigation approval for the about:blank, it will silently discard any navigation attempt for the pipeline. I expect to revisit this later after we have decoupled about:blank from our asynchronous navigation infrastructure. Testing: Not observable behaviour within WPT except via timing changes in tests that involve navigating about:blank iframes/windows. Fixes: part of servo#43149 --------- Signed-off-by: Josh Matthews <[email protected]>
That's all #44669. |
|
🔨 Triggering try run (#31258915992) for Linux (WPT) |
|
Test results for linux-wpt from try job (#31258915992): Flaky unexpected result (38)
Stable unexpected results that are known to be intermittent (22)
Stable unexpected results (8)
|
|
|
|
I'm pretty sure the intermittent |
|
|
|
Note that that last test fails in 3 out of 4 browsers: https://wpt.fyi/results/navigation-timing/response-start-after-coop-bcg-switch.https.html?label=master&label=experimental&aligned |
|
Yes, but there's failing the test for test-related reasons and failing the test for completely unrelated reasons, and right now we're doing the second one. |
|
🔨 Triggering try run (#31421301561) for Linux (WPT) |
|
|
) In preparation for servo#46975, we need to ensure that we don't expose an outdated font context if the document is replaced. This fixes a timeout exposed by servo#46975. Testing: No behaviour change expected; existing tests suffice. Part of servo#43149 Signed-off-by: Josh Matthews <[email protected]>
|
The big new set of test timeouts is related to this behaviour change: <script>
events = 0;
function doload() {
console.log("load event");
events += 1;
if (events == 1) {
setTimeout(() => {
frame.contentDocument.open();
frame.contentDocument.write("hi");
frame.contentDocument.close();
}, 0);
}
}
</script>
<iframe id=frame onload="doload()"></iframe>In Firefox/old Servo this gives two load events, but in this PR it only gives one. |
|
With the state machine for the load event, it can only fire once. Should we reset the state machine to the initial state when |
|
I am delighted to report that removing some of our complex iframe load event code fixes the timeouts in each test I have checked while maintaining the expected number of iframe load events. |
|
✨ Try run (#32323029446) succeeded. |
|
Let's go ahead and merge this? |
mrobinson
left a comment
There was a problem hiding this comment.
This looks like a big improvement, but the new failures related to document.domain still look a bit scary.
|
Someone thinks this change could be added to the monthly blog post! To help with this, we need someone to answer the following questions: 😄
If this change is part of a broader feature/project please make sure the PR description contains a Please add Thanks for helping us prepare the monthly blog post! ❤️ |
@servo-highfive monthly update answer |
|
This also affects users—any pages using window.open usually were broken, because any onload event would fire long before the actual page loaded. |
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]>
…s. (servo#46988) The initial about:blank document is intended to be synchronously available. Our current implementation is too tied to our asynchronous navigation infrastructure, and this gets in the way of the work happening in servo#46975. This change removes one source of intermittent failures due to timing when a test attempts to navigate the initial about:blank shortly after it is created—when the constellation observes that there is a pending navigation approval for the about:blank, it will silently discard any navigation attempt for the pipeline. I expect to revisit this later after we have decoupled about:blank from our asynchronous navigation infrastructure. Testing: Not observable behaviour within WPT except via timing changes in tests that involve navigating about:blank iframes/windows. Fixes: part of servo#43149 --------- Signed-off-by: Josh Matthews <[email protected]>
) In preparation for servo#46975, we need to ensure that we don't expose an outdated font context if the document is replaced. This fixes a timeout exposed by servo#46975. Testing: No behaviour change expected; existing tests suffice. Part of servo#43149 Signed-off-by: Josh Matthews <[email protected]>
…nceTiming (servo#47289) servo#46975 exposes a case where the navigation timing information for documents in iframes is incorrect, because PerformanceTiming is initialized with the timing information for about:blank. We can avoid this by always returning timing information derived from the global's active document instead. Testing: No behaviour change possible before servo#46975, and this change fixes failures exposed in that PR. Part of servo#43149 Signed-off-by: Josh Matthews <[email protected]>
These changes move away from the 1:1 model for windows and documents and implement initial about:blank document replacement. This means that the concept of a global's active document becomes meaningful, so we need to be more careful about verifying that a particular document is actually relevant in various operations. Testing: Many new passing tests. Fixes: part of servo#43149 Fixes: servo#44521 Fixes: servo#28691 Fixes: servo#24145 Fixes: servo#28684 --------- Signed-off-by: Josh Matthews <[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]>
These changes move away from the 1:1 model for windows and documents and implement initial about:blank document replacement. This means that the concept of a global's active document becomes meaningful, so we need to be more careful about verifying that a particular document is actually relevant in various operations.
Testing: Many new passing tests.
Fixes: part of #43149
Fixes: #44521
Fixes: #28691
Fixes: #24145
Fixes: #28684