Title: [143043] trunk/Source/WebCore
- Revision
- 143043
- Author
- o...@chromium.org
- Date
- 2013-02-15 13:18:20 -0800 (Fri, 15 Feb 2013)
Log Message
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:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (143042 => 143043)
--- trunk/Source/WebCore/ChangeLog 2013-02-15 21:16:39 UTC (rev 143042)
+++ trunk/Source/WebCore/ChangeLog 2013-02-15 21:18:20 UTC (rev 143043)
@@ -1,3 +1,24 @@
+2013-02-14 Ojan Vafai <o...@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 <huangxueq...@baidu.com>
Flexbox should ignore firstLine pseudo element.
Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (143042 => 143043)
--- trunk/Source/WebCore/rendering/RenderGrid.cpp 2013-02-15 21:16:39 UTC (rev 143042)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp 2013-02-15 21:18:20 UTC (rev 143043)
@@ -168,30 +168,34 @@
setNeedsLayout(false);
}
-void RenderGrid::computePreferredLogicalWidths()
+void RenderGrid::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const
{
- ASSERT(preferredLogicalWidthsDirty());
+ const_cast<RenderGrid*>(this)->placeItemsOnGrid();
- placeItemsOnGrid();
-
- m_minPreferredLogicalWidth = 0;
- m_maxPreferredLogicalWidth = 0;
-
- // FIXME: We don't take our own logical width into account.
-
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();
@@ -199,7 +203,6 @@
m_maxPreferredLogicalWidth += borderAndPaddingInInlineDirection;
setPreferredLogicalWidthsDirty(false);
- m_grid.clear();
}
LayoutUnit RenderGrid::computePreferredTrackWidth(const Length& length, size_t trackIndex) const
Modified: trunk/Source/WebCore/rendering/RenderGrid.h (143042 => 143043)
--- trunk/Source/WebCore/rendering/RenderGrid.h 2013-02-15 21:16:39 UTC (rev 143042)
+++ trunk/Source/WebCore/rendering/RenderGrid.h 2013-02-15 21:18:20 UTC (rev 143043)
@@ -46,6 +46,7 @@
private:
virtual bool isRenderGrid() const OVERRIDE { return true; }
+ virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const OVERRIDE;
virtual void computePreferredLogicalWidths() OVERRIDE;
LayoutUnit computePreferredTrackWidth(const Length&, size_t) const;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes