Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(46)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 1375673004: Keep block pagination struts after layout, and store them before any type of break. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutBox.h
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index ba42f1764f79509456cadd8d8d318e6ad188bb18..c0998aaab9552a2387c21668dee8e2a4462c62e9 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -76,6 +76,8 @@ public:
LayoutRect m_previousLayoutOverflowRect;
LayoutUnit m_pageLogicalOffset;
+
+ LayoutUnit m_paginationStrut;
};
class CORE_EXPORT LayoutBox : public LayoutBoxModelObject {
@@ -483,6 +485,23 @@ public:
void clearSpannerPlaceholder();
LayoutMultiColumnSpannerPlaceholder* spannerPlaceholder() const final { return m_rareData ? m_rareData->m_spannerPlaceholder : 0; }
+ // A pagination strut is the amount of space needed to push an in-flow block-level object (or
+ // float) to the logical top of the next page or column. It will be set both for forced breaks
+ // (e.g. page-break-before:always) and soft breaks (when there's not enough space in the current
+ // page / column for the object). The strut is baked into the logicalTop() of the object, so
+ // that logicalTop() - paginationStrut() == the original position in the previous column before
+ // deciding to break.
+ //
+ // Pagination struts are either set in front of a block-level box (here) or before a line
+ // (RootInlineBox::paginationStrut()).
+ LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : LayoutUnit(); }
+ void setPaginationStrut(LayoutUnit);
+ void resetPaginationStrut()
+ {
+ if (m_rareData)
+ m_rareData->m_paginationStrut = LayoutUnit();
+ }
+
LayoutRect clippedOverflowRectForPaintInvalidation(const LayoutBoxModelObject* paintInvalidationContainer, const PaintInvalidationState* = nullptr) const override;
void mapRectToPaintInvalidationBacking(const LayoutBoxModelObject* paintInvalidationContainer, LayoutRect&, const PaintInvalidationState*) const override;
virtual void invalidatePaintForOverhangingFloats(bool paintAllDescendants);
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698