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

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

Issue 1681273003: Add CSS parser support for break-after, break-before and break-inside. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master Created 4 years, 10 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.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 52b6ac39c50ab18701cdc52660db2e3b66f32b80..828f53d17ea36c84eedb8778a25038415322d210 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -1867,8 +1867,8 @@ bool LayoutBox::hasForcedBreakBefore() const
LayoutFlowThread* flowThread = flowThreadContainingBlock();
bool checkColumnBreaks = flowThread;
bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogicalHeight(); // TODO(mstensho): Once columns can print, we have to check this.
- bool checkBeforeAlways = (checkColumnBreaks && style()->columnBreakBefore() == PBALWAYS)
- || (checkPageBreaks && style()->pageBreakBefore() == PBALWAYS);
+ bool checkBeforeAlways = (checkColumnBreaks && style()->breakBefore() == BreakColumn)
+ || (checkPageBreaks && style()->breakBefore() == BreakPage);
return checkBeforeAlways && isForcedBreakAllowed(this);
}
@@ -1877,8 +1877,8 @@ bool LayoutBox::hasForcedBreakAfter() const
LayoutFlowThread* flowThread = flowThreadContainingBlock();
bool checkColumnBreaks = flowThread;
bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogicalHeight(); // TODO(mstensho): Once columns can print, we have to check this.
- bool checkAfterAlways = (checkColumnBreaks && style()->columnBreakAfter() == PBALWAYS)
- || (checkPageBreaks && style()->pageBreakAfter() == PBALWAYS);
+ bool checkAfterAlways = (checkColumnBreaks && style()->breakAfter() == BreakColumn)
+ || (checkPageBreaks && style()->breakAfter() == BreakPage);
return checkAfterAlways && isForcedBreakAllowed(this);
}
@@ -4184,8 +4184,9 @@ LayoutBox::PaginationBreakability LayoutBox::paginationBreakability() const
bool checkColumnBreaks = flowThreadContainingBlock();
bool checkPageBreaks = !checkColumnBreaks && view()->layoutState()->pageLogicalHeight();
- bool isUnsplittable = (checkColumnBreaks && style()->columnBreakInside() == PBAVOID)
- || (checkPageBreaks && style()->pageBreakInside() == PBAVOID);
+ EBreak breakInside = style()->breakInside();
+ bool isUnsplittable = (checkColumnBreaks && (breakInside == BreakAvoid || breakInside == BreakAvoidColumn))
+ || (checkPageBreaks && (breakInside == BreakAvoid || breakInside == BreakAvoidPage));
if (isUnsplittable)
return AvoidBreaks;
return AllowAnyBreaks;
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.cpp ('k') | third_party/WebKit/Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698