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

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

Issue 2483023002: Let positionNewFloats() take a logicalTop parameter. (Closed)
Patch Set: 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
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 c3510f973e22afc515e8188f6e701bb74f3f47fb..dbe43e55d98ce7f5081325dd7a33a5d3a3ff5f49 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -2118,12 +2118,10 @@ void LayoutBlockFlow::adjustFloatingBlock(const MarginInfo& marginInfo) {
// tested for by simply calling canCollapseWithMarginBefore. See
// http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for
// an example of this scenario.
- LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore()
- ? LayoutUnit()
- : marginInfo.margin();
- setLogicalHeight(logicalHeight() + marginOffset);
- positionNewFloats();
- setLogicalHeight(logicalHeight() - marginOffset);
+ LayoutUnit logicalTop = logicalHeight();
+ if (!marginInfo.canCollapseWithMarginBefore())
+ logicalTop += marginInfo.margin();
+ positionNewFloats(logicalTop);
}
void LayoutBlockFlow::handleAfterSideOfBlock(LayoutBox* lastChild,
@@ -3340,7 +3338,7 @@ void LayoutBlockFlow::childBecameNonInline(LayoutObject*) {
}
void LayoutBlockFlow::clearFloats(EClear clear) {
- positionNewFloats();
+ positionNewFloats(logicalHeight());
// set y position
LayoutUnit newY;
switch (clear) {
@@ -3592,7 +3590,8 @@ void LayoutBlockFlow::removeFloatingObjectsBelow(FloatingObject* lastFloat,
}
}
-bool LayoutBlockFlow::positionNewFloats(LineWidth* width) {
+bool LayoutBlockFlow::positionNewFloats(LayoutUnit logicalTop,
+ LineWidth* width) {
if (!m_floatingObjects)
return false;
@@ -3620,8 +3619,6 @@ bool LayoutBlockFlow::positionNewFloats(LineWidth* width) {
}
}
- LayoutUnit logicalTop = logicalHeight();
-
// The float cannot start above the top position of the last positioned float.
if (lastPlacedFloatingObject)
logicalTop =
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.h ('k') | third_party/WebKit/Source/core/layout/LayoutBlockFlowLine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698