Closed Bug 1389215 Opened 7 years ago Closed 7 years ago

Stop layerizing in response to margin animations

Categories

(Core :: Web Painting, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: mstange, Assigned: mstange)

Details

Attachments

(1 file)

We currently create a layer for an element if JavaScript animates any of the margin properties on the element.

I'm not aware of any pages where this benefits us. I've only seen it cause unnecessary invalidations because of margin changes that were incorrectly detected as animations.
For example, on http://bazqux.com/ (an RSS reader, requires an account), as you scroll over posts, there's some JS that highlights the post that you're currently looking at, and sets margin-left to zero a few times. So in this case the margin doesn't even change, and it still gets detected as an animation.
Comment on attachment 8895963 [details]
Bug 1389215 - Don't layerize in response to margin changes.

https://reviewboard.mozilla.org/r/167236/#review172492

::: layout/painting/ActiveLayerTracker.cpp:444
(Diff revision 1)
>    }
>    return nsLayoutUtils::HasEffectiveAnimation(aFrame, aProperty);
>  }
>  
>  /* static */ bool
>  ActiveLayerTracker::IsOffsetOrMarginStyleAnimated(nsIFrame* aFrame)

Could rename this function now that margins aren't taken into account.
Attachment #8895963 - Flags: review?(matt.woodrow) → review+
Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/ae6148ddda6b
Don't layerize in response to margin changes. r=mattwoodrow
https://hg.mozilla.org/mozilla-central/rev/ae6148ddda6b
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
I see an improvement in memory on AWSY:
== Change summary for alert #8755 (as of August 13 2017 01:16 UTC) ==

Improvements:

  5%  Resident Memory summary macosx64-stylo opt stylo     667,672,371.49 -> 637,141,298.34

For up to date results, see: https://treeherder.mozilla.org/perf.html#/alerts?id=8755
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: