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 72f0687b7dc9b888388815d92075146b806f8bc4..e0ca01c7b3f54674b4cc0e5f320d819914eef387 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp |
@@ -881,9 +881,14 @@ void LayoutFlexibleBox::layoutFlexItems(bool relayoutChildren, SubtreeLayoutScop |
PaintLayerScrollableArea::PreventRelayoutScope preventRelayoutScope(layoutScope); |
+ // Fieldsets need to find their legend and position it inside the border of the object. |
+ // The legend then gets skipped during normal layout. |
+ // It doesn't get included in the normal layout process but is instead skipped. |
+ LayoutObject* childToExclude = layoutSpecialExcludedChild(relayoutChildren, layoutScope); |
+ |
m_orderIterator.first(); |
LayoutUnit crossAxisOffset = flowAwareBorderBefore() + flowAwarePaddingBefore(); |
- while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow, totalFlexShrink, totalWeightedFlexShrink, sumHypotheticalMainSize, relayoutChildren)) { |
+ while (computeNextFlexLine(orderedChildren, sumFlexBaseSize, totalFlexGrow, totalFlexShrink, totalWeightedFlexShrink, sumHypotheticalMainSize, relayoutChildren, childToExclude)) { |
LayoutUnit containerMainInnerSize = mainAxisContentExtent(sumHypotheticalMainSize); |
// availableFreeSpace is the initial amount of free space in this flexbox. |
// remainingFreeSpace starts out at the same value but as we place and lay out |
@@ -1200,7 +1205,7 @@ LayoutUnit LayoutFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax(co |
return childSize; |
} |
-bool LayoutFlexibleBox::computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& sumFlexBaseSize, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink, LayoutUnit& sumHypotheticalMainSize, bool relayoutChildren) |
+bool LayoutFlexibleBox::computeNextFlexLine(OrderedFlexItemList& orderedChildren, LayoutUnit& sumFlexBaseSize, double& totalFlexGrow, double& totalFlexShrink, double& totalWeightedFlexShrink, LayoutUnit& sumHypotheticalMainSize, bool relayoutChildren, LayoutObject* childToExclude) |
{ |
orderedChildren.clear(); |
sumFlexBaseSize = LayoutUnit(); |
@@ -1215,6 +1220,10 @@ bool LayoutFlexibleBox::computeNextFlexLine(OrderedFlexItemList& orderedChildren |
bool lineHasInFlowItem = false; |
for (LayoutBox* child = m_orderIterator.currentChild(); child; child = m_orderIterator.next()) { |
+ |
+ if (childToExclude == child) |
+ continue; // Skip this child, since it will be positioned by the specialized subclass (fieldsets runs). |
+ |
if (child->isOutOfFlowPositioned()) { |
orderedChildren.append(FlexItem(child)); |
continue; |