Changeset 107880 in webkit
- Timestamp:
- Feb 15, 2012 8:49:03 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107879 r107880 1 2012-02-15 Levi Weintraub <leviw@chromium.org> 2 3 Add zeroLayoutUnit constant. 4 https://bugs.webkit.org/show_bug.cgi?id=78747 5 6 Reviewed by Eric Seidel. 7 8 Converting call sites where LayoutUnits and raw zeros are in ternary operations 9 and templatized function calls (like std::max and min) to use a new zeroLayoutUnit 10 constant instead of the raw zero. 11 12 No new tests. No change in behavior. 13 14 * rendering/InlineFlowBox.cpp: 15 (WebCore::InlineFlowBox::placeBoxesInBlockDirection): 16 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow): 17 (WebCore::InlineFlowBox::paintFillLayer): 18 (WebCore::InlineFlowBox::paintBoxDecorations): 19 (WebCore::InlineFlowBox::paintMask): 20 (WebCore::InlineFlowBox::computeOverAnnotationAdjustment): 21 * rendering/LayoutTypes.h: 22 (WebCore): 23 * rendering/RenderBlock.cpp: 24 (WebCore::RenderBlock::MarginInfo::MarginInfo): 25 (WebCore::RenderBlock::adjustFloatingBlock): 26 (WebCore::RenderBlock::paintColumnRules): 27 (WebCore::RenderBlock::nextFloatLogicalBottomBelow): 28 (WebCore::RenderBlock::getClearDelta): 29 (WebCore::RenderBlock::computeInlinePreferredLogicalWidths): 30 (WebCore::getHeightForLineCount): 31 (WebCore::RenderBlock::adjustForUnsplittableChild): 32 * rendering/RenderBlock.h: 33 (WebCore::RenderBlock::paginationStrut): 34 (WebCore::RenderBlock::pageLogicalOffset): 35 * rendering/RenderBlockLineLayout.cpp: 36 (WebCore::LineLayoutState::updateRepaintRangeFromBox): 37 (WebCore::RenderBlock::addOverflowFromInlineChildren): 38 * rendering/RenderBox.cpp: 39 (WebCore::RenderBox::positionForPoint): 40 * rendering/RenderBox.h: 41 (WebCore::RenderBox::minYVisualOverflow): 42 (WebCore::RenderBox::minXVisualOverflow): 43 (RenderBox): 44 * rendering/RenderBoxModelObject.cpp: 45 (WebCore::RenderBoxModelObject::offsetLeft): 46 (WebCore::RenderBoxModelObject::offsetTop): 47 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 48 * rendering/RenderFieldset.cpp: 49 (WebCore::RenderFieldset::paintBoxDecorations): 50 * rendering/RenderFileUploadControl.cpp: 51 (WebCore::nodeWidth): 52 * rendering/RenderFlowThread.cpp: 53 (WebCore::RenderFlowThread::layout): 54 (WebCore::RenderFlowThread::computeLogicalWidth): 55 * rendering/RenderInline.cpp: 56 (WebCore::RenderInline::paintOutlineForLine): 57 * rendering/RenderLayer.cpp: 58 (WebCore::RenderLayer::resize): 59 * rendering/RenderListBox.cpp: 60 (WebCore::RenderListBox::listIndexAtOffset): 61 (WebCore::RenderListBox::verticalScrollbarWidth): 62 * rendering/RenderMarquee.cpp: 63 (WebCore::RenderMarquee::computePosition): 64 * rendering/RenderObject.cpp: 65 (WebCore::RenderObject::repaintAfterLayoutIfNeeded): 66 * rendering/RenderReplaced.cpp: 67 (WebCore::RenderReplaced::computePreferredLogicalWidths): 68 * rendering/RenderTable.cpp: 69 (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth): 70 (WebCore::RenderTable::layout): 71 * rendering/RenderTable.h: 72 (WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection): 73 * rendering/mathml/RenderMathMLSubSup.cpp: 74 (WebCore::RenderMathMLSubSup::layout): 75 1 76 2012-02-15 Alexey Proskuryakov <ap@apple.com> 2 77 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r107874 r107880 658 658 RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); 659 659 if (RenderRubyBase* rubyBase = rubyRun->rubyBase()) { 660 LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : 0);661 LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : 0);660 LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : zeroLayoutUnit); 661 LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : zeroLayoutUnit); 662 662 newLogicalTop += !renderer()->style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading; 663 663 boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading); … … 788 788 style->getBorderImageInlineDirectionOutsets(borderOutsetLogicalLeft, borderOutsetLogicalRight); 789 789 790 LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : 0;791 LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : 0;790 LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : zeroLayoutUnit; 791 LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : zeroLayoutUnit; 792 792 793 793 LayoutUnit logicalLeftVisualOverflow = min(pixelSnappedLogicalLeft() - outsetLogicalLeft, logicalVisualOverflow.x()); … … 1117 1117 totalLogicalWidth += curr->logicalWidth(); 1118 1118 } 1119 LayoutUnit stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : 0);1120 LayoutUnit stripY = rect.y() - (isHorizontal() ? 0: logicalOffsetOnLine);1119 LayoutUnit stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit); 1120 LayoutUnit stripY = rect.y() - (isHorizontal() ? zeroLayoutUnit : logicalOffsetOnLine); 1121 1121 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : width(); 1122 1122 LayoutUnit stripHeight = isHorizontal() ? height() : totalLogicalWidth; … … 1248 1248 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1249 1249 totalLogicalWidth += curr->logicalWidth(); 1250 LayoutUnit stripX = adjustedPaintoffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);1251 LayoutUnit stripY = adjustedPaintoffset.y() - (isHorizontal() ? 0: logicalOffsetOnLine);1250 LayoutUnit stripX = adjustedPaintoffset.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit); 1251 LayoutUnit stripY = adjustedPaintoffset.y() - (isHorizontal() ? zeroLayoutUnit : logicalOffsetOnLine); 1252 1252 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); 1253 1253 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; … … 1319 1319 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1320 1320 totalLogicalWidth += curr->logicalWidth(); 1321 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0);1322 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0: logicalOffsetOnLine);1321 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit); 1322 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? zeroLayoutUnit : logicalOffsetOnLine); 1323 1323 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); 1324 1324 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; … … 1417 1417 1418 1418 if (!rubyRun->style()->isFlippedLinesWritingMode()) { 1419 LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : 0);1419 LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : zeroLayoutUnit); 1420 1420 if (topOfFirstRubyTextLine >= 0) 1421 1421 continue; -
trunk/Source/WebCore/rendering/LayoutTypes.h
r107731 r107880 46 46 typedef IntSize LayoutSize; 47 47 typedef IntRect LayoutRect; 48 49 const LayoutUnit zeroLayoutUnit = 0; 48 50 49 51 inline LayoutRect enclosingLayoutRect(const FloatRect& rect) -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r107650 r107880 115 115 || blockStyle->marginAfterCollapse() == MDISCARD; 116 116 117 m_positiveMargin = m_canCollapseMarginBeforeWithChildren ? block->maxPositiveMarginBefore() : 0;118 m_negativeMargin = m_canCollapseMarginBeforeWithChildren ? block->maxNegativeMarginBefore() : 0;117 m_positiveMargin = m_canCollapseMarginBeforeWithChildren ? block->maxPositiveMarginBefore() : zeroLayoutUnit; 118 m_negativeMargin = m_canCollapseMarginBeforeWithChildren ? block->maxNegativeMarginBefore() : zeroLayoutUnit; 119 119 } 120 120 … … 1612 1612 // http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for 1613 1613 // an example of this scenario. 1614 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? 0: marginInfo.margin();1614 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? zeroLayoutUnit : marginInfo.margin(); 1615 1615 setLogicalHeight(logicalHeight() + marginOffset); 1616 1616 positionNewFloats(); … … 2484 2484 2485 2485 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) { 2486 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? 0: contentLogicalWidth();2486 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? zeroLayoutUnit : contentLogicalWidth(); 2487 2487 LayoutUnit ruleAdd = logicalLeftOffsetForContent(); 2488 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? 0: contentLogicalWidth();2488 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? zeroLayoutUnit : contentLogicalWidth(); 2489 2489 LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); 2490 2490 BoxSide boxSide = isHorizontalWritingMode() … … 3790 3790 } 3791 3791 3792 return bottom == numeric_limits<LayoutUnit>::max() ? 0: bottom;3792 return bottom == numeric_limits<LayoutUnit>::max() ? zeroLayoutUnit : bottom; 3793 3793 } 3794 3794 … … 4187 4187 4188 4188 // 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). 4189 LayoutUnit result = clearSet ? max<LayoutUnit>(0, logicalBottom - logicalTop) : 0;4189 LayoutUnit result = clearSet ? max<LayoutUnit>(0, logicalBottom - logicalTop) : zeroLayoutUnit; 4190 4190 if (!result && child->avoidsFloats()) { 4191 4191 LayoutUnit newLogicalTop = logicalTop; … … 5173 5173 RenderStyle* styleToUse = style(); 5174 5174 RenderBlock* containingBlock = this->containingBlock(); 5175 LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : 0;5175 LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : zeroLayoutUnit; 5176 5176 5177 5177 // If we are at the start of a line, we want to ignore all white-space. … … 5945 5945 for (RootInlineBox* box = block->firstRootBox(); box; box = box->nextRootBox()) { 5946 5946 if (++count == l) 5947 return box->lineBottom() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0);5947 return box->lineBottom() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : zeroLayoutUnit); 5948 5948 } 5949 5949 } … … 5954 5954 int result = getHeightForLineCount(toRenderBlock(obj), l, false, count); 5955 5955 if (result != -1) 5956 return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : 0);5956 return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : zeroLayoutUnit); 5957 5957 } 5958 5958 else if (!obj->isFloatingOrPositioned() && !obj->isRunIn()) … … 6522 6522 if (!isUnsplittable) 6523 6523 return logicalOffset; 6524 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : 0);6524 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : zeroLayoutUnit); 6525 6525 LayoutState* layoutState = view()->layoutState(); 6526 6526 if (layoutState->m_columnInfo) -
trunk/Source/WebCore/rendering/RenderBlock.h
r107613 r107880 243 243 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; 244 244 245 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : 0; }245 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : zeroLayoutUnit; } 246 246 void setPaginationStrut(LayoutUnit); 247 247 248 248 // The page logical offset is the object's offset from the top of the page in the page progression 249 249 // direction (so an x-offset in vertical text and a y-offset for horizontal text). 250 int pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : 0; }250 LayoutUnit pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : zeroLayoutUnit; } 251 251 void setPageLogicalOffset(int); 252 252 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r107733 r107880 1094 1094 { 1095 1095 m_usesRepaintBounds = true; 1096 m_repaintLogicalTop = min(m_repaintLogicalTop, box->logicalTopVisualOverflow() + min(paginationDelta, 0));1097 m_repaintLogicalBottom = max(m_repaintLogicalBottom, box->logicalBottomVisualOverflow() + max(paginationDelta, 0));1096 m_repaintLogicalTop = min(m_repaintLogicalTop, box->logicalTopVisualOverflow() + min(paginationDelta, zeroLayoutUnit)); 1097 m_repaintLogicalBottom = max(m_repaintLogicalBottom, box->logicalBottomVisualOverflow() + max(paginationDelta, zeroLayoutUnit)); 1098 1098 } 1099 1099 … … 2652 2652 void RenderBlock::addOverflowFromInlineChildren() 2653 2653 { 2654 LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : 0;2654 LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : zeroLayoutUnit; 2655 2655 // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to. 2656 2656 if (hasOverflowClip() && !endPadding && node() && node()->rendererIsEditable() && node() == node()->rootEditableElement() && style()->isLeftToRightDirection()) -
trunk/Source/WebCore/rendering/RenderBox.cpp
r107836 r107880 3446 3446 RenderBox* renderer = toRenderBox(renderObject); 3447 3447 3448 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? 0: renderer->y());3448 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? zeroLayoutUnit : renderer->y()); 3449 3449 LayoutUnit bottom = top + renderer->contentHeight(); 3450 LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? 0: renderer->x());3450 LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? zeroLayoutUnit : renderer->x()); 3451 3451 LayoutUnit right = left + renderer->contentWidth(); 3452 3452 -
trunk/Source/WebCore/rendering/RenderBox.h
r107836 r107880 162 162 163 163 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); } 164 LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : 0; }164 LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : zeroLayoutUnit; } 165 165 LayoutUnit maxYVisualOverflow() const { return m_overflow ? m_overflow->maxYVisualOverflow() : height(); } 166 LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : 0; }166 LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : zeroLayoutUnit; } 167 167 LayoutUnit maxXVisualOverflow() const { return m_overflow ? m_overflow->maxXVisualOverflow() : width(); } 168 168 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? minXVisualOverflow() : minYVisualOverflow(); } … … 315 315 316 316 RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const; 317 void computeLogicalWidthInRegion(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = 0);317 void computeLogicalWidthInRegion(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = zeroLayoutUnit); 318 318 319 319 bool stretchesToViewport() const -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r107874 r107880 454 454 455 455 RenderBoxModelObject* offsetPar = offsetParent(); 456 LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : 0);456 LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : zeroLayoutUnit); 457 457 458 458 // If the offsetParent of the element is null, or is the HTML body element, … … 488 488 489 489 RenderBoxModelObject* offsetPar = offsetParent(); 490 LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : 0);490 LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : zeroLayoutUnit); 491 491 492 492 // If the offsetParent of the element is null, or is the HTML body element, … … 704 704 } 705 705 706 LayoutUnit bLeft = includeLeftEdge ? borderLeft() : 0;707 LayoutUnit bRight = includeRightEdge ? borderRight() : 0;708 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : 0;709 LayoutUnit pRight = includeRightEdge ? paddingRight() : 0;706 LayoutUnit bLeft = includeLeftEdge ? borderLeft() : zeroLayoutUnit; 707 LayoutUnit bRight = includeRightEdge ? borderRight() : zeroLayoutUnit; 708 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : zeroLayoutUnit; 709 LayoutUnit pRight = includeRightEdge ? paddingRight() : zeroLayoutUnit; 710 710 711 711 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithLocalScrolling); … … 726 726 // Clip to the padding or content boxes as necessary. 727 727 bool includePadding = bgLayer->clip() == ContentFillBox; 728 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : 0),729 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : 0),730 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : 0),731 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0));728 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : zeroLayoutUnit), 729 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : zeroLayoutUnit), 730 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : zeroLayoutUnit), 731 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : zeroLayoutUnit)); 732 732 backgroundClipStateSaver.save(); 733 733 context->clip(clipRect); -
trunk/Source/WebCore/rendering/RenderFieldset.cpp
r107836 r107880 133 133 // https://bugs.webkit.org/show_bug.cgi?id=47236 134 134 if (style()->isHorizontalWritingMode()) { 135 LayoutUnit yOff = (legend->y() > 0) ? 0: (legend->height() - borderTop()) / 2;135 LayoutUnit yOff = (legend->y() > 0) ? zeroLayoutUnit : (legend->height() - borderTop()) / 2; 136 136 paintRect.setHeight(paintRect.height() - yOff); 137 137 paintRect.setY(paintRect.y() + yOff); 138 138 } else { 139 LayoutUnit xOff = (legend->x() > 0) ? 0: (legend->width() - borderLeft()) / 2;139 LayoutUnit xOff = (legend->x() > 0) ? zeroLayoutUnit : (legend->width() - borderLeft()) / 2; 140 140 paintRect.setWidth(paintRect.width() - xOff); 141 141 paintRect.setX(paintRect.x() + xOff); -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r107706 r107880 87 87 static int nodeWidth(Node* node) 88 88 { 89 return node ? node->renderBox()->width() : 0;89 return node ? node->renderBox()->width() : zeroLayoutUnit; 90 90 } 91 91 -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r107650 r107880 383 383 LayoutRect regionRect; 384 384 if (isHorizontalWritingMode()) { 385 regionRect = LayoutRect(style()->direction() == LTR ? 0: logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());385 regionRect = LayoutRect(style()->direction() == LTR ? zeroLayoutUnit : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight()); 386 386 logicalHeight += regionRect.height(); 387 387 } else { 388 regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? 0: logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());388 regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? zeroLayoutUnit : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight()); 389 389 logicalHeight += regionRect.width(); 390 390 } … … 420 420 LayoutUnit regionLogicalWidth = isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight(); 421 421 if (regionLogicalWidth != logicalWidth) { 422 LayoutUnit logicalLeft = style()->direction() == LTR ? 0: logicalWidth - regionLogicalWidth;422 LayoutUnit logicalLeft = style()->direction() == LTR ? zeroLayoutUnit : logicalWidth - regionLogicalWidth; 423 423 region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false); 424 424 } -
trunk/Source/WebCore/rendering/RenderInline.cpp
r106968 r107880 1419 1419 drawLineForBoxSide(graphicsContext, 1420 1420 left - outlineWidth, 1421 top - (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.maxX() - 1) <= thisline.x() ? outlineWidth : 0),1421 top - (lastline.isEmpty() || thisline.x() < lastline.x() || (lastline.maxX() - 1) <= thisline.x() ? outlineWidth : zeroLayoutUnit), 1422 1422 left, 1423 bottom + (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? outlineWidth : 0),1423 bottom + (nextline.isEmpty() || thisline.x() <= nextline.x() || (nextline.maxX() - 1) <= thisline.x() ? outlineWidth : zeroLayoutUnit), 1424 1424 BSLeft, 1425 1425 outlineColor, outlineStyle, … … 1431 1431 drawLineForBoxSide(graphicsContext, 1432 1432 right, 1433 top - (lastline.isEmpty() || lastline.maxX() < thisline.maxX() || (thisline.maxX() - 1) <= lastline.x() ? outlineWidth : 0),1433 top - (lastline.isEmpty() || lastline.maxX() < thisline.maxX() || (thisline.maxX() - 1) <= lastline.x() ? outlineWidth : zeroLayoutUnit), 1434 1434 right + outlineWidth, 1435 bottom + (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? outlineWidth : 0),1435 bottom + (nextline.isEmpty() || nextline.maxX() <= thisline.maxX() || (thisline.maxX() - 1) <= nextline.x() ? outlineWidth : zeroLayoutUnit), 1436 1436 BSRight, 1437 1437 outlineColor, outlineStyle, -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r107731 r107880 1748 1748 styleDeclaration->setProperty(CSSPropertyMarginRight, String::number(renderer->marginRight() / zoomFactor) + "px", false); 1749 1749 } 1750 LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? 0: renderer->borderAndPaddingWidth());1750 LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? zeroLayoutUnit : renderer->borderAndPaddingWidth()); 1751 1751 baseWidth = baseWidth / zoomFactor; 1752 1752 styleDeclaration->setProperty(CSSPropertyWidth, String::number(baseWidth + difference.width()) + "px", false); … … 1759 1759 styleDeclaration->setProperty(CSSPropertyMarginBottom, String::number(renderer->marginBottom() / zoomFactor) + "px", false); 1760 1760 } 1761 LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? 0: renderer->borderAndPaddingHeight());1761 LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? zeroLayoutUnit : renderer->borderAndPaddingHeight()); 1762 1762 baseHeight = baseHeight / zoomFactor; 1763 1763 styleDeclaration->setProperty(CSSPropertyHeight, String::number(baseHeight + difference.height()) + "px", false); -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r107429 r107880 474 474 return -1; 475 475 476 LayoutUnit scrollbarWidth = m_vBar ? m_vBar->width() : LayoutUnit(0);476 int scrollbarWidth = m_vBar ? m_vBar->width() : 0; 477 477 if (offset.width() < borderLeft() + paddingLeft() || offset.width() > width() - borderRight() - paddingRight() - scrollbarWidth) 478 478 return -1; … … 639 639 int RenderListBox::verticalScrollbarWidth() const 640 640 { 641 return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : LayoutUnit(0);641 return m_vBar && !m_vBar->isOverlayScrollbar() ? m_vBar->width() : 0; 642 642 } 643 643 -
trunk/Source/WebCore/rendering/RenderMarquee.cpp
r105772 r107880 126 126 if (dir == MRIGHT) { 127 127 if (stopAtContentEdge) 128 return max( 0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));128 return max(zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth)); 129 129 else 130 130 return ltr ? contentWidth : clientWidth; … … 132 132 else { 133 133 if (stopAtContentEdge) 134 return min( 0, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));134 return min(zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth)); 135 135 else 136 136 return ltr ? -clientWidth : -contentWidth; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r107622 r107880 1418 1418 style()->getBoxShadowHorizontalExtent(shadowLeft, shadowRight); 1419 1419 1420 LayoutUnit borderRight = isBox() ? toRenderBox(this)->borderRight() : LayoutUnit(0);1421 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : LayoutUnit(0);1420 LayoutUnit borderRight = isBox() ? toRenderBox(this)->borderRight() : zeroLayoutUnit; 1421 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : zeroLayoutUnit; 1422 1422 LayoutUnit borderWidth = max<LayoutUnit>(-outlineStyle->outlineOffset(), max(borderRight, max<LayoutUnit>(style()->borderTopRightRadius().width().calcValue(boxWidth), style()->borderBottomRightRadius().width().calcValue(boxWidth)))) + max(ow, shadowRight); 1423 1423 LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth, … … 1437 1437 style()->getBoxShadowVerticalExtent(shadowTop, shadowBottom); 1438 1438 1439 LayoutUnit borderBottom = isBox() ? toRenderBox(this)->borderBottom() : LayoutUnit(0);1440 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : LayoutUnit(0);1439 LayoutUnit borderBottom = isBox() ? toRenderBox(this)->borderBottom() : zeroLayoutUnit; 1440 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : zeroLayoutUnit; 1441 1441 LayoutUnit borderHeight = max<LayoutUnit>(-outlineStyle->outlineOffset(), max(borderBottom, max<LayoutUnit>(style()->borderBottomLeftRadius().height().calcValue(boxHeight), style()->borderBottomRightRadius().height().calcValue(boxHeight)))) + max(ow, shadowBottom); 1442 1442 LayoutRect bottomRect(newOutlineBox.x(), -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r106492 r107880 439 439 440 440 if (style()->maxWidth().isFixed()) 441 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : 0));441 m_maxPreferredLogicalWidth = min(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : zeroLayoutUnit)); 442 442 443 443 if (style()->width().isPercent() || style()->height().isPercent() -
trunk/Source/WebCore/rendering/RenderTable.cpp
r107836 r107880 273 273 if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) { 274 274 recalcBordersInRowDirection(); 275 borders = borderStart() + borderEnd() + (collapseBorders() ? 0: paddingStart() + paddingEnd());275 borders = borderStart() + borderEnd() + (collapseBorders() ? zeroLayoutUnit : paddingStart() + paddingEnd()); 276 276 } 277 277 return styleLogicalWidth.calcMinValue(availableWidth) + borders; … … 371 371 } 372 372 373 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? 0: paddingBefore());374 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? 0: paddingAfter());373 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? zeroLayoutUnit : paddingBefore()); 374 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? zeroLayoutUnit : paddingAfter()); 375 375 376 376 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); … … 383 383 if (logicalHeightLength.isFixed()) { 384 384 // HTML tables size as though CSS height includes border/padding, CSS tables do not. 385 LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : 0;385 LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : zeroLayoutUnit; 386 386 computedLogicalHeight = logicalHeightLength.value() - borders; 387 387 } else if (logicalHeightLength.isPercent()) -
trunk/Source/WebCore/rendering/RenderTable.h
r106479 r107880 173 173 { 174 174 return borderStart() + borderEnd() + 175 (collapseBorders() ? 0: (paddingStart() + paddingEnd() + (numEffCols() + 1) * hBorderSpacing()));175 (collapseBorders() ? zeroLayoutUnit : (paddingStart() + paddingEnd() + (numEffCols() + 1) * hBorderSpacing())); 176 176 } 177 177 -
trunk/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
r107473 r107880 163 163 current = current->nextSibling(); 164 164 } 165 LayoutUnit heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : 0;165 LayoutUnit heightDiff = m_scripts ? (m_scripts->offsetHeight() - maxHeight) / 2 : zeroLayoutUnit; 166 166 if (heightDiff < 0) 167 167 heightDiff = 0;
Note: See TracChangeset
for help on using the changeset viewer.