Changeset 119015 in webkit


Ignore:
Timestamp:
May 30, 2012 6:37:04 PM (12 years ago)
Author:
ojan@chromium.org
Message:

Avoid second layout for flex-direction:row, flex-basis:auto flex items
https://bugs.webkit.org/show_bug.cgi?id=87901

Reviewed by Tony Chang.

No new tests. This is strictly a performance optimization and has no other
web visible changes.

Also, add FIXMEs for other cases where we could avoid doing layouts.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r119014 r119015  
     12012-05-30  Ojan Vafai  <ojan@chromium.org>
     2
     3        Avoid second layout for flex-direction:row, flex-basis:auto flex items
     4        https://bugs.webkit.org/show_bug.cgi?id=87901
     5
     6        Reviewed by Tony Chang.
     7
     8        No new tests. This is strictly a performance optimization and has no other
     9        web visible changes.
     10
     11        Also, add FIXMEs for other cases where we could avoid doing layouts.
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes):
     15        (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
     16        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
     17
    1182012-05-30  Zhenyao Mo  <zmo@google.com>
    219
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r118971 r119015  
    758758
    759759        child->clearOverrideSize();
    760         if (preferredLengthForChild(child).isAuto()) {
     760        // Only need to layout here if we will need to get the logicalHeight of the child in computeNextFlexLine.
     761        if (hasOrthogonalFlow(child) && preferredLengthForChild(child).isAuto()) {
    761762            if (!relayoutChildren)
    762763                child->setChildNeedsLayout(true);
     
    992993        LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
    993994        setLogicalOverrideSize(child, childPreferredSize);
     995        // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
    994996        child->setChildNeedsLayout(true);
    995997        child->layoutIfNeeded();
     
    12141216        child->computeLogicalHeight();
    12151217
     1218        // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
    12161219        if (child->logicalHeight() != logicalHeightBefore) {
    12171220            child->setOverrideHeight(child->logicalHeight());
Note: See TracChangeset for help on using the changeset viewer.