Open Bug 1268348 Opened 4 years ago Updated 3 years ago

Pass the old visibility state to OnVisibilityChanged() to let us avoid work in some cases

Categories

(Core :: Layout, defect)

defect
Not set

Tracking

()

REOPENED
mozilla49
Tracking Status
firefox49 --- fixed

People

(Reporter: seth, Assigned: seth)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Overrides of nsIFrame::OnVisibilityChanged() usually do some work when a frame becomes visible - for example, triggering image decoding. Now that we have multiple notions of visibility, it's possible to transition from one visible state to another visible state. When such a visible-to-visible transition occurs, frames often don't need to reduce the work they did at the time of the nonvisible-to-visible transition. To make it easy to avoid that work, let's pass the old visibility state to OnVisibilityChanged().

In this bug we'll do that, and when updating OnVisibilityChanged() overrides we'll change them to avoid requesting duplicate image decodes. (Since that's the main use-case for now.)
s/reduce the work/redo the work
Here's the patch. The API change is made in nsIFrame.h and implemented in
nsFrame.cpp; the rest is just updating callers with the new signature (and
avoiding duplicating image decoding or tracking work, as mentioned above).
Attachment #8746379 - Flags: review?(mstange)
Attachment #8746379 - Flags: review?(mstange) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d6a286242f2d0e531bc4ccc4a46bf8c70de7f152
Bug 1268348 - Pass the previous visibility state to OnVisibilityChange(). r=mstange
https://hg.mozilla.org/mozilla-central/rev/d6a286242f2d
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
Depends on: 1272357
No longer depends on: 1272357
I backed this bug out on inbound, I expect the backout to get merged to mozilla-central. I plan to also request uplift to backout on aurora (so this bug would not be landed in any version of Firefox).

Bug 1284350 tracks the back out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
You need to log in before you can comment on or make changes to this bug.