diff options
Diffstat (limited to 'components/script/dom/performanceobserver.rs')
-rw-r--r-- | components/script/dom/performanceobserver.rs | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/components/script/dom/performanceobserver.rs b/components/script/dom/performanceobserver.rs index 62499393455..167a997287d 100644 --- a/components/script/dom/performanceobserver.rs +++ b/components/script/dom/performanceobserver.rs @@ -86,22 +86,6 @@ impl PerformanceObserver { reflect_dom_object_with_proto(Box::new(observer), global, proto, can_gc) } - #[allow(non_snake_case)] - pub fn Constructor( - global: &GlobalScope, - proto: Option<HandleObject>, - can_gc: CanGc, - callback: Rc<PerformanceObserverCallback>, - ) -> Fallible<DomRoot<PerformanceObserver>> { - Ok(PerformanceObserver::new_with_proto( - global, - proto, - callback, - Vec::new(), - can_gc, - )) - } - /// Buffer a new performance entry. pub fn queue_entry(&self, entry: &PerformanceEntry) { self.entries.borrow_mut().push(DomRoot::from_ref(entry)); @@ -132,17 +116,32 @@ impl PerformanceObserver { pub fn set_entries(&self, entries: DOMPerformanceEntryList) { *self.entries.borrow_mut() = entries; } +} + +impl PerformanceObserverMethods for PerformanceObserver { + // https://w3c.github.io/performance-timeline/#dom-performanceobserver-constructor + fn Constructor( + global: &GlobalScope, + proto: Option<HandleObject>, + can_gc: CanGc, + callback: Rc<PerformanceObserverCallback>, + ) -> Fallible<DomRoot<PerformanceObserver>> { + Ok(PerformanceObserver::new_with_proto( + global, + proto, + callback, + Vec::new(), + can_gc, + )) + } // https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute - #[allow(non_snake_case)] - pub fn SupportedEntryTypes(cx: JSContext, global: &GlobalScope) -> JSVal { + fn SupportedEntryTypes(cx: JSContext, global: &GlobalScope) -> JSVal { // While this is exposed through a method of PerformanceObserver, // it is specified as associated with the global scope. global.supported_performance_entry_types(cx) } -} -impl PerformanceObserverMethods for PerformanceObserver { // https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe() fn Observe(&self, options: &PerformanceObserverInit) -> Fallible<()> { // Step 1 is self |