Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReturn Option for Window's layout channel #27163
Conversation
highfive
commented
Jul 3, 2020
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @jdm (or someone else) soon. |
highfive
commented
Jul 3, 2020
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jul 3, 2020
|
Opened new PR for upstreamable changes. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24436. |
8768532
to
9483686
|
Transplanted upstreamable changes to existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24436. |
| @@ -0,0 +1,23 @@ | |||
| <!doctype html> | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jul 3, 2020
Member
This test can be moved to tests/wpt/mozilla/tests/mozilla. These are WPT tests that we don't upstream and are used for checking regressions in specific cases in our engine, rather than conformance tests for all engines.
| @@ -2472,7 +2473,7 @@ impl ScriptThread { | |||
| .borrow() | |||
| .iter() | |||
| .next() | |||
| .map(|(_, document)| document.window().layout_chan().clone()) | |||
| .map(|(_, document)| document.window().layout_chan().unwrap().clone()) | |||
This comment has been minimized.
This comment has been minimized.
| @@ -1553,7 +1556,8 @@ impl Window { | |||
| // TODO Step 1 | |||
| // TODO(mrobinson, #18709): Add smooth scrolling support to WebRender so that we can | |||
| // properly process ScrollBehavior here. | |||
| self.layout_chan | |||
| self.layout_chan() | |||
| .unwrap() | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jul 3, 2020
Member
We'll want to replace these unwraps in this PR with warn! statements and return from the code as soon as possible.
9483686
to
d6ba755
|
No upstreamable changes; closed existing PR. Completed upstream sync of web-platform-test changes at web-platform-tests/wpt#24436. |
d6ba755
to
36fbbea
| let _ = window | ||
| .layout_chan() | ||
| .send(Msg::RegisterPaint(name, properties, painter)); | ||
|
|
||
| match window.layout_chan() { | ||
| Some(chan) => chan | ||
| .send(Msg::RegisterPaint(name, properties, painter)) | ||
| .unwrap(), | ||
| None => warn!("Layout channel unavailable"), | ||
| } |
This comment has been minimized.
This comment has been minimized.
alarsyo
Jul 3, 2020
Author
Contributor
Not sure why the Result was ignored here and not unwrapped like everywhere else, I've changed it to match with other uses of this channel
|
@bors-servo try=wpt |
…es-panic, r=<try> Return Option for Window's layout channel <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23053 <!-- Either: --> - [x] There are tests for these changes <!-- 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. --> This is my first contribution, I'm trying to figure things out! This fix passes the test case shown in #23053, however I don't know what the behavior should be in `Document` and `ScriptThread` if `Window::is_alive()` is false : simply ignore it, don't do anything ? Or is this something that should not happen now that we return false in `Window::force_reflow()` ? I'm not sure about the directory where the test case should go, any advice?
|
|
|
I think we can make this PR also close all the open issues mentioned at #22507 (comment) While leaving #22507 itself open, since we still have the underlying problem of perhaps closing the layout thread too early(or in other words exiting the pipeline, while the related browsing context is still alive even though not fully active), which requires some further investigation, such as what happens if a disconnected iframe is re-connected into the document. |
|
Have I done this right? :) |
Looks like it, Github as added them to list of closing issues on the right panel.. Great work, thanks! @bors-servo r=jdm |
|
|
…es-panic, r=jdm Return Option for Window's layout channel <!-- Please describe your changes on the following line: --> `Window::layout_chan()` now returns an `Option<Sender<Msg>>`, returning `None` if the window is dead. FIX #26969 FIX #26429 FIX #21208 FIX #19092 FIX #22559 FIX #22584 FIX #22652 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #23053 <!-- Either: --> - [x] There are tests for these changes <!-- 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. --> This is my first contribution, I'm trying to figure things out! This fix passes the test case shown in #23053, however I don't know what the behavior should be in `Document` and `ScriptThread` if `Window::is_alive()` is false : simply ignore it, don't do anything ? Or is this something that should not happen now that we return false in `Window::force_reflow()` ? I'm not sure about the directory where the test case should go, any advice?
|
|
|
@bors-servo retry |
|
|
alarsyo commentedJul 3, 2020
•
edited
Window::layout_chan()now returns anOption<Sender<Msg>>, returningNoneif the window is dead.FIX #26969
FIX #26429
FIX #21208
FIX #19092
FIX #22559
FIX #22584
FIX #22652
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis is my first contribution, I'm trying to figure things out!
This fix passes the test case shown in #23053, however I don't know what the behavior should be in
DocumentandScriptThreadifWindow::is_alive()is false : simply ignore it, don't do anything ? Or is this something that should not happen now that we return false inWindow::force_reflow()?I'm not sure about the directory where the test case should go, any advice?