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.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123842
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-07-27 Tony Chang <tony@chromium.org>
+
+ changing -webkit-order should change the paint order of flex items
+ https://bugs.webkit.org/show_bug.cgi?id=92041
+
+ Reviewed by Ojan Vafai.
+
+ Use a ref test since this is testing paint behavior.
+
+ * css3/flexbox/order-painting-expected.html: Added.
+ * css3/flexbox/order-painting.html: Added.
+
2012-07-27 Csaba Osztrogonác <ossy@webkit.org>
[Qt][WK2] REGRESSION(r119127): resetting window.internals settings between tests doesn't work properly
--- /dev/null
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test passes if there is no red showing.</p>
+
+<div style="width: 100px; height: 100px; background-color: green"></div>
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html>
+<html>
+<body>
+<p>This test passes if there is no red showing.</p>
+
+<div style="display: -webkit-flex; width: 100px;">
+ <div style="-webkit-order: 2; background-color: green; width: 100px; height: 100px; margin-left: -50px;"></div>
+ <div style="-webkit-order: 1; background-color: red; width: 50px; height: 100px;"></div>
+</div>
+</body>
+</html>
+2012-07-27 Tony Chang <tony@chromium.org>
+
+ changing -webkit-order should change the paint order of flex items
+ https://bugs.webkit.org/show_bug.cgi?id=92041
+
+ Reviewed by Ojan Vafai.
+
+ 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.
+
2012-07-26 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r123820.
WTF::Vector<LineContext> lineContexts;
OrderHashSet orderValues;
computeMainAxisPreferredSizes(relayoutChildren, orderValues);
- OrderIterator flexIterator(this, orderValues);
- layoutFlexItems(flexIterator, lineContexts);
+ m_orderIterator = adoptPtr(new OrderIterator(this, orderValues));
+ layoutFlexItems(*m_orderIterator, lineContexts);
LayoutUnit oldClientAfterEdge = clientLogicalBottom();
computeLogicalHeight();
- repositionLogicalHeightDependentFlexItems(flexIterator, lineContexts, oldClientAfterEdge);
+ repositionLogicalHeightDependentFlexItems(*m_orderIterator, lineContexts, oldClientAfterEdge);
if (size() != previousSize)
relayoutChildren = true;
setNeedsLayout(false);
}
+void RenderFlexibleBox::paintChildren(PaintInfo& paintInfo, const LayoutPoint& paintOffset, PaintInfo& paintInfoForChild, bool usePrintRect)
+{
+ ASSERT(m_orderIterator);
+
+ for (RenderBox* child = m_orderIterator->first(); child; child = m_orderIterator->next()) {
+ if (!paintChild(child, paintInfo, paintOffset, paintInfoForChild, usePrintRect))
+ return;
+ }
+}
+
void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(OrderIterator& iterator, WTF::Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge)
{
LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? ZERO_LAYOUT_UNIT : lineContexts[0].crossAxisOffset;
#define RenderFlexibleBox_h
#include "RenderBlock.h"
+#include <wtf/OwnPtr.h>
namespace WebCore {
RenderFlexibleBox(Node*);
virtual ~RenderFlexibleBox();
- virtual const char* renderName() const;
+ virtual const char* renderName() const OVERRIDE;
- virtual bool isFlexibleBox() const { return true; }
- virtual void computePreferredLogicalWidths();
- virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0);
+ virtual bool isFlexibleBox() const OVERRIDE { return true; }
+ virtual void computePreferredLogicalWidths() OVERRIDE;
+ virtual void layoutBlock(bool relayoutChildren, LayoutUnit pageLogicalHeight = 0) OVERRIDE;
+
+ virtual void paintChildren(PaintInfo& forSelf, const LayoutPoint&, PaintInfo& forChild, bool usePrintRect) OVERRIDE;
bool isHorizontalFlow() const;
void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent);
void flipForRightToLeftColumn(OrderIterator&);
void flipForWrapReverse(OrderIterator&, const WTF::Vector<LineContext>&, LayoutUnit crossAxisStartEdge);
+
+ OwnPtr<OrderIterator> m_orderIterator;
};
} // namespace WebCore