improve spec compliance of window.close#20865
Conversation
|
Heads up! This PR modifies the following files:
|
|
Opened new PR for upstreamable changes. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
7eff72a to
38ef920
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
38ef920 to
4160746
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
4160746 to
3c5c135
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
3c5c135 to
df6b835
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
df6b835 to
12195e7
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
12195e7 to
b5aedac
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
b5aedac to
caea691
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
|
@bors-servo try |
… r=<try> improve spec compliance of window.close <!-- Please describe your changes on the following line: --> Improve the spec compliance of https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close, mainly by implementing the steps related to [closing a browsing context](https://html.spec.whatwg.org/multipage/window-object.html#close-a-browsing-context) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20865) <!-- Reviewable:end -->
|
💔 Test failed - linux-dev |
|
|
@CYBAI thanks, should have waited for CI to finish... |
caea691 to
080af33
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
080af33 to
89889e7
Compare
|
Sorry I've been busy/without WiFi for a week or so. I should be able to look at this soon. |
|
@jdm I haven't had a chance yet to follow the instructions on how to setup wpt as a standalone server, however just trying out The way the test currently behaves with Servo is that the window is indeed closed so you can't really see the results, however the test passes (and does not crash like it would without these changes) because I was also thinking that since |
cbrewster
left a comment
There was a problem hiding this comment.
Looks good. I think we still need to make sure that the compositor shuts down properly.
| self.main_thread_script_chan() | ||
| .send(MainThreadScriptMsg::ExitWindow(self.upcast::<GlobalScope>().pipeline_id())) | ||
| .unwrap(); | ||
| // Note: check the length of the "session history", as opposed to the joint session history? |
There was a problem hiding this comment.
This would probably be something that should be clarified in the spec, perhaps open an issue there. I would think the jsh is the right thing to look at here, but I could be wrong.
| GetScreenAvailSize(IpcSender<(DeviceUintSize)>), | ||
| /// Requests that the compositor shut down. | ||
| Exit, | ||
| GetScreenAvailSize(IpcSender<(DeviceUintSize)>) |
| GetScreenSize(..) => "GetScreenSize", | ||
| GetScreenAvailSize(..) => "GetScreenAvailSize", | ||
| Exit => "Exit", | ||
| GetScreenAvailSize(..) => "GetScreenAvailSize" |
| } | ||
|
|
||
| (Msg::Exit, _) => { | ||
| self.start_shutting_down(); |
There was a problem hiding this comment.
I don't think this gets called anymore after these changes.
There was a problem hiding this comment.
By appending WindowEvent::Quit here, compositor.maybe_start_shutting_down ends up being called via Servo's handling of WindowEvent::Quit here, and maybe_start_shutting_down ends up calling start_shutting_down.
The difference is that the compositor is shut down only after the unload steps have been run.
If the embedder were to handle tabs or something similar, it wouldn't have to send a WindowEvent::Quit in case other "tabs" were still running... (and I might actually have to end up doing something similar as part of #20678 to make some of the related tests pass)
There was a problem hiding this comment.
Ah missed that! This sounds reasonable.
ports/servo/browser.rs
Outdated
| // Nothing left to do for now, | ||
| // but could hide a tab, and show another one, instead of quitting. | ||
| self.event_queue.push(WindowEvent::Quit); | ||
| } |
There was a problem hiding this comment.
Just found the , is inconsistent in this pattern matching.
Should we fix it in this PR or have an E-easy issue to make the consistency of comma for pattern matching?
There was a problem hiding this comment.
Thanks, I can add a comma for this specific change, and you could make it consistent across the rest in a separate PR?
There was a problem hiding this comment.
Yes, I think I can send one after this one merged.
e5df6eb to
397e5fd
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
|
@cbrewster Thanks for the review, I've fixed the nits and replied to the other points... |
397e5fd to
2753e5e
Compare
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at jdm/web-platform-tests#63. |
|
LGTM, the test does fail in other browsers, but I believe it is spec compliant. The test should be updated in the future if the spec ends up changing. @bors-servo r+ |
|
📌 Commit 2753e5e has been approved by |
… r=cbrewster improve spec compliance of window.close <!-- Please describe your changes on the following line: --> Improve the spec compliance of https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close, mainly by implementing the steps related to [closing a browsing context](https://html.spec.whatwg.org/multipage/window-object.html#close-a-browsing-context) --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20865) <!-- Reviewable:end -->
|
@cbrewster thanks for checking the other browsers! |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Upstreamed from servo/servo#20865 [ci skip]
Improve the spec compliance of https://html.spec.whatwg.org/multipage/window-object.html#dom-window-close, mainly by implementing the steps related to closing a browsing context
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is