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

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

Issue 2228803003: There's no class A break point before or after a float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/balance-float-after-forced-break-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6a19f033836de0391ee12d806643160be5dda3eb..94b51258271c2c39a8d04ecc08a3f12afe701964 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2026,13 +2026,20 @@ EBreak LayoutBox::joinFragmentainerBreakValues(EBreak firstValue, EBreak secondV
EBreak LayoutBox::classABreakPointValue(EBreak previousBreakAfterValue) const
{
+ // First assert that we're at a class A break point.
ASSERT(isBreakBetweenControllable(previousBreakAfterValue));
+
return joinFragmentainerBreakValues(previousBreakAfterValue, breakBefore());
}
bool LayoutBox::needsForcedBreakBefore(EBreak previousBreakAfterValue) const
{
- return isForcedFragmentainerBreakValue(classABreakPointValue(previousBreakAfterValue));
+ // Forced break values are only honored when specified on in-flow objects, but floats and
+ // out-of-flow positioned objects may be affected by a break-after value of the previous
+ // in-flow object, even though we're not at a class A break point.
+ EBreak breakValue = isFloatingOrOutOfFlowPositioned()
+ ? previousBreakAfterValue : classABreakPointValue(previousBreakAfterValue);
+ return isForcedFragmentainerBreakValue(breakValue);
}
bool LayoutBox::paintedOutputOfObjectHasNoEffect() const
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/balance-float-after-forced-break-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698