mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
make Navigator::OnLine and WorkerNavigator::OnLine use self.upcast::<GlobalScope>() to obtain the is_online value to return
Signed-off-by: TG <ebiritg@gmail.com>
This commit is contained in:
parent
93dcf9bb86
commit
f30c759c94
2 changed files with 4 additions and 2 deletions
|
@ -224,9 +224,10 @@ impl NavigatorMethods<crate::DomTypeHolder> for Navigator {
|
|||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-navigator-online>
|
||||
fn OnLine(&self) -> bool {
|
||||
true
|
||||
*self.global().is_online().lock().unwrap()
|
||||
}
|
||||
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-navigator-plugins
|
||||
fn Plugins(&self) -> DomRoot<PluginArray> {
|
||||
self.plugins
|
||||
|
|
|
@ -19,6 +19,7 @@ use crate::dom::webgpu::gpu::GPU;
|
|||
use crate::dom::workerglobalscope::WorkerGlobalScope;
|
||||
use crate::script_runtime::{CanGc, JSContext};
|
||||
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#workernavigator
|
||||
#[dom_struct]
|
||||
pub(crate) struct WorkerNavigator {
|
||||
|
@ -107,7 +108,7 @@ impl WorkerNavigatorMethods<crate::DomTypeHolder> for WorkerNavigator {
|
|||
|
||||
/// <https://html.spec.whatwg.org/multipage/#dom-navigator-online>
|
||||
fn OnLine(&self) -> bool {
|
||||
true
|
||||
*self.global().is_online().lock().unwrap()
|
||||
}
|
||||
|
||||
// https://w3c.github.io/permissions/#navigator-and-workernavigator-extension
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue