Title: [224625] trunk/Source/WebCore
- Revision
- 224625
- Author
- za...@apple.com
- Date
- 2017-11-09 07:08:46 -0800 (Thu, 09 Nov 2017)
Log Message
[LayoutState cleanup] Add pagination parameter to subtree LayoutState
https://bugs.webkit.org/show_bug.cgi?id=179465
<rdar://problem/35434096>
Reviewed by Antti Koivisto.
It enables us to remove the last setters from LayoutState.
No change in functionality.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
* rendering/LayoutState.cpp:
(WebCore::LayoutState::LayoutState):
(WebCore::LayoutState::layoutDeltaMatches const):
(WebCore::LayoutState::layoutDeltaMatches): Deleted.
* rendering/LayoutState.h:
(WebCore::LayoutState::isPaginated const):
(WebCore::LayoutState::setIsPaginated): Deleted.
(WebCore::LayoutState::setPageLogicalHeight): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (224624 => 224625)
--- trunk/Source/WebCore/ChangeLog 2017-11-09 12:36:07 UTC (rev 224624)
+++ trunk/Source/WebCore/ChangeLog 2017-11-09 15:08:46 UTC (rev 224625)
@@ -1,3 +1,26 @@
+2017-11-09 Zalan Bujtas <za...@apple.com>
+
+ [LayoutState cleanup] Add pagination parameter to subtree LayoutState
+ https://bugs.webkit.org/show_bug.cgi?id=179465
+ <rdar://problem/35434096>
+
+ Reviewed by Antti Koivisto.
+
+ It enables us to remove the last setters from LayoutState.
+
+ No change in functionality.
+
+ * page/LayoutContext.cpp:
+ (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded):
+ * rendering/LayoutState.cpp:
+ (WebCore::LayoutState::LayoutState):
+ (WebCore::LayoutState::layoutDeltaMatches const):
+ (WebCore::LayoutState::layoutDeltaMatches): Deleted.
+ * rendering/LayoutState.h:
+ (WebCore::LayoutState::isPaginated const):
+ (WebCore::LayoutState::setIsPaginated): Deleted.
+ (WebCore::LayoutState::setPageLogicalHeight): Deleted.
+
2017-11-08 Joseph Pecoraro <pecor...@apple.com>
AVSampleBufferGenerator leaks seen on leaks bot
Modified: trunk/Source/WebCore/page/LayoutContext.cpp (224624 => 224625)
--- trunk/Source/WebCore/page/LayoutContext.cpp 2017-11-09 12:36:07 UTC (rev 224624)
+++ trunk/Source/WebCore/page/LayoutContext.cpp 2017-11-09 15:08:46 UTC (rev 224625)
@@ -569,10 +569,7 @@
{
if (layoutState())
return false;
- m_layoutStateStack.append(std::make_unique<LayoutState>(layoutRoot));
- layoutState()->setIsPaginated();
- // This is just a flag for known page height (see RenderBlockFlow::checkForPaginationLogicalHeightChange).
- layoutState()->setPageLogicalHeight(1);
+ m_layoutStateStack.append(std::make_unique<LayoutState>(layoutRoot, LayoutState::IsPaginated::Yes));
return true;
}
Modified: trunk/Source/WebCore/rendering/LayoutState.cpp (224624 => 224625)
--- trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-09 12:36:07 UTC (rev 224624)
+++ trunk/Source/WebCore/rendering/LayoutState.cpp 2017-11-09 15:08:46 UTC (rev 224625)
@@ -34,9 +34,9 @@
namespace WebCore {
-LayoutState::LayoutState(RenderElement& renderer)
+LayoutState::LayoutState(RenderElement& renderer, IsPaginated isPaginated)
: m_clipped(false)
- , m_isPaginated(false)
+ , m_isPaginated(isPaginated == IsPaginated::Yes)
, m_pageLogicalHeightChanged(false)
#if !ASSERT_DISABLED
, m_layoutDeltaXSaturated(false)
@@ -57,6 +57,10 @@
m_paintOffset -= toLayoutSize(containerBox.scrollPosition());
}
}
+ if (m_isPaginated) {
+ // This is just a flag for known page height (see RenderBlockFlow::checkForPaginationLogicalHeightChange).
+ m_pageLogicalHeight = 1;
+ }
}
LayoutState::LayoutState(const LayoutContext::LayoutStateStack& layoutStateStack, RenderBox& renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged)
@@ -261,7 +265,7 @@
}
#if !ASSERT_DISABLED
-bool LayoutState::layoutDeltaMatches(LayoutSize delta)
+bool LayoutState::layoutDeltaMatches(LayoutSize delta) const
{
return (delta.width() == m_layoutDelta.width() || m_layoutDeltaXSaturated) && (delta.height() == m_layoutDelta.height() || m_layoutDeltaYSaturated);
}
Modified: trunk/Source/WebCore/rendering/LayoutState.h (224624 => 224625)
--- trunk/Source/WebCore/rendering/LayoutState.h 2017-11-09 12:36:07 UTC (rev 224624)
+++ trunk/Source/WebCore/rendering/LayoutState.h 2017-11-09 15:08:46 UTC (rev 224625)
@@ -54,16 +54,15 @@
{
}
LayoutState(const LayoutContext::LayoutStateStack&, RenderBox&, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged);
- explicit LayoutState(RenderElement&);
+ enum class IsPaginated { No, Yes };
+ explicit LayoutState(RenderElement&, IsPaginated = IsPaginated::No);
bool isPaginated() const { return m_isPaginated; }
- void setIsPaginated() { m_isPaginated = true; }
// The page logical offset is the object's offset from the top of the page in the page progression
// direction (so an x-offset in vertical text and a y-offset for horizontal text).
LayoutUnit pageLogicalOffset(RenderBox*, LayoutUnit childLogicalOffset) const;
- void setPageLogicalHeight(LayoutUnit logicalHeight) { m_pageLogicalHeight = logicalHeight; }
LayoutUnit pageLogicalHeight() const { return m_pageLogicalHeight; }
bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; }
@@ -87,7 +86,7 @@
void addLayoutDelta(LayoutSize);
LayoutSize layoutDelta() const { return m_layoutDelta; }
#if !ASSERT_DISABLED
- bool layoutDeltaMatches(LayoutSize);
+ bool layoutDeltaMatches(LayoutSize) const;
#endif
private:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes