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

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

Issue 1909233002: Spec-compliant parsing and initial values for 'orphans' and 'widows'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Some unit tests had non-conformant widphans assumptions too. 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/LayoutBlockFlowLine.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
index 6efd25d790308b4acf31a941fe4c975a0089bc53..d04501abfbc1d46ae1278847fb2c8efbaef29a04 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp
@@ -978,7 +978,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
// In case we already adjusted the line positions during this layout to avoid widows
// then we need to ignore the possibility of having a new widows situation.
// Otherwise, we risk leaving empty containers which is against the block fragmentation principles.
- if (paginated && !style()->hasAutoWidows() && !didBreakAtLineToAvoidWidow()) {
+ if (paginated && style()->widows() > 1 && !didBreakAtLineToAvoidWidow()) {
// Check the line boxes to make sure we didn't create unacceptable widows.
// However, we'll prioritize orphans - so nothing we do here should create
// a new orphan.
@@ -1018,7 +1018,7 @@ void LayoutBlockFlow::layoutRunsAndFloatsInRange(LineLayoutState& layoutState,
// This means that setting widows implies we also care about orphans, but given
// the specification says the initial orphan value is non-zero, this is ok. The
// author is always free to set orphans explicitly as well.
- int orphans = style()->hasAutoOrphans() ? style()->initialOrphans() : style()->orphans();
+ int orphans = style()->orphans();
int numLinesAvailable = numLinesInPreviousPage - orphans;
if (numLinesAvailable <= 0)
return;

Powered by Google App Engine
This is Rietveld 408576698