mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Return a reference in BrowserContext::active_window()
This commit is contained in:
parent
409b5e3695
commit
6ab7f64620
2 changed files with 5 additions and 5 deletions
|
@ -48,8 +48,8 @@ impl BrowsingContext {
|
||||||
&*self.history[self.active_index].document
|
&*self.history[self.active_index].document
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn active_window(&self) -> Root<Window> {
|
pub fn active_window(&self) -> &Window {
|
||||||
Root::from_ref(self.active_document().window())
|
self.active_document().window()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn frame_element(&self) -> Option<&Element> {
|
pub fn frame_element(&self) -> Option<&Element> {
|
||||||
|
@ -63,8 +63,8 @@ impl BrowsingContext {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
pub fn create_window_proxy(&mut self) {
|
pub fn create_window_proxy(&mut self) {
|
||||||
let win = self.active_window();
|
// We inline self.active_window() because we can't borrow *self here.
|
||||||
let win = win.r();
|
let win = self.history[self.active_index].document.window();
|
||||||
|
|
||||||
let WindowProxyHandler(handler) = win.windowproxy_handler();
|
let WindowProxyHandler(handler) = win.windowproxy_handler();
|
||||||
assert!(!handler.is_null());
|
assert!(!handler.is_null());
|
||||||
|
|
|
@ -1249,7 +1249,7 @@ impl Window {
|
||||||
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
// FIXME(https://github.com/rust-lang/rust/issues/23338)
|
||||||
let r = window.r();
|
let r = window.r();
|
||||||
let context = r.browsing_context();
|
let context = r.browsing_context();
|
||||||
context.as_ref().unwrap().active_window()
|
Root::from_ref(context.as_ref().unwrap().active_window())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue