Implement PerformanceNavigation interface

This commit is contained in:
Iulian Gabriel Radu 2019-04-11 00:26:01 +03:00
parent e100af57a5
commit 62f0785c2c
19 changed files with 411 additions and 69 deletions

View file

@ -19,6 +19,7 @@ use crate::dom::globalscope::GlobalScope;
use crate::dom::performanceentry::PerformanceEntry;
use crate::dom::performancemark::PerformanceMark;
use crate::dom::performancemeasure::PerformanceMeasure;
use crate::dom::performancenavigation::PerformanceNavigation;
use crate::dom::performancenavigationtiming::PerformanceNavigationTiming;
use crate::dom::performanceobserver::PerformanceObserver as DOMPerformanceObserver;
use crate::dom::window::Window;
@ -372,6 +373,11 @@ impl PerformanceMethods for Performance {
unreachable!("Are we trying to expose Performance.timing in workers?");
}
// https://w3c.github.io/navigation-timing/#dom-performance-navigation
fn Navigation(&self) -> DomRoot<PerformanceNavigation> {
PerformanceNavigation::new(&self.global())
}
// https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#dom-performance-now
fn Now(&self) -> DOMHighResTimeStamp {
Finite::wrap(self.now())