Modified: trunk/Source/WebCore/ChangeLog (224349 => 224350)
--- trunk/Source/WebCore/ChangeLog 2017-11-02 19:17:25 UTC (rev 224349)
+++ trunk/Source/WebCore/ChangeLog 2017-11-02 19:24:42 UTC (rev 224350)
@@ -1,3 +1,21 @@
+2017-11-02 Zalan Bujtas <[email protected]>
+
+ LayoutState::m_next is really the ancestor state.
+ https://bugs.webkit.org/show_bug.cgi?id=179187
+ <rdar://problem/35319525>
+
+ Reviewed by Simon Fraser.
+
+ No change in functionality.
+
+ * rendering/LayoutState.cpp:
+ (WebCore::LayoutState::LayoutState):
+ (WebCore::LayoutState::clearPaginationInformation):
+ (WebCore::LayoutState::propagateLineGridInfo):
+ (WebCore::LayoutState::establishLineGrid):
+ * rendering/LayoutState.h:
+ * rendering/RenderView.h:
+
2017-11-02 Alex Christensen <[email protected]>
Fix iOS WebKitLegacy after r224267
Modified: trunk/Source/WebCore/rendering/LayoutState.cpp (224349 => 224350)
--- trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-02 19:17:25 UTC (rev 224349)
+++ trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-02 19:24:42 UTC (rev 224350)
@@ -34,13 +34,13 @@
namespace WebCore {
-LayoutState::LayoutState(std::unique_ptr<LayoutState> next, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
- : m_next(WTFMove(next))
+LayoutState::LayoutState(std::unique_ptr<LayoutState> ancestor, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
+ : m_ancestor(WTFMove(ancestor))
#ifndef NDEBUG
, m_renderer(renderer)
#endif
{
- ASSERT(m_next);
+ ASSERT(m_ancestor);
bool fixed = renderer->isOutOfFlowPositioned() && renderer->style().position() == FixedPosition;
if (fixed) {
@@ -48,7 +48,7 @@
FloatPoint fixedOffset = renderer->view().localToAbsolute(FloatPoint(), IsFixed);
m_paintOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset;
} else
- m_paintOffset = m_next->m_paintOffset + offset;
+ m_paintOffset = m_ancestor->m_paintOffset + offset;
if (renderer->isOutOfFlowPositioned() && !fixed) {
if (RenderElement* container = renderer->container()) {
@@ -62,9 +62,9 @@
if (renderer->isInFlowPositioned() && renderer->hasLayer())
m_paintOffset += renderer->layer()->offsetForInFlowPosition();
- m_clipped = !fixed && m_next->m_clipped;
+ m_clipped = !fixed && m_ancestor->m_clipped;
if (m_clipped)
- m_clipRect = m_next->m_clipRect;
+ m_clipRect = m_ancestor->m_clipRect;
if (renderer->hasOverflowClip()) {
LayoutRect clipRect(toLayoutPoint(m_paintOffset) + renderer->view().layoutDelta(), renderer->cachedSizeForOverflowClip());
@@ -89,9 +89,9 @@
m_isPaginated = true;
} else {
// If we don't establish a new page height, then propagate the old page height and offset down.
- m_pageLogicalHeight = m_next->m_pageLogicalHeight;
- m_pageLogicalHeightChanged = m_next->m_pageLogicalHeightChanged;
- m_pageOffset = m_next->m_pageOffset;
+ m_pageLogicalHeight = m_ancestor->m_pageLogicalHeight;
+ m_pageLogicalHeightChanged = m_ancestor->m_pageLogicalHeightChanged;
+ m_pageOffset = m_ancestor->m_pageOffset;
// Disable pagination for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and
// writing mode roots.
@@ -105,10 +105,10 @@
// Propagate line grid information.
propagateLineGridInfo(renderer);
- m_layoutDelta = m_next->m_layoutDelta;
+ m_layoutDelta = m_ancestor->m_layoutDelta;
#if !ASSERT_DISABLED
- m_layoutDeltaXSaturated = m_next->m_layoutDeltaXSaturated;
- m_layoutDeltaYSaturated = m_next->m_layoutDeltaYSaturated;
+ m_layoutDeltaXSaturated = m_ancestor->m_layoutDeltaXSaturated;
+ m_layoutDeltaYSaturated = m_ancestor->m_layoutDeltaYSaturated;
#endif
if (lineGrid() && (lineGrid()->style().writingMode() == renderer->style().writingMode()) && is<RenderMultiColumnFlow>(*renderer))
@@ -148,8 +148,8 @@
void LayoutState::clearPaginationInformation()
{
- m_pageLogicalHeight = m_next->m_pageLogicalHeight;
- m_pageOffset = m_next->m_pageOffset;
+ m_pageLogicalHeight = m_ancestor->m_pageLogicalHeight;
+ m_pageOffset = m_ancestor->m_pageOffset;
}
LayoutUnit LayoutState::pageLogicalOffset(RenderBox* child, LayoutUnit childLogicalOffset) const
@@ -163,12 +163,12 @@
{
// Disable line grids for objects we don't support. For now this includes overflow:scroll/auto, inline blocks and
// writing mode roots.
- if (!m_next || renderer->isUnsplittableForPagination())
+ if (!m_ancestor || renderer->isUnsplittableForPagination())
return;
- m_lineGrid = m_next->m_lineGrid;
- m_lineGridOffset = m_next->m_lineGridOffset;
- m_lineGridPaginationOrigin = m_next->m_lineGridPaginationOrigin;
+ m_lineGrid = m_ancestor->m_lineGrid;
+ m_lineGridOffset = m_ancestor->m_lineGridOffset;
+ m_lineGridPaginationOrigin = m_ancestor->m_lineGridPaginationOrigin;
}
void LayoutState::establishLineGrid(RenderBlockFlow* block)
@@ -178,7 +178,7 @@
if (m_lineGrid->style().lineGrid() == block->style().lineGrid())
return;
RenderBlockFlow* currentGrid = m_lineGrid;
- for (LayoutState* currentState = m_next.get(); currentState; currentState = currentState->m_next.get()) {
+ for (LayoutState* currentState = m_ancestor.get(); currentState; currentState = currentState->m_ancestor.get()) {
if (currentState->m_lineGrid == currentGrid)
continue;
currentGrid = currentState->m_lineGrid;
Modified: trunk/Source/WebCore/rendering/LayoutState.h (224349 => 224350)
--- trunk/Source/WebCore/rendering/LayoutState.h 2017-11-02 19:17:25 UTC (rev 224349)
+++ trunk/Source/WebCore/rendering/LayoutState.h 2017-11-02 19:24:42 UTC (rev 224350)
@@ -53,7 +53,7 @@
{
}
- LayoutState(std::unique_ptr<LayoutState>, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
+ LayoutState(std::unique_ptr<LayoutState> ancestor, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
explicit LayoutState(RenderObject&);
void clearPaginationInformation();
@@ -97,7 +97,7 @@
// The current line grid that we're snapping to and the offset of the start of the grid.
RenderBlockFlow* m_lineGrid { nullptr };
- std::unique_ptr<LayoutState> m_next;
+ std::unique_ptr<LayoutState> m_ancestor;
// FIXME: Distinguish between the layout clip rect and the paint clip rect which may be larger,
// e.g., because of composited scrolling.
Modified: trunk/Source/WebCore/rendering/RenderView.h (224349 => 224350)
--- trunk/Source/WebCore/rendering/RenderView.h 2017-11-02 19:17:25 UTC (rev 224349)
+++ trunk/Source/WebCore/rendering/RenderView.h 2017-11-02 19:24:42 UTC (rev 224350)
@@ -263,7 +263,7 @@
void popLayoutState()
{
- m_layoutState = WTFMove(m_layoutState->m_next);
+ m_layoutState = WTFMove(m_layoutState->m_ancestor);
}
// Suspends the LayoutState optimization. Used under transforms that cannot be represented by