mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Introduce Reflectable::global_scope
This commit is contained in:
parent
27f100b1d4
commit
ae6af5172b
30 changed files with 116 additions and 120 deletions
|
@ -79,7 +79,7 @@ impl NavigatorMethods for Navigator {
|
|||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-navigator-bluetooth
|
||||
fn Bluetooth(&self) -> Root<Bluetooth> {
|
||||
self.bluetooth.or_init(|| Bluetooth::new(self.global().r().as_global_scope()))
|
||||
self.bluetooth.or_init(|| Bluetooth::new(&self.global_scope()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#navigatorlanguage
|
||||
|
@ -89,12 +89,12 @@ impl NavigatorMethods for Navigator {
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
||||
fn Plugins(&self) -> Root<PluginArray> {
|
||||
self.plugins.or_init(|| PluginArray::new(self.global().r().as_global_scope()))
|
||||
self.plugins.or_init(|| PluginArray::new(&self.global_scope()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-mimetypes
|
||||
fn MimeTypes(&self) -> Root<MimeTypeArray> {
|
||||
self.mime_types.or_init(|| MimeTypeArray::new(self.global().r().as_global_scope()))
|
||||
self.mime_types.or_init(|| MimeTypeArray::new(&self.global_scope()))
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-javaenabled
|
||||
|
@ -105,7 +105,7 @@ impl NavigatorMethods for Navigator {
|
|||
// https://w3c.github.io/ServiceWorker/#navigator-service-worker-attribute
|
||||
fn ServiceWorker(&self) -> Root<ServiceWorkerContainer> {
|
||||
self.service_worker.or_init(|| {
|
||||
ServiceWorkerContainer::new(self.global().r().as_global_scope())
|
||||
ServiceWorkerContainer::new(&self.global_scope())
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue