[Webkit-unassigned] [Bug 247863] New: PerformanceObserver does not queue a task on observe call
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sun Nov 13 11:30:21 PST 2022
https://bugs.webkit.org/show_bug.cgi?id=247863
Bug ID: 247863
Summary: PerformanceObserver does not queue a task on observe
call
Product: WebKit
Version: Safari Technology Preview
Hardware: Mac (Intel)
OS: macOS 12
Status: NEW
Severity: Normal
Priority: P2
Component: New Bugs
Assignee: webkit-unassigned at lists.webkit.org
Reporter: philip at philipwalton.com
Steps to reproduce:
1. Navigate to https://example.com in Safari and wait for content to appear on the screen
2. Open the Web Inspector and paste the following code into the JavaScript console:
```
const po = new PerformanceObserver(() => {
console.log('PO handler scope');
});
po.observe({type: 'paint', buffered: true});
console.log('Top-level scope');
```
3. Notice the order in which the log statements are printed.
In Safari the order is:
```
PO handler scope
Top-level scope
```
But in Chrome and Firefox the order is reversed:
```
Top-level scope
PO handler scope
```
Based on my reading of the observe processing model in the spec [1] both Chrome and Firefox are correct. The last line in the processing model "5.2 observe() method" reads "Queue the PerformanceObserver task with relevantGlobal as input.", which should defer execution of the observer callback until after the current call stack finishes.
[1] https://www.w3.org/TR/performance-timeline/#observe-method
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221113/28c45152/attachment.htm>
More information about the webkit-unassigned
mailing list