Closed Bug 1450189 Opened 4 years ago Closed 4 years ago

Don't invalidate display items when a frame gets a new style context

Categories

(Core :: Web Painting, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: mattwoodrow, Assigned: mattwoodrow)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

We currently invalidate all display items for a frame (and all descendants of that frame) whenever we get a new style context, even though the relevant rendering might not have changed (this happens frequently on gmail).

We invalidate display items, since the sometimes have raw pointers to style data, which will be dangling after we change style context.

Instead we can just hold a strong pointer to the style context, and if anything relevant changed then we'll get a call to InvalidateFrame() to trigger the display item invalidation.
Comment on attachment 8963872 [details] [diff] [review]
Don't invalidate display items when we get a new style context

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

LGTM.

::: layout/painting/nsDisplayList.cpp
@@ +3678,5 @@
>    if ((drawBackgroundColor && color != NS_RGBA(0,0,0,0)) ||
>        aBuilder->IsForEventDelivery()) {
>      Maybe<DisplayListClipState::AutoSaveRestore> clipState;
>      nsRect bgColorRect = bgRect;
> +    if (bgSC && !aBuilder->IsForEventDelivery()) {

There is a call bg->BottomLayer() below (and other calls as well) that might now be nullptr, if the background is themed.
Attachment #8963872 - Flags: review?(mikokm) → review+
Pushed by mwoodrow@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/79da39e0fd79
Don't invalidate display items when we get a new style context. r=miko
https://hg.mozilla.org/mozilla-central/rev/79da39e0fd79
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.