diff --git a/components/script/dom/performance.rs b/components/script/dom/performance.rs index e04d623346c..277662ccb42 100644 --- a/components/script/dom/performance.rs +++ b/components/script/dom/performance.rs @@ -93,13 +93,11 @@ impl PerformanceEntryList { pub fn clear_entries_by_name_and_type( &mut self, name: Option, - entry_type: Option, + entry_type: DOMString, ) { self.entries.retain(|e| { - name.as_ref().map_or(true, |name_| *e.name() != *name_) && - entry_type - .as_ref() - .map_or(true, |type_| *e.entry_type() != *type_) + *e.entry_type() != *entry_type || + name.as_ref().map_or(false, |name_| *e.name() != *name_) }); } @@ -479,7 +477,7 @@ impl PerformanceMethods for Performance { fn ClearMarks(&self, mark_name: Option) { self.buffer .borrow_mut() - .clear_entries_by_name_and_type(mark_name, Some(DOMString::from("mark"))); + .clear_entries_by_name_and_type(mark_name, DOMString::from("mark")); } // https://w3c.github.io/user-timing/#dom-performance-measure @@ -526,13 +524,13 @@ impl PerformanceMethods for Performance { fn ClearMeasures(&self, measure_name: Option) { self.buffer .borrow_mut() - .clear_entries_by_name_and_type(measure_name, Some(DOMString::from("measure"))); + .clear_entries_by_name_and_type(measure_name, DOMString::from("measure")); } // https://w3c.github.io/resource-timing/#dom-performance-clearresourcetimings fn ClearResourceTimings(&self) { self.buffer .borrow_mut() - .clear_entries_by_name_and_type(None, Some(DOMString::from("resource"))); + .clear_entries_by_name_and_type(None, DOMString::from("resource")); self.resource_timing_buffer_current_size.set(0); } diff --git a/tests/wpt/meta-legacy-layout/user-timing/clearMarks.html.ini b/tests/wpt/meta-legacy-layout/user-timing/clearMarks.html.ini deleted file mode 100644 index 3a91bd4357c..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clearMarks.html.ini +++ /dev/null @@ -1,12 +0,0 @@ -[clearMarks.html] - [First loop: checking entries after removing "". There should be 2 entries.] - expected: FAIL - - [First loop: checking entries after removing "1". There should be 1 entries.] - expected: FAIL - - [Second loop: checking entries after removing "". There should be 4 entries.] - expected: FAIL - - [Second loop: checking entries after removing "1". There should be 2 entries.] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/user-timing/clearMeasures.html.ini b/tests/wpt/meta-legacy-layout/user-timing/clearMeasures.html.ini deleted file mode 100644 index 837d6a09f17..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clearMeasures.html.ini +++ /dev/null @@ -1,15 +0,0 @@ -[clearMeasures.html] - [First loop: checking entries after removing "". There should be 2 entries.] - expected: FAIL - - [First loop: checking entries after removing "2". There should be 1 entries.] - expected: FAIL - - [Second loop: checking entries after removing "". There should be 4 entries.] - expected: FAIL - - [Second loop: checking entries after removing "2". There should be 2 entries.] - expected: FAIL - - [Nothing should happen if we clear a non-exist measure] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_mark.any.js.ini b/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_mark.any.js.ini deleted file mode 100644 index 18034af5534..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_mark.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_non_existent_mark.any.html] - [Clearing a non-existent mark doesn't affect existing marks] - expected: FAIL - - -[clear_non_existent_mark.any.worker.html] - [Clearing a non-existent mark doesn't affect existing marks] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_measure.any.js.ini b/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_measure.any.js.ini deleted file mode 100644 index 79eebf30387..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clear_non_existent_measure.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_non_existent_measure.any.worker.html] - [Clearing a non-existent measure doesn't affect existing measures] - expected: FAIL - - -[clear_non_existent_measure.any.html] - [Clearing a non-existent measure doesn't affect existing measures] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/user-timing/clear_one_mark.any.js.ini b/tests/wpt/meta-legacy-layout/user-timing/clear_one_mark.any.js.ini deleted file mode 100644 index 602b6742a38..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clear_one_mark.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_one_mark.any.html] - [Clearing an existent mark doesn't affect other existing marks] - expected: FAIL - - -[clear_one_mark.any.worker.html] - [Clearing an existent mark doesn't affect other existing marks] - expected: FAIL diff --git a/tests/wpt/meta-legacy-layout/user-timing/clear_one_measure.any.js.ini b/tests/wpt/meta-legacy-layout/user-timing/clear_one_measure.any.js.ini deleted file mode 100644 index d1b2d3f1212..00000000000 --- a/tests/wpt/meta-legacy-layout/user-timing/clear_one_measure.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_one_measure.any.worker.html] - [Clearing an existent measure doesn't affect other existing measures] - expected: FAIL - - -[clear_one_measure.any.html] - [Clearing an existent measure doesn't affect other existing measures] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clearMarks.html.ini b/tests/wpt/meta/user-timing/clearMarks.html.ini deleted file mode 100644 index 3a91bd4357c..00000000000 --- a/tests/wpt/meta/user-timing/clearMarks.html.ini +++ /dev/null @@ -1,12 +0,0 @@ -[clearMarks.html] - [First loop: checking entries after removing "". There should be 2 entries.] - expected: FAIL - - [First loop: checking entries after removing "1". There should be 1 entries.] - expected: FAIL - - [Second loop: checking entries after removing "". There should be 4 entries.] - expected: FAIL - - [Second loop: checking entries after removing "1". There should be 2 entries.] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clearMeasures.html.ini b/tests/wpt/meta/user-timing/clearMeasures.html.ini deleted file mode 100644 index 837d6a09f17..00000000000 --- a/tests/wpt/meta/user-timing/clearMeasures.html.ini +++ /dev/null @@ -1,15 +0,0 @@ -[clearMeasures.html] - [First loop: checking entries after removing "". There should be 2 entries.] - expected: FAIL - - [First loop: checking entries after removing "2". There should be 1 entries.] - expected: FAIL - - [Second loop: checking entries after removing "". There should be 4 entries.] - expected: FAIL - - [Second loop: checking entries after removing "2". There should be 2 entries.] - expected: FAIL - - [Nothing should happen if we clear a non-exist measure] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clear_non_existent_mark.any.js.ini b/tests/wpt/meta/user-timing/clear_non_existent_mark.any.js.ini deleted file mode 100644 index 18034af5534..00000000000 --- a/tests/wpt/meta/user-timing/clear_non_existent_mark.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_non_existent_mark.any.html] - [Clearing a non-existent mark doesn't affect existing marks] - expected: FAIL - - -[clear_non_existent_mark.any.worker.html] - [Clearing a non-existent mark doesn't affect existing marks] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clear_non_existent_measure.any.js.ini b/tests/wpt/meta/user-timing/clear_non_existent_measure.any.js.ini deleted file mode 100644 index 79eebf30387..00000000000 --- a/tests/wpt/meta/user-timing/clear_non_existent_measure.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_non_existent_measure.any.worker.html] - [Clearing a non-existent measure doesn't affect existing measures] - expected: FAIL - - -[clear_non_existent_measure.any.html] - [Clearing a non-existent measure doesn't affect existing measures] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clear_one_mark.any.js.ini b/tests/wpt/meta/user-timing/clear_one_mark.any.js.ini deleted file mode 100644 index 602b6742a38..00000000000 --- a/tests/wpt/meta/user-timing/clear_one_mark.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_one_mark.any.html] - [Clearing an existent mark doesn't affect other existing marks] - expected: FAIL - - -[clear_one_mark.any.worker.html] - [Clearing an existent mark doesn't affect other existing marks] - expected: FAIL diff --git a/tests/wpt/meta/user-timing/clear_one_measure.any.js.ini b/tests/wpt/meta/user-timing/clear_one_measure.any.js.ini deleted file mode 100644 index d1b2d3f1212..00000000000 --- a/tests/wpt/meta/user-timing/clear_one_measure.any.js.ini +++ /dev/null @@ -1,8 +0,0 @@ -[clear_one_measure.any.worker.html] - [Clearing an existent measure doesn't affect other existing measures] - expected: FAIL - - -[clear_one_measure.any.html] - [Clearing an existent measure doesn't affect other existing measures] - expected: FAIL