Intersection observers run too often

RESOLVED FIXED in Firefox 54

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: billm, Assigned: billm)

Tracking

unspecified
mozilla54
Points:
---

Firefox Tracking Flags

(firefox54 fixed)

Details

Attachments

(1 attachment)

Posted patch patchSplinter Review
Every 100ms or so, we notify intersection observers from the refresh driver. For each document managed by the refresh driver, we dispatch a runnable to do the notification. When a document has lots of frames, this ends up dispatching tons of runnables that never do anything.

Since intersection observers are currently rare, I think the easiest fix is to avoid dispatching if there isn't anything to do. Hopefully this still satisfies the spec.
Attachment #8828127 - Flags: review?(mstange)
And if the spec requires this we should file a spec issue to try to fix it.
Comment on attachment 8828127 [details] [diff] [review]
patch

Review of attachment 8828127 [details] [diff] [review]:
-----------------------------------------------------------------

Seems reasonable. IIRC the spec doesn't require a certain notification latency, so even if this patch made us delay intersection observer notifications in some cases, we'd still be compliant.
Attachment #8828127 - Flags: review?(mstange) → review+

Comment 3

2 years ago
Pushed by wmccloskey@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/46a9096745e7
Check for intersection observers before posting runnable (r=mstange)
This got backed out along with bug 1331804.
Flags: needinfo?(wmccloskey)

Comment 5

2 years ago
Pushed by wmccloskey@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/96837f017b83
Check for intersection observers before posting runnable (r=mstange)
Flags: needinfo?(wmccloskey)

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/96837f017b83
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla54
You need to log in before you can comment on or make changes to this bug.