From 7315212211adf73c2127ed472507d32071c5fa5e Mon Sep 17 00:00:00 2001 From: "P. Albrecht" Date: Fri, 8 Sep 2017 13:04:26 -0500 Subject: [PATCH] servo: Merge #18370 - An observer disconnected after a mark must receive the mark (from pylbrecht:observer); r=ferjm I worked on top of #18283 as suggested [here](https://github.com/servo/servo/issues/18284#issuecomment-326043873). r? @ferjm - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18284 (github issue number if applicable). - [X] There are tests for these changes Source-Repo: https://github.com/servo/servo Source-Revision: 867d542261336d918177f8780ef915b7ec84e3ba --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 79691b6f8e710beeab4ca8ba260f4ee0869914a7 --- servo/components/script/dom/performance.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/servo/components/script/dom/performance.rs b/servo/components/script/dom/performance.rs index 8e85543f8e32..7cef2f280100 100644 --- a/servo/components/script/dom/performance.rs +++ b/servo/components/script/dom/performance.rs @@ -182,6 +182,15 @@ impl Performance { Some(p) => p, None => return, }; + + if self.pending_notification_observers_task.get() { + if let Some(o) = observers.iter().nth(index) { + DOMPerformanceObserver::new(&self.global(), + o.observer.callback(), + o.observer.entries()).notify(); + } + } + observers.remove(index); }