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 upLayout queries on elements in disconnected frames panics #23053
Comments
|
Previously found in #19170. |
|
One way of fixing this would be to merge the script and layout threads. |
|
I think we should fix this by removing this |
|
Then we can add an automated test based on the code I provided earlier. We will want to assert that the returned rectangle is zero-sized. |
|
@highfive : assign me |
|
Hey @soniasingla! Thanks for your interest in working on this issue. It's now assigned to you! |
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
I propose a slightly different solution to this, where at the top of if !self.is_alive() {
warn!("Reflow attempted on zombie window.");
return false;
}That way we narrow down the cases where we don't panic to iframes that have been removed from the document, instead of removing the panic entirely, which I think could simply hide other problems. |
|
That sounds reasonable. |
|
Ok I think it would be even better to make: servo/components/script/dom/window.rs Line 2105 in fde47f8 return where and make every use of the layout chan go through this function, including inside |
|
@highfive: assign me |
|
Hey @alarsyo! Thanks for your interest in working on this issue. It's now assigned to you! |
…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?
…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?
When we remove an iframe, we shut down its browsing context and layout thread. Layout queries assume that the layout thread always exists, however.