aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/window.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/window.rs')
-rw-r--r--components/script/dom/window.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 6689cd87d1a..aac4c7d3a73 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -509,6 +509,13 @@ impl Window {
})
}
+ /// Returns the window proxy of the webview, which is the top-level ancestor browsing context.
+ /// <https://html.spec.whatwg.org/multipage/#top-level-browsing-context>
+ pub(crate) fn webview_window_proxy(&self) -> Option<DomRoot<WindowProxy>> {
+ self.undiscarded_window_proxy()
+ .and_then(|window_proxy| ScriptThread::find_window_proxy(window_proxy.webview_id().0))
+ }
+
#[cfg(feature = "bluetooth")]
pub(crate) fn bluetooth_thread(&self) -> IpcSender<BluetoothRequest> {
self.bluetooth_thread.clone()
@@ -2214,11 +2221,16 @@ impl Window {
)
}
+ // Query content box without considering any reflow
+ pub(crate) fn content_box_query_unchecked(&self, node: &Node) -> Option<UntypedRect<Au>> {
+ self.layout.borrow().query_content_box(node.to_opaque())
+ }
+
pub(crate) fn content_box_query(&self, node: &Node, can_gc: CanGc) -> Option<UntypedRect<Au>> {
if !self.layout_reflow(QueryMsg::ContentBox, can_gc) {
return None;
}
- self.layout.borrow().query_content_box(node.to_opaque())
+ self.content_box_query_unchecked(node)
}
pub(crate) fn content_boxes_query(&self, node: &Node, can_gc: CanGc) -> Vec<UntypedRect<Au>> {