servo: Merge #18372 - TEST: fix and add case of po-observe.any.js (from tigercosmos:userTimingApi); r=ferjm
authortigercosmos <b04209032@ntu.edu.tw>
Mon, 11 Sep 2017 05:26:46 -0500
changeset 429527 994883c61ef580925e5669360a4bb619886f9615
parent 429526 629ebf9fa7259fc0a4e7ea4dbf62f88d61ccb105
child 429528 cdd9f6610d88cffa99941c814c8c817e58e2ab37
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersferjm
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
servo: Merge #18372 - TEST: fix and add case of po-observe.any.js (from tigercosmos:userTimingApi); r=ferjm <!-- Please describe your changes on the following line: --> 1. implementing step 3 from the [`PerformanceObserver.observe()`](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()) method spec properly. 2. also add cases about step 1 & 2 work on the top of #18283 r? @ferjm --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #18285 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 6a09b1d21abd66d6954d8107f4439c33054ee264
servo/components/script/dom/performance.rs
--- a/servo/components/script/dom/performance.rs
+++ b/servo/components/script/dom/performance.rs
@@ -158,17 +158,17 @@ impl Performance {
             let mut new_entries = entry_types.iter()
                             .flat_map(|e| entries.get_entries_by_name_and_type(None, Some(e.clone())))
                             .collect::<DOMPerformanceEntryList>();
             let mut obs_entries = observer.entries();
             obs_entries.append(&mut new_entries);
             observer.set_entries(obs_entries);
         }
         let mut observers = self.observers.borrow_mut();
-        match observers.iter().position(|o| &(*o.observer) == observer) {
+        match observers.iter().position(|o| *o.observer == *observer) {
             // If the observer is already in the list, we only update the observed
             // entry types.
             Some(p) => observers[p].entry_types = entry_types,
             // Otherwise, we create and insert the new PerformanceObserver.
             None => observers.push(PerformanceObserver {
                 observer: Root::from_ref(observer),
                 entry_types
             })