Changeset 145457 in webkit


Ignore:
Timestamp:
Mar 11, 2013 6:39:24 PM (11 years ago)
Author:
tony@chromium.org
Message:

Small code cleanup in RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=112076

Reviewed by Ojan Vafai.

No new tests, this is a refactor and existing tests in css3/flexbox should pass.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock): Remove unused param from repositionLogicalHeightDependentFlexItems.
(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Remove unused param from repositionLogicalHeightDependentFlexItems.
The clientLogicalBottom can't have changed in this time (the only thing we've done is align children).
(WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Just call layout() if we marked the flexitem as needing layout.
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Just call layout() if we marked the flexitem as needing layout.

  • rendering/RenderFlexibleBox.h:

(RenderFlexibleBox): Remove unused param from repositionLogicalHeightDependentFlexItems.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r145453 r145457  
     12013-03-11  Tony Chang  <tony@chromium.org>
     2
     3        Small code cleanup in RenderFlexibleBox
     4        https://bugs.webkit.org/show_bug.cgi?id=112076
     5
     6        Reviewed by Ojan Vafai.
     7
     8        No new tests, this is a refactor and existing tests in css3/flexbox should pass.
     9
     10        * rendering/RenderFlexibleBox.cpp:
     11        (WebCore::RenderFlexibleBox::layoutBlock): Remove unused param from repositionLogicalHeightDependentFlexItems.
     12        (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Remove unused param from repositionLogicalHeightDependentFlexItems.
     13        The clientLogicalBottom can't have changed in this time (the only thing we've done is align children).
     14        (WebCore::RenderFlexibleBox::computeMainAxisPreferredSizes): Just call layout() if we marked the flexitem as needing layout.
     15        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Just call layout() if we marked the flexitem as needing layout.
     16        * rendering/RenderFlexibleBox.h:
     17        (RenderFlexibleBox): Remove unused param from repositionLogicalHeightDependentFlexItems.
     18
    1192013-03-11  Jochen Eisinger  <jochen@chromium.org>
    220
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r144497 r145457  
    358358    LayoutUnit oldClientAfterEdge = clientLogicalBottom();
    359359    updateLogicalHeight();
    360     repositionLogicalHeightDependentFlexItems(lineContexts, oldClientAfterEdge);
     360    repositionLogicalHeightDependentFlexItems(lineContexts);
    361361
    362362    RenderBlock::finishDelayUpdateScrollInfo();
     
    418418}
    419419
    420 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge)
     420void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(Vector<LineContext>& lineContexts)
    421421{
    422422    LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? LayoutUnit() : lineContexts[0].crossAxisOffset;
     
    429429    alignChildren(lineContexts);
    430430
    431     if (style()->flexWrap() == FlexWrapReverse) {
    432         if (isHorizontalFlow())
    433             oldClientAfterEdge = clientLogicalBottom();
     431    if (style()->flexWrap() == FlexWrapReverse)
    434432        flipForWrapReverse(lineContexts, crossAxisStartEdge);
    435     }
    436433
    437434    // direction:rtl + flex-direction:column means the cross-axis direction is flipped.
     
    894891        if (hasOrthogonalFlow(child) && (flexBasisForChild(child).isAuto() || childMainAxisMin.isAuto())) {
    895892            child->setChildNeedsLayout(true, MarkOnlyThis);
    896             child->layoutIfNeeded();
     893            child->layout();
    897894        }
    898895
     
    13861383                child->setLogicalHeight(0);
    13871384                child->setChildNeedsLayout(true, MarkOnlyThis);
    1388                 child->layoutIfNeeded();
     1385                child->layout();
    13891386            }
    13901387        }
     
    13981395                child->setOverrideLogicalContentWidth(childWidth - child->borderAndPaddingLogicalWidth());
    13991396                child->setChildNeedsLayout(true, MarkOnlyThis);
    1400                 child->layoutIfNeeded();
     1397                child->layout();
    14011398            }
    14021399        }
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r144104 r145457  
    146146    bool hasAutoMarginsInCrossAxis(RenderBox* child) const;
    147147    bool updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace);
    148     void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&, LayoutUnit& oldClientAfterEdge);
     148    void repositionLogicalHeightDependentFlexItems(Vector<LineContext>&);
    149149    void appendChildFrameRects(ChildFrameRects&);
    150150    void repaintChildrenDuringLayoutIfMoved(const ChildFrameRects&);
Note: See TracChangeset for help on using the changeset viewer.