#include "config.h"
#include "core/rendering/RenderFlexibleBox.h"
-#include "core/rendering/LayoutRectRecorder.h"
#include "core/rendering/LayoutRepainter.h"
#include "core/rendering/RenderLayer.h"
#include "core/rendering/RenderView.h"
{
RenderBlock::styleDidChange(diff, oldStyle);
- if (oldStyle && oldStyle->alignItems() == ItemPositionStretch && diff == StyleDifferenceLayout) {
+ if (oldStyle && oldStyle->alignItems() == ItemPositionStretch && diff.needsFullLayout()) {
// Flex items that were previously stretching need to be relayed out so we can compute new available cross axis space.
// This is only necessary for stretching since other alignment values don't change the size of the box.
for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) {
return;
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
- LayoutRectRecorder recorder(*this);
if (updateLogicalWidthAndColumnWidth())
relayoutChildren = true;
if (logicalHeight() != previousHeight)
relayoutChildren = true;
- layoutPositionedObjects(relayoutChildren || isRoot());
+ layoutPositionedObjects(relayoutChildren || isDocumentElement());
computeRegionRangeForBlock(flowThreadContainingBlock());
return flexLength;
}
-void RenderFlexibleBox::setCrossAxisExtent(LayoutUnit extent)
-{
- if (isHorizontalFlow())
- setHeight(extent);
- else
- setWidth(extent);
-}
-
LayoutUnit RenderFlexibleBox::crossAxisExtentForChild(RenderBox* child) const
{
return isHorizontalFlow() ? child->height() : child->width();
return marginTop();
}
-LayoutUnit RenderFlexibleBox::flowAwareMarginAfterForChild(RenderBox* child) const
-{
- switch (transformedWritingMode()) {
- case TopToBottomWritingMode:
- return child->marginBottom();
- case BottomToTopWritingMode:
- return child->marginTop();
- case LeftToRightWritingMode:
- return child->marginRight();
- case RightToLeftWritingMode:
- return child->marginLeft();
- }
- ASSERT_NOT_REACHED();
- return marginBottom();
-}
-
LayoutUnit RenderFlexibleBox::crossAxisMarginExtentForChild(RenderBox* child) const
{
return isHorizontalFlow() ? child->marginHeight() : child->marginWidth();
return isHorizontalFlow() ? child->borderAndPaddingWidth() : child->borderAndPaddingHeight();
}
-LayoutUnit RenderFlexibleBox::mainAxisScrollbarExtentForChild(RenderBox* child) const
-{
- return isHorizontalFlow() ? child->verticalScrollbarWidth() : child->horizontalScrollbarHeight();
-}
-
static inline bool preferredMainAxisExtentDependsOnLayout(const Length& flexBasis, bool hasInfiniteLineLength)
{
return flexBasis.isAuto() || (flexBasis.isFixed() && !flexBasis.value() && hasInfiniteLineLength);
bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow();
for (size_t i = 0; i < children.size(); ++i) {
RenderBox* child = children[i];
- LayoutRectRecorder recorder(*child);
if (child->isOutOfFlowPositioned()) {
prepareChildForPositionedLayout(child, mainAxisOffset, crossAxisOffset, FlipForRowReverse);
continue;
}
+ // FIXME Investigate if this can be removed based on other flags. crbug.com/370010
+ child->setMayNeedInvalidation(true);
+
LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
setLogicalOverrideSize(child, childPreferredSize);
if (childPreferredSize != mainAxisExtentForChild(child)) {
size_t seenInFlowPositionedChildren = 0;
for (size_t i = 0; i < children.size(); ++i) {
RenderBox* child = children[i];
- LayoutRectRecorder recorder(*child);
if (child->isOutOfFlowPositioned()) {
child->layer()->setStaticBlockPosition(mainAxisOffset);