servo/components
Nolan Lawson 25b182c372
fix(user-timing): fix clearing marks/measures by name (#32120)
This fixes several tests in
[wpt/user-timing](https://wpt.fyi/results/user-timing?label=master&product=chrome%5Bexperimental%5D&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&product=servo&aligned)
by fixing some logic errors in how marks/measures are cleared (via
[`clearMarks`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks)
and
[`clearMeasures`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures)).

There are two changes:

1. Fix the boolean logic in `clear_entries_by_name_and_type` so that,
when `clearMarks('foo')` or `clearMeasures('foo')` is called, the
presence of the entry name correctly filters based on existing entry
names.
2. Make the `entry_name` param a `DOMString` rather than an
`Option<DOMString>` since every API call has it as `Some` anyway, and
I'm not aware of any [Performance
APIs](https://developer.mozilla.org/en-US/docs/Web/API/Performance)
where you can clear all entries regardless of type. (This is not
strictly required for the fix, but I think it makes the code easier to
read.)

~~I also considered adding the expected WPT results using `mach
update-wpt`. But I'm not sure if you want these changes, since the
expectations are currently missing (i.e. `tests/wpt/meta/user-timing`
does not exist).~~ (_Update: added!_)

For the record, this PR fixes the following tests:

- `clearMarks.html.ini`
- `clearMeasures.html.ini`
- `clear_non_existent_mark.any.js.ini`
- `clear_non_existent_measure.any.js.ini`
- `clear_one_mark.any.js.ini`
- `clear_one_measure.any.js.ini`

~~In case you do want these meta files, here they are:
510e6146ba~~

---
<!-- 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
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] 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. -->
2024-04-22 09:16:05 +00:00
..
allocator rustdoc: Add some basic Safety sections to unsafe functions (#31639) 2024-03-13 10:44:59 +00:00
background_hang_monitor fix: missing thread name when spawning (#31656) 2024-03-14 10:40:58 +00:00
bluetooth clippy: fix warnings in components/bluetooth (#31566) 2024-03-07 23:32:35 +00:00
canvas Simplify FontHandle and rename it to PlatformFont (#32101) 2024-04-17 17:44:34 +00:00
compositing chore: Clean up use of gfx and constellation types (#31981) 2024-04-09 06:43:48 +00:00
config compositor: Remove the is_running_problem_test setting (#31589) 2024-03-09 02:29:43 +00:00
config_plugins clippy: fix warnings in components/config* (#31562) 2024-03-08 07:15:56 +00:00
constellation Initial internal support for multiple webviews (#31417) 2024-04-03 11:06:28 +00:00
deny_public_fields Strict import formatting (grouping and granularity) (#30325) 2023-09-11 19:16:54 +00:00
devtools clippy: Allow too_many_arguments for existing functions (#31974) 2024-04-02 12:50:45 +00:00
dom_struct clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
domobject_derive clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
geometry dependencies: Upgrade to WebRender 0.64 (#31486) 2024-03-14 17:40:54 +00:00
gfx clippy: Fix clone_on_copy warnings (#32108) 2024-04-18 14:18:14 +00:00
hyper_serde clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
jstraceable_derive Update to syn 2 where possible (#30387) 2023-09-19 15:57:37 +00:00
layout Upgrade Stylo to 2024-01-16 (#32066) 2024-04-13 17:42:09 +00:00
layout_2020 layout: Have TextRun::glyph_run_is_preserved_newline take into account TextRunSegment offset (#32119) 2024-04-21 20:09:49 +00:00
layout_thread clippy: fix several lint warns (#32126) 2024-04-22 06:45:39 +00:00
layout_thread_2020 clippy: fix several lint warns (#32126) 2024-04-22 06:45:39 +00:00
media clippy: fix result_unit_err warnings (#31791) 2024-03-21 12:51:45 +00:00
metrics clippy: Fix assorted warnings in components/ (#31628) 2024-03-13 08:31:58 +00:00
net Backout Host-header related change from #32024. (#32093) 2024-04-16 12:38:25 +00:00
pixels clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
profile clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
rand Fix clippy warnings in components/rand (#31549) 2024-03-07 23:16:42 +00:00
range clippy: fix warnings in various modules in components (#31568) 2024-03-08 14:28:04 +00:00
script fix(user-timing): fix clearing marks/measures by name (#32120) 2024-04-22 09:16:05 +00:00
servo Initial internal support for multiple webviews (#31417) 2024-04-03 11:06:28 +00:00
shared Upgrade Stylo to 2024-03-01 (#32089) 2024-04-16 12:27:51 +00:00
url clippy: Map to an error type instead of using allowing result_unit_err in components/url (#31834) 2024-03-26 12:23:07 +00:00
webdriver_server clippy: Allow too_many_arguments for existing functions (#31974) 2024-04-02 12:50:45 +00:00
webgpu webgpu: Implement onSubmittedWorkDone (#31772) 2024-04-04 08:12:40 +00:00