diff options
author | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-09-14 15:53:12 -0500 |
---|---|---|
committer | Alan Jeffrey <ajeffrey@mozilla.com> | 2017-09-22 09:04:18 -0500 |
commit | fbfb9a80b4f23854c984c7039c8dc30a8eb583b1 (patch) | |
tree | 937b48c64482d7d188804844bd5b0dbd0f2ca7f0 /components/script/dom/node.rs | |
parent | 6a791cd7f26b42a6688099bea203c21fb3c9cc12 (diff) | |
download | servo-fbfb9a80b4f23854c984c7039c8dc30a8eb583b1.tar.gz servo-fbfb9a80b4f23854c984c7039c8dc30a8eb583b1.zip |
Remove sources of panic when laying out an iframe without a nested browsing context.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index b83cdcbd37e..f5b318b3178 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1021,8 +1021,8 @@ pub trait LayoutNodeHelpers { fn image_url(&self) -> Option<ServoUrl>; fn canvas_data(&self) -> Option<HTMLCanvasData>; fn svg_data(&self) -> Option<SVGSVGData>; - fn iframe_browsing_context_id(&self) -> BrowsingContextId; - fn iframe_pipeline_id(&self) -> PipelineId; + fn iframe_browsing_context_id(&self) -> Option<BrowsingContextId>; + fn iframe_pipeline_id(&self) -> Option<PipelineId>; fn opaque(&self) -> OpaqueNode; } @@ -1172,16 +1172,16 @@ impl LayoutNodeHelpers for LayoutJS<Node> { .map(|svg| svg.data()) } - fn iframe_browsing_context_id(&self) -> BrowsingContextId { + fn iframe_browsing_context_id(&self) -> Option<BrowsingContextId> { let iframe_element = self.downcast::<HTMLIFrameElement>() .expect("not an iframe element!"); - iframe_element.browsing_context_id().unwrap() + iframe_element.browsing_context_id() } - fn iframe_pipeline_id(&self) -> PipelineId { + fn iframe_pipeline_id(&self) -> Option<PipelineId> { let iframe_element = self.downcast::<HTMLIFrameElement>() .expect("not an iframe element!"); - iframe_element.pipeline_id().unwrap() + iframe_element.pipeline_id() } #[allow(unsafe_code)] |