Changeset 93284 in webkit
- Timestamp:
- Aug 17, 2011 11:37:30 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93281 r93284 1 2011-08-17 Emil A Eklund <eae@chromium.org> 2 3 Switch RenderBox to to new layout types 4 https://bugs.webkit.org/show_bug.cgi?id=66156 5 6 Reviewed by Eric Seidel. 7 8 Convert RenderBox to new layout abstraction as a part of the ongoing 9 conversion work. 10 11 No new tests as no new functionality. 12 13 * rendering/RenderBox.cpp: 14 (WebCore::RenderBox::scrollWidth): 15 (WebCore::RenderBox::scrollHeight): 16 (WebCore::RenderBox::scrollLeft): 17 (WebCore::RenderBox::scrollTop): 18 (WebCore::RenderBox::setScrollLeft): 19 (WebCore::RenderBox::setScrollTop): 20 (WebCore::RenderBox::absoluteRects): 21 (WebCore::RenderBox::absoluteContentBox): 22 (WebCore::RenderBox::absoluteContentQuad): 23 (WebCore::RenderBox::outlineBoundsForRepaint): 24 (WebCore::RenderBox::reflectionBox): 25 (WebCore::RenderBox::reflectedRect): 26 (WebCore::RenderBox::verticalScrollbarWidth): 27 (WebCore::RenderBox::horizontalScrollbarHeight): 28 (WebCore::RenderBox::computeContentBoxLogicalWidth): 29 (WebCore::RenderBox::computeContentBoxLogicalHeight): 30 (WebCore::RenderBox::maskClipRect): 31 (WebCore::RenderBox::repaintLayerRectsForImage): 32 (WebCore::RenderBox::pushContentsClip): 33 (WebCore::RenderBox::overflowClipRect): 34 (WebCore::RenderBox::clipRect): 35 (WebCore::RenderBox::containingBlockLogicalWidthForContent): 36 (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight): 37 (WebCore::RenderBox::positionLineBox): 38 (WebCore::RenderBox::clippedOverflowRectForRepaint): 39 (WebCore::RenderBox::computeRectForRepaint): 40 (WebCore::RenderBox::computeLogicalWidth): 41 (WebCore::RenderBox::computeInlineDirectionMargins): 42 (WebCore::RenderBox::computeLogicalHeight): 43 (WebCore::RenderBox::computeLogicalHeightUsing): 44 (WebCore::RenderBox::computePercentageLogicalHeight): 45 (WebCore::RenderBox::computeBlockDirectionMargins): 46 (WebCore::RenderBox::containingBlockLogicalWidthForPositioned): 47 (WebCore::RenderBox::containingBlockLogicalHeightForPositioned): 48 (WebCore::computeInlineStaticDistance): 49 (WebCore::RenderBox::computePositionedLogicalWidth): 50 (WebCore::computeLogicalLeftPositionedOffset): 51 (WebCore::RenderBox::computePositionedLogicalWidthUsing): 52 (WebCore::computeBlockStaticDistance): 53 (WebCore::RenderBox::computePositionedLogicalHeight): 54 (WebCore::computeLogicalTopPositionedOffset): 55 (WebCore::RenderBox::computePositionedLogicalHeightUsing): 56 (WebCore::RenderBox::computePositionedLogicalWidthReplaced): 57 (WebCore::RenderBox::computePositionedLogicalHeightReplaced): 58 (WebCore::RenderBox::localCaretRect): 59 (WebCore::RenderBox::lineHeight): 60 (WebCore::RenderBox::baselinePosition): 61 (WebCore::RenderBox::logicalVisualOverflowRectForPropagation): 62 (WebCore::RenderBox::visualOverflowRectForPropagation): 63 (WebCore::RenderBox::logicalLayoutOverflowRectForPropagation): 64 (WebCore::RenderBox::layoutOverflowRectForPropagation): 65 (WebCore::RenderBox::locationOffsetIncludingFlipping): 66 * rendering/RenderBox.h: 67 (WebCore::RenderBox::borderFitAdjust): 68 (WebCore::RenderBox::intrinsicSize): 69 (WebCore::RenderBox::intrinsicLogicalWidth): 70 (WebCore::RenderBox::intrinsicLogicalHeight): 71 (WebCore::RenderBox::scrollbarLogicalHeight): 72 (WebCore::RenderBox::controlClipRect): 73 (WebCore::RenderBox::firstLineBoxBaseline): 74 (WebCore::RenderBox::lastLineBoxBaseline): 75 1 76 2011-08-17 Annie Sullivan <sullivan@chromium.org> 2 77 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r92631 r93284 417 417 } 418 418 419 int RenderBox::scrollWidth() const419 LayoutUnit RenderBox::scrollWidth() const 420 420 { 421 421 if (hasOverflowClip()) … … 425 425 if (style()->isLeftToRightDirection()) 426 426 return max(clientWidth(), maxXLayoutOverflow() - borderLeft()); 427 return clientWidth() - min (0, minXLayoutOverflow() - borderLeft());428 } 429 430 int RenderBox::scrollHeight() const427 return clientWidth() - min<LayoutUnit>(0, minXLayoutOverflow() - borderLeft()); 428 } 429 430 LayoutUnit RenderBox::scrollHeight() const 431 431 { 432 432 if (hasOverflowClip()) … … 437 437 } 438 438 439 int RenderBox::scrollLeft() const439 LayoutUnit RenderBox::scrollLeft() const 440 440 { 441 441 return hasOverflowClip() ? layer()->scrollXOffset() : 0; 442 442 } 443 443 444 int RenderBox::scrollTop() const444 LayoutUnit RenderBox::scrollTop() const 445 445 { 446 446 return hasOverflowClip() ? layer()->scrollYOffset() : 0; 447 447 } 448 448 449 void RenderBox::setScrollLeft( int newLeft)449 void RenderBox::setScrollLeft(LayoutUnit newLeft) 450 450 { 451 451 if (hasOverflowClip()) … … 453 453 } 454 454 455 void RenderBox::setScrollTop( int newTop)455 void RenderBox::setScrollTop(LayoutUnit newTop) 456 456 { 457 457 if (hasOverflowClip()) … … 459 459 } 460 460 461 void RenderBox::absoluteRects(Vector< LayoutRect>& rects, const LayoutPoint& accumulatedOffset)461 void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) 462 462 { 463 463 rects.append(LayoutRect(accumulatedOffset, size())); … … 476 476 } 477 477 478 IntRect RenderBox::absoluteContentBox() const479 { 480 IntRect rect = contentBoxRect();478 LayoutRect RenderBox::absoluteContentBox() const 479 { 480 LayoutRect rect = contentBoxRect(); 481 481 FloatPoint absPos = localToAbsolute(FloatPoint()); 482 482 rect.move(absPos.x(), absPos.y()); … … 486 486 FloatQuad RenderBox::absoluteContentQuad() const 487 487 { 488 IntRect rect = contentBoxRect();488 LayoutRect rect = contentBoxRect(); 489 489 return localToAbsoluteQuad(FloatRect(rect)); 490 490 } 491 491 492 IntRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, IntPoint* cachedOffsetToRepaintContainer) const493 { 494 IntRect box = borderBoundingBox();492 LayoutRect RenderBox::outlineBoundsForRepaint(RenderBoxModelObject* repaintContainer, LayoutPoint* cachedOffsetToRepaintContainer) const 493 { 494 LayoutRect box = borderBoundingBox(); 495 495 adjustRectForOutlineAndShadow(box); 496 496 … … 516 516 } 517 517 518 IntRect RenderBox::reflectionBox() const519 { 520 IntRect result;518 LayoutRect RenderBox::reflectionBox() const 519 { 520 LayoutRect result; 521 521 if (!style()->boxReflect()) 522 522 return result; 523 IntRect box = borderBoxRect();523 LayoutRect box = borderBoxRect(); 524 524 result = box; 525 525 switch (style()->boxReflect()->direction()) { … … 549 549 } 550 550 551 IntRect RenderBox::reflectedRect(const IntRect& r) const551 LayoutRect RenderBox::reflectedRect(const LayoutRect& r) const 552 552 { 553 553 if (!style()->boxReflect()) 554 return IntRect();555 556 IntRect box = borderBoxRect();557 IntRect result = r;554 return LayoutRect(); 555 556 LayoutRect box = borderBoxRect(); 557 LayoutRect result = r; 558 558 switch (style()->boxReflect()->direction()) { 559 559 case ReflectionBelow: … … 585 585 } 586 586 587 int RenderBox::verticalScrollbarWidth() const587 LayoutUnit RenderBox::verticalScrollbarWidth() const 588 588 { 589 589 return includeVerticalScrollbarSize() ? layer()->verticalScrollbarWidth() : 0; 590 590 } 591 591 592 int RenderBox::horizontalScrollbarHeight() const592 LayoutUnit RenderBox::horizontalScrollbarHeight() const 593 593 { 594 594 return includeHorizontalScrollbarSize() ? layer()->horizontalScrollbarHeight() : 0; … … 739 739 if (style()->boxSizing() == BORDER_BOX) 740 740 width -= borderAndPaddingLogicalWidth(); 741 return max (0, width);741 return max<LayoutUnit>(0, width); 742 742 } 743 743 … … 746 746 if (style()->boxSizing() == BORDER_BOX) 747 747 height -= borderAndPaddingLogicalHeight(); 748 return max (0, height);748 return max<LayoutUnit>(0, height); 749 749 } 750 750 … … 970 970 } 971 971 972 IntRect RenderBox::maskClipRect()973 { 974 IntRect bbox = borderBoxRect();972 LayoutRect RenderBox::maskClipRect() 973 { 974 LayoutRect bbox = borderBoxRect(); 975 975 if (style()->maskBoxImage().image()) 976 976 return bbox; 977 977 978 IntRect result;978 LayoutRect result; 979 979 for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLayer = maskLayer->next()) { 980 980 if (maskLayer->image()) { … … 1039 1039 bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer* layers, bool drawingBackground) 1040 1040 { 1041 IntRect rendererRect;1041 LayoutRect rendererRect; 1042 1042 RenderBox* layerRenderer = 0; 1043 1043 … … 1051 1051 layerRenderer = view(); 1052 1052 1053 int rw;1054 int rh;1053 LayoutUnit rw; 1054 LayoutUnit rh; 1055 1055 1056 1056 if (FrameView* frameView = toRenderView(layerRenderer)->frameView()) { … … 1061 1061 rh = layerRenderer->height(); 1062 1062 } 1063 rendererRect = IntRect(-layerRenderer->marginLeft(),1063 rendererRect = LayoutRect(-layerRenderer->marginLeft(), 1064 1064 -layerRenderer->marginTop(), 1065 1065 max(layerRenderer->width() + layerRenderer->marginLeft() + layerRenderer->marginRight() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw), … … 1127 1127 paintInfo.context->save(); 1128 1128 if (style()->hasBorderRadius()) 1129 paintInfo.context->addRoundedRectClip(style()->getRoundedBorderFor( IntRect(accumulatedOffset, size())));1129 paintInfo.context->addRoundedRectClip(style()->getRoundedBorderFor(LayoutRect(accumulatedOffset, size()))); 1130 1130 paintInfo.context->clip(clipRect); 1131 1131 return true; … … 1145 1145 } 1146 1146 1147 IntRect RenderBox::overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy relevancy)1147 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location, OverlayScrollbarSizeRelevancy relevancy) 1148 1148 { 1149 1149 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the property 1150 1150 // here. 1151 IntRect clipRect(location + IntSize(borderLeft(), borderTop()),1152 size() - IntSize(borderLeft() + borderRight(), borderTop() + borderBottom()));1151 LayoutRect clipRect(location + LayoutSize(borderLeft(), borderTop()), 1152 size() - LayoutSize(borderLeft() + borderRight(), borderTop() + borderBottom())); 1153 1153 1154 1154 // Subtract out scrollbars if we have them. … … 1159 1159 } 1160 1160 1161 IntRect RenderBox::clipRect(const IntPoint& location)1162 { 1163 IntRect clipRect(location, size());1161 LayoutRect RenderBox::clipRect(const LayoutPoint& location) 1162 { 1163 LayoutRect clipRect(location, size()); 1164 1164 if (!style()->clipLeft().isAuto()) { 1165 int c = style()->clipLeft().calcValue(width());1165 LayoutUnit c = style()->clipLeft().calcValue(width()); 1166 1166 clipRect.move(c, 0); 1167 1167 clipRect.contract(c, 0); … … 1172 1172 1173 1173 if (!style()->clipTop().isAuto()) { 1174 int c = style()->clipTop().calcValue(height());1174 LayoutUnit c = style()->clipTop().calcValue(height()); 1175 1175 clipRect.move(0, c); 1176 1176 clipRect.contract(0, c); … … 1183 1183 } 1184 1184 1185 int RenderBox::containingBlockLogicalWidthForContent() const1185 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const 1186 1186 { 1187 1187 RenderBlock* cb = containingBlock(); … … 1191 1191 } 1192 1192 1193 int RenderBox::perpendicularContainingBlockLogicalHeight() const1193 LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const 1194 1194 { 1195 1195 RenderBlock* cb = containingBlock(); … … 1367 1367 box->destroy(renderArena()); 1368 1368 } else if (isReplaced()) { 1369 setLocation(rounded IntPoint(FloatPoint(box->x(), box->y())));1369 setLocation(roundedLayoutPoint(FloatPoint(box->x(), box->y()))); 1370 1370 m_inlineBoxWrapper = box; 1371 1371 } … … 1382 1382 } 1383 1383 1384 IntRect RenderBox::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const1384 LayoutRect RenderBox::clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const 1385 1385 { 1386 1386 if (style()->visibility() != VISIBLE && !enclosingLayer()->hasVisibleContent()) 1387 return IntRect();1388 1389 IntRect r = visualOverflowRect();1387 return LayoutRect(); 1388 1389 LayoutRect r = visualOverflowRect(); 1390 1390 1391 1391 RenderView* v = view(); … … 1413 1413 } 1414 1414 1415 void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect& rect, bool fixed) const1415 void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& rect, bool fixed) const 1416 1416 { 1417 1417 // The rect we compute at each step is shifted by our x/y offset in the parent container's coordinate space. … … 1458 1458 if (isWritingModeRoot() && !isPositioned()) 1459 1459 flipForWritingMode(rect); 1460 IntPoint topLeft = rect.location();1460 LayoutPoint topLeft = rect.location(); 1461 1461 topLeft.move(x(), y()); 1462 1462 … … 1486 1486 RenderBlock* cb = toRenderBlock(o); 1487 1487 if (cb->hasColumns()) { 1488 IntRect repaintRect(topLeft, rect.size());1488 LayoutRect repaintRect(topLeft, rect.size()); 1489 1489 cb->adjustRectForColumns(repaintRect); 1490 1490 topLeft = repaintRect.location(); … … 1503 1503 topLeft -= containerBox->layer()->scrolledContentOffset(); // For overflow:auto/scroll/hidden. 1504 1504 1505 IntRect repaintRect(topLeft, rect.size());1506 IntRect boxRect(IntPoint(), containerBox->layer()->size());1505 LayoutRect repaintRect(topLeft, rect.size()); 1506 LayoutRect boxRect(LayoutPoint(), containerBox->layer()->size()); 1507 1507 rect = intersection(repaintRect, boxRect); 1508 1508 if (rect.isEmpty()) … … 1513 1513 if (containerSkipped) { 1514 1514 // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates. 1515 IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);1515 LayoutSize containerOffset = repaintContainer->offsetFromAncestorContainer(o); 1516 1516 rect.move(-containerOffset); 1517 1517 return; … … 1578 1578 1579 1579 RenderBlock* cb = containingBlock(); 1580 int containerLogicalWidth = max(0, containingBlockLogicalWidthForContent());1580 LayoutUnit containerLogicalWidth = max<LayoutUnit>(0, containingBlockLogicalWidthForContent()); 1581 1581 bool hasPerpendicularContainingBlock = cb->isHorizontalWritingMode() != isHorizontalWritingMode(); 1582 int containerWidthInInlineDirection = containerLogicalWidth;1582 LayoutUnit containerWidthInInlineDirection = containerLogicalWidth; 1583 1583 if (hasPerpendicularContainingBlock) 1584 1584 containerWidthInInlineDirection = perpendicularContainingBlockLogicalHeight(); … … 1589 1589 setMarginEnd(style()->marginEnd().calcMinValue(containerLogicalWidth)); 1590 1590 if (treatAsReplaced) 1591 setLogicalWidth(max (logicalWidthLength.value() + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth()));1591 setLogicalWidth(max<LayoutUnit>(logicalWidthLength.calcFloatValue(0) + borderAndPaddingLogicalWidth(), minPreferredLogicalWidth())); 1592 1592 return; 1593 1593 } … … 1602 1602 // Calculate MaxLogicalWidth 1603 1603 if (!style()->logicalMaxWidth().isUndefined()) { 1604 int maxLogicalWidth = computeLogicalWidthUsing(MaxLogicalWidth, containerWidthInInlineDirection);1604 LayoutUnit maxLogicalWidth = computeLogicalWidthUsing(MaxLogicalWidth, containerWidthInInlineDirection); 1605 1605 if (logicalWidth() > maxLogicalWidth) { 1606 1606 setLogicalWidth(maxLogicalWidth); … … 1610 1610 1611 1611 // Calculate MinLogicalWidth 1612 int minLogicalWidth = computeLogicalWidthUsing(MinLogicalWidth, containerWidthInInlineDirection);1612 LayoutUnit minLogicalWidth = computeLogicalWidthUsing(MinLogicalWidth, containerWidthInInlineDirection); 1613 1613 if (logicalWidth() < minLogicalWidth) { 1614 1614 setLogicalWidth(minLogicalWidth); … … 1721 1721 if ((marginStartLength.isAuto() && marginEndLength.isAuto() && childWidth < containerWidth) 1722 1722 || (!marginStartLength.isAuto() && !marginEndLength.isAuto() && containingBlock->style()->textAlign() == WEBKIT_CENTER)) { 1723 containingBlock->setMarginStartForChild(this, max (0, (containerWidth - childWidth) / 2));1723 containingBlock->setMarginStartForChild(this, max<LayoutUnit>(0, (containerWidth - childWidth) / 2)); 1724 1724 containingBlock->setMarginEndForChild(this, containerWidth - childWidth - containingBlock->marginStartForChild(this)); 1725 1725 return; … … 1806 1806 if (checkMinMaxHeight) { 1807 1807 heightResult = computeLogicalHeightUsing(style()->logicalHeight()); 1808 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148 1808 1809 if (heightResult == -1) 1809 1810 heightResult = logicalHeight(); … … 1864 1865 else if (h.isPercent()) 1865 1866 logicalHeight = computePercentageLogicalHeight(h); 1867 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148 1866 1868 if (logicalHeight != -1) { 1867 1869 logicalHeight = computeBorderBoxLogicalHeight(logicalHeight); … … 1928 1930 // We need to recur and compute the percentage height for our containing block. 1929 1931 result = cb->computePercentageLogicalHeight(cb->style()->logicalHeight()); 1932 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148 1930 1933 if (result != -1) 1931 1934 result = cb->computeContentBoxLogicalHeight(result); … … 1942 1945 result = cb->computeContentBoxLogicalHeight(cb->availableLogicalHeight()); 1943 1946 1947 // FIXME: Use < 0 or roughlyEquals when we move to float, see https://bugs.webkit.org/show_bug.cgi?id=66148 1944 1948 if (result != -1) { 1945 1949 result = height.calcValue(result); … … 2110 2114 // Margins are calculated with respect to the logical width of 2111 2115 // the containing block (8.3) 2112 int cw = containingBlockLogicalWidthForContent();2116 LayoutUnit cw = containingBlockLogicalWidthForContent(); 2113 2117 2114 2118 RenderStyle* containingBlockStyle = containingBlock->style(); … … 2135 2139 return 0; 2136 2140 2137 int fromLeft;2138 int fromRight;2141 LayoutUnit fromLeft; 2142 LayoutUnit fromRight; 2139 2143 if (containingBlock->style()->isLeftToRightDirection()) { 2140 2144 fromLeft = first->logicalLeft() + first->borderLogicalLeft(); … … 2145 2149 } 2146 2150 2147 return max (0, (fromRight - fromLeft));2151 return max<LayoutUnit>(0, fromRight - fromLeft); 2148 2152 } 2149 2153 … … 2166 2170 return 0; 2167 2171 2168 int heightResult;2169 IntRect boundingBox = flow->linesBoundingBox();2172 LayoutUnit heightResult; 2173 LayoutRect boundingBox = flow->linesBoundingBox(); 2170 2174 if (containingBlock->isHorizontalWritingMode()) 2171 2175 heightResult = boundingBox.height(); … … 2184 2188 // FIXME: The static distance computation has not been patched for mixed writing modes yet. 2185 2189 if (containerDirection == LTR) { 2186 int staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft();2190 LayoutUnit staticPosition = child->layer()->staticInlinePosition() - containerBlock->borderLogicalLeft(); 2187 2191 for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) { 2188 2192 if (curr->isBox()) … … 2192 2196 } else { 2193 2197 RenderBox* enclosingBox = child->parent()->enclosingBox(); 2194 int staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalRight();2198 LayoutUnit staticPosition = child->layer()->staticInlinePosition() + containerLogicalWidth + containerBlock->borderLogicalRight(); 2195 2199 staticPosition -= enclosingBox->logicalWidth(); 2196 2200 for (RenderObject* curr = enclosingBox; curr && curr != containerBlock; curr = curr->container()) { … … 2238 2242 const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container()); 2239 2243 2240 const int containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock);2244 const LayoutUnit containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock); 2241 2245 2242 2246 // To match WinIE, in quirks mode use the parent's 'direction' property … … 2245 2249 2246 2250 bool isHorizontal = isHorizontalWritingMode(); 2247 const int bordersPlusPadding = borderAndPaddingLogicalWidth();2251 const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalWidth(); 2248 2252 const Length marginLogicalLeft = isHorizontal ? style()->marginLeft() : style()->marginTop(); 2249 2253 const Length marginLogicalRight = isHorizontal ? style()->marginRight() : style()->marginBottom(); 2250 int& marginLogicalLeftAlias = isHorizontal ? m_marginLeft : m_marginTop;2251 int& marginLogicalRightAlias = isHorizontal ? m_marginRight : m_marginBottom;2254 LayoutUnit& marginLogicalLeftAlias = isHorizontal ? m_marginLeft : m_marginTop; 2255 LayoutUnit& marginLogicalRightAlias = isHorizontal ? m_marginRight : m_marginBottom; 2252 2256 2253 2257 Length logicalLeft = style()->logicalLeft(); … … 2283 2287 2284 2288 // Calculate constraint equation values for 'width' case. 2285 int logicalWidthResult;2286 int logicalLeftResult;2289 LayoutUnit logicalWidthResult; 2290 LayoutUnit logicalLeftResult; 2287 2291 computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection, 2288 2292 containerLogicalWidth, bordersPlusPadding, … … 2294 2298 // Calculate constraint equation values for 'max-width' case. 2295 2299 if (!style()->logicalMaxWidth().isUndefined()) { 2296 int maxLogicalWidth;2297 int maxMarginLogicalLeft;2298 int maxMarginLogicalRight;2299 int maxLogicalLeftPos;2300 LayoutUnit maxLogicalWidth; 2301 LayoutUnit maxMarginLogicalLeft; 2302 LayoutUnit maxMarginLogicalRight; 2303 LayoutUnit maxLogicalLeftPos; 2300 2304 2301 2305 computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), containerBlock, containerDirection, … … 2314 2318 // Calculate constraint equation values for 'min-width' case. 2315 2319 if (!style()->logicalMinWidth().isZero()) { 2316 int minLogicalWidth;2317 int minMarginLogicalLeft;2318 int minMarginLogicalRight;2319 int minLogicalLeftPos;2320 LayoutUnit minLogicalWidth; 2321 LayoutUnit minMarginLogicalLeft; 2322 LayoutUnit minMarginLogicalRight; 2323 LayoutUnit minLogicalLeftPos; 2320 2324 2321 2325 computePositionedLogicalWidthUsing(style()->logicalMinWidth(), containerBlock, containerDirection, … … 2345 2349 } 2346 2350 2347 static void computeLogicalLeftPositionedOffset( int& logicalLeftPos, const RenderBox* child, int logicalWidthValue, const RenderBoxModelObject* containerBlock, int containerLogicalWidth)2351 static void computeLogicalLeftPositionedOffset(LayoutUnit& logicalLeftPos, const RenderBox* child, LayoutUnit logicalWidthValue, const RenderBoxModelObject* containerBlock, LayoutUnit containerLogicalWidth) 2348 2352 { 2349 2353 // Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped … … 2357 2361 2358 2362 void RenderBox::computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection, 2359 int containerLogicalWidth, int bordersPlusPadding,2363 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, 2360 2364 Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight, 2361 int& logicalWidthValue, int& marginLogicalLeftValue, int& marginLogicalRightValue, int& logicalLeftPos)2365 LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos) 2362 2366 { 2363 2367 // 'left' and 'right' cannot both be 'auto' because one would of been … … 2365 2369 ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); 2366 2370 2367 int logicalLeftValue = 0;2371 LayoutUnit logicalLeftValue = 0; 2368 2372 2369 2373 bool logicalWidthIsAuto = logicalWidth.isIntrinsicOrAuto(); … … 2390 2394 logicalWidthValue = computeContentBoxLogicalWidth(logicalWidth.calcValue(containerLogicalWidth)); 2391 2395 2392 const int availableSpace = containerLogicalWidth - (logicalLeftValue + logicalWidthValue + logicalRight.calcValue(containerLogicalWidth) + bordersPlusPadding);2396 const LayoutUnit availableSpace = containerLogicalWidth - (logicalLeftValue + logicalWidthValue + logicalRight.calcValue(containerLogicalWidth) + bordersPlusPadding); 2393 2397 2394 2398 // Margins are now the only unknown … … 2471 2475 marginLogicalRightValue = marginLogicalRight.calcMinValue(containerLogicalWidth); 2472 2476 2473 const int availableSpace = containerLogicalWidth - (marginLogicalLeftValue + marginLogicalRightValue + bordersPlusPadding);2477 const LayoutUnit availableSpace = containerLogicalWidth - (marginLogicalLeftValue + marginLogicalRightValue + bordersPlusPadding); 2474 2478 2475 2479 // FIXME: Is there a faster way to find the correct case? … … 2477 2481 if (logicalLeftIsAuto && logicalWidthIsAuto && !logicalRightIsAuto) { 2478 2482 // RULE 1: (use shrink-to-fit for width, and solve of left) 2479 int logicalRightValue = logicalRight.calcValue(containerLogicalWidth);2483 LayoutUnit logicalRightValue = logicalRight.calcValue(containerLogicalWidth); 2480 2484 2481 2485 // FIXME: would it be better to have shrink-to-fit in one step? 2482 int preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;2483 int preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;2484 int availableWidth = availableSpace - logicalRightValue;2486 LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; 2487 LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding; 2488 LayoutUnit availableWidth = availableSpace - logicalRightValue; 2485 2489 logicalWidthValue = min(max(preferredMinWidth, availableWidth), preferredWidth); 2486 2490 logicalLeftValue = availableSpace - (logicalWidthValue + logicalRightValue); … … 2490 2494 2491 2495 // FIXME: would it be better to have shrink-to-fit in one step? 2492 int preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding;2493 int preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding;2494 int availableWidth = availableSpace - logicalLeftValue;2496 LayoutUnit preferredWidth = maxPreferredLogicalWidth() - bordersPlusPadding; 2497 LayoutUnit preferredMinWidth = minPreferredLogicalWidth() - bordersPlusPadding; 2498 LayoutUnit availableWidth = availableSpace - logicalLeftValue; 2495 2499 logicalWidthValue = min(max(preferredMinWidth, availableWidth), preferredWidth); 2496 2500 } else if (logicalLeftIsAuto && !logicalWidthIsAuto && !logicalRightIsAuto) { … … 2535 2539 2536 2540 // FIXME: The static distance computation has not been patched for mixed writing modes. 2537 int staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore();2541 LayoutUnit staticLogicalTop = child->layer()->staticBlockPosition() - containerBlock->borderBefore(); 2538 2542 for (RenderObject* curr = child->parent(); curr && curr != containerBlock; curr = curr->container()) { 2539 2543 if (curr->isBox() && !curr->isTableRow()) … … 2560 2564 const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container()); 2561 2565 2562 const int containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock);2566 const LayoutUnit containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock); 2563 2567 2564 2568 bool isHorizontal = isHorizontalWritingMode(); 2565 2569 bool isFlipped = style()->isFlippedBlocksWritingMode(); 2566 const int bordersPlusPadding = borderAndPaddingLogicalHeight();2570 const LayoutUnit bordersPlusPadding = borderAndPaddingLogicalHeight(); 2567 2571 const Length marginBefore = style()->marginBefore(); 2568 2572 const Length marginAfter = style()->marginAfter(); 2569 int& marginBeforeAlias = isHorizontal ? (isFlipped ? m_marginBottom : m_marginTop) : (isFlipped ? m_marginRight: m_marginLeft);2570 int& marginAfterAlias = isHorizontal ? (isFlipped ? m_marginTop : m_marginBottom) : (isFlipped ? m_marginLeft: m_marginRight);2573 LayoutUnit& marginBeforeAlias = isHorizontal ? (isFlipped ? m_marginBottom : m_marginTop) : (isFlipped ? m_marginRight: m_marginLeft); 2574 LayoutUnit& marginAfterAlias = isHorizontal ? (isFlipped ? m_marginTop : m_marginBottom) : (isFlipped ? m_marginLeft: m_marginRight); 2571 2575 2572 2576 Length logicalTop = style()->logicalTop(); … … 2594 2598 computeBlockStaticDistance(logicalTop, logicalBottom, this, containerBlock); 2595 2599 2596 int logicalHeightResult; // Needed to compute overflow.2597 int logicalTopPos;2600 LayoutUnit logicalHeightResult; // Needed to compute overflow. 2601 LayoutUnit logicalTopPos; 2598 2602 2599 2603 // Calculate constraint equation values for 'height' case. … … 2608 2612 // Calculate constraint equation values for 'max-height' case. 2609 2613 if (!style()->logicalMaxHeight().isUndefined()) { 2610 int maxLogicalHeight;2611 int maxMarginBefore;2612 int maxMarginAfter;2613 int maxLogicalTopPos;2614 LayoutUnit maxLogicalHeight; 2615 LayoutUnit maxMarginBefore; 2616 LayoutUnit maxMarginAfter; 2617 LayoutUnit maxLogicalTopPos; 2614 2618 2615 2619 computePositionedLogicalHeightUsing(style()->logicalMaxHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, … … 2627 2631 // Calculate constraint equation values for 'min-height' case. 2628 2632 if (!style()->logicalMinHeight().isZero()) { 2629 int minLogicalHeight;2630 int minMarginBefore;2631 int minMarginAfter;2632 int minLogicalTopPos;2633 LayoutUnit minLogicalHeight; 2634 LayoutUnit minMarginBefore; 2635 LayoutUnit minMarginAfter; 2636 LayoutUnit minLogicalTopPos; 2633 2637 2634 2638 computePositionedLogicalHeightUsing(style()->logicalMinHeight(), containerBlock, containerLogicalHeight, bordersPlusPadding, … … 2648 2652 } 2649 2653 2650 static void computeLogicalTopPositionedOffset( int& logicalTopPos, const RenderBox* child, int logicalHeightValue, const RenderBoxModelObject* containerBlock, int containerLogicalHeight)2654 static void computeLogicalTopPositionedOffset(LayoutUnit& logicalTopPos, const RenderBox* child, LayoutUnit logicalHeightValue, const RenderBoxModelObject* containerBlock, LayoutUnit containerLogicalHeight) 2651 2655 { 2652 2656 // Deal with differing writing modes here. Our offset needs to be in the containing block's coordinate space. If the containing block is flipped … … 2671 2675 2672 2676 void RenderBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const RenderBoxModelObject* containerBlock, 2673 int containerLogicalHeight, int bordersPlusPadding,2677 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, 2674 2678 Length logicalTop, Length logicalBottom, Length marginBefore, Length marginAfter, 2675 int& logicalHeightValue, int& marginBeforeValue, int& marginAfterValue, int& logicalTopPos)2679 LayoutUnit& logicalHeightValue, LayoutUnit& marginBeforeValue, LayoutUnit& marginAfterValue, LayoutUnit& logicalTopPos) 2676 2680 { 2677 2681 // 'top' and 'bottom' cannot both be 'auto' because 'top would of been … … 2679 2683 ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto())); 2680 2684 2681 int contentLogicalHeight = logicalHeight() - bordersPlusPadding;2682 2683 int logicalTopValue = 0;2685 LayoutUnit contentLogicalHeight = logicalHeight() - bordersPlusPadding; 2686 2687 LayoutUnit logicalTopValue = 0; 2684 2688 2685 2689 bool logicalHeightIsAuto = logicalHeightLength.isAuto(); … … 2708 2712 logicalTopValue = logicalTop.calcValue(containerLogicalHeight); 2709 2713 2710 const int availableSpace = containerLogicalHeight - (logicalTopValue + logicalHeightValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding);2714 const LayoutUnit availableSpace = containerLogicalHeight - (logicalTopValue + logicalHeightValue + logicalBottom.calcValue(containerLogicalHeight) + bordersPlusPadding); 2711 2715 2712 2716 // Margins are now the only unknown … … 2759 2763 marginAfterValue = marginAfter.calcMinValue(containerLogicalHeight); 2760 2764 2761 const int availableSpace = containerLogicalHeight - (marginBeforeValue + marginAfterValue + bordersPlusPadding);2765 const LayoutUnit availableSpace = containerLogicalHeight - (marginBeforeValue + marginAfterValue + bordersPlusPadding); 2762 2766 2763 2767 // Use rule/case that applies. … … 2777 2781 // RULE 5: (solve of height) 2778 2782 logicalTopValue = logicalTop.calcValue(containerLogicalHeight); 2779 logicalHeightValue = max (0, availableSpace - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight)));2783 logicalHeightValue = max<LayoutUnit>(0, availableSpace - (logicalTopValue + logicalBottom.calcValue(containerLogicalHeight))); 2780 2784 } else if (!logicalTopIsAuto && !logicalHeightIsAuto && logicalBottomIsAuto) { 2781 2785 // RULE 6: (no need solve of bottom) … … 2802 2806 const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container()); 2803 2807 2804 const int containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock);2808 const LayoutUnit containerLogicalWidth = containingBlockLogicalWidthForPositioned(containerBlock); 2805 2809 2806 2810 // To match WinIE, in quirks mode use the parent's 'direction' property … … 2814 2818 Length marginLogicalLeft = isHorizontal ? style()->marginLeft() : style()->marginTop(); 2815 2819 Length marginLogicalRight = isHorizontal ? style()->marginRight() : style()->marginBottom(); 2816 int& marginLogicalLeftAlias = isHorizontal ? m_marginLeft : m_marginTop;2817 int& marginLogicalRightAlias = isHorizontal ? m_marginRight : m_marginBottom;2820 LayoutUnit& marginLogicalLeftAlias = isHorizontal ? m_marginLeft : m_marginTop; 2821 LayoutUnit& marginLogicalRightAlias = isHorizontal ? m_marginRight : m_marginBottom; 2818 2822 2819 2823 /*-----------------------------------------------------------------------*\ … … 2825 2829 // correct max/min in the non-replaced version, are not necessary. 2826 2830 setLogicalWidth(computeReplacedLogicalWidth() + borderAndPaddingLogicalWidth()); 2827 const int availableSpace = containerLogicalWidth - logicalWidth();2831 const LayoutUnit availableSpace = containerLogicalWidth - logicalWidth(); 2828 2832 2829 2833 /*-----------------------------------------------------------------------*\ … … 2854 2858 * 'margin-right' ('margin-left'). 2855 2859 \*-----------------------------------------------------------------------*/ 2856 int logicalLeftValue = 0;2857 int logicalRightValue = 0;2860 LayoutUnit logicalLeftValue = 0; 2861 LayoutUnit logicalRightValue = 0; 2858 2862 2859 2863 if (marginLogicalLeft.isAuto() && marginLogicalRight.isAuto()) { … … 2864 2868 logicalRightValue = logicalRight.calcValue(containerLogicalWidth); 2865 2869 2866 int difference = availableSpace - (logicalLeftValue + logicalRightValue);2870 LayoutUnit difference = availableSpace - (logicalLeftValue + logicalRightValue); 2867 2871 if (difference > 0) { 2868 2872 marginLogicalLeftAlias = difference / 2; // split the difference … … 2927 2931 // NOTE: It is not necessary to solve for 'right' when the direction is 2928 2932 // LTR because the value is not used. 2929 int totalLogicalWidth = logicalWidth() + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias;2933 LayoutUnit totalLogicalWidth = logicalWidth() + logicalLeftValue + logicalRightValue + marginLogicalLeftAlias + marginLogicalRightAlias; 2930 2934 if (totalLogicalWidth > containerLogicalWidth && (containerDirection == RTL)) 2931 2935 logicalLeftValue = containerLogicalWidth - (totalLogicalWidth - logicalLeftValue); … … 2950 2954 } 2951 2955 2952 int logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias;2956 LayoutUnit logicalLeftPos = logicalLeftValue + marginLogicalLeftAlias; 2953 2957 computeLogicalLeftPositionedOffset(logicalLeftPos, this, logicalWidth(), containerBlock, containerLogicalWidth); 2954 2958 setLogicalLeft(logicalLeftPos); … … 2966 2970 const RenderBoxModelObject* containerBlock = toRenderBoxModelObject(container()); 2967 2971 2968 const int containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock);2972 const LayoutUnit containerLogicalHeight = containingBlockLogicalHeightForPositioned(containerBlock); 2969 2973 2970 2974 // Variables to solve. … … 2973 2977 Length marginBefore = style()->marginBefore(); 2974 2978 Length marginAfter = style()->marginAfter(); 2975 int& marginBeforeAlias = isHorizontal ? (isFlipped ? m_marginBottom : m_marginTop) : (isFlipped ? m_marginRight: m_marginLeft);2976 int& marginAfterAlias = isHorizontal ? (isFlipped ? m_marginTop : m_marginBottom) : (isFlipped ? m_marginLeft: m_marginRight);2979 LayoutUnit& marginBeforeAlias = isHorizontal ? (isFlipped ? m_marginBottom : m_marginTop) : (isFlipped ? m_marginRight: m_marginLeft); 2980 LayoutUnit& marginAfterAlias = isHorizontal ? (isFlipped ? m_marginTop : m_marginBottom) : (isFlipped ? m_marginLeft: m_marginRight); 2977 2981 2978 2982 Length logicalTop = style()->logicalTop(); … … 2987 2991 // correct max/min in the non-replaced version, are not necessary. 2988 2992 setLogicalHeight(computeReplacedLogicalHeight() + borderAndPaddingLogicalHeight()); 2989 const int availableSpace = containerLogicalHeight - logicalHeight();2993 const LayoutUnit availableSpace = containerLogicalHeight - logicalHeight(); 2990 2994 2991 2995 /*-----------------------------------------------------------------------*\ … … 3014 3018 * margins must get equal values. 3015 3019 \*-----------------------------------------------------------------------*/ 3016 int logicalTopValue = 0;3017 int logicalBottomValue = 0;3020 LayoutUnit logicalTopValue = 0; 3021 LayoutUnit logicalBottomValue = 0; 3018 3022 3019 3023 if (marginBefore.isAuto() && marginAfter.isAuto()) { … … 3024 3028 logicalBottomValue = logicalBottom.calcValue(containerLogicalHeight); 3025 3029 3026 int difference = availableSpace - (logicalTopValue + logicalBottomValue);3030 LayoutUnit difference = availableSpace - (logicalTopValue + logicalBottomValue); 3027 3031 // NOTE: This may result in negative values. 3028 3032 marginBeforeAlias = difference / 2; // split the difference … … 3080 3084 3081 3085 // Use computed values to calculate the vertical position. 3082 int logicalTopPos = logicalTopValue + marginBeforeAlias;3086 LayoutUnit logicalTopPos = logicalTopValue + marginBeforeAlias; 3083 3087 computeLogicalTopPositionedOffset(logicalTopPos, this, logicalHeight(), containerBlock, containerLogicalHeight); 3084 3088 setLogicalTop(logicalTopPos); 3085 3089 } 3086 3090 3087 IntRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, int* extraWidthToEndOfLine)3091 LayoutRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit* extraWidthToEndOfLine) 3088 3092 { 3089 3093 // VisiblePositions at offsets inside containers either a) refer to the positions before/after … … 3093 3097 3094 3098 // FIXME: What about border and padding? 3095 IntRect rect(x(), y(), caretWidth, height());3099 LayoutRect rect(x(), y(), caretWidth, height()); 3096 3100 bool ltr = box ? box->isLeftToRightDirection() : style()->isLeftToRightDirection(); 3097 3101 3098 3102 if ((!caretOffset) ^ ltr) 3099 rect.move( IntSize(width() - caretWidth, 0));3103 rect.move(LayoutSize(width() - caretWidth, 0)); 3100 3104 3101 3105 if (box) { 3102 3106 RootInlineBox* rootBox = box->root(); 3103 int top = rootBox->lineTop();3107 LayoutUnit top = rootBox->lineTop(); 3104 3108 rect.setY(top); 3105 3109 rect.setHeight(rootBox->lineBottom() - top); … … 3114 3118 // 3115 3119 // FIXME: ignoring :first-line, missing good reason to take care of 3116 int fontHeight = style()->fontMetrics().height();3120 LayoutUnit fontHeight = style()->fontMetrics().height(); 3117 3121 if (fontHeight > rect.height() || (!isReplaced() && !isTable())) 3118 3122 rect.setHeight(fontHeight); … … 3320 3324 } 3321 3325 3322 int RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const3326 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const 3323 3327 { 3324 3328 if (isReplaced()) … … 3327 3331 } 3328 3332 3329 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const3333 LayoutUnit RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, LineDirectionMode direction, LinePositionMode /*linePositionMode*/) const 3330 3334 { 3331 3335 if (isReplaced()) { 3332 int result = direction == HorizontalLine ? m_marginTop + height() + m_marginBottom : m_marginRight + width() + m_marginLeft;3336 LayoutUnit result = direction == HorizontalLine ? m_marginTop + height() + m_marginBottom : m_marginRight + width() + m_marginLeft; 3333 3337 if (baselineType == AlphabeticBaseline) 3334 3338 return result; … … 3351 3355 } 3352 3356 3353 IntRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* parentStyle) const3354 { 3355 IntRect rect = visualOverflowRectForPropagation(parentStyle);3357 LayoutRect RenderBox::logicalVisualOverflowRectForPropagation(RenderStyle* parentStyle) const 3358 { 3359 LayoutRect rect = visualOverflowRectForPropagation(parentStyle); 3356 3360 if (!parentStyle->isHorizontalWritingMode()) 3357 3361 return rect.transposedRect(); … … 3359 3363 } 3360 3364 3361 IntRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle) const3365 LayoutRect RenderBox::visualOverflowRectForPropagation(RenderStyle* parentStyle) const 3362 3366 { 3363 3367 // If the writing modes of the child and parent match, then we don't have to 3364 3368 // do anything fancy. Just return the result. 3365 IntRect rect = visualOverflowRect();3369 LayoutRect rect = visualOverflowRect(); 3366 3370 if (parentStyle->writingMode() == style()->writingMode()) 3367 3371 return rect; … … 3377 3381 } 3378 3382 3379 IntRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* parentStyle) const3380 { 3381 IntRect rect = layoutOverflowRectForPropagation(parentStyle);3383 LayoutRect RenderBox::logicalLayoutOverflowRectForPropagation(RenderStyle* parentStyle) const 3384 { 3385 LayoutRect rect = layoutOverflowRectForPropagation(parentStyle); 3382 3386 if (!parentStyle->isHorizontalWritingMode()) 3383 3387 return rect.transposedRect(); … … 3385 3389 } 3386 3390 3387 IntRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const3391 LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const 3388 3392 { 3389 3393 // Only propagate interior layout overflow if we don't clip it. 3390 IntRect rect = borderBoxRect();3394 LayoutRect rect = borderBoxRect(); 3391 3395 if (!hasOverflowClip()) 3392 3396 rect.unite(layoutOverflowRect()); … … 3493 3497 } 3494 3498 3495 IntSize RenderBox::locationOffsetIncludingFlipping() const3499 LayoutSize RenderBox::locationOffsetIncludingFlipping() const 3496 3500 { 3497 3501 RenderBlock* containerBlock = containingBlock(); … … 3499 3503 return locationOffset(); 3500 3504 3501 IntRect rect(frameRect());3505 LayoutRect rect(frameRect()); 3502 3506 containerBlock->flipForWritingMode(rect); // FIXME: This is wrong if we are an absolutely positioned object enclosed by a relative-positioned inline. 3503 return IntSize(rect.x(), rect.y());3507 return LayoutSize(rect.x(), rect.y()); 3504 3508 } 3505 3509 -
trunk/Source/WebCore/rendering/RenderBox.h
r92438 r93284 128 128 129 129 // Bounds of the outline box in absolute coords. Respects transforms 130 virtual IntRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, IntPoint* cachedOffsetToRepaintContainer) const;130 virtual LayoutRect outlineBoundsForRepaint(RenderBoxModelObject* /*repaintContainer*/, LayoutPoint* cachedOffsetToRepaintContainer) const; 131 131 virtual void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&); 132 132 … … 193 193 // textareas can scroll shadow content (but pretend that they are the objects that are 194 194 // scrolling). 195 virtual int scrollLeft() const;196 virtual int scrollTop() const;197 virtual int scrollWidth() const;198 virtual int scrollHeight() const;199 virtual void setScrollLeft( int);200 virtual void setScrollTop( int);195 virtual LayoutUnit scrollLeft() const; 196 virtual LayoutUnit scrollTop() const; 197 virtual LayoutUnit scrollWidth() const; 198 virtual LayoutUnit scrollHeight() const; 199 virtual void setScrollLeft(LayoutUnit); 200 virtual void setScrollTop(LayoutUnit); 201 201 202 202 virtual LayoutUnit marginTop() const { return m_marginTop; } … … 234 234 int reflectionOffset() const; 235 235 // Given a rect in the object's coordinate space, returns the corresponding rect in the reflection. 236 IntRect reflectedRect(const IntRect&) const;236 LayoutRect reflectedRect(const LayoutRect&) const; 237 237 238 238 virtual void layout(); … … 256 256 LayoutUnit computeContentBoxLogicalHeight(LayoutUnit height) const; 257 257 258 virtual void borderFitAdjust( IntRect&) const { } // Shrink the box in which the border paints if border-fit is set.258 virtual void borderFitAdjust(LayoutRect&) const { } // Shrink the box in which the border paints if border-fit is set. 259 259 260 260 // Resolve auto margins in the inline direction of the containing block so that objects can be pushed to the start, middle or end … … 277 277 void deleteLineBoxWrapper(); 278 278 279 virtual IntRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const;280 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false) const;279 virtual LayoutRect clippedOverflowRectForRepaint(RenderBoxModelObject* repaintContainer) const; 280 virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect&, bool fixed = false) const; 281 281 282 282 virtual void repaintDuringLayoutIfMoved(const LayoutRect&); 283 283 284 virtual int containingBlockLogicalWidthForContent() const;285 int perpendicularContainingBlockLogicalHeight() const;284 virtual LayoutUnit containingBlockLogicalWidthForContent() const; 285 LayoutUnit perpendicularContainingBlockLogicalHeight() const; 286 286 287 287 virtual void computeLogicalWidth(); … … 293 293 } 294 294 295 virtual IntSize intrinsicSize() const { return IntSize(); }296 int intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); }297 int intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); }295 virtual LayoutSize intrinsicSize() const { return LayoutSize(); } 296 LayoutUnit intrinsicLogicalWidth() const { return style()->isHorizontalWritingMode() ? intrinsicSize().width() : intrinsicSize().height(); } 297 LayoutUnit intrinsicLogicalHeight() const { return style()->isHorizontalWritingMode() ? intrinsicSize().height() : intrinsicSize().width(); } 298 298 299 299 // Whether or not the element shrinks to its intrinsic width (rather than filling the width … … 324 324 LayoutUnit availableHeight() const { return style()->isHorizontalWritingMode() ? availableLogicalHeight() : availableLogicalWidth(); } 325 325 326 virtual int verticalScrollbarWidth() const;327 int horizontalScrollbarHeight() const;328 int scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }326 virtual LayoutUnit verticalScrollbarWidth() const; 327 LayoutUnit horizontalScrollbarHeight() const; 328 LayoutUnit scrollbarLogicalHeight() const { return style()->isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); } 329 329 virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0); 330 330 virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Node** stopNode = 0); … … 340 340 bool scrollsOverflowY() const { return hasOverflowClip() && (style()->overflowY() == OSCROLL || hasAutoVerticalScrollbar()); } 341 341 342 virtual IntRect localCaretRect(InlineBox*, int caretOffset, int* extraWidthToEndOfLine = 0);343 344 virtual IntRect overflowClipRect(const IntPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize);345 IntRect clipRect(const IntPoint& location);342 virtual LayoutRect localCaretRect(InlineBox*, int caretOffset, LayoutUnit* extraWidthToEndOfLine = 0); 343 344 virtual LayoutRect overflowClipRect(const LayoutPoint& location, OverlayScrollbarSizeRelevancy = IgnoreOverlayScrollbarSize); 345 LayoutRect clipRect(const LayoutPoint& location); 346 346 virtual bool hasControlClip() const { return false; } 347 virtual IntRect controlClipRect(const IntPoint&) const { return IntRect(); }347 virtual LayoutRect controlClipRect(const LayoutPoint&) const { return LayoutRect(); } 348 348 bool pushContentsClip(PaintInfo&, const LayoutPoint& accumulatedOffset); 349 349 void popContentsClip(PaintInfo&, PaintPhase originalPhase, const LayoutPoint& accumulatedOffset); … … 367 367 } 368 368 369 IntRect maskClipRect();369 LayoutRect maskClipRect(); 370 370 371 371 virtual VisiblePosition positionForPoint(const LayoutPoint&); … … 375 375 RenderLayer* enclosingFloatPaintingLayer() const; 376 376 377 virtual int firstLineBoxBaseline() const { return -1; }378 virtual int lastLineBoxBaseline() const { return -1; }377 virtual LayoutUnit firstLineBoxBaseline() const { return -1; } 378 virtual LayoutUnit lastLineBoxBaseline() const { return -1; } 379 379 380 380 bool shrinkToAvoidFloats() const; … … 387 387 bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); } 388 388 389 virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;390 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const;389 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; 390 virtual LayoutUnit baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const; 391 391 392 392 enum FlippingAdjustment { ChildToParentFlippingAdjustment, ParentToChildFlippingAdjustment }; … … 399 399 FloatPoint flipForWritingMode(const FloatPoint&) const; 400 400 void flipForWritingMode(FloatRect&) const; 401 IntSize locationOffsetIncludingFlipping() const;402 403 IntRect logicalVisualOverflowRectForPropagation(RenderStyle*) const;404 IntRect visualOverflowRectForPropagation(RenderStyle*) const;405 IntRect logicalLayoutOverflowRectForPropagation(RenderStyle*) const;406 IntRect layoutOverflowRectForPropagation(RenderStyle*) const;401 LayoutSize locationOffsetIncludingFlipping() const; 402 403 LayoutRect logicalVisualOverflowRectForPropagation(RenderStyle*) const; 404 LayoutRect visualOverflowRectForPropagation(RenderStyle*) const; 405 LayoutRect logicalLayoutOverflowRectForPropagation(RenderStyle*) const; 406 LayoutRect layoutOverflowRectForPropagation(RenderStyle*) const; 407 407 408 408 RenderOverflow* hasRenderOverflow() const { return m_overflow.get(); } … … 451 451 void computePositionedLogicalHeight(); 452 452 void computePositionedLogicalWidthUsing(Length logicalWidth, const RenderBoxModelObject* containerBlock, TextDirection containerDirection, 453 int containerLogicalWidth, int bordersPlusPadding,453 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, 454 454 Length logicalLeft, Length logicalRight, Length marginLogicalLeft, Length marginLogicalRight, 455 int& logicalWidthValue, int& marginLogicalLeftValue, int& marginLogicalRightValue, int& logicalLeftPos);455 LayoutUnit& logicalWidthValue, LayoutUnit& marginLogicalLeftValue, LayoutUnit& marginLogicalRightValue, LayoutUnit& logicalLeftPos); 456 456 void computePositionedLogicalHeightUsing(Length logicalHeight, const RenderBoxModelObject* containerBlock, 457 int containerLogicalHeight, int bordersPlusPadding,457 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, 458 458 Length logicalTop, Length logicalBottom, Length marginLogicalTop, Length marginLogicalBottom, 459 int& logicalHeightValue, int& marginLogicalTopValue, int& marginLogicalBottomValue, int& logicalTopPos);459 LayoutUnit& logicalHeightValue, LayoutUnit& marginLogicalTopValue, LayoutUnit& marginLogicalBottomValue, LayoutUnit& logicalTopPos); 460 460 461 461 void computePositionedLogicalHeightReplaced();
Note: See TracChangeset
for help on using the changeset viewer.