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

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

Issue 1916693002: Rewrite overhanging float arithmetic to work near numeric limits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/overhanging-float-overflow-crash-expected.txt ('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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index dc4c50aec0ba4ed76016a1de6db29e0543d8adac..9e94f5d16f9e14357329886f428f2c56655cadc3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -999,18 +999,16 @@ void LayoutBlockFlow::rebuildFloatsFromIntruding()
// First add in floats from the parent. Self-collapsing blocks let their parent track any floats that intrude into
// them (as opposed to floats they contain themselves) so check for those here too. If margin collapsing has moved
// us up past the top a previous sibling then we need to check for floats from the parent too.
- LayoutUnit logicalTopOffset = logicalTop();
- bool parentFloatsMayIntrude = !siblingFloatMayIntrude && (!prev || toLayoutBlockFlow(prev)->isSelfCollapsingBlock() || toLayoutBlock(prev)->logicalTop() > logicalTopOffset)
- && parentBlockFlow->lowestFloatLogicalBottom() > logicalTopOffset;
+ bool parentFloatsMayIntrude = !siblingFloatMayIntrude && (!prev || toLayoutBlockFlow(prev)->isSelfCollapsingBlock() || toLayoutBlock(prev)->logicalTop() > logicalTop())
+ && parentBlockFlow->lowestFloatLogicalBottom() > logicalTop();
if (siblingFloatMayIntrude || parentFloatsMayIntrude)
- addIntrudingFloats(parentBlockFlow, parentBlockFlow->logicalLeftOffsetForContent(), logicalTopOffset);
+ addIntrudingFloats(parentBlockFlow, parentBlockFlow->logicalLeftOffsetForContent(), logicalTop());
// Add overhanging floats from the previous LayoutBlockFlow, but only if it has a float that intrudes into our space.
if (prev) {
- LayoutBlockFlow* blockFlow = toLayoutBlockFlow(prev);
- logicalTopOffset -= blockFlow->logicalTop();
- if (blockFlow->lowestFloatLogicalBottom() > logicalTopOffset)
- addIntrudingFloats(blockFlow, LayoutUnit(), logicalTopOffset);
+ LayoutBlockFlow* previousBlockFlow = toLayoutBlockFlow(prev);
+ if (logicalTop() < previousBlockFlow->logicalTop() + previousBlockFlow->lowestFloatLogicalBottom())
+ addIntrudingFloats(previousBlockFlow, LayoutUnit(), logicalTop() - previousBlockFlow->logicalTop());
}
if (childrenInline()) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/float/overhanging-float-overflow-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698