@@void RenderBlock::layoutBlock(bool relay
12061206 // We need to go ahead and set our explicit page height if one exists, so that we can
12071207 // avoid doing two layout passes.
12081208 computeLogicalHeight();
1209 int columnHeight = contentLogicalHeight();
1209 LayoutUnit columnHeight = contentLogicalHeight();
12101210 if (columnHeight > 0) {
12111211 pageLogicalHeight = columnHeight;
12121212 hasSpecifiedPageLogicalHeight = true;
@@void RenderBlock::layoutBlock(bool relay
12221222 colInfo->clearForcedBreaks();
12231223 }
12241224
1225 LayoutStateMaintainer statePusher(view(), this, IntSize(x(), y()), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, colInfo);
1225 LayoutStateMaintainer statePusher(view(), this, locationOffset(), hasColumns() || hasTransform() || hasReflection() || style()->isFlippedBlocksWritingMode(), pageLogicalHeight, pageLogicalHeightChanged, colInfo);
12261226
12271227 // We use four values, maxTopPos, maxTopNeg, maxBottomPos, and maxBottomNeg, to track
12281228 // our current maximal positive and negative margins. These values are used when we
@@void RenderBlock::layoutBlock(bool relay
13461346 repaintRect.move(-layer()->scrolledContentOffset());
13471347
13481348 // Don't allow this rect to spill out of our overflow box.
1349 repaintRect.intersect(IntRect(0, 0, width(), height()));
1349 repaintRect.intersect(LayoutRect(0, 0, width(), height()));
13501350 }
13511351
13521352 // Make sure the rect is still non-empty after intersecting for overflow above
@@void RenderBlock::computeOverflow(Layout
14141414 LayoutRect clientRect(clientBoxRect());
14151415 LayoutRect rectToApply;
14161416 if (isHorizontalWritingMode())
1417 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), 1, max(0, oldClientAfterEdge - clientRect.y()));
1417 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), 1, max<LayoutUnit>(0, oldClientAfterEdge - clientRect.y()));
1419 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), max(0, oldClientAfterEdge - clientRect.x()), 1);
1419 rectToApply = LayoutRect(clientRect.x(), clientRect.y(), max<LayoutUnit>(0, oldClientAfterEdge - clientRect.x()), 1);
14201420 addLayoutOverflow(rectToApply);
14211421 }
14221422
@@void RenderBlock::setCollapsedBottomMarg
18431843 }
18441844}
18451845
1846 void RenderBlock::handleAfterSideOfBlock(int beforeSide, int afterSide, MarginInfo& marginInfo)
1846void RenderBlock::handleAfterSideOfBlock(LayoutUnit beforeSide, LayoutUnit afterSide, MarginInfo& marginInfo)
18471847{
18481848 marginInfo.setAtAfterSideOfBlock(true);
18491849
@@void RenderBlock::layoutBlockChild(Rende
21242124 setLogicalHeight(newHeight);
21252125 }
21262126
2127 // FIXME: Needs to use epsilon once we move to float, see https://bugs.webkit.org/show_bug.cgi?id=64021
2127 // FIXME: Change to use roughlyEquals when we move to float.
2128 // See https://bugs.webkit.org/show_bug.cgi?id=66148
21282129 ASSERT(oldLayoutDelta == view()->layoutDelta());
21292130}
21302131
@@void RenderBlock::paintChildren(PaintInf
24952496 if (checkAfterAlways
24962497 && (absoluteChildY + child->height()) > paintInfo.rect.y()
24972498 && (absoluteChildY + child->height()) < paintInfo.rect.maxY()) {
2498 view()->setBestTruncatedAt(absoluteChildY + child->height() + max(0, child->collapsedMarginAfter()), this, true);
2499 view()->setBestTruncatedAt(absoluteChildY + child->height() + max<LayoutUnit>(0, child->collapsedMarginAfter()), this, true);
24992500 return;
25002501 }
25012502 }
@@GapRects RenderBlock::selectionGapRectsF
27972798 // FIXME: this is broken with transforms
27982799 TransformState transformState(TransformState::ApplyTransformDirection, FloatPoint());
27992800 mapLocalToContainer(repaintContainer, false, false, transformState);
2800 IntPoint offsetFromRepaintContainer = roundedIntPoint(transformState.mappedPoint());
2801 LayoutPoint offsetFromRepaintContainer = roundedLayoutPoint(transformState.mappedPoint());
28012802
28022803 if (hasOverflowClip())
28032804 offsetFromRepaintContainer -= layer()->scrolledContentOffset();
@@void RenderBlock::paintSelection(PaintIn
28332834 }
28342835}
28352836
2836 static void clipOutPositionedObjects(const PaintInfo* paintInfo, const IntPoint& offset, RenderBlock::PositionedObjectsListHashSet* positionedObjects)
2837static void clipOutPositionedObjects(const PaintInfo* paintInfo, const LayoutPoint& offset, RenderBlock::PositionedObjectsListHashSet* positionedObjects)
28372838{
28382839 if (!positionedObjects)
28392840 return;
@@static void clipOutPositionedObjects(con
28412842 RenderBlock::PositionedObjectsListHashSet::const_iterator end = positionedObjects->end();
28422843 for (RenderBlock::PositionedObjectsListHashSet::const_iterator it = positionedObjects->begin(); it != end; ++it) {
28432844 RenderBox* r = *it;
2844 paintInfo->context->clipOut(IntRect(offset.x() + r->x(), offset.y() + r->y(), r->width(), r->height()));
2845 paintInfo->context->clipOut(LayoutRect(offset.x() + r->x(), offset.y() + r->y(), r->width(), r->height()));
28452846 }
28462847}
28472848
2848 static int blockDirectionOffset(RenderBlock* rootBlock, const IntSize& offsetFromRootBlock)
2849static int blockDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
28492850{
28502851 return rootBlock->isHorizontalWritingMode() ? offsetFromRootBlock.height() : offsetFromRootBlock.width();
28512852}
28522853
2853 static int inlineDirectionOffset(RenderBlock* rootBlock, const IntSize& offsetFromRootBlock)
2854static int inlineDirectionOffset(RenderBlock* rootBlock, const LayoutSize& offsetFromRootBlock)
28542855{
28552856 return rootBlock->isHorizontalWritingMode() ? offsetFromRootBlock.width() : offsetFromRootBlock.height();
28562857}
@@GapRects RenderBlock::selectionGaps(Rend
28802881 clipOutPositionedObjects(paintInfo, flippedBlockRect.location(), m_positionedObjects.get());
28812882 if (isBody() || isRoot()) // The <body> must make sure to examine its containingBlock's positioned objects.
28822883 for (RenderBlock* cb = containingBlock(); cb && !cb->isRenderView(); cb = cb->containingBlock())
2883 clipOutPositionedObjects(paintInfo, IntPoint(cb->x(), cb->y()), cb->m_positionedObjects.get()); // FIXME: Not right for flipped writing modes.
2884 clipOutPositionedObjects(paintInfo, LayoutPoint(cb->x(), cb->y()), cb->m_positionedObjects.get()); // FIXME: Not right for flipped writing modes.
28842885 if (m_floatingObjects) {
28852886 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
28862887 FloatingObjectSetIterator end = floatingObjectSet.end();
@@GapRects RenderBlock::inlineSelectionGap
29562957
29572958 LayoutRect logicalRect(curr->logicalLeft(), selTop, curr->logicalWidth(), selTop + selHeight);
29582959 logicalRect.move(isHorizontalWritingMode() ? offsetFromRootBlock : offsetFromRootBlock.transposedSize());
2959 IntRect physicalRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
2960 LayoutRect physicalRect = rootBlock->logicalRectToPhysicalRect(rootBlockPhysicalPosition, logicalRect);
29602961 if (!paintInfo || (isHorizontalWritingMode() && physicalRect.y() < paintInfo->rect.maxY() && physicalRect.maxY() > paintInfo->rect.y())
29612962 || (!isHorizontalWritingMode() && physicalRect.x() < paintInfo->rect.maxX() && physicalRect.maxX() > paintInfo->rect.x()))
29622963 result.unite(curr->lineSelectionGap(rootBlock, rootBlockPhysicalPosition, offsetFromRootBlock, selTop, selHeight, paintInfo));
@@bool RenderBlock::positionNewFloats()
33173318 }
33183319 }
33193320
3320 int logicalTop = logicalHeight();
3321 LayoutUnit logicalTop = logicalHeight();
33213322
33223323 // The float cannot start above the top position of the last positioned float.
33233324 if (lastPlacedFloatingObject)
@@bool RenderBlock::positionNewFloats()
33343335 continue;
33353336
33363337 RenderBox* childBox = floatingObject->renderer();
3337 int childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
3338 LayoutUnit childLogicalLeftMargin = style()->isLeftToRightDirection() ? marginStartForChild(childBox) : marginEndForChild(childBox);
3339 int rightOffset = logicalRightOffsetForContent(); // Constant part of right offset.
3340 int leftOffset = logicalLeftOffsetForContent(); // Constant part of left offset.
3341 int floatLogicalWidth = logicalWidthForFloat(floatingObject); // The width we look for.
3340 LayoutUnit rightOffset = logicalRightOffsetForContent(); // Constant part of right offset.
3341 LayoutUnit leftOffset = logicalLeftOffsetForContent(); // Constant part of left offset.
3342 LayoutUnit floatLogicalWidth = logicalWidthForFloat(floatingObject); // The width we look for.
33423343 if (rightOffset - leftOffset < floatLogicalWidth)
33433344 floatLogicalWidth = rightOffset - leftOffset; // Never look for more than what will be available.
33443345
3345 IntRect oldRect(childBox->x(), childBox->y() , childBox->width(), childBox->height());
3346 LayoutRect oldRect(childBox->x(), childBox->y() , childBox->width(), childBox->height());
33463347
33473348 if (childBox->style()->clear() & CLEFT)
33483349 logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatLeft), logicalTop);
33493350 if (childBox->style()->clear() & CRIGHT)
33503351 logicalTop = max(lowestFloatLogicalBottom(FloatingObject::FloatRight), logicalTop);
33513352
3352 int floatLogicalLeft;
3353 LayoutUnit floatLogicalLeft;
33533354 if (childBox->style()->floating() == LeftFloat) {
3354 int heightRemainingLeft = 1;
3355 int heightRemainingRight = 1;
3355 LayoutUnit heightRemainingLeft = 1;
3356 LayoutUnit heightRemainingRight = 1;
33563357 floatLogicalLeft = logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft);
33573358 while (logicalRightOffsetForLine(logicalTop, rightOffset, false, &heightRemainingRight) - floatLogicalLeft < floatLogicalWidth) {
33583359 logicalTop += min(heightRemainingLeft, heightRemainingRight);
33593360 floatLogicalLeft = logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft);
33603361 }
3361 floatLogicalLeft = max(0, floatLogicalLeft);
3362 floatLogicalLeft = max<LayoutUnit>(0, floatLogicalLeft);
3363 int heightRemainingLeft = 1;
3364 int heightRemainingRight = 1;
3364 LayoutUnit heightRemainingLeft = 1;
3365 LayoutUnit heightRemainingRight = 1;
33653366 floatLogicalLeft = logicalRightOffsetForLine(logicalTop, rightOffset, false, &heightRemainingRight);
33663367 while (floatLogicalLeft - logicalLeftOffsetForLine(logicalTop, leftOffset, false, &heightRemainingLeft) < floatLogicalWidth) {
33673368 logicalTop += min(heightRemainingLeft, heightRemainingRight);
@@bool RenderBlock::positionNewFloats()
33853386
33863387 // If we are unsplittable and don't fit, then we need to move down.
33873388 // We include our margins as part of the unsplittable area.
3388 int newLogicalTop = adjustForUnsplittableChild(childBox, logicalTop, true);
3389 LayoutUnit newLogicalTop = adjustForUnsplittableChild(childBox, logicalTop, true);
33893390
33903391 // See if we have a pagination strut that is making us move down further.
33913392 // Note that an unsplittable child can't also have a pagination strut, so this is
@@LayoutUnit RenderBlock::availableLogical
35833584 return (result < 0) ? 0 : result;
35843585}
35853586
3586 int RenderBlock::nextFloatLogicalBottomBelow(int logicalHeight) const
3587LayoutUnit RenderBlock::nextFloatLogicalBottomBelow(LayoutUnit logicalHeight) const
35873588{
35883589 if (!m_floatingObjects)
35893590 return 0;
35903591
3591 int bottom = INT_MAX;
3592 LayoutUnit bottom = numeric_limits<LayoutUnit>::max();
35923593 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
35933594 FloatingObjectSetIterator end = floatingObjectSet.end();
35943595 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
35953596 FloatingObject* r = *it;
3596 int floatBottom = logicalBottomForFloat(r);
3597 LayoutUnit floatBottom = logicalBottomForFloat(r);
35973598 if (floatBottom > logicalHeight)
35983599 bottom = min(floatBottom, bottom);
35993600 }
36003601
3601 return bottom == INT_MAX ? 0 : bottom;
3602 return bottom == numeric_limits<LayoutUnit>::max() ? 0 : bottom;
3604 int RenderBlock::lowestFloatLogicalBottom(FloatingObject::Type floatType) const
3605LayoutUnit RenderBlock::lowestFloatLogicalBottom(FloatingObject::Type floatType) const
36053606{
36063607 if (!m_floatingObjects)
36073608 return 0;
3608 int lowestFloatBottom = 0;
3609 LayoutUnit lowestFloatBottom = 0;
36093610 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
36103611 FloatingObjectSetIterator end = floatingObjectSet.end();
36113612 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
@@int RenderBlock::lowestFloatLogicalBotto
36163617 return lowestFloatBottom;
36173618}
36183619
3619 void RenderBlock::markLinesDirtyInBlockRange(int logicalTop, int logicalBottom, RootInlineBox* highest)
3620void RenderBlock::markLinesDirtyInBlockRange(LayoutUnit logicalTop, LayoutUnit logicalBottom, RootInlineBox* highest)
36203621{
36213622 if (logicalTop >= logicalBottom)
36223623 return;
36233624
36243625 RootInlineBox* lowestDirtyLine = lastRootBox();
36253626 RootInlineBox* afterLowest = lowestDirtyLine;
3626 while (lowestDirtyLine && lowestDirtyLine->blockLogicalHeight() >= logicalBottom && logicalBottom < numeric_limits<int>::max()) {
3627 while (lowestDirtyLine && lowestDirtyLine->blockLogicalHeight() >= logicalBottom && logicalBottom < numeric_limits<LayoutUnit>::max()) {
36273628 afterLowest = lowestDirtyLine;
36283629 lowestDirtyLine = lowestDirtyLine->prevRootBox();
36293630 }
@@void RenderBlock::clearFloats(BlockLayou
37183719 }
37193720
37203721 // First add in floats from the parent.
3721 int logicalTopOffset = logicalTop();
3722 LayoutUnit logicalTopOffset = logicalTop();
37223723 if (parentHasFloats)
37233724 addIntrudingFloats(parentBlock, parentBlock->logicalLeftOffsetForContent(), logicalTopOffset);
37243725
3725 int logicalLeftOffset = 0;
3726 LayoutUnit logicalLeftOffset = 0;
37263727 if (prev)
37273728 logicalTopOffset -= toRenderBox(prev)->logicalTop();
37283729 else if (!parentHasFloats) {
@@void RenderBlock::clearFloats(BlockLayou
37363737 addIntrudingFloats(block, logicalLeftOffset, logicalTopOffset);
37373738
37383739 if (childrenInline()) {
3739 int changeLogicalTop = numeric_limits<int>::max();
3740 int changeLogicalBottom = numeric_limits<int>::min();
3740 LayoutUnit changeLogicalTop = numeric_limits<LayoutUnit>::max();
3741 LayoutUnit changeLogicalBottom = numeric_limits<LayoutUnit>::min();
37413742 if (m_floatingObjects) {
37423743 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
37433744 FloatingObjectSetIterator end = floatingObjectSet.end();
37443745 for (FloatingObjectSetIterator it = floatingObjectSet.begin(); it != end; ++it) {
37453746 FloatingObject* f = *it;
37463747 FloatingObject* oldFloatingObject = floatMap.get(f->m_renderer);
3747 int logicalBottom = logicalBottomForFloat(f);
3748 LayoutUnit logicalBottom = logicalBottomForFloat(f);
37483749 if (oldFloatingObject) {
3749 int oldLogicalBottom = logicalBottomForFloat(oldFloatingObject);
3750 LayoutUnit oldLogicalBottom = logicalBottomForFloat(oldFloatingObject);
37503751 if (logicalWidthForFloat(f) != logicalWidthForFloat(oldFloatingObject) || logicalLeftForFloat(f) != logicalLeftForFloat(oldFloatingObject)) {
37513752 changeLogicalTop = 0;
37523753 changeLogicalBottom = max(changeLogicalBottom, max(logicalBottom, oldLogicalBottom));
@@void RenderBlock::clearFloats(BlockLayou
37823783 }
37833784}
37843785
3785 int RenderBlock::addOverhangingFloats(RenderBlock* child, int logicalLeftOffset, int logicalTopOffset, bool makeChildPaintOtherFloats)
3786LayoutUnit RenderBlock::addOverhangingFloats(RenderBlock* child, LayoutUnit logicalLeftOffset, LayoutUnit logicalTopOffset, bool makeChildPaintOtherFloats)
37863787{
37873788 // Prevent floats from being added to the canvas by the root element, e.g., <html>.
37883789 if (child->hasOverflowClip() || !child->containsFloats() || child->isRoot() || child->hasColumns() || child->isWritingModeRoot())
37893790 return 0;
37903791
3791 int childLogicalTop = child->logicalTop();
3792 int lowestFloatLogicalBottom = 0;
3792 LayoutUnit childLogicalTop = child->logicalTop();
3793 LayoutUnit lowestFloatLogicalBottom = 0;
37933794
37943795 // Floats that will remain the child's responsibility to paint should factor into its
37953796 // overflow.
37963797 FloatingObjectSetIterator childEnd = child->m_floatingObjects->set().end();
37973798 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) {
37983799 FloatingObject* r = *childIt;
3799 int logicalBottomForFloat = min(this->logicalBottomForFloat(r), numeric_limits<int>::max() - childLogicalTop);
3800 int logicalBottom = childLogicalTop + logicalBottomForFloat;
3800 LayoutUnit logicalBottomForFloat = min(this->logicalBottomForFloat(r), numeric_limits<LayoutUnit>::max() - childLogicalTop);
3801 LayoutUnit logicalBottom = childLogicalTop + logicalBottomForFloat;
38013802 lowestFloatLogicalBottom = max(lowestFloatLogicalBottom, logicalBottom);
38023803
38033804 if (logicalBottom > logicalHeight()) {
38043805 // If the object is not in the list, we add it now.
38053806 if (!containsFloat(r->m_renderer)) {
3806 int leftOffset = isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
3807 int topOffset = isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
3808 FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
3807 LayoutUnit leftOffset = isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
3808 LayoutUnit topOffset = isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
3809 FloatingObject* floatingObj = new FloatingObject(r->type(), LayoutRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
38093810 floatingObj->m_renderer = r->m_renderer;
38103811
38113812 // The nearest enclosing layer always paints the float (so that zindex and stacking
@@int RenderBlock::addOverhangingFloats(Re
38393840 // Since the float doesn't overhang, it didn't get put into our list. We need to go ahead and add its overflow in to the
38403841 // child now.
38413842 if (r->m_isDescendant)
3842 child->addOverflowFromChild(r->m_renderer, IntSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
3843 child->addOverflowFromChild(r->m_renderer, LayoutSize(xPositionForFloatIncludingMargin(r), yPositionForFloatIncludingMargin(r)));
38433844 }
38443845 }
38453846 return lowestFloatLogicalBottom;
@@bool RenderBlock::hasOverhangingFloat(Re
38583859 return logicalBottomForFloat(*it) > logicalHeight();
38593860}
38603861
3861 void RenderBlock::addIntrudingFloats(RenderBlock* prev, int logicalLeftOffset, int logicalTopOffset)
3862void RenderBlock::addIntrudingFloats(RenderBlock* prev, LayoutUnit logicalLeftOffset, LayoutUnit logicalTopOffset)
38623863{
38633864 // If the parent or previous sibling doesn't have any floats to add, don't bother.
38643865 if (!prev->m_floatingObjects)
@@void RenderBlock::addIntrudingFloats(Ren
38723873 FloatingObject* r = *prevIt;
38733874 if (logicalBottomForFloat(r) > logicalTopOffset) {
38743875 if (!m_floatingObjects || !m_floatingObjects->set().contains(r)) {
3875 int leftOffset = isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
3876 int topOffset = isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
3876 LayoutUnit leftOffset = isHorizontalWritingMode() ? logicalLeftOffset : logicalTopOffset;
3877 LayoutUnit topOffset = isHorizontalWritingMode() ? logicalTopOffset : logicalLeftOffset;
3878 FloatingObject* floatingObj = new FloatingObject(r->type(), IntRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
3879 FloatingObject* floatingObj = new FloatingObject(r->type(), LayoutRect(r->x() - leftOffset, r->y() - topOffset, r->width(), r->height()));
38793880
38803881 // Applying the child's margin makes no sense in the case where the child was passed in.
38813882 // since this margin was added already through the modification of the |logicalLeftOffset| variable
@@void RenderBlock::markSiblingsWithFloats
39583959 }
39593960}
39603961
3961 int RenderBlock::getClearDelta(RenderBox* child, int yPos)
3962LayoutUnit RenderBlock::getClearDelta(RenderBox* child, LayoutUnit yPos)
39623963{
39633964 // There is no need to compute clearance if we have no floats.
39643965 if (!containsFloats())
@@int RenderBlock::getClearDelta(RenderBox
39663967
39673968 // At least one float is present. We need to perform the clearance computation.
39683969 bool clearSet = child->style()->clear() != CNONE;
3970 LayoutUnit bottom = 0;
39703971 switch (child->style()->clear()) {
39713972 case CNONE:
39723973 break;
@@int RenderBlock::getClearDelta(RenderBox
39823983 }
39833984
39843985 // We also clear floats if we are too big to sit on the same line as a float (and wish to avoid floats by default).
3985 int result = clearSet ? max(0, bottom - yPos) : 0;
3986 LayoutUnit result = clearSet ? max<LayoutUnit>(0, bottom - yPos) : 0;
39863987 if (!result && child->avoidsFloats()) {
3988 LayoutUnit y = yPos;
3989 int widthAtY = availableLogicalWidthForLine(y, false);
3990 LayoutUnit widthAtY = availableLogicalWidthForLine(y, false);
3991 // FIXME: Change to use roughlyEquals when we move to float.
3992 // See https://bugs.webkit.org/show_bug.cgi?id=66148
39903993 if (widthAtY == availableLogicalWidth())
39913994 return y - yPos;
39923995
3993 int oldChildY = child->y();
3994 int oldChildWidth = child->width();
3996 LayoutUnit oldChildY = child->y();
3997 LayoutUnit oldChildWidth = child->width();
39953998 child->setY(y);
39963999 child->computeLogicalWidth();
3997 int childWidthAtY = child->width();
4000 LayoutUnit childWidthAtY = child->width();
39984001 child->setY(oldChildY);
39994002 child->setWidth(oldChildWidth);
40004003
4004 // FIXME: Change to use roughlyEquals when we move to float.
4005 // See https://bugs.webkit.org/show_bug.cgi?id=66148
40014006 if (childWidthAtY <= widthAtY)
40024007 return y - yPos;
40034008
@@VisiblePosition RenderBlock::positionFor
42644269 }
42654270
42664271 // pass the box a top position that is inside it
4267 IntPoint point(pointInLogicalContents.x(), closestBox->logicalTop());
4272 LayoutPoint point(pointInLogicalContents.x(), closestBox->logicalTop());
42684273 if (!isHorizontalWritingMode())
42694274 point = point.transposedPoint();
42704275 if (closestBox->renderer()->isReplaced())
@@VisiblePosition RenderBlock::positionFor
43334338 return RenderBox::positionForPoint(point);
43344339}
43354340
4336 void RenderBlock::offsetForContents(IntPoint& offset) const
4341void RenderBlock::offsetForContents(LayoutPoint& offset) const
43374342{
43384343 if (hasOverflowClip())
43394344 offset += layer()->scrolledContentOffset();
@@void RenderBlock::calcColumnWidth()
43874392 setDesiredColumnCountAndWidth(desiredColumnCount, desiredColumnWidth);
43884393}
43894394
4390 void RenderBlock::setDesiredColumnCountAndWidth(int count, int width)
4395void RenderBlock::setDesiredColumnCountAndWidth(int count, LayoutUnit width)
43914396{
43924397 bool destroyColumns = !firstChild()
43934398 || (count == 1 && style()->hasAutoColumnWidth())
@@bool RenderBlock::layoutColumns(bool has
44694474 ColumnInfo* colInfo = columnInfo();
44704475 int desiredColumnCount = colInfo->desiredColumnCount();
44714476 if (!hasSpecifiedPageLogicalHeight) {
4472 int columnHeight = pageLogicalHeight;
4477 LayoutUnit columnHeight = pageLogicalHeight;
44734478 int minColumnCount = colInfo->forcedBreaks() + 1;
44744479 if (minColumnCount >= desiredColumnCount) {
44754480 // The forced page breaks are in control of the balancing. Just set the column height to the
44764481 // maximum page break distance.
44774482 if (!pageLogicalHeight) {
4478 int distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(),
4483 LayoutUnit distanceBetweenBreaks = max(colInfo->maximumDistanceBetweenForcedBreaks(),
44794484 view()->layoutState()->pageLogicalOffset(borderBefore() + paddingBefore() + contentLogicalHeight()) - colInfo->forcedBreakOffset());
44804485 columnHeight = max(colInfo->minimumColumnHeight(), distanceBetweenBreaks);
44814486 }
44824487 } else if (contentLogicalHeight() > pageLogicalHeight * desiredColumnCount) {
44834488 // Now that we know the intrinsic height of the columns, we have to rebalance them.
4484 columnHeight = max(colInfo->minimumColumnHeight(), (int)ceilf((float)contentLogicalHeight() / desiredColumnCount));
4489 columnHeight = max(colInfo->minimumColumnHeight(), ceiledLayoutUnit((float)contentLogicalHeight() / desiredColumnCount));
44854490 }
44864491
44874492 if (columnHeight && columnHeight != pageLogicalHeight) {
@@bool RenderBlock::layoutColumns(bool has
45034508 return false;
45044509}
45054510
4506 void RenderBlock::adjustPointToColumnContents(IntPoint& point) const
4511void RenderBlock::adjustPointToColumnContents(LayoutPoint& point) const
45074512{
45084513 // Just bail if we have no columns.
45094514 if (!hasColumns())
@@void RenderBlock::adjustPointToColumnCon
45144519 return;
45154520
45164521 // Determine which columns we intersect.
4517 int colGap = columnGap();
4518 int halfColGap = colGap / 2;
4519 IntPoint columnPoint(columnRectAt(colInfo, 0).location());
4520 int logicalOffset = 0;
4522 LayoutUnit colGap = columnGap();
4523 LayoutUnit halfColGap = colGap / 2;
4524 LayoutPoint columnPoint(columnRectAt(colInfo, 0).location());
4525 LayoutUnit logicalOffset = 0;
45214526 for (unsigned i = 0; i < colInfo->columnCount(); i++) {
45224527 // Add in half the column gap to the left and right of the rect.
4523 IntRect colRect = columnRectAt(colInfo, i);
4528 LayoutRect colRect = columnRectAt(colInfo, i);
45244529 if (isHorizontalWritingMode()) {
4525 IntRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height());
4530 LayoutRect gapAndColumnRect(colRect.x() - halfColGap, colRect.y(), colRect.width() + colGap, colRect.height());
45264531 if (point.x() >= gapAndColumnRect.x() && point.x() < gapAndColumnRect.maxX()) {
45274532 // FIXME: The clamping that follows is not completely right for right-to-left
45284533 // content.
@@void RenderBlock::adjustPointToColumnCon
45444549 // Move to the next position.
45454550 logicalOffset += colRect.height();
45464551 } else {
4547 IntRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap);
4552 LayoutRect gapAndColumnRect(colRect.x(), colRect.y() - halfColGap, colRect.width(), colRect.height() + colGap);
45484553 if (point.y() >= gapAndColumnRect.y() && point.y() < gapAndColumnRect.maxY()) {
45494554 // FIXME: The clamping that follows is not completely right for right-to-left
45504555 // content.
@@void RenderBlock::computeBlockPreferredL
52055210 }
52065211
52075212 // Always make sure these values are non-negative.
5208 m_minPreferredLogicalWidth = max(0, m_minPreferredLogicalWidth);
5209 m_maxPreferredLogicalWidth = max(0, m_maxPreferredLogicalWidth);
5213 m_minPreferredLogicalWidth = max<LayoutUnit>(0, m_minPreferredLogicalWidth);
5214 m_maxPreferredLogicalWidth = max<LayoutUnit>(0, m_maxPreferredLogicalWidth);
52105215
52115216 m_maxPreferredLogicalWidth = max(floatLeftWidth + floatRightWidth, m_maxPreferredLogicalWidth);
52125217}
@@bool RenderBlock::hasLineIfEmpty() const
52255230 return false;
52265231}
52275232
5228 int RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
5233LayoutUnit RenderBlock::lineHeight(bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
52295234{
52305235 // Inline blocks are replaced elements. Otherwise, just pass off to
52315236 // the base class. If we're being queried as though we're the root line
@@int RenderBlock::lineHeight(bool firstLi
52465251 return m_lineHeight;
52475252}
52485253
5249 int RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
5254LayoutUnit RenderBlock::baselinePosition(FontBaseline baselineType, bool firstLine, LineDirectionMode direction, LinePositionMode linePositionMode) const
52505255{
52515256 // Inline blocks are replaced elements. Otherwise, just pass off to
52525257 // the base class. If we're being queried as though we're the root line
@@int RenderBlock::baselinePosition(FontBa
52825287 return fontMetrics.ascent(baselineType) + (lineHeight(firstLine, direction, linePositionMode) - fontMetrics.height()) / 2;
52835288}
52845289
5285 int RenderBlock::firstLineBoxBaseline() const
5290LayoutUnit RenderBlock::firstLineBoxBaseline() const
52865291{
52875292 if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
52885293 return -1;
@@int RenderBlock::firstLineBoxBaseline()
52965301 else {
52975302 for (RenderBox* curr = firstChildBox(); curr; curr = curr->nextSiblingBox()) {
52985303 if (!curr->isFloatingOrPositioned()) {
5299 int result = curr->firstLineBoxBaseline();
5304 LayoutUnit result = curr->firstLineBoxBaseline();
53005305 if (result != -1)
53015306 return curr->logicalTop() + result; // Translate to our coordinate space.
53025307 }
@@int RenderBlock::firstLineBoxBaseline()
53065311 return -1;
53075312}
53085313
5309 int RenderBlock::lastLineBoxBaseline() const
5314LayoutUnit RenderBlock::lastLineBoxBaseline() const
53105315{
53115316 if (!isBlockFlow() || (isWritingModeRoot() && !isRubyRun()))
53125317 return -1;
@@int RenderBlock::lastLineBoxBaseline() c
53285333 for (RenderBox* curr = lastChildBox(); curr; curr = curr->previousSiblingBox()) {
53295334 if (!curr->isFloatingOrPositioned()) {
53305335 haveNormalFlowChild = true;
5331 int result = curr->lastLineBoxBaseline();
5336 LayoutUnit result = curr->lastLineBoxBaseline();
53325337 if (result != -1)
53335338 return curr->logicalTop() + result; // Translate to our coordinate space.
53345339 }
@@int RenderBlock::heightForLineCount(int
56675672 return getHeightForLineCount(this, l, true, count);
56685673}
56695674
5670 void RenderBlock::adjustForBorderFit(int x, int& left, int& right) const
5675void RenderBlock::adjustForBorderFit(LayoutUnit x, LayoutUnit& left, LayoutUnit& right) const
56715676{
56725677 // We don't deal with relative positioning. Our assumption is that you shrink to fit the lines without accounting
56735678 // for either overflow or translations via relative positioning.
@@void RenderBlock::adjustForBorderFit(int
56755680 if (childrenInline()) {
56765681 for (RootInlineBox* box = firstRootBox(); box; box = box->nextRootBox()) {
56775682 if (box->firstChild())
5678 left = min(left, x + static_cast<int>(box->firstChild()->x()));
5683 left = min(left, x + static_cast<LayoutUnit>(box->firstChild()->x()));
56795684 if (box->lastChild())
5680 right = max(right, x + static_cast<int>(ceilf(box->lastChild()->logicalRight())));
5685 right = max(right, x + static_cast<LayoutUnit>(ceilf(box->lastChild()->logicalRight())));
56815686 }
56825687 }
56835688 else {
@@void RenderBlock::adjustForBorderFit(int
57015706 FloatingObject* r = *it;
57025707 // Only examine the object if our m_shouldPaint flag is set.
57035708 if (r->m_shouldPaint) {
5704 int floatLeft = xPositionForFloatIncludingMargin(r) - r->m_renderer->x();
5705 int floatRight = floatLeft + r->m_renderer->width();
5709 LayoutUnit floatLeft = xPositionForFloatIncludingMargin(r) - r->m_renderer->x();
5710 LayoutUnit floatRight = floatLeft + r->m_renderer->width();
57065711 left = min(left, floatLeft);
57075712 right = max(right, floatRight);
57085713 }
@@void RenderBlock::adjustForBorderFit(int
57115716 }
57125717}
57135718
5714 void RenderBlock::borderFitAdjust(IntRect& rect) const
5719void RenderBlock::borderFitAdjust(LayoutRect& rect) const
57155720{
57165721 if (style()->borderFit() == BorderFitBorder)
57175722 return;
57185723
57195724 // Walk any normal flow lines to snugly fit.
5720 int left = INT_MAX;
5721 int right = INT_MIN;
5722 int oldWidth = rect.width();
5725 LayoutUnit left = numeric_limits<LayoutUnit>::max();
5726 LayoutUnit right = numeric_limits<LayoutUnit>::min();
5727 LayoutUnit oldWidth = rect.width();
57235728 adjustForBorderFit(0, left, right);
5724 if (left != INT_MAX) {
5729 if (left != numeric_limits<LayoutUnit>::max()) {
57255730 left -= (borderLeft() + paddingLeft());
57265731 if (left > 0) {
57275732 rect.move(left, 0);
57285733 rect.expand(-left, 0);
57295734 }
57305735 }
5731 if (right != INT_MIN) {
5736 if (right != numeric_limits<LayoutUnit>::min()) {
57325737 right += (borderRight() + paddingRight());
57335738 if (right < oldWidth)
57345739 rect.expand(-(oldWidth - right), 0);
@@void RenderBlock::clearTruncation()
57505755 }
57515756}
57525757
5753 void RenderBlock::setMaxMarginBeforeValues(int pos, int neg)
5758void RenderBlock::setMaxMarginBeforeValues(LayoutUnit pos, LayoutUnit neg)
57545759{
57555760 if (!m_rareData) {
57565761 if (pos == RenderBlockRareData::positiveMarginBeforeDefault(this) && neg == RenderBlockRareData::negativeMarginBeforeDefault(this))
@@void RenderBlock::setMaxMarginBeforeValu
57615766 m_rareData->m_margins.setNegativeMarginBefore(neg);
57625767}
57635768
5764 void RenderBlock::setMaxMarginAfterValues(int pos, int neg)
5769void RenderBlock::setMaxMarginAfterValues(LayoutUnit pos, LayoutUnit neg)
57655770{
57665771 if (!m_rareData) {
57675772 if (pos == RenderBlockRareData::positiveMarginAfterDefault(this) && neg == RenderBlockRareData::negativeMarginAfterDefault(this))
@@void RenderBlock::absoluteQuads(Vector<F
58245829 quads.append(RenderBox::localToAbsoluteQuad(FloatRect(0, 0, width(), height()), false, wasFixed));
58255830}
58265831
5827 IntRect RenderBlock::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, int outlineWidth) const
5832LayoutRect RenderBlock::rectWithOutlineForRepaint(RenderBoxModelObject* repaintContainer, LayoutUnit outlineWidth) const
5829 IntRect r(RenderBox::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
5834 LayoutRect r(RenderBox::rectWithOutlineForRepaint(repaintContainer, outlineWidth));
58305835 if (isAnonymousBlockContinuation())
58315836 r.inflateY(collapsedMarginBefore()); // FIXME: This is wrong for block-flows that are horizontal.
58325837 return r;
@@void RenderBlock::updateHitTestResult(Hi
58775882 }
58785883}
58795884
5880 IntRect RenderBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, int* extraWidthToEndOfLine)
5885LayoutRect RenderBlock::localCaretRect(InlineBox* inlineBox, int caretOffset, LayoutUnit* extraWidthToEndOfLine)
58815886{
58825887 // Do the normal calculation in most cases.
58835888 if (firstChild())
@@IntRect RenderBlock::localCaretRect(Inli
58925897 // constructed and this kludge is not called any more. So only the caret size
58935898 // of an empty :first-line'd block is wrong. I think we can live with that.
58945899 RenderStyle* currentStyle = firstLineStyle();
5895 int height = lineHeight(true, currentStyle->isHorizontalWritingMode() ? HorizontalLine : VerticalLine);
5900 LayoutUnit height = lineHeight(true, currentStyle->isHorizontalWritingMode() ? HorizontalLine : VerticalLine);
58965901
58975902 enum CaretAlignment { alignLeft, alignRight, alignCenter };
58985903
@@IntRect RenderBlock::localCaretRect(Inli
59255930 break;
59265931 }
59275932
5928 int x = borderLeft() + paddingLeft();
5929 int w = width();
5933 LayoutUnit x = borderLeft() + paddingLeft();
5934 LayoutUnit w = width();
59305935
59315936 switch (alignment) {
59325937 case alignLeft:
@@IntRect RenderBlock::localCaretRect(Inli
59475952 // myRight and containerRight are set up, but then clobbered.
59485953 // So *extraWidthToEndOfLine will always be 0 here.
59495954
5950 int myRight = x + caretWidth;
5955 LayoutUnit myRight = x + caretWidth;
59515956 // FIXME: why call localToAbsoluteForContent() twice here, too?
59525957 FloatPoint absRightPoint = localToAbsolute(FloatPoint(myRight, 0));
59535958
5954 int containerRight = containingBlock()->x() + containingBlockLogicalWidthForContent();
5959 LayoutUnit containerRight = containingBlock()->x() + containingBlockLogicalWidthForContent();
59555960 FloatPoint absContainerPoint = localToAbsolute(FloatPoint(containerRight, 0));
59565961
59575962 *extraWidthToEndOfLine = absContainerPoint.x() - absRightPoint.x();
59585963 }
59595964 }
59605965
5961 int y = paddingTop() + borderTop();
5966 LayoutUnit y = paddingTop() + borderTop();
5963 return IntRect(x, y, caretWidth, height);
5968 return LayoutRect(x, y, caretWidth, height);
59645969}
59655970
59665971void RenderBlock::addFocusRingRects(Vector<LayoutRect>& rects, const LayoutPoint& additionalOffset)
@@void RenderBlock::addFocusRingRects(Vect
60016006 pos = curr->localToAbsolute();
60026007 else
60036008 pos = FloatPoint(additionalOffset.x() + box->x(), additionalOffset.y() + box->y());
6004 box->addFocusRingRects(rects, flooredIntPoint(pos));
6009 box->addFocusRingRects(rects, flooredLayoutPoint(pos));
60056010 }
60066011 }
60076012 }
@@RenderBlock* RenderBlock::createAnonymou
60586063 return newBox;
60596064}
60606065
6061 int RenderBlock::nextPageLogicalTopExcludingBoundaryPoint(int logicalOffset) const
6066LayoutUnit RenderBlock::nextPageLogicalTopExcludingBoundaryPoint(LayoutUnit logicalOffset) const
60626067{
60636068 LayoutState* layoutState = view()->layoutState();
60646069 if (!layoutState->m_pageLogicalHeight)
60656070 return logicalOffset;
60666071
60676072 // The logicalOffset is in our coordinate space. We can add in our pushed offset.
6068 int pageLogicalHeight = layoutState->m_pageLogicalHeight;
6069 IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6070 int offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6071 int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight;
6073 LayoutUnit pageLogicalHeight = layoutState->m_pageLogicalHeight;
6074 LayoutSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6075 LayoutUnit offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6076 LayoutUnit remainingLogicalHeight = layoutMod(pageLogicalHeight - layoutMod(offset + logicalOffset, pageLogicalHeight), pageLogicalHeight);
60726077 return logicalOffset + (remainingLogicalHeight ? remainingLogicalHeight : pageLogicalHeight);
60736078}
60746079
6075 int RenderBlock::nextPageLogicalTopIncludingBoundaryPoint(int logicalOffset) const
6080LayoutUnit RenderBlock::nextPageLogicalTopIncludingBoundaryPoint(LayoutUnit logicalOffset) const
60766081{
60776082 LayoutState* layoutState = view()->layoutState();
60786083 if (!layoutState->m_pageLogicalHeight)
60796084 return logicalOffset;
60806085
60816086 // The logicalOffset is in our coordinate space. We can add in our pushed offset.
6082 int pageLogicalHeight = layoutState->m_pageLogicalHeight;
6083 IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6084 int offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6085 int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight;
6087 LayoutUnit pageLogicalHeight = layoutState->m_pageLogicalHeight;
6088 LayoutSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6089 LayoutUnit offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6090 LayoutUnit remainingLogicalHeight = layoutMod(pageLogicalHeight - layoutMod(offset + logicalOffset, pageLogicalHeight), pageLogicalHeight);
60866091 return logicalOffset + remainingLogicalHeight;
60876092}
60886093
@@int RenderBlock::applyAfterBreak(RenderB
61296134 return logicalOffset;
61306135}
61316136
6132 int RenderBlock::adjustForUnsplittableChild(RenderBox* child, int logicalOffset, bool includeMargins)
6137LayoutUnit RenderBlock::adjustForUnsplittableChild(RenderBox* child, LayoutUnit logicalOffset, bool includeMargins)
61336138{
61346139 bool isUnsplittable = child->isReplaced() || child->scrollsOverflow() || child->style()->columnBreakInside() == PBAVOID;
61356140 if (!isUnsplittable)
61366141 return logicalOffset;
6137 int childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0);
6142 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0);
61386143 LayoutState* layoutState = view()->layoutState();
61396144 if (layoutState->m_columnInfo)
61406145 layoutState->m_columnInfo->updateMinimumColumnHeight(childLogicalHeight);
6141 int pageLogicalHeight = layoutState->m_pageLogicalHeight;
6146 LayoutUnit pageLogicalHeight = layoutState->m_pageLogicalHeight;
61426147 if (!pageLogicalHeight || childLogicalHeight > pageLogicalHeight)
61436148 return logicalOffset;
6144 IntSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6145 int offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6146 int remainingLogicalHeight = (pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight) % pageLogicalHeight;
6149 LayoutSize delta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6150 LayoutUnit offset = isHorizontalWritingMode() ? delta.height() : delta.width();
6151 LayoutUnit remainingLogicalHeight = layoutMod(pageLogicalHeight - layoutMod(offset + logicalOffset, pageLogicalHeight), pageLogicalHeight);
61476152 if (remainingLogicalHeight < childLogicalHeight)
61486153 return logicalOffset + remainingLogicalHeight;
61496154 return logicalOffset;
61506155}
61516156
6152 void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, int& delta)
6157void RenderBlock::adjustLinePositionForPagination(RootInlineBox* lineBox, LayoutUnit& delta)
61536158{
61546159 // FIXME: For now we paginate using line overflow. This ensures that lines don't overlap at all when we
61556160 // put a strut between them for pagination purposes. However, this really isn't the desired rendering, since
@@void RenderBlock::adjustLinePositionForP
61686173 // Technically if the location we move the line to has a different line width than our old position, then we need to dirty the
61696174 // line and all following lines.
61706175 LayoutState* layoutState = view()->layoutState();
6171 int pageLogicalHeight = layoutState->m_pageLogicalHeight;
6172 IntRect logicalVisualOverflow = lineBox->logicalVisualOverflowRect(lineBox->lineTop(), lineBox->lineBottom());
6173 int logicalOffset = logicalVisualOverflow.y();
6174 int lineHeight = logicalVisualOverflow.maxY() - logicalOffset;
6176 LayoutUnit pageLogicalHeight = layoutState->m_pageLogicalHeight;
6177 LayoutRect logicalVisualOverflow = lineBox->logicalVisualOverflowRect(lineBox->lineTop(), lineBox->lineBottom());
6178 LayoutUnit logicalOffset = logicalVisualOverflow.y();
6179 LayoutUnit lineHeight = logicalVisualOverflow.maxY() - logicalOffset;
61756180 if (layoutState->m_columnInfo)
61766181 layoutState->m_columnInfo->updateMinimumColumnHeight(lineHeight);
61776182 logicalOffset += delta;
61786183 lineBox->setPaginationStrut(0);
61796184 if (!pageLogicalHeight || lineHeight > pageLogicalHeight)
61806185 return;
6181 IntSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6182 int offset = isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
6183 int remainingLogicalHeight = pageLogicalHeight - (offset + logicalOffset) % pageLogicalHeight;
6186 LayoutSize offsetDelta = layoutState->m_layoutOffset - layoutState->m_pageOffset;
6187 LayoutUnit offset = isHorizontalWritingMode() ? offsetDelta.height() : offsetDelta.width();
6188 LayoutUnit remainingLogicalHeight = pageLogicalHeight - layoutMod(offset + logicalOffset, pageLogicalHeight);
61846189 if (remainingLogicalHeight < lineHeight) {
6185 int totalLogicalHeight = lineHeight + max(0, logicalOffset);
6190 LayoutUnit totalLogicalHeight = lineHeight + max<LayoutUnit>(0, logicalOffset);
61866191 if (lineBox == firstRootBox() && totalLogicalHeight < pageLogicalHeight && !isPositioned() && !isTableCell())
6187 setPaginationStrut(remainingLogicalHeight + max(0, logicalOffset));
6192 setPaginationStrut(remainingLogicalHeight + max<LayoutUnit>(0, logicalOffset));
61886193 else {
61896194 delta += remainingLogicalHeight;
61906195 lineBox->setPaginationStrut(remainingLogicalHeight);
93343