deno
d23528d0 - fix(ext/web): honor PerformanceObserver buffered flag (#34748)

Commit
98 days ago
fix(ext/web): honor PerformanceObserver buffered flag (#34748) ## What When `PerformanceObserver.observe()` is called with the single-type form and `options.buffered = true`, replay the global performance entry buffer into the observer's buffer and queue the callback. Previously, a freshly- created observer with `buffered: true` never saw entries that were recorded before `observe()` was called. ## Why [Performance Timeline §observe()](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe) says: > 7. If options's buffered flag is set: > 1. Let queue be the result of running get entries on relevant global object's performance entry buffer with type and null. > 2. Append the entries in queue to observer's observer buffer. > 3. Queue the PerformanceObserver task. Our implementation only delivered newly-emitted entries to observers, so the buffered flag was a no-op. ## WPT subtests now passing - `user-timing/buffered-flag.any.html` — *PerformanceObserver with buffered flag sees previous marks* - `user-timing/buffered-flag.any.html` — *PerformanceObserver with buffered flag sees previous measures* - `user-timing/buffered-flag.any.worker.html` — same two subtests in the worker harness Expectations file `tests/wpt/runner/expectations/user-timing.json` flipped from `false` to `true` for both files. ## Root cause `PerformanceObserver.prototype.observe` in `ext/web/15_performance.js` was missing the buffered-flag branch entirely.
Author
Parents
Loading