Diff
Modified: trunk/Source/WebCore/ChangeLog (162838 => 162839)
--- trunk/Source/WebCore/ChangeLog 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/ChangeLog 2014-01-27 16:27:45 UTC (rev 162839)
@@ -156,6 +156,33 @@
2014-01-26 David Hyatt <[email protected]>
+ [New Multicolumn] Make sure the progression axis and direction are propagated to the new columns.
+ https://bugs.webkit.org/show_bug.cgi?id=127670
+
+ This patch makes sure that the progression axis and direction style properties
+ are properly propagated from the style to the multi-column flow thread. Virtualizing
+ and renaming updateColumnInfoFromStyle to updateColumnProgressionFromStyle lets us
+ share code between the old multi-column code and the new.
+
+ Reviewed by Sam Weinig.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::updateColumnProgressionFromStyle):
+ * rendering/RenderBlock.h:
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::setComputedColumnCountAndWidth):
+ (WebCore::RenderBlockFlow::updateColumnProgressionFromStyle):
+ * rendering/RenderBlockFlow.h:
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::styleDidChange):
+ * rendering/RenderMultiColumnFlowThread.cpp:
+ (WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread):
+ * rendering/RenderMultiColumnFlowThread.h:
+ * style/StyleResolveForDocument.cpp:
+ (WebCore::Style::resolveForDocument):
+
+2014-01-26 David Hyatt <[email protected]>
+
[New Multicolumn] Change the axis property to be a boolean like other isInline checks
https://bugs.webkit.org/show_bug.cgi?id=127661
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2014-01-27 16:27:45 UTC (rev 162839)
@@ -3711,7 +3711,7 @@
}
}
-void RenderBlock::updateColumnInfoFromStyle(RenderStyle* style)
+void RenderBlock::updateColumnProgressionFromStyle(RenderStyle* style)
{
if (!hasColumns())
return;
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2014-01-27 16:27:45 UTC (rev 162839)
@@ -257,7 +257,8 @@
ColumnInfo* columnInfo() const;
int columnGap() const;
- void updateColumnInfoFromStyle(RenderStyle*);
+ // FIXME: Can devirtualize this and only have the RenderBlockFlow version once the old multi-column code is gone.
+ virtual void updateColumnProgressionFromStyle(RenderStyle*);
LayoutUnit initialBlockOffsetForPainting() const;
LayoutUnit blockDeltaForPaintingNextColumn() const;
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2014-01-27 16:27:45 UTC (rev 162839)
@@ -3593,9 +3593,38 @@
if (!multiColumnFlowThread())
createMultiColumnFlowThread();
multiColumnFlowThread()->setColumnCountAndWidth(count, width);
+ multiColumnFlowThread()->setProgressionIsInline(style().hasInlineColumnAxis());
+ multiColumnFlowThread()->setProgressionIsReversed(style().columnProgression() == ReverseColumnProgression);
}
}
+void RenderBlockFlow::updateColumnProgressionFromStyle(RenderStyle* style)
+{
+ if (!document().regionBasedColumnsEnabled())
+ return RenderBlock::updateColumnProgressionFromStyle(style);
+
+ if (!multiColumnFlowThread())
+ return;
+
+ bool needsLayout = false;
+ bool oldProgressionIsInline = multiColumnFlowThread()->progressionIsInline();
+ bool newProgressionIsInline = style->hasInlineColumnAxis();
+ if (oldProgressionIsInline != newProgressionIsInline) {
+ multiColumnFlowThread()->setProgressionIsInline(newProgressionIsInline);
+ needsLayout = true;
+ }
+
+ bool oldProgressionIsReversed = multiColumnFlowThread()->progressionIsReversed();
+ bool newProgressionIsReversed = style->columnProgression() == ReverseColumnProgression;
+ if (oldProgressionIsReversed != newProgressionIsReversed) {
+ multiColumnFlowThread()->setProgressionIsReversed(newProgressionIsReversed);
+ needsLayout = true;
+ }
+
+ if (needsLayout)
+ setNeedsLayoutAndPrefWidthsRecalc();
+}
+
LayoutUnit RenderBlockFlow::computedColumnWidth() const
{
if (!document().regionBasedColumnsEnabled())
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.h 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h 2014-01-27 16:27:45 UTC (rev 162839)
@@ -379,6 +379,8 @@
void createMultiColumnFlowThread();
void destroyMultiColumnFlowThread();
+ virtual void updateColumnProgressionFromStyle(RenderStyle*) override;
+
protected:
// A page break is required at some offset due to space shortage in the current fragmentainer.
void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage);
@@ -436,7 +438,7 @@
virtual bool isMultiColumnBlockFlow() const override { return multiColumnFlowThread(); }
virtual void setComputedColumnCountAndWidth(int, LayoutUnit) override;
-
+
virtual LayoutUnit computedColumnWidth() const override;
virtual unsigned computedColumnCount() const override;
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2014-01-27 16:27:45 UTC (rev 162839)
@@ -380,8 +380,8 @@
const Pagination& pagination = view().frameView().pagination();
if (viewChangedWritingMode && pagination.mode != Pagination::Unpaginated) {
viewStyle.setColumnStylesFromPaginationMode(pagination.mode);
- if (view().hasColumns())
- view().updateColumnInfoFromStyle(&viewStyle);
+ if (view().hasColumns() || view().multiColumnFlowThread())
+ view().updateColumnProgressionFromStyle(&viewStyle);
}
}
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.cpp 2014-01-27 16:27:45 UTC (rev 162839)
@@ -37,6 +37,8 @@
, m_columnHeightAvailable(0)
, m_inBalancingPass(false)
, m_needsRebalancing(false)
+ , m_progressionIsInline(false)
+ , m_progressionIsReversed(false)
{
setFlowThreadState(InsideInFlowThread);
}
Modified: trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h (162838 => 162839)
--- trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/rendering/RenderMultiColumnFlowThread.h 2014-01-27 16:27:45 UTC (rev 162839)
@@ -55,6 +55,12 @@
m_columnWidth = width;
}
+ bool progressionIsInline() const { return m_progressionIsInline; }
+ void setProgressionIsInline(bool progressionIsInline) { m_progressionIsInline = progressionIsInline; }
+
+ bool progressionIsReversed() const { return m_progressionIsReversed; }
+ void setProgressionIsReversed(bool reversed) { m_progressionIsReversed = reversed; }
+
private:
virtual const char* renderName() const override;
virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logicalTop, LogicalExtentComputedValues&) const override;
@@ -71,6 +77,9 @@
LayoutUnit m_columnHeightAvailable; // Total height available to columns, or 0 if auto.
bool m_inBalancingPass; // Guard to avoid re-entering column balancing.
bool m_needsRebalancing;
+
+ bool m_progressionIsInline;
+ bool m_progressionIsReversed;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/style/StyleResolveForDocument.cpp (162838 => 162839)
--- trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2014-01-27 16:18:06 UTC (rev 162838)
+++ trunk/Source/WebCore/style/StyleResolveForDocument.cpp 2014-01-27 16:27:45 UTC (rev 162839)
@@ -101,8 +101,8 @@
if (pagination.mode != Pagination::Unpaginated) {
documentStyle.get().setColumnStylesFromPaginationMode(pagination.mode);
documentStyle.get().setColumnGap(pagination.gap);
- if (renderView.hasColumns())
- renderView.updateColumnInfoFromStyle(&documentStyle.get());
+ if (renderView.hasColumns() || renderView.multiColumnFlowThread())
+ renderView.updateColumnProgressionFromStyle(&documentStyle.get());
}
// Seamless iframes want to inherit their font from their parent iframe, so early return before setting the font.