Changeset 123842 in webkit


Ignore:
Timestamp:
Jul 27, 2012 12:27:44 AM (12 years ago)
Author:
tony@chromium.org
Message:

changing -webkit-order should change the paint order of flex items
https://bugs.webkit.org/show_bug.cgi?id=92041

Reviewed by Ojan Vafai.

Source/WebCore:

Override paintChildren and use the flex order iterator to determine the order to paint the children.

Test: css3/flexbox/order-painting.html

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::layoutBlock): Save a reference to the order iterator.
(WebCore::RenderFlexibleBox::paintChildren):

  • rendering/RenderFlexibleBox.h:

(RenderFlexibleBox): Hold a reference to the order iterator so we don't have to recreate it at paint time.

Also mark all the virtual methods with OVERRIDE.

LayoutTests:

Use a ref test since this is testing paint behavior.

  • css3/flexbox/order-painting-expected.html: Added.
  • css3/flexbox/order-painting.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123841 r123842  
     12012-07-27  Tony Chang  <tony@chromium.org>
     2
     3        changing -webkit-order should change the paint order of flex items
     4        https://bugs.webkit.org/show_bug.cgi?id=92041
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Use a ref test since this is testing paint behavior.
     9
     10        * css3/flexbox/order-painting-expected.html: Added.
     11        * css3/flexbox/order-painting.html: Added.
     12
    1132012-07-27  Csaba Osztrogonác  <ossy@webkit.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r123840 r123842  
     12012-07-27  Tony Chang  <tony@chromium.org>
     2
     3        changing -webkit-order should change the paint order of flex items
     4        https://bugs.webkit.org/show_bug.cgi?id=92041
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Override paintChildren and use the flex order iterator to determine the order to paint the children.
     9
     10        Test: css3/flexbox/order-painting.html
     11
     12        * rendering/RenderFlexibleBox.cpp:
     13        (WebCore::RenderFlexibleBox::layoutBlock): Save a reference to the order iterator.
     14        (WebCore::RenderFlexibleBox::paintChildren):
     15        * rendering/RenderFlexibleBox.h:
     16        (RenderFlexibleBox): Hold a reference to the order iterator so we don't have to recreate it at paint time.
     17            Also mark all the virtual methods with OVERRIDE.
     18
    1192012-07-26  Sheriff Bot  <webkit.review.bot@gmail.com>
    220
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r123783 r123842  
    260260    OrderHashSet orderValues;
    261261    computeMainAxisPreferredSizes(relayoutChildren, orderValues);
    262     OrderIterator flexIterator(this, orderValues);
    263     layoutFlexItems(flexIterator, lineContexts);
     262    m_orderIterator = adoptPtr(new OrderIterator(this, orderValues));
     263    layoutFlexItems(*m_orderIterator, lineContexts);
    264264
    265265    LayoutUnit oldClientAfterEdge = clientLogicalBottom();
    266266    computeLogicalHeight();
    267     repositionLogicalHeightDependentFlexItems(flexIterator, lineContexts, oldClientAfterEdge);
     267    repositionLogicalHeightDependentFlexItems(*m_orderIterator, lineContexts, oldClientAfterEdge);
    268268
    269269    if (size() != previousSize)
     
    288288
    289289    setNeedsLayout(false);
     290}
     291
     292void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintInfo& paintInfoForChild, bool usePrintRect)
     293{
     294    ASSERT(m_orderIterator);
     295
     296    for (RenderBox* child = m_orderIterator->first(); child; child = m_orderIterator->next()) {
     297        if (!paintChild(child, paintInfo, paintOffset, paintInfoForChild, usePrintRect))
     298            return;
     299    }
    290300}
    291301
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.h

    r120780 r123842  
    3333
    3434#include "RenderBlock.h"
     35#include <wtf/OwnPtr.h>
    3536
    3637namespace WebCore {
     
    4142    virtual ~RenderFlexibleBox();
    4243
    43     virtual const char* renderName() const;
     44    virtual const char* renderName() const OVERRIDE;
    4445
    45     virtual bool isFlexibleBox() const { return true; }
    46     virtual void computePreferredLogicalWidths();
    47     virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0);
     46    virtual bool isFlexibleBox() const OVERRIDE { return true; }
     47    virtual void computePreferredLogicalWidths() OVERRIDE;
     48    virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE;
     49
     50    virtual void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) OVERRIDE;
    4851
    4952    bool isHorizontalFlow() const;
     
    133136    void flipForRightToLeftColumn(OrderIterator&);
    134137    void flipForWrapReverse(OrderIterator&, const WTF::Vector<LineContext>&, LayoutUnit crossAxisStartEdge);
     138
     139    OwnPtr<OrderIterator> m_orderIterator;
    135140};
    136141
Note: See TracChangeset for help on using the changeset viewer.