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

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

Issue 2462643002: Be more restrictive about forcing relayout of children for pagination. (Closed)
Patch Set: No need to call updateFragmentationInfoForChild() when not paginated. Created 4 years, 2 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/LayoutFlexibleBox.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index 6cd1c691060730a91390c7439312311586390714..cd826f62a4705ba0ad974dfdee5492ac511b185e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -32,6 +32,7 @@
#include "core/frame/UseCounter.h"
#include "core/layout/LayoutState.h"
+#include "core/layout/LayoutView.h"
#include "core/layout/TextAutosizer.h"
#include "core/paint/BlockPainter.h"
#include "core/paint/PaintLayer.h"
@@ -1859,6 +1860,7 @@ void LayoutFlexibleBox::layoutAndPlaceChildren(
LayoutUnit maxAscent, maxDescent; // Used when align-items: baseline.
LayoutUnit maxChildCrossAxisExtent;
bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow();
+ bool isPaginated = view()->layoutState()->isPaginated();
for (size_t i = 0; i < children.size(); ++i) {
const FlexItem& flexItem = children[i];
LayoutBox* child = flexItem.box;
@@ -1940,6 +1942,9 @@ void LayoutFlexibleBox::layoutAndPlaceChildren(
mainAxisOffset += justifyContentSpaceBetweenChildren(
availableFreeSpace, distribution, children.size());
+
+ if (isPaginated)
+ updateFragmentationInfoForChild(*child);
}
if (isColumnFlow())

Powered by Google App Engine
This is Rietveld 408576698