mirror of
https://github.com/servo/servo.git
synced 2025-07-31 19:20:22 +01:00
Implement a global_object_for_reflector method.
This commit is contained in:
parent
69ed59d78f
commit
6dab37c88c
1 changed files with 5 additions and 0 deletions
|
@ -229,6 +229,11 @@ impl GlobalField {
|
|||
}
|
||||
}
|
||||
|
||||
/// Returns the global object of the realm that the given DOM object's reflector was created in.
|
||||
pub fn global_object_for_reflector<T: Reflectable>(reflector: &T) -> GlobalRoot {
|
||||
global_object_for_js_object(*reflector.reflector().get_jsobject())
|
||||
}
|
||||
|
||||
/// Returns the global object of the realm that the given JS object was created in.
|
||||
#[allow(unrooted_must_root)]
|
||||
pub fn global_object_for_js_object(obj: *mut JSObject) -> GlobalRoot {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue