diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-03-15 15:42:12 +0100 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-04-04 17:49:24 +0200 |
commit | 9e0b41ebc425701e44799b9aaff1c41a65b6b55a (patch) | |
tree | b58ebd8f17a18b37870d28a4b02cf538c1b9de60 /components/script/dom/node.rs | |
parent | e09acf88f44cabbe8dbb4a1863ce16723b14f1a0 (diff) | |
download | servo-9e0b41ebc425701e44799b9aaff1c41a65b6b55a.tar.gz servo-9e0b41ebc425701e44799b9aaff1c41a65b6b55a.zip |
Add support for <iframe> elements for Layout 2020
This change adds support for the <iframe> element to Layout 2020. In
addition, certain aspects of the implementation are made the same
between both layout systems.
Diffstat (limited to 'components/script/dom/node.rs')
-rw-r--r-- | components/script/dom/node.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/components/script/dom/node.rs b/components/script/dom/node.rs index fe5caa5fbda..e05306986c0 100644 --- a/components/script/dom/node.rs +++ b/components/script/dom/node.rs @@ -1541,17 +1541,13 @@ impl<'dom> LayoutNodeHelpers<'dom> for LayoutDom<'dom, Node> { } fn iframe_browsing_context_id(self) -> Option<BrowsingContextId> { - let iframe_element = self - .downcast::<HTMLIFrameElement>() - .expect("not an iframe element!"); - iframe_element.browsing_context_id() + self.downcast::<HTMLIFrameElement>() + .map_or(None, |iframe_element| iframe_element.browsing_context_id()) } fn iframe_pipeline_id(self) -> Option<PipelineId> { - let iframe_element = self - .downcast::<HTMLIFrameElement>() - .expect("not an iframe element!"); - iframe_element.pipeline_id() + self.downcast::<HTMLIFrameElement>() + .map_or(None, |iframe_element| iframe_element.pipeline_id()) } #[allow(unsafe_code)] |