Make adding/removing a transform style not cause nsChangeHint_ReconstructFrame

RESOLVED DUPLICATE of bug 691651

Status

()

Core
CSS Parsing and Computation
RESOLVED DUPLICATE of bug 691651
6 years ago
6 years ago

People

(Reporter: mats, Unassigned)

Tracking

(Blocks: 1 bug, {perf})

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
Looking at the remaining culprits (after bug 730769 / bug 728906) that makes
us slow on the IE Maze, it looks to me that they all come from a large number
of reflows.  This comes from the test toggling element.style.MozTransform
between "none" and "translate", so we hit:

http://mxr.mozilla.org/mozilla-central/source/layout/style/nsStyleStruct.cpp#2259
2259   /* If we've added or removed the transform property, we need to reconstruct the frame to add
2260    * or remove the view object, and also to handle abs-pos and fixed-pos containers.
2261    */
2262   if (HasTransform() != aOther.HasTransform()) {
2263     NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
2264   }

It seems to me that ReconstructFrame is overkill in this case, we could reparent views, 
abs/fixed pos descendants of the restyled frame, then reflow / recalculate overflow
areas as needed.

In the IE Maze case, I estimate that it will improve more than 60% if we can avoid
re-creating the frame for this style change.

Would this be possible?
(Reporter)

Updated

6 years ago
Blocks: 641341
We only have views on root frames, sub document frames, plugins and popups now, so they shouldn't cause any problems here.

We could also just bail out and reconstruct the frame if we have abs/fixed pos descendants.
(Reporter)

Comment 2

6 years ago
My 60% estimate was accurate, I have a hack that now runs IE Maze at 41s. :-)
The top of the list is now:
3.7% nsAttrAndChildArray::IndexOfChild
3.6% nsDisplayBackground::GetBounds
3.0% ozone_size
2.7% PL_DHashTableOperate
... the remaining stuff is 2% or lower
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 691651
You need to log in before you can comment on or make changes to this bug.