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

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

Issue 2511283003: Set the inline position of floats a bit later. (Closed)
Patch Set: Rebase master. No conflicts here. Created 4 years, 1 month 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 | « no previous file | 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 b1c7fe7d3ef38b5ed52be60a310f883f66397753..dd29fed7bae60dbf585a4a6250e217eff5ff7fa2 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -3662,9 +3662,6 @@ LayoutUnit LayoutBlockFlow::positionAndLayoutFloat(
// FIXME Investigate if this can be removed. crbug.com/370006
child.setMayNeedPaintInvalidation();
- LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection()
- ? marginStartForChild(child)
- : marginEndForChild(child);
logicalTopMarginEdge = std::max(
logicalTopMarginEdge, lowestFloatLogicalBottom(child.style()->clear()));
@@ -3678,16 +3675,13 @@ LayoutUnit LayoutBlockFlow::positionAndLayoutFloat(
}
}
+ LayoutUnit marginBefore = marginBeforeForChild(child);
+ LayoutUnit marginAfter = marginAfterForChild(child);
LayoutPoint floatLogicalLocation =
computeLogicalLocationForFloat(floatingObject, logicalTopMarginEdge);
logicalTopMarginEdge = floatLogicalLocation.y();
- setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
- setLogicalLeftForChild(child,
- floatLogicalLocation.x() + childLogicalLeftMargin);
- setLogicalTopForChild(child,
- logicalTopMarginEdge + marginBeforeForChild(child));
+ setLogicalTopForChild(child, logicalTopMarginEdge + marginBefore);
SubtreeLayoutScope layoutScope(child);
if (!child.needsLayout())
@@ -3702,12 +3696,7 @@ LayoutUnit LayoutBlockFlow::positionAndLayoutFloat(
floatLogicalLocation = computeLogicalLocationForFloat(
floatingObject, newLogicalTopMarginEdge);
logicalTopMarginEdge = floatLogicalLocation.y();
- setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
-
- setLogicalLeftForChild(child,
- floatLogicalLocation.x() + childLogicalLeftMargin);
- setLogicalTopForChild(child,
- logicalTopMarginEdge + marginBeforeForChild(child));
+ setLogicalTopForChild(child, logicalTopMarginEdge + marginBefore);
if (child.isLayoutBlock())
child.setChildNeedsLayout(MarkOnlyThis);
@@ -3715,11 +3704,15 @@ LayoutUnit LayoutBlockFlow::positionAndLayoutFloat(
}
}
+ LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection()
+ ? marginStartForChild(child)
+ : marginEndForChild(child);
+ setLogicalLeftForChild(child,
+ floatLogicalLocation.x() + childLogicalLeftMargin);
+ setLogicalLeftForFloat(floatingObject, floatLogicalLocation.x());
setLogicalTopForFloat(floatingObject, logicalTopMarginEdge);
-
setLogicalHeightForFloat(floatingObject, logicalHeightForChild(child) +
- marginBeforeForChild(child) +
- marginAfterForChild(child));
+ marginBefore + marginAfter);
if (ShapeOutsideInfo* shapeOutside = child.shapeOutsideInfo())
shapeOutside->setReferenceBoxLogicalSize(logicalSizeForChild(child));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698