[Webkit-unassigned] [Bug 87905] Can avoid a second layout of flex-items in some cases

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 14 12:13:07 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=87905





--- Comment #3 from Ojan Vafai <ojan at chromium.org>  2012-11-14 12:14:54 PST ---
(From update of attachment 174091)
View in context: https://bugs.webkit.org/attachment.cgi?id=174091&action=review

This is actually a separate optimization than bug 87905. That bug is about when we *do* change the height, there are many cases where we don't need to do a layout (i.e. if there are no descendants or css properties that depend on the height).

This is still a good optimization though. It just needs it's own bug.

> Source/WebCore/rendering/RenderFlexibleBox.cpp:1094
> +        if (child->size().isZero() || childPreferredSize != childCurrentSize) {
> +            child->setChildNeedsLayout(true, MarkOnlyThis);
> +            child->layoutIfNeeded();
> +        }

I don't think we need the isZero check. Instead, we should always call child->layoutIfNeeded() here (i.e. move it out of the if-statement), but only setChildNeedsLayout if childPreferredSize != childCurrentSize.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list