aboutsummaryrefslogtreecommitdiffstats
path: root/components/script_layout_interface/wrapper_traits.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2017-09-22 09:34:12 -0500
committerGitHub <noreply@github.com>2017-09-22 09:34:12 -0500
commitc48ef50b7260df7f2e781e15bba37b08f0970062 (patch)
tree35a0807a0c15b27edd0685ee642660c3a810d9f9 /components/script_layout_interface/wrapper_traits.rs
parent4af0d9acb3f5724cac9f40a46ee03ab364a053bc (diff)
parentfbfb9a80b4f23854c984c7039c8dc30a8eb583b1 (diff)
downloadservo-c48ef50b7260df7f2e781e15bba37b08f0970062.tar.gz
servo-c48ef50b7260df7f2e781e15bba37b08f0970062.zip
Auto merge of #18514 - asajeffrey:layout-dont-panic-if-no-iframe-bc, r=emilio
Remove sources of panic when laying out an iframe without a nested browsing context <!-- Please describe your changes on the following line: --> At the moment, layout panics if it discovers an iframe without a nested browsing context. Under normal circumstances, this is reasonable, but it requires very tight synchronization between script, layout, the constellation and the compositor. In particular, if a layout is in progress when an iframe's browsing context is discarded, this can trigger panic. This PR fixes this in two ways: 1. Making the pipeline and browsing context ids optional in layout's representation of an iframe. 2. Shutting down layout before discarding a browsing context, rather than after. This is belt and braces. --- <!-- 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 #17482 and #18477 - [X] These changes do not require tests because the PR is fixing a panic caused by a race condition <!-- 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/18514) <!-- Reviewable:end -->
Diffstat (limited to 'components/script_layout_interface/wrapper_traits.rs')
-rw-r--r--components/script_layout_interface/wrapper_traits.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script_layout_interface/wrapper_traits.rs b/components/script_layout_interface/wrapper_traits.rs
index c58b6292ef0..d022360305b 100644
--- a/components/script_layout_interface/wrapper_traits.rs
+++ b/components/script_layout_interface/wrapper_traits.rs
@@ -275,12 +275,12 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
fn svg_data(&self) -> Option<SVGSVGData>;
/// If this node is an iframe element, returns its browsing context ID. If this node is
- /// not an iframe element, fails.
- fn iframe_browsing_context_id(&self) -> BrowsingContextId;
+ /// not an iframe element, fails. Returns None if there is no nested browsing context.
+ fn iframe_browsing_context_id(&self) -> Option<BrowsingContextId>;
/// If this node is an iframe element, returns its pipeline ID. If this node is
- /// not an iframe element, fails.
- fn iframe_pipeline_id(&self) -> PipelineId;
+ /// not an iframe element, fails. Returns None if there is no nested browsing context.
+ fn iframe_pipeline_id(&self) -> Option<PipelineId>;
fn get_colspan(&self) -> u32;