summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/RenderBox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/rendering/RenderBox.cpp')
-rw-r--r--Source/WebCore/rendering/RenderBox.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp
index 9b3b7de86..faf9102e1 100644
--- a/Source/WebCore/rendering/RenderBox.cpp
+++ b/Source/WebCore/rendering/RenderBox.cpp
@@ -175,12 +175,8 @@ void RenderBox::removeFloatingOrPositionedChildFromBlockLists()
}
}
- if (isOutOfFlowPositioned()) {
- for (RenderObject* curr = parent(); curr; curr = curr->parent()) {
- if (curr->isRenderBlock())
- toRenderBlock(curr)->removePositionedObject(this);
- }
- }
+ if (isOutOfFlowPositioned())
+ RenderBlock::removePositionedObject(this);
}
void RenderBox::styleWillChange(StyleDifference diff, const RenderStyle* newStyle)
@@ -309,7 +305,7 @@ void RenderBox::updateBoxModelInfoFromStyle()
setFloating(!isOutOfFlowPositioned() && styleToUse->isFloating());
// We also handle <body> and <html>, whose overflow applies to the viewport.
- if (styleToUse->overflowX() != OVISIBLE && !isRootObject && (isRenderBlock() || isTableRow() || isTableSection())) {
+ if (styleToUse->overflowX() != OVISIBLE && !isRootObject && isRenderBlock()) {
bool boxHasOverflowClip = true;
if (isBody()) {
// Overflow on the body can propagate to the viewport under the following conditions.
@@ -1252,7 +1248,7 @@ LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
return cb->computeContentBoxLogicalHeight(logicalHeightLength.value());
}
-void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool fixed, bool useTransforms, TransformState& transformState, ApplyContainerFlipOrNot, bool* wasFixed) const
+void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, TransformState& transformState, MapLocalToContainerFlags mode, bool* wasFixed) const
{
if (repaintContainer == this)
return;
@@ -1278,17 +1274,17 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool
// If this box has a transform, it acts as a fixed position container for fixed descendants,
// and may itself also be fixed position. So propagate 'fixed' up only if this box is fixed position.
if (hasTransform && !isFixedPos)
- fixed = false;
+ mode &= ~IsFixed;
else if (isFixedPos)
- fixed = true;
+ mode |= IsFixed;
if (wasFixed)
- *wasFixed = fixed;
+ *wasFixed = mode & IsFixed;
LayoutSize containerOffset = offsetFromContainer(o, roundedLayoutPoint(transformState.mappedPoint()));
- bool preserve3D = useTransforms && (o->style()->preserves3D() || style()->preserves3D());
- if (useTransforms && shouldUseTransformFromContainer(o)) {
+ bool preserve3D = mode & UseTransforms && (o->style()->preserves3D() || style()->preserves3D());
+ if (mode & UseTransforms && shouldUseTransformFromContainer(o)) {
TransformationMatrix t;
getTransformFromContainer(o, containerOffset, t);
transformState.applyTransform(t, preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
@@ -1303,15 +1299,16 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool
return;
}
+ mode &= ~ApplyContainerFlip;
if (o->isRenderFlowThread()) {
// Transform from render flow coordinates into region coordinates.
RenderRegion* region = toRenderFlowThread(o)->mapFromFlowToRegion(transformState);
if (region)
- region->mapLocalToContainer(region->containerForRepaint(), fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed);
+ region->mapLocalToContainer(region->containerForRepaint(), transformState, mode, wasFixed);
return;
}
- o->mapLocalToContainer(repaintContainer, fixed, useTransforms, transformState, DoNotApplyContainerFlip, wasFixed);
+ o->mapLocalToContainer(repaintContainer, transformState, mode, wasFixed);
}
const RenderObject* RenderBox::pushMappingToContainer(const RenderBoxModelObject* ancestorToStopAt, RenderGeometryMap& geometryMap) const
@@ -2060,6 +2057,14 @@ LayoutUnit RenderBox::computeLogicalHeightUsing(SizeType heightType, const Lengt
return logicalHeight;
}
+LayoutUnit RenderBox::computeLogicalClientHeight(SizeType heightType, const Length& height)
+{
+ LayoutUnit heightIncludingScrollbar = computeContentLogicalHeightUsing(heightType, height);
+ if (heightIncludingScrollbar == -1)
+ return -1;
+ return std::max(LayoutUnit(0), computeContentBoxLogicalHeight(heightIncludingScrollbar) - scrollbarLogicalHeight());
+}
+
LayoutUnit RenderBox::computeContentLogicalHeightUsing(SizeType heightType, const Length& height)
{
if (height.isAuto())
@@ -3951,8 +3956,6 @@ LayoutSize RenderBox::topLeftLocationOffset() const
return locationOffset();
LayoutRect rect(frameRect());
- if (containerBlock->style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft())
- rect.move(containerBlock->verticalScrollbarWidth(), 0);
containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absolutely positioned object enclosed by a relative-positioned inline.
return LayoutSize(rect.x(), rect.y());
}
@@ -3999,6 +4002,10 @@ RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil
RenderBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(this);
postBox->setChildrenInline(boxToSplit->childrenInline());
RenderBox* parentBox = toRenderBox(boxToSplit->parent());
+ // We need to invalidate the |parentBox| before inserting the new node
+ // so that the table repainting logic knows the structure is dirty.
+ // See for example RenderTableCell:clippedOverflowRectForRepaint.
+ markBoxForRelayoutAfterSplit(parentBox);
parentBox->virtualChildren()->insertChildNode(parentBox, postBox, boxToSplit->nextSibling());
boxToSplit->moveChildrenTo(postBox, beforeChild, 0, true);