OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 RenderBlock::removePercentHeightDescendantIfNeeded(this); | 184 RenderBlock::removePercentHeightDescendantIfNeeded(this); |
185 | 185 |
186 // Normally we can do optimized positioning layout for absolute/fixed po
sitioned objects. There is one special case, however, which is | 186 // Normally we can do optimized positioning layout for absolute/fixed po
sitioned objects. There is one special case, however, which is |
187 // when the positioned object's margin-before is changed. In this case t
he parent has to get a layout in order to run margin collapsing | 187 // when the positioned object's margin-before is changed. In this case t
he parent has to get a layout in order to run margin collapsing |
188 // to determine the new static position. | 188 // to determine the new static position. |
189 if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition(isHorizo
ntalWritingMode()) && oldStyle->marginBefore() != newStyle->marginBefore() | 189 if (isOutOfFlowPositioned() && newStyle->hasStaticBlockPosition(isHorizo
ntalWritingMode()) && oldStyle->marginBefore() != newStyle->marginBefore() |
190 && parent() && !parent()->normalChildNeedsLayout()) | 190 && parent() && !parent()->normalChildNeedsLayout()) |
191 parent()->setChildNeedsLayout(); | 191 parent()->setChildNeedsLayout(); |
192 } | 192 } |
193 | 193 |
194 if (RenderBlock::hasPercentHeightContainerMap() && firstChild() | 194 if (RenderBlock::hasPercentHeightContainerMap() && slowFirstChild() |
195 && oldHorizontalWritingMode != isHorizontalWritingMode()) | 195 && oldHorizontalWritingMode != isHorizontalWritingMode()) |
196 RenderBlock::clearPercentHeightDescendantsFrom(this); | 196 RenderBlock::clearPercentHeightDescendantsFrom(this); |
197 | 197 |
198 // If our zoom factor changes and we have a defined scrollLeft/Top, we need
to adjust that value into the | 198 // If our zoom factor changes and we have a defined scrollLeft/Top, we need
to adjust that value into the |
199 // new zoomed coordinate space. | 199 // new zoomed coordinate space. |
200 if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() !
= newStyle->effectiveZoom() && layer()) { | 200 if (hasOverflowClip() && oldStyle && newStyle && oldStyle->effectiveZoom() !
= newStyle->effectiveZoom() && layer()) { |
201 if (int left = layer()->scrollableArea()->scrollXOffset()) { | 201 if (int left = layer()->scrollableArea()->scrollXOffset()) { |
202 left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(
); | 202 left = (left / oldStyle->effectiveZoom()) * newStyle->effectiveZoom(
); |
203 layer()->scrollableArea()->scrollToXOffset(left); | 203 layer()->scrollableArea()->scrollToXOffset(left); |
204 } | 204 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // FIXME: This should probably consult RenderOverflow. | 290 // FIXME: This should probably consult RenderOverflow. |
291 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) | 291 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) |
292 repaint(); | 292 repaint(); |
293 } | 293 } |
294 } | 294 } |
295 } | 295 } |
296 | 296 |
297 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && (boxHasOverflowCl
ip != hasOverflowClip())) { | 297 if (RuntimeEnabledFeatures::repaintAfterLayoutEnabled() && (boxHasOverflowCl
ip != hasOverflowClip())) { |
298 // FIXME: This shouldn't be required if we tracked the visual overflow | 298 // FIXME: This shouldn't be required if we tracked the visual overflow |
299 // generated by positioned children or self painting layers. crbug.com/3
45403 | 299 // generated by positioned children or self painting layers. crbug.com/3
45403 |
300 for (RenderObject* child = firstChild(); child; child = child->nextSibli
ng()) | 300 for (RenderObject* child = slowFirstChild(); child; child = child->nextS
ibling()) |
301 child->setShouldDoFullRepaintIfSelfPaintingLayer(true); | 301 child->setShouldDoFullRepaintIfSelfPaintingLayer(true); |
302 } | 302 } |
303 | 303 |
304 setHasOverflowClip(boxHasOverflowClip); | 304 setHasOverflowClip(boxHasOverflowClip); |
305 | 305 |
306 setHasTransform(styleToUse->hasTransformRelatedProperty()); | 306 setHasTransform(styleToUse->hasTransformRelatedProperty()); |
307 setHasReflection(styleToUse->boxReflect()); | 307 setHasReflection(styleToUse->boxReflect()); |
308 } | 308 } |
309 | 309 |
310 void RenderBox::layout() | 310 void RenderBox::layout() |
311 { | 311 { |
312 ASSERT(needsLayout()); | 312 ASSERT(needsLayout()); |
313 | 313 |
314 RenderObject* child = firstChild(); | 314 RenderObject* child = slowFirstChild(); |
315 if (!child) { | 315 if (!child) { |
316 clearNeedsLayout(); | 316 clearNeedsLayout(); |
317 return; | 317 return; |
318 } | 318 } |
319 | 319 |
320 LayoutStateMaintainer statePusher(*this, locationOffset()); | 320 LayoutStateMaintainer statePusher(*this, locationOffset()); |
321 while (child) { | 321 while (child) { |
322 child->layoutIfNeeded(); | 322 child->layoutIfNeeded(); |
323 ASSERT(!child->needsLayout()); | 323 ASSERT(!child->needsLayout()); |
324 child = child->nextSibling(); | 324 child = child->nextSibling(); |
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 height -= borderAndPaddingLogicalHeight(); | 1042 height -= borderAndPaddingLogicalHeight(); |
1043 return max<LayoutUnit>(0, height); | 1043 return max<LayoutUnit>(0, height); |
1044 } | 1044 } |
1045 | 1045 |
1046 // Hit Testing | 1046 // Hit Testing |
1047 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, HitTestAction action) | 1047 bool RenderBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffs
et, HitTestAction action) |
1048 { | 1048 { |
1049 LayoutPoint adjustedLocation = accumulatedOffset + location(); | 1049 LayoutPoint adjustedLocation = accumulatedOffset + location(); |
1050 | 1050 |
1051 // Check kids first. | 1051 // Check kids first. |
1052 for (RenderObject* child = lastChild(); child; child = child->previousSiblin
g()) { | 1052 for (RenderObject* child = slowLastChild(); child; child = child->previousSi
bling()) { |
1053 if (!child->hasLayer() && child->nodeAtPoint(request, result, locationIn
Container, adjustedLocation, action)) { | 1053 if (!child->hasLayer() && child->nodeAtPoint(request, result, locationIn
Container, adjustedLocation, action)) { |
1054 updateHitTestResult(result, locationInContainer.point() - toLayoutSi
ze(adjustedLocation)); | 1054 updateHitTestResult(result, locationInContainer.point() - toLayoutSi
ze(adjustedLocation)); |
1055 return true; | 1055 return true; |
1056 } | 1056 } |
1057 } | 1057 } |
1058 | 1058 |
1059 // Check our bounds next. For this purpose always assume that we can only be
hit in the | 1059 // Check our bounds next. For this purpose always assume that we can only be
hit in the |
1060 // foreground phase (which is true for replaced elements like images). | 1060 // foreground phase (which is true for replaced elements like images). |
1061 LayoutRect boundsRect = borderBoxRect(); | 1061 LayoutRect boundsRect = borderBoxRect(); |
1062 boundsRect.moveBy(adjustedLocation); | 1062 boundsRect.moveBy(adjustedLocation); |
1063 if (visibleToHitTestRequest(request) && action == HitTestForeground && locat
ionInContainer.intersects(boundsRect)) { | 1063 if (visibleToHitTestRequest(request) && action == HitTestForeground && locat
ionInContainer.intersects(boundsRect)) { |
1064 updateHitTestResult(result, locationInContainer.point() - toLayoutSize(a
djustedLocation)); | 1064 updateHitTestResult(result, locationInContainer.point() - toLayoutSize(a
djustedLocation)); |
1065 if (!result.addNodeToRectBasedTestResult(node(), request, locationInCont
ainer, boundsRect)) | 1065 if (!result.addNodeToRectBasedTestResult(node(), request, locationInCont
ainer, boundsRect)) |
1066 return true; | 1066 return true; |
1067 } | 1067 } |
1068 | 1068 |
1069 return false; | 1069 return false; |
1070 } | 1070 } |
1071 | 1071 |
1072 // --------------------- painting stuff ------------------------------- | 1072 // --------------------- painting stuff ------------------------------- |
1073 | 1073 |
1074 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 1074 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
1075 { | 1075 { |
1076 LayoutPoint adjustedPaintOffset = paintOffset + location(); | 1076 LayoutPoint adjustedPaintOffset = paintOffset + location(); |
1077 // default implementation. Just pass paint through to the children | 1077 // default implementation. Just pass paint through to the children |
1078 PaintInfo childInfo(paintInfo); | 1078 PaintInfo childInfo(paintInfo); |
1079 childInfo.updatePaintingRootForChildren(this); | 1079 childInfo.updatePaintingRootForChildren(this); |
1080 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) | 1080 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) |
1081 child->paint(childInfo, adjustedPaintOffset); | 1081 child->paint(childInfo, adjustedPaintOffset); |
1082 } | 1082 } |
1083 | 1083 |
1084 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo) | 1084 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo) |
1085 { | 1085 { |
1086 if (paintInfo.skipRootBackground()) | 1086 if (paintInfo.skipRootBackground()) |
1087 return; | 1087 return; |
1088 | 1088 |
1089 RenderObject* rootBackgroundRenderer = rendererForRootBackground(); | 1089 RenderObject* rootBackgroundRenderer = rendererForRootBackground(); |
1090 | 1090 |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1278 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) | 1278 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) |
1279 return false; | 1279 return false; |
1280 } | 1280 } |
1281 return true; | 1281 return true; |
1282 } | 1282 } |
1283 | 1283 |
1284 bool RenderBox::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, u
nsigned maxDepthToTest) const | 1284 bool RenderBox::foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, u
nsigned maxDepthToTest) const |
1285 { | 1285 { |
1286 if (!maxDepthToTest) | 1286 if (!maxDepthToTest) |
1287 return false; | 1287 return false; |
1288 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) { | 1288 for (RenderObject* child = slowFirstChild(); child; child = child->nextSibli
ng()) { |
1289 if (!child->isBox()) | 1289 if (!child->isBox()) |
1290 continue; | 1290 continue; |
1291 RenderBox* childBox = toRenderBox(child); | 1291 RenderBox* childBox = toRenderBox(child); |
1292 if (!isCandidateForOpaquenessTest(childBox)) | 1292 if (!isCandidateForOpaquenessTest(childBox)) |
1293 continue; | 1293 continue; |
1294 LayoutPoint childLocation = childBox->location(); | 1294 LayoutPoint childLocation = childBox->location(); |
1295 if (childBox->isRelPositioned()) | 1295 if (childBox->isRelPositioned()) |
1296 childLocation.move(childBox->relativePositionOffset()); | 1296 childLocation.move(childBox->relativePositionOffset()); |
1297 LayoutRect childLocalRect = localRect; | 1297 LayoutRect childLocalRect = localRect; |
1298 childLocalRect.moveBy(-childLocation); | 1298 childLocalRect.moveBy(-childLocation); |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2134 static float getMaxWidthListMarker(const RenderBox* renderer) | 2134 static float getMaxWidthListMarker(const RenderBox* renderer) |
2135 { | 2135 { |
2136 #ifndef NDEBUG | 2136 #ifndef NDEBUG |
2137 ASSERT(renderer); | 2137 ASSERT(renderer); |
2138 Node* parentNode = renderer->generatingNode(); | 2138 Node* parentNode = renderer->generatingNode(); |
2139 ASSERT(parentNode); | 2139 ASSERT(parentNode); |
2140 ASSERT(isHTMLOListElement(parentNode) || isHTMLUListElement(parentNode)); | 2140 ASSERT(isHTMLOListElement(parentNode) || isHTMLUListElement(parentNode)); |
2141 ASSERT(renderer->style()->textAutosizingMultiplier() != 1); | 2141 ASSERT(renderer->style()->textAutosizingMultiplier() != 1); |
2142 #endif | 2142 #endif |
2143 float maxWidth = 0; | 2143 float maxWidth = 0; |
2144 for (RenderObject* child = renderer->firstChild(); child; child = child->nex
tSibling()) { | 2144 for (RenderObject* child = renderer->slowFirstChild(); child; child = child-
>nextSibling()) { |
2145 if (!child->isListItem()) | 2145 if (!child->isListItem()) |
2146 continue; | 2146 continue; |
2147 | 2147 |
2148 RenderBox* listItem = toRenderBox(child); | 2148 RenderBox* listItem = toRenderBox(child); |
2149 for (RenderObject* itemChild = listItem->firstChild(); itemChild; itemCh
ild = itemChild->nextSibling()) { | 2149 for (RenderObject* itemChild = listItem->slowFirstChild(); itemChild; it
emChild = itemChild->nextSibling()) { |
2150 if (!itemChild->isListMarker()) | 2150 if (!itemChild->isListMarker()) |
2151 continue; | 2151 continue; |
2152 RenderBox* itemMarker = toRenderBox(itemChild); | 2152 RenderBox* itemMarker = toRenderBox(itemChild); |
2153 // Make sure to compute the autosized width. | 2153 // Make sure to compute the autosized width. |
2154 if (itemMarker->needsLayout()) | 2154 if (itemMarker->needsLayout()) |
2155 itemMarker->layout(); | 2155 itemMarker->layout(); |
2156 maxWidth = max<float>(maxWidth, toRenderListMarker(itemMarker)->logi
calWidth().toFloat()); | 2156 maxWidth = max<float>(maxWidth, toRenderListMarker(itemMarker)->logi
calWidth().toFloat()); |
2157 break; | 2157 break; |
2158 } | 2158 } |
2159 } | 2159 } |
(...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4012 | 4012 |
4013 if (!isHorizontalWritingMode()) | 4013 if (!isHorizontalWritingMode()) |
4014 return rect.transposedRect(); | 4014 return rect.transposedRect(); |
4015 | 4015 |
4016 return rect; | 4016 return rect; |
4017 } | 4017 } |
4018 | 4018 |
4019 PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point) | 4019 PositionWithAffinity RenderBox::positionForPoint(const LayoutPoint& point) |
4020 { | 4020 { |
4021 // no children...return this render object's element, if there is one, and o
ffset 0 | 4021 // no children...return this render object's element, if there is one, and o
ffset 0 |
4022 if (!firstChild()) | 4022 RenderObject* firstChild = slowFirstChild(); |
| 4023 if (!firstChild) |
4023 return createPositionWithAffinity(nonPseudoNode() ? firstPositionInOrBef
oreNode(nonPseudoNode()) : Position()); | 4024 return createPositionWithAffinity(nonPseudoNode() ? firstPositionInOrBef
oreNode(nonPseudoNode()) : Position()); |
4024 | 4025 |
4025 if (isTable() && nonPseudoNode()) { | 4026 if (isTable() && nonPseudoNode()) { |
4026 LayoutUnit right = contentWidth() + borderAndPaddingWidth(); | 4027 LayoutUnit right = contentWidth() + borderAndPaddingWidth(); |
4027 LayoutUnit bottom = contentHeight() + borderAndPaddingHeight(); | 4028 LayoutUnit bottom = contentHeight() + borderAndPaddingHeight(); |
4028 | 4029 |
4029 if (point.x() < 0 || point.x() > right || point.y() < 0 || point.y() > b
ottom) { | 4030 if (point.x() < 0 || point.x() > right || point.y() < 0 || point.y() > b
ottom) { |
4030 if (point.x() <= right / 2) | 4031 if (point.x() <= right / 2) |
4031 return createPositionWithAffinity(firstPositionInOrBeforeNode(no
nPseudoNode())); | 4032 return createPositionWithAffinity(firstPositionInOrBeforeNode(no
nPseudoNode())); |
4032 return createPositionWithAffinity(lastPositionInOrAfterNode(nonPseud
oNode())); | 4033 return createPositionWithAffinity(lastPositionInOrAfterNode(nonPseud
oNode())); |
4033 } | 4034 } |
4034 } | 4035 } |
4035 | 4036 |
4036 // Pass off to the closest child. | 4037 // Pass off to the closest child. |
4037 LayoutUnit minDist = LayoutUnit::max(); | 4038 LayoutUnit minDist = LayoutUnit::max(); |
4038 RenderBox* closestRenderer = 0; | 4039 RenderBox* closestRenderer = 0; |
4039 LayoutPoint adjustedPoint = point; | 4040 LayoutPoint adjustedPoint = point; |
4040 if (isTableRow()) | 4041 if (isTableRow()) |
4041 adjustedPoint.moveBy(location()); | 4042 adjustedPoint.moveBy(location()); |
4042 | 4043 |
4043 for (RenderObject* renderObject = firstChild(); renderObject; renderObject =
renderObject->nextSibling()) { | 4044 for (RenderObject* renderObject = firstChild; renderObject; renderObject = r
enderObject->nextSibling()) { |
4044 if ((!renderObject->firstChild() && !renderObject->isInline() && !render
Object->isRenderBlockFlow() ) | 4045 if ((!renderObject->slowFirstChild() && !renderObject->isInline() && !re
nderObject->isRenderBlockFlow() ) |
4045 || renderObject->style()->visibility() != VISIBLE) | 4046 || renderObject->style()->visibility() != VISIBLE) |
4046 continue; | 4047 continue; |
4047 | 4048 |
4048 if (!renderObject->isBox()) | 4049 if (!renderObject->isBox()) |
4049 continue; | 4050 continue; |
4050 | 4051 |
4051 RenderBox* renderer = toRenderBox(renderObject); | 4052 RenderBox* renderer = toRenderBox(renderObject); |
4052 | 4053 |
4053 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTab
leRow() ? LayoutUnit() : renderer->y()); | 4054 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTab
leRow() ? LayoutUnit() : renderer->y()); |
4054 LayoutUnit bottom = top + renderer->contentHeight(); | 4055 LayoutUnit bottom = top + renderer->contentHeight(); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4121 { | 4122 { |
4122 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() ||
hasOverflowClip() || isFlexItemIncludingDeprecated() | 4123 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() ||
hasOverflowClip() || isFlexItemIncludingDeprecated() |
4123 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell()
|| isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement(
) || style()->columnSpan(); | 4124 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell()
|| isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement(
) || style()->columnSpan(); |
4124 } | 4125 } |
4125 | 4126 |
4126 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
e) | 4127 void RenderBox::markForPaginationRelayoutIfNeeded(SubtreeLayoutScope& layoutScop
e) |
4127 { | 4128 { |
4128 ASSERT(!needsLayout()); | 4129 ASSERT(!needsLayout()); |
4129 // If fragmentation height has changed, we need to lay out. No need to enter
the renderer if it | 4130 // If fragmentation height has changed, we need to lay out. No need to enter
the renderer if it |
4130 // is childless, though. | 4131 // is childless, though. |
4131 if (view()->layoutState()->pageLogicalHeightChanged() && firstChild()) | 4132 if (view()->layoutState()->pageLogicalHeightChanged() && slowFirstChild()) |
4132 layoutScope.setChildNeedsLayout(this); | 4133 layoutScope.setChildNeedsLayout(this); |
4133 } | 4134 } |
4134 | 4135 |
4135 void RenderBox::addVisualEffectOverflow() | 4136 void RenderBox::addVisualEffectOverflow() |
4136 { | 4137 { |
4137 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()->
hasOutline()) | 4138 if (!style()->boxShadow() && !style()->hasBorderImageOutsets() && !style()->
hasOutline()) |
4138 return; | 4139 return; |
4139 | 4140 |
4140 bool isFlipped = style()->isFlippedBlocksWritingMode(); | 4141 bool isFlipped = style()->isFlippedBlocksWritingMode(); |
4141 bool isHorizontal = isHorizontalWritingMode(); | 4142 bool isHorizontal = isHorizontalWritingMode(); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4637 | 4638 |
4638 box->setNeedsLayoutAndPrefWidthsRecalc(); | 4639 box->setNeedsLayoutAndPrefWidthsRecalc(); |
4639 } | 4640 } |
4640 | 4641 |
4641 RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil
d) | 4642 RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil
d) |
4642 { | 4643 { |
4643 bool didSplitParentAnonymousBoxes = false; | 4644 bool didSplitParentAnonymousBoxes = false; |
4644 | 4645 |
4645 while (beforeChild->parent() != this) { | 4646 while (beforeChild->parent() != this) { |
4646 RenderBox* boxToSplit = toRenderBox(beforeChild->parent()); | 4647 RenderBox* boxToSplit = toRenderBox(beforeChild->parent()); |
4647 if (boxToSplit->firstChild() != beforeChild && boxToSplit->isAnonymous()
) { | 4648 if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymo
us()) { |
4648 didSplitParentAnonymousBoxes = true; | 4649 didSplitParentAnonymousBoxes = true; |
4649 | 4650 |
4650 // We have to split the parent box into two boxes and move children | 4651 // We have to split the parent box into two boxes and move children |
4651 // from |beforeChild| to end into the new post box. | 4652 // from |beforeChild| to end into the new post box. |
4652 RenderBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th
is); | 4653 RenderBox* postBox = boxToSplit->createAnonymousBoxWithSameTypeAs(th
is); |
4653 postBox->setChildrenInline(boxToSplit->childrenInline()); | 4654 postBox->setChildrenInline(boxToSplit->childrenInline()); |
4654 RenderBox* parentBox = toRenderBox(boxToSplit->parent()); | 4655 RenderBox* parentBox = toRenderBox(boxToSplit->parent()); |
4655 // We need to invalidate the |parentBox| before inserting the new no
de | 4656 // We need to invalidate the |parentBox| before inserting the new no
de |
4656 // so that the table repainting logic knows the structure is dirty. | 4657 // so that the table repainting logic knows the structure is dirty. |
4657 // See for example RenderTableCell:clippedOverflowRectForRepaint. | 4658 // See for example RenderTableCell:clippedOverflowRectForRepaint. |
(...skipping 23 matching lines...) Expand all Loading... |
4681 return 0; | 4682 return 0; |
4682 | 4683 |
4683 if (!layoutState && !flowThreadContainingBlock()) | 4684 if (!layoutState && !flowThreadContainingBlock()) |
4684 return 0; | 4685 return 0; |
4685 | 4686 |
4686 RenderBlock* containerBlock = containingBlock(); | 4687 RenderBlock* containerBlock = containingBlock(); |
4687 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4688 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4688 } | 4689 } |
4689 | 4690 |
4690 } // namespace WebCore | 4691 } // namespace WebCore |
OLD | NEW |