+2013-02-14 Ojan Vafai <ojan@chromium.org>
+
+ Implement RenderGrid::computeIntrinsicLogicalWidths
+ https://bugs.webkit.org/show_bug.cgi?id=109881
+
+ Reviewed by Tony Chang.
+
+ For now this is not observable due to the FIXMEs for unimplemented bits
+ of computePreferredLogicalWidths. But, soon, I'll be removing the computePreferredLogicalWidths
+ override entirely and instead use RenderBlock's, which will also address the
+ RenderGrid FIXMEs.
+
+ * rendering/RenderGrid.cpp:
+ (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
+ const_cast the usages of m_grid. Alternately, we could stack allocate it, but there's disagreement on
+ whether that's the right choice. See https://bugs.webkit.org/show_bug.cgi?id=109880.
+
+ (WebCore::RenderGrid::computePreferredLogicalWidths):
+ * rendering/RenderGrid.h:
+
+
2013-02-15 Xueqing Huang <huangxueqing@baidu.com>
Flexbox should ignore firstLine pseudo element.
setNeedsLayout(false);
}
-void RenderGrid::computePreferredLogicalWidths()
+void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- ASSERT(preferredLogicalWidthsDirty());
-
- placeItemsOnGrid();
-
- m_minPreferredLogicalWidth = 0;
- m_maxPreferredLogicalWidth = 0;
-
- // FIXME: We don't take our own logical width into account.
+ const_cast<RenderGrid*>(this)->placeItemsOnGrid();
const Vector<GridTrackSize>& trackStyles = style()->gridColumns();
-
for (size_t i = 0; i < trackStyles.size(); ++i) {
LayoutUnit minTrackBreadth = computePreferredTrackWidth(trackStyles[i].minTrackBreadth(), i);
LayoutUnit maxTrackBreadth = computePreferredTrackWidth(trackStyles[i].maxTrackBreadth(), i);
maxTrackBreadth = std::max(maxTrackBreadth, minTrackBreadth);
- m_minPreferredLogicalWidth += minTrackBreadth;
- m_maxPreferredLogicalWidth += maxTrackBreadth;
+ minLogicalWidth += minTrackBreadth;
+ maxLogicalWidth += maxTrackBreadth;
// FIXME: This should add in the scrollbarWidth (e.g. see RenderFlexibleBox).
}
+ const_cast<RenderGrid*>(this)->m_grid.clear();
+}
+
+void RenderGrid::computePreferredLogicalWidths()
+{
+ ASSERT(preferredLogicalWidthsDirty());
+
+ m_minPreferredLogicalWidth = 0;
+ m_maxPreferredLogicalWidth = 0;
+
+ // FIXME: We don't take our own logical width into account.
+ computeIntrinsicLogicalWidths(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
// FIXME: We should account for min / max logical width.
LayoutUnit borderAndPaddingInInlineDirection = borderAndPaddingLogicalWidth();
m_maxPreferredLogicalWidth += borderAndPaddingInInlineDirection;
setPreferredLogicalWidthsDirty(false);
- m_grid.clear();
}
LayoutUnit RenderGrid::computePreferredTrackWidth(const Length& length, size_t trackIndex) const