Closed Bug 1965183 Opened 5 months ago Closed 5 months ago

Consider to set microtask level to 0 when dispatching events

Categories

(Remote Protocol :: Agent, enhancement, P2)

enhancement

Tracking

(firefox140 fixed)

RESOLVED FIXED
140 Branch
Tracking Status
firefox140 --- fixed

People

(Reporter: smaug, Assigned: smaug)

References

Details

(Whiteboard: [webdriver:m16][webdriver:relnote][webdriver:external])

Attachments

(1 file)

Assignee: nobody → smaug
Status: NEW → ASSIGNED
Attachment #9486256 - Attachment description: WIP: Bug 1965183 - Consider to set microtask level to 0 when dispatching events → Bug 1965183 - Consider to set microtask level to 0 when dispatching events
Severity: -- → S3
Priority: -- → P2
Whiteboard: [webdriver:backlog][webdriver:external]
Attachment #9486256 - Attachment description: Bug 1965183 - Consider to set microtask level to 0 when dispatching events → Bug 1965183 - Consider to set microtask level to 0 when dispatching events, r=whimboo

The reason we need this is that because Marionette is implemented in JS, and window actors have their callbacks implemented as webidl callbacks. Those function are treated as the top level JS execution. And that means that if dispatching some dom event (from that js callback) has a side effect of dispatching other events too, microtask checkpoint will run only after all the JS execution has stopped, not between the DOM events, like it would normally happen if events were dispatched natively. And not having normal microtask checkpoint means that mutation observer callbacks and promise callbacks get called at wrong time.

Component: Marionette → Agent
Whiteboard: [webdriver:backlog][webdriver:external] → [webdriver:m16][webdriver:external]
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2d38949c16ad Consider to set microtask level to 0 when dispatching events, r=masayuki,webdriver-reviewers,whimboo
Pushed by agoloman@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f5379b8600bb Revert "Bug 1965183 - Consider to set microtask level to 0 when dispatching events, r=masayuki,webdriver-reviewers,whimboo" for causing wpt failures @select-events-2.tentative.html.

Backed out for causing wpt failures @select-events-2.tentative.html.

Flags: needinfo?(smaug)
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/851d81a8022d Consider to set microtask level to 0 when dispatching events, r=masayuki,webdriver-reviewers,whimboo
Pushed by sstanca@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/92a90ab1cdae Revert "Bug 1965183 - Consider to set microtask level to 0 when dispatching events, r=masayuki,webdriver-reviewers,whimboo" for causing wpt failures in select-events-2.tentative.html.

No links to new failures?

Flags: needinfo?(smaug) → needinfo?(sstanca)

Thanks!

(select popup handling is still a bit weird when it comes to microtasks. It doesn't use normal event handling)

Flags: needinfo?(sstanca)
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fed8d1373082 Consider to set microtask level to 0 when dispatching events, r=masayuki,webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 140 Branch
See Also: → 1967129
Whiteboard: [webdriver:m16][webdriver:external] → [webdriver:m16][webdriver:relnote][webdriver:external]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: