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

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

Issue 1856373002: Only allow forced fragmentainer breaks at class A break points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Woho! LayoutTests/printing/css2.1/page-break-after-003.html now passes. Created 4 years, 8 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 1cf0809acef7d33475d3b90043cbfd84e88eb4d5..eac511eeb11530eb55be32eda7c7e16a0cd7b692 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -629,14 +629,29 @@ public:
// fragmentation context that supports the specified value.
bool isBreakInsideControllable(EBreak) const;
- EBreak breakAfter() const;
- EBreak breakBefore() const;
+ virtual EBreak breakAfter() const;
+ virtual EBreak breakBefore() const;
EBreak breakInside() const;
+ // Join two adjacent break values specified on break-before and/or break-after. avoid* values
+ // win over auto values, and forced break values win over avoid* values. |firstValue| is
+ // specified on an element earlier in the flow than |secondValue|. This method is used at class
+ // A break points [1], to join the values of the previous break-after and the next
+ // break-before, to figure out whether we may, must, or should not, break at that point. It is
+ // also used when propagating break-before values from first children and break-after values on
+ // last children to their container.
+ //
+ // [1] https://drafts.csswg.org/css-break/#possible-breaks
+ static EBreak joinFragmentainerBreakValues(EBreak firstValue, EBreak secondValue);
+
static bool isForcedFragmentainerBreakValue(EBreak);
- bool hasForcedBreakBefore() const;
- bool hasForcedBreakAfter() const;
+ EBreak classABreakPointValue(EBreak previousBreakAfterValue) const;
+
+ // Return true if we should insert a break in front of this box. The box needs to start at a
+ // valid class A break point in order to allow a forced break. To determine whether or not to
+ // break, we also need to know the break-after value of the previous in-flow sibling.
+ bool needsForcedBreakBefore(EBreak previousBreakAfterValue) const;
LayoutRect localOverflowRectForPaintInvalidation() const override;
bool mapToVisualRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect&, VisualRectFlags = DefaultVisualRectFlags) const override;
« 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