mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Use global_scope_from_object in Window::global_is_mozbrowser
This commit is contained in:
parent
4d9347d5b3
commit
1fed45e393
1 changed files with 4 additions and 5 deletions
|
@ -17,7 +17,7 @@ use dom::bindings::codegen::Bindings::WindowBinding::{self, FrameRequestCallback
|
|||
use dom::bindings::codegen::Bindings::WindowBinding::{ScrollBehavior, ScrollToOptions};
|
||||
use dom::bindings::codegen::UnionTypes::RequestOrUSVString;
|
||||
use dom::bindings::error::{Error, ErrorResult, Fallible};
|
||||
use dom::bindings::global::{GlobalRef, global_root_from_object};
|
||||
use dom::bindings::global::global_scope_from_object;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::{JS, MutNullableHeap, Root};
|
||||
use dom::bindings::num::Finite;
|
||||
|
@ -1496,10 +1496,9 @@ impl Window {
|
|||
/// in a top-level `Window` global.
|
||||
#[allow(unsafe_code)]
|
||||
pub unsafe fn global_is_mozbrowser(_: *mut JSContext, obj: HandleObject) -> bool {
|
||||
match global_root_from_object(obj.get()).r() {
|
||||
GlobalRef::Window(window) => window.is_mozbrowser(),
|
||||
_ => false,
|
||||
}
|
||||
global_scope_from_object(obj.get())
|
||||
.downcast::<Window>()
|
||||
.map_or(false, |window| window.is_mozbrowser())
|
||||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue