diff options
author | Nolan Lawson <nolan@nolanlawson.com> | 2024-04-22 02:16:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-22 09:16:05 +0000 |
commit | 25b182c372427e798954b814b0f1a0875ab43f98 (patch) | |
tree | ca6047e994e6edc3354d18e34dc4ba8b638727bb /components/gfx/platform/macos | |
parent | f9e154af5543063e4a168b92948d1009c73f2bf3 (diff) | |
download | servo-25b182c372427e798954b814b0f1a0875ab43f98.tar.gz servo-25b182c372427e798954b814b0f1a0875ab43f98.zip |
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:
https://github.com/nolanlawson/servo/commit/510e6146ba01bae4f4aafda8754718e24ce6e868~~
---
<!-- 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. -->
Diffstat (limited to 'components/gfx/platform/macos')
0 files changed, 0 insertions, 0 deletions