mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Add global default method for Reflectable trait
This commit is contained in:
parent
2703568227
commit
ce6075825d
17 changed files with 88 additions and 83 deletions
|
@ -5,11 +5,11 @@
|
|||
use dom::bindings::codegen::Bindings::StorageBinding;
|
||||
use dom::bindings::codegen::Bindings::StorageBinding::StorageMethods;
|
||||
use dom::bindings::error::{Error, ErrorResult};
|
||||
use dom::bindings::global::{GlobalRef, global_root_from_reflector};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::inheritance::Castable;
|
||||
use dom::bindings::js::{Root, RootedReference};
|
||||
use dom::bindings::refcounted::Trusted;
|
||||
use dom::bindings::reflector::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::reflector::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::event::{Event, EventBubbles, EventCancelable};
|
||||
use dom::storageevent::StorageEvent;
|
||||
use dom::urlhelper::UrlHelper;
|
||||
|
@ -40,13 +40,13 @@ impl Storage {
|
|||
}
|
||||
|
||||
fn get_url(&self) -> Url {
|
||||
let global_root = global_root_from_reflector(self);
|
||||
let global_root = self.global();
|
||||
let global_ref = global_root.r();
|
||||
global_ref.get_url()
|
||||
}
|
||||
|
||||
fn get_storage_thread(&self) -> StorageThread {
|
||||
let global_root = global_root_from_reflector(self);
|
||||
let global_root = self.global();
|
||||
let global_ref = global_root.r();
|
||||
global_ref.as_window().storage_thread()
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ impl Storage {
|
|||
/// https://html.spec.whatwg.org/multipage/#send-a-storage-notification
|
||||
fn broadcast_change_notification(&self, key: Option<String>, old_value: Option<String>,
|
||||
new_value: Option<String>) {
|
||||
let global_root = global_root_from_reflector(self);
|
||||
let global_root = self.global();
|
||||
let global_ref = global_root.r();
|
||||
let main_script_chan = global_ref.as_window().main_thread_script_chan();
|
||||
let script_chan = global_ref.dom_manipulation_thread_source();
|
||||
|
@ -181,7 +181,7 @@ impl MainThreadRunnable for StorageEventRunnable {
|
|||
let this = *self;
|
||||
let storage_root = this.element.root();
|
||||
let storage = storage_root.r();
|
||||
let global_root = global_root_from_reflector(storage);
|
||||
let global_root = storage.global();
|
||||
let global_ref = global_root.r();
|
||||
let ev_window = global_ref.as_window();
|
||||
let ev_url = storage.get_url();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue