Changeset 113665 in webkit
- Timestamp:
- Apr 9, 2012 7:54:29 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r113663 r113665 1 2012-04-09 Emil A Eklund <eae@chromium.org> 2 3 Replace numeric_limits<LayoutUnit>::min/max with constants 4 https://bugs.webkit.org/show_bug.cgi?id=83497 5 6 Reviewed by Eric Seidel. 7 8 Replace all uses of numeric_limits<LayoutUnit>::min/max with 9 MIN_LAYOUT_UNIT and MAX_LAYOUT_UNIT respectively in preparation for the 10 switch to subpixel layout. 11 12 Also rename zeroLayoutUnit to ZERO_LAYOUT_UNIT to be consistent and 13 change it to be a define as to avoid global initializer warnings once we 14 change the definition of LayoutUnit from int to FractionalLayoutUnit. 15 16 No new tests, no change in functionality. 17 18 * dom/ElementRareData.h: 19 (WebCore::defaultMinimumSizeForResizing): 20 * editing/FrameSelection.cpp: 21 (WebCore::NoXPosForVerticalArrowNavigation): 22 * platform/graphics/transforms/TransformationMatrix.cpp: 23 (WebCore::clampEdgeValue): 24 (WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad): 25 * rendering/AutoTableLayout.cpp: 26 (WebCore::AutoTableLayout::computePreferredLogicalWidths): 27 * rendering/InlineFlowBox.cpp: 28 (WebCore::InlineFlowBox::placeBoxesInBlockDirection): 29 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow): 30 (WebCore::InlineFlowBox::paintFillLayer): 31 (WebCore::InlineFlowBox::paintBoxDecorations): 32 (WebCore::InlineFlowBox::paintMask): 33 (WebCore::InlineFlowBox::computeOverAnnotationAdjustment): 34 * rendering/LayoutTypes.h: 35 (WebCore): 36 * rendering/RenderBlock.cpp: 37 (WebCore::RenderBlock::MarginInfo::MarginInfo): 38 (WebCore::RenderBlock::computeInitialRegionRangeForBlock): 39 (WebCore::RenderBlock::adjustFloatingBlock): 40 (WebCore::RenderBlock::paintColumnRules): 41 (WebCore::RenderBlock::removeFloatingObject): 42 (WebCore::RenderBlock::nextFloatLogicalBottomBelow): 43 (WebCore::RenderBlock::markLinesDirtyInBlockRange): 44 (WebCore::RenderBlock::clearFloats): 45 (WebCore::RenderBlock::addOverhangingFloats): 46 (WebCore::RenderBlock::getClearDelta): 47 (WebCore::RenderBlock::computeInlinePreferredLogicalWidths): 48 (WebCore::getHeightForLineCount): 49 (WebCore::RenderBlock::borderFitAdjust): 50 (WebCore::RenderBlock::adjustForUnsplittableChild): 51 * rendering/RenderBlock.h: 52 (WebCore::RenderBlock::paginationStrut): 53 (WebCore::RenderBlock::pageLogicalOffset): 54 * rendering/RenderBlockLineLayout.cpp: 55 (WebCore::LineLayoutState::updateRepaintRangeFromBox): 56 (WebCore::RenderBlock::checkFloatsInCleanLine): 57 (WebCore::RenderBlock::addOverflowFromInlineChildren): 58 * rendering/RenderBox.cpp: 59 (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats): 60 (WebCore::RenderBox::positionForPoint): 61 * rendering/RenderBox.h: 62 (WebCore::RenderBox::minYVisualOverflow): 63 (WebCore::RenderBox::minXVisualOverflow): 64 (RenderBox): 65 * rendering/RenderBoxModelObject.cpp: 66 (WebCore::RenderBoxModelObject::offsetLeft): 67 (WebCore::RenderBoxModelObject::offsetTop): 68 (WebCore::RenderBoxModelObject::paintFillLayerExtended): 69 * rendering/RenderDeprecatedFlexibleBox.cpp: 70 (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): 71 (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): 72 (WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex): 73 * rendering/RenderFieldset.cpp: 74 (WebCore::RenderFieldset::paintBoxDecorations): 75 (WebCore::RenderFieldset::paintMask): 76 * rendering/RenderFlexibleBox.cpp: 77 (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): 78 (WebCore::RenderFlexibleBox::lineBreakLength): 79 (WebCore::RenderFlexibleBox::alignChildren): 80 (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): 81 * rendering/RenderFlowThread.cpp: 82 (WebCore::RenderFlowThread::layout): 83 (WebCore::RenderFlowThread::computeLogicalWidth): 84 * rendering/RenderInline.cpp: 85 (WebCore::RenderInline::linesVisualOverflowBoundingBox): 86 * rendering/RenderLayer.cpp: 87 (WebCore::RenderLayer::resize): 88 * rendering/RenderListMarker.cpp: 89 (WebCore::RenderListMarker::updateMargins): 90 * rendering/RenderMarquee.cpp: 91 (WebCore::RenderMarquee::computePosition): 92 * rendering/RenderObject.cpp: 93 (WebCore::RenderObject::repaintAfterLayoutIfNeeded): 94 * rendering/RenderReplaced.cpp: 95 (WebCore::RenderReplaced::computeReplacedLogicalWidth): 96 (WebCore::RenderReplaced::computePreferredLogicalWidths): 97 * rendering/RenderTable.cpp: 98 (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth): 99 (WebCore::RenderTable::layout): 100 * rendering/RenderTable.h: 101 (WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection): 102 * rendering/RenderText.cpp: 103 (WebCore::RenderText::linesVisualOverflowBoundingBox): 104 1 105 2012-04-09 Levi Weintraub <leviw@chromium.org> 2 106 -
trunk/Source/WebCore/dom/ElementRareData.h
r112919 r113665 84 84 inline IntSize defaultMinimumSizeForResizing() 85 85 { 86 return IntSize( std::numeric_limits<LayoutUnit>::max(), std::numeric_limits<LayoutUnit>::max());86 return IntSize(MAX_LAYOUT_UNIT, MAX_LAYOUT_UNIT); 87 87 } 88 88 -
trunk/Source/WebCore/editing/FrameSelection.cpp
r111689 r113665 77 77 static inline LayoutUnit NoXPosForVerticalArrowNavigation() 78 78 { 79 return std::numeric_limits<LayoutUnit>::min();79 return MIN_LAYOUT_UNIT; 80 80 } 81 81 -
trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp
r110322 r113665 589 589 { 590 590 ASSERT(!isnan(f)); 591 return min<float>(max<float>(f, - numeric_limits<LayoutUnit>::max() / 2), numeric_limits<LayoutUnit>::max()/ 2);591 return min<float>(max<float>(f, -MAX_LAYOUT_UNIT / 2), MAX_LAYOUT_UNIT / 2); 592 592 } 593 593 … … 601 601 float right; 602 602 if (isinf(mappedQuadBounds.x()) && isinf(mappedQuadBounds.width())) 603 right = numeric_limits<LayoutUnit>::max()/ 2;603 right = MAX_LAYOUT_UNIT / 2; 604 604 else 605 605 right = clampEdgeValue(ceilf(mappedQuadBounds.maxX())); … … 607 607 float bottom; 608 608 if (isinf(mappedQuadBounds.y()) && isinf(mappedQuadBounds.height())) 609 bottom = numeric_limits<LayoutUnit>::max()/ 2;609 bottom = MAX_LAYOUT_UNIT / 2; 610 610 else 611 611 bottom = clampEdgeValue(ceilf(mappedQuadBounds.maxY())); -
trunk/Source/WebCore/rendering/AutoTableLayout.cpp
r112752 r113665 252 252 if (scaleColumns) { 253 253 maxNonPercent = maxNonPercent * 100 / max(remainingPercent, epsilon); 254 maxWidth = max<int>(maxWidth, static_cast<int>(min(maxNonPercent, numeric_limits<LayoutUnit>::max()/ 2.0f)));255 maxWidth = max<int>(maxWidth, static_cast<int>(min(maxPercent, numeric_limits<LayoutUnit>::max()/ 2.0f)));254 maxWidth = max<int>(maxWidth, static_cast<int>(min(maxNonPercent, MAX_LAYOUT_UNIT / 2.0f))); 255 maxWidth = max<int>(maxWidth, static_cast<int>(min(maxPercent, MAX_LAYOUT_UNIT / 2.0f))); 256 256 } 257 257 … … 268 268 } else if (!remainingPercent && maxNonPercent) { 269 269 // if there was no remaining percent, maxWidth is invalid 270 maxWidth = std::numeric_limits<LayoutUnit>::max();270 maxWidth = MAX_LAYOUT_UNIT; 271 271 } 272 272 -
trunk/Source/WebCore/rendering/InlineFlowBox.cpp
r112725 r113665 665 665 RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer()); 666 666 if (RenderRubyBase* rubyBase = rubyRun->rubyBase()) { 667 LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : zeroLayoutUnit);668 LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : zeroLayoutUnit);667 LayoutUnit bottomRubyBaseLeading = (curr->logicalHeight() - rubyBase->logicalBottom()) + rubyBase->logicalHeight() - (rubyBase->lastRootBox() ? rubyBase->lastRootBox()->lineBottom() : ZERO_LAYOUT_UNIT); 668 LayoutUnit topRubyBaseLeading = rubyBase->logicalTop() + (rubyBase->firstRootBox() ? rubyBase->firstRootBox()->lineTop() : ZERO_LAYOUT_UNIT); 669 669 newLogicalTop += !renderer()->style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading; 670 670 boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading); … … 795 795 style->getBorderImageInlineDirectionOutsets(borderOutsetLogicalLeft, borderOutsetLogicalRight); 796 796 797 LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : zeroLayoutUnit;798 LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : zeroLayoutUnit;797 LayoutUnit outsetLogicalLeft = includeLogicalLeftEdge() ? borderOutsetLogicalLeft : ZERO_LAYOUT_UNIT; 798 LayoutUnit outsetLogicalRight = includeLogicalRightEdge() ? borderOutsetLogicalRight : ZERO_LAYOUT_UNIT; 799 799 800 800 LayoutUnit logicalLeftVisualOverflow = min(pixelSnappedLogicalLeft() - outsetLogicalLeft, logicalVisualOverflow.x()); … … 1124 1124 totalLogicalWidth += curr->logicalWidth(); 1125 1125 } 1126 LayoutUnit stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit);1127 LayoutUnit stripY = rect.y() - (isHorizontal() ? zeroLayoutUnit: logicalOffsetOnLine);1126 LayoutUnit stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : ZERO_LAYOUT_UNIT); 1127 LayoutUnit stripY = rect.y() - (isHorizontal() ? ZERO_LAYOUT_UNIT : logicalOffsetOnLine); 1128 1128 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : static_cast<LayoutUnit>(width()); 1129 1129 LayoutUnit stripHeight = isHorizontal() ? static_cast<LayoutUnit>(height()) : totalLogicalWidth; … … 1255 1255 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1256 1256 totalLogicalWidth += curr->logicalWidth(); 1257 LayoutUnit stripX = adjustedPaintoffset.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit);1258 LayoutUnit stripY = adjustedPaintoffset.y() - (isHorizontal() ? zeroLayoutUnit: logicalOffsetOnLine);1257 LayoutUnit stripX = adjustedPaintoffset.x() - (isHorizontal() ? logicalOffsetOnLine : ZERO_LAYOUT_UNIT); 1258 LayoutUnit stripY = adjustedPaintoffset.y() - (isHorizontal() ? ZERO_LAYOUT_UNIT : logicalOffsetOnLine); 1259 1259 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); 1260 1260 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; … … 1326 1326 for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) 1327 1327 totalLogicalWidth += curr->logicalWidth(); 1328 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : zeroLayoutUnit);1329 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? zeroLayoutUnit: logicalOffsetOnLine);1328 LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : ZERO_LAYOUT_UNIT); 1329 LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? ZERO_LAYOUT_UNIT : logicalOffsetOnLine); 1330 1330 LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); 1331 1331 LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; … … 1424 1424 1425 1425 if (!rubyRun->style()->isFlippedLinesWritingMode()) { 1426 LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : zeroLayoutUnit);1426 LayoutUnit topOfFirstRubyTextLine = rubyText->logicalTop() + (rubyText->firstRootBox() ? rubyText->firstRootBox()->lineTop() : ZERO_LAYOUT_UNIT); 1427 1427 if (topOfFirstRubyTextLine >= 0) 1428 1428 continue; -
trunk/Source/WebCore/rendering/LayoutTypes.h
r112977 r113665 48 48 typedef IntRect LayoutRect; 49 49 50 const LayoutUnit zeroLayoutUnit = 0; 50 #define MAX_LAYOUT_UNIT INT_MAX 51 #define MIN_LAYOUT_UNIT INT_MIN 52 #define ZERO_LAYOUT_UNIT 0 51 53 52 54 inline LayoutRect enclosingLayoutRect(const FloatRect& rect) -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r113607 r113665 191 191 || blockStyle->marginAfterCollapse() == MDISCARD; 192 192 193 m_positiveMargin = m_canCollapseMarginBeforeWithChildren ? block->maxPositiveMarginBefore() : zeroLayoutUnit;194 m_negativeMargin = m_canCollapseMarginBeforeWithChildren ? block->maxNegativeMarginBefore() : zeroLayoutUnit;193 m_positiveMargin = m_canCollapseMarginBeforeWithChildren ? block->maxPositiveMarginBefore() : ZERO_LAYOUT_UNIT; 194 m_negativeMargin = m_canCollapseMarginBeforeWithChildren ? block->maxNegativeMarginBefore() : ZERO_LAYOUT_UNIT; 195 195 } 196 196 … … 1337 1337 LayoutUnit oldHeight = logicalHeight(); 1338 1338 LayoutUnit oldLogicalTop = logicalTop(); 1339 setLogicalHeight( numeric_limits<LayoutUnit>::max()/ 2);1339 setLogicalHeight(MAX_LAYOUT_UNIT / 2); 1340 1340 computeLogicalHeight(); 1341 1341 enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage()); … … 1724 1724 // http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for 1725 1725 // an example of this scenario. 1726 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? zeroLayoutUnit: marginInfo.margin();1726 LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? ZERO_LAYOUT_UNIT : marginInfo.margin(); 1727 1727 setLogicalHeight(logicalHeight() + marginOffset); 1728 1728 positionNewFloats(); … … 2615 2615 2616 2616 if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) { 2617 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? zeroLayoutUnit: contentLogicalWidth();2617 LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? ZERO_LAYOUT_UNIT : contentLogicalWidth(); 2618 2618 LayoutUnit ruleAdd = logicalLeftOffsetForContent(); 2619 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? zeroLayoutUnit: contentLogicalWidth();2619 LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? ZERO_LAYOUT_UNIT : contentLogicalWidth(); 2620 2620 LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth(); 2621 2621 BoxSide boxSide = isHorizontalWritingMode() … … 3532 3532 3533 3533 // Fix for https://bugs.webkit.org/show_bug.cgi?id=54995. 3534 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTop == numeric_limits<LayoutUnit>::max())3535 logicalBottom = numeric_limits<LayoutUnit>::max();3534 if (logicalBottom < 0 || logicalBottom < logicalTop || logicalTop == MAX_LAYOUT_UNIT) 3535 logicalBottom = MAX_LAYOUT_UNIT; 3536 3536 else { 3537 3537 // Special-case zero- and less-than-zero-height floats: those don't touch … … 3977 3977 return logicalHeight; 3978 3978 3979 LayoutUnit bottom = numeric_limits<LayoutUnit>::max();3979 LayoutUnit bottom = MAX_LAYOUT_UNIT; 3980 3980 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); 3981 3981 FloatingObjectSetIterator end = floatingObjectSet.end(); … … 3987 3987 } 3988 3988 3989 return bottom == numeric_limits<LayoutUnit>::max() ? zeroLayoutUnit: bottom;3989 return bottom == MAX_LAYOUT_UNIT ? ZERO_LAYOUT_UNIT : bottom; 3990 3990 } 3991 3991 … … 4012 4012 RootInlineBox* lowestDirtyLine = lastRootBox(); 4013 4013 RootInlineBox* afterLowest = lowestDirtyLine; 4014 while (lowestDirtyLine && lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && logicalBottom < numeric_limits<LayoutUnit>::max()) {4014 while (lowestDirtyLine && lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && logicalBottom < MAX_LAYOUT_UNIT) { 4015 4015 afterLowest = lowestDirtyLine; 4016 4016 lowestDirtyLine = lowestDirtyLine->prevRootBox(); … … 4138 4138 4139 4139 if (childrenInline()) { 4140 LayoutUnit changeLogicalTop = numeric_limits<LayoutUnit>::max();4141 LayoutUnit changeLogicalBottom = numeric_limits<LayoutUnit>::min();4140 LayoutUnit changeLogicalTop = MAX_LAYOUT_UNIT; 4141 LayoutUnit changeLogicalBottom = MIN_LAYOUT_UNIT; 4142 4142 if (m_floatingObjects) { 4143 4143 const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set(); … … 4216 4216 for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) { 4217 4217 FloatingObject* r = *childIt; 4218 LayoutUnit logicalBottomForFloat = min(this->logicalBottomForFloat(r), numeric_limits<LayoutUnit>::max()- childLogicalTop);4218 LayoutUnit logicalBottomForFloat = min(this->logicalBottomForFloat(r), MAX_LAYOUT_UNIT - childLogicalTop); 4219 4219 LayoutUnit logicalBottom = childLogicalTop + logicalBottomForFloat; 4220 4220 lowestFloatLogicalBottom = max(lowestFloatLogicalBottom, logicalBottom); … … 4407 4407 4408 4408 // 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). 4409 LayoutUnit result = clearSet ? max<LayoutUnit>(0, logicalBottom - logicalTop) : zeroLayoutUnit;4409 LayoutUnit result = clearSet ? max<LayoutUnit>(0, logicalBottom - logicalTop) : ZERO_LAYOUT_UNIT; 4410 4410 if (!result && child->avoidsFloats()) { 4411 4411 LayoutUnit newLogicalTop = logicalTop; … … 5396 5396 RenderStyle* styleToUse = style(); 5397 5397 RenderBlock* containingBlock = this->containingBlock(); 5398 LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : zeroLayoutUnit;5398 LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : ZERO_LAYOUT_UNIT; 5399 5399 5400 5400 // If we are at the start of a line, we want to ignore all white-space. … … 6176 6176 for (RootInlineBox* box = block->firstRootBox(); box; box = box->nextRootBox()) { 6177 6177 if (++count == l) 6178 return box->lineBottom() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : zeroLayoutUnit);6178 return box->lineBottom() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : ZERO_LAYOUT_UNIT); 6179 6179 } 6180 6180 } … … 6185 6185 int result = getHeightForLineCount(toRenderBlock(obj), l, false, count); 6186 6186 if (result != -1) 6187 return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : zeroLayoutUnit);6187 return result + obj->y() + (includeBottom ? (block->borderBottom() + block->paddingBottom()) : ZERO_LAYOUT_UNIT); 6188 6188 } 6189 6189 else if (!obj->isFloatingOrPositioned() && !obj->isRunIn()) … … 6275 6275 6276 6276 // Walk any normal flow lines to snugly fit. 6277 LayoutUnit left = numeric_limits<LayoutUnit>::max();6278 LayoutUnit right = numeric_limits<LayoutUnit>::min();6277 LayoutUnit left = MAX_LAYOUT_UNIT; 6278 LayoutUnit right = MIN_LAYOUT_UNIT; 6279 6279 LayoutUnit oldWidth = rect.width(); 6280 6280 adjustForBorderFit(0, left, right); 6281 if (left != numeric_limits<LayoutUnit>::max()) {6281 if (left != MAX_LAYOUT_UNIT) { 6282 6282 left = min(left, oldWidth - (borderRight() + paddingRight())); 6283 6283 … … 6288 6288 } 6289 6289 } 6290 if (right != numeric_limits<LayoutUnit>::min()) {6290 if (right != MIN_LAYOUT_UNIT) { 6291 6291 right = max(right, borderLeft() + paddingLeft()); 6292 6292 … … 6718 6718 if (!isUnsplittable) 6719 6719 return logicalOffset; 6720 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : zeroLayoutUnit);6720 LayoutUnit childLogicalHeight = logicalHeightForChild(child) + (includeMargins ? marginBeforeForChild(child) + marginAfterForChild(child) : ZERO_LAYOUT_UNIT); 6721 6721 LayoutState* layoutState = view()->layoutState(); 6722 6722 if (layoutState->m_columnInfo) -
trunk/Source/WebCore/rendering/RenderBlock.h
r113597 r113665 258 258 LayoutRect columnRectAt(ColumnInfo*, unsigned) const; 259 259 260 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : zeroLayoutUnit; }260 LayoutUnit paginationStrut() const { return m_rareData ? m_rareData->m_paginationStrut : ZERO_LAYOUT_UNIT; } 261 261 void setPaginationStrut(LayoutUnit); 262 262 263 263 // The page logical offset is the object's offset from the top of the page in the page progression 264 264 // direction (so an x-offset in vertical text and a y-offset for horizontal text). 265 LayoutUnit pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : zeroLayoutUnit; }265 LayoutUnit pageLogicalOffset() const { return m_rareData ? m_rareData->m_pageLogicalOffset : ZERO_LAYOUT_UNIT; } 266 266 void setPageLogicalOffset(LayoutUnit); 267 267 -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r112555 r113665 1097 1097 { 1098 1098 m_usesRepaintBounds = true; 1099 m_repaintLogicalTop = min(m_repaintLogicalTop, box->logicalTopVisualOverflow() + min(paginationDelta, zeroLayoutUnit));1100 m_repaintLogicalBottom = max(m_repaintLogicalBottom, box->logicalBottomVisualOverflow() + max(paginationDelta, zeroLayoutUnit));1099 m_repaintLogicalTop = min(m_repaintLogicalTop, box->logicalTopVisualOverflow() + min(paginationDelta, ZERO_LAYOUT_UNIT)); 1100 m_repaintLogicalBottom = max(m_repaintLogicalBottom, box->logicalBottomVisualOverflow() + max(paginationDelta, ZERO_LAYOUT_UNIT)); 1101 1101 } 1102 1102 … … 1557 1557 LayoutUnit floatHeight = isHorizontalWritingMode() ? max(floats[floatIndex].rect.height(), newSize.height()) 1558 1558 : max(floats[floatIndex].rect.width(), newSize.width()); 1559 floatHeight = min(floatHeight, numeric_limits<LayoutUnit>::max()- floatTop);1559 floatHeight = min(floatHeight, MAX_LAYOUT_UNIT - floatTop); 1560 1560 line->markDirty(); 1561 1561 markLinesDirtyInBlockRange(line->lineBottomWithLeading(), floatTop + floatHeight, line); … … 2666 2666 void RenderBlock::addOverflowFromInlineChildren() 2667 2667 { 2668 LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : zeroLayoutUnit;2668 LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : ZERO_LAYOUT_UNIT; 2669 2669 // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to. 2670 2670 if (hasOverflowClip() && !endPadding && node() && node()->rendererIsEditable() && node() == node()->rootEditableElement() && style()->isLeftToRightDirection()) -
trunk/Source/WebCore/rendering/RenderBox.cpp
r113581 r113665 1327 1327 LayoutUnit adjustedPageOffsetForContainingBlock = offsetFromLogicalTopOfFirstPage - logicalTop(); 1328 1328 if (region) { 1329 LayoutUnit offsetFromLogicalTopOfRegion = region ? region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage : zeroLayoutUnit;1329 LayoutUnit offsetFromLogicalTopOfRegion = region ? region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage : ZERO_LAYOUT_UNIT; 1330 1330 logicalTopPosition = max(logicalTopPosition, logicalTopPosition + offsetFromLogicalTopOfRegion); 1331 1331 containingBlockRegion = cb->clampToStartAndEndRegions(region); … … 3544 3544 3545 3545 // Pass off to the closest child. 3546 LayoutUnit minDist = numeric_limits<LayoutUnit>::max();3546 LayoutUnit minDist = MAX_LAYOUT_UNIT; 3547 3547 RenderBox* closestRenderer = 0; 3548 3548 LayoutPoint adjustedPoint = point; … … 3560 3560 RenderBox* renderer = toRenderBox(renderObject); 3561 3561 3562 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? zeroLayoutUnit: renderer->y());3562 LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? ZERO_LAYOUT_UNIT : renderer->y()); 3563 3563 LayoutUnit bottom = top + renderer->contentHeight(); 3564 LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? zeroLayoutUnit: renderer->x());3564 LayoutUnit left = renderer->borderLeft() + renderer->paddingLeft() + (isTableRow() ? ZERO_LAYOUT_UNIT : renderer->x()); 3565 3565 LayoutUnit right = left + renderer->contentWidth(); 3566 3566 -
trunk/Source/WebCore/rendering/RenderBox.h
r113611 r113665 168 168 169 169 virtual LayoutRect visualOverflowRect() const { return m_overflow ? m_overflow->visualOverflowRect() : borderBoxRect(); } 170 LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : zeroLayoutUnit; }170 LayoutUnit minYVisualOverflow() const { return m_overflow? m_overflow->minYVisualOverflow() : ZERO_LAYOUT_UNIT; } 171 171 LayoutUnit maxYVisualOverflow() const { return m_overflow ? m_overflow->maxYVisualOverflow() : height(); } 172 LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : zeroLayoutUnit; }172 LayoutUnit minXVisualOverflow() const { return m_overflow ? m_overflow->minXVisualOverflow() : ZERO_LAYOUT_UNIT; } 173 173 LayoutUnit maxXVisualOverflow() const { return m_overflow ? m_overflow->maxXVisualOverflow() : width(); } 174 174 LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? minXVisualOverflow() : minYVisualOverflow(); } … … 326 326 327 327 RenderBoxRegionInfo* renderBoxRegionInfo(RenderRegion*, LayoutUnit offsetFromLogicalTopOfFirstPage, RenderBoxRegionInfoFlags = CacheRenderBoxRegionInfo) const; 328 void computeLogicalWidthInRegion(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = zeroLayoutUnit);328 void computeLogicalWidthInRegion(RenderRegion* = 0, LayoutUnit offsetFromLogicalTopOfFirstPage = ZERO_LAYOUT_UNIT); 329 329 330 330 bool stretchesToViewport() const -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r112749 r113665 487 487 488 488 RenderBoxModelObject* offsetPar = offsetParent(); 489 LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : zeroLayoutUnit);489 LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : ZERO_LAYOUT_UNIT); 490 490 491 491 // If the offsetParent of the element is null, or is the HTML body element, … … 521 521 522 522 RenderBoxModelObject* offsetPar = offsetParent(); 523 LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : zeroLayoutUnit);523 LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : ZERO_LAYOUT_UNIT); 524 524 525 525 // If the offsetParent of the element is null, or is the HTML body element, … … 764 764 int bLeft = includeLeftEdge ? borderLeft() : 0; 765 765 int bRight = includeRightEdge ? borderRight() : 0; 766 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : zeroLayoutUnit;767 LayoutUnit pRight = includeRightEdge ? paddingRight() : zeroLayoutUnit;766 LayoutUnit pLeft = includeLeftEdge ? paddingLeft() : ZERO_LAYOUT_UNIT; 767 LayoutUnit pRight = includeRightEdge ? paddingRight() : ZERO_LAYOUT_UNIT; 768 768 769 769 GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithLocalScrolling); … … 788 788 // Clip to the padding or content boxes as necessary. 789 789 bool includePadding = bgLayer->clip() == ContentFillBox; 790 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : zeroLayoutUnit),791 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : zeroLayoutUnit),792 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : zeroLayoutUnit),793 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : zeroLayoutUnit));790 LayoutRect clipRect = LayoutRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : ZERO_LAYOUT_UNIT), 791 scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : ZERO_LAYOUT_UNIT), 792 scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : ZERO_LAYOUT_UNIT), 793 scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : ZERO_LAYOUT_UNIT)); 794 794 backgroundClipStateSaver.save(); 795 795 context->clip(clipRect); -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r112425 r113665 518 518 LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i); 519 519 if (allowedFlex) { 520 LayoutUnit projectedFlex = (allowedFlex == numeric_limits<LayoutUnit>::max()) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style()->boxFlex()));520 LayoutUnit projectedFlex = (allowedFlex == MAX_LAYOUT_UNIT) ? allowedFlex : LayoutUnit(allowedFlex * (totalFlex / child->style()->boxFlex())); 521 521 spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex); 522 522 } … … 772 772 LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i); 773 773 if (allowedFlex) { 774 LayoutUnit projectedFlex = (allowedFlex == numeric_limits<LayoutUnit>::max()) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style()->boxFlex()));774 LayoutUnit projectedFlex = (allowedFlex == MAX_LAYOUT_UNIT) ? allowedFlex : static_cast<LayoutUnit>(allowedFlex * (totalFlex / child->style()->boxFlex())); 775 775 spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex); 776 776 } … … 1001 1001 if (isHorizontal()) { 1002 1002 // FIXME: For now just handle fixed values. 1003 LayoutUnit maxWidth = numeric_limits<LayoutUnit>::max();1003 LayoutUnit maxWidth = MAX_LAYOUT_UNIT; 1004 1004 LayoutUnit width = child->overrideWidth() - child->borderAndPaddingWidth(); 1005 1005 if (!child->style()->maxWidth().isUndefined() && child->style()->maxWidth().isFixed()) … … 1009 1009 else if (child->style()->maxWidth().type() == MinIntrinsic) 1010 1010 maxWidth = child->minPreferredLogicalWidth(); 1011 if (maxWidth == numeric_limits<LayoutUnit>::max())1011 if (maxWidth == MAX_LAYOUT_UNIT) 1012 1012 return maxWidth; 1013 1013 return max<LayoutUnit>(0, maxWidth - width); 1014 1014 } else { 1015 1015 // FIXME: For now just handle fixed values. 1016 LayoutUnit maxHeight = numeric_limits<LayoutUnit>::max();1016 LayoutUnit maxHeight = MAX_LAYOUT_UNIT; 1017 1017 LayoutUnit height = child->overrideHeight() - child->borderAndPaddingHeight(); 1018 1018 if (!child->style()->maxHeight().isUndefined() && child->style()->maxHeight().isFixed()) 1019 1019 maxHeight = child->style()->maxHeight().value(); 1020 if (maxHeight == numeric_limits<LayoutUnit>::max())1020 if (maxHeight == MAX_LAYOUT_UNIT) 1021 1021 return maxHeight; 1022 1022 return max<LayoutUnit>(0, maxHeight - height); -
trunk/Source/WebCore/rendering/RenderFieldset.cpp
r112158 r113665 133 133 // https://bugs.webkit.org/show_bug.cgi?id=47236 134 134 if (style()->isHorizontalWritingMode()) { 135 LayoutUnit yOff = (legend->y() > 0) ? zeroLayoutUnit: (legend->height() - borderTop()) / 2;135 LayoutUnit yOff = (legend->y() > 0) ? ZERO_LAYOUT_UNIT : (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) ? zeroLayoutUnit: (legend->width() - borderLeft()) / 2;139 LayoutUnit xOff = (legend->x() > 0) ? ZERO_LAYOUT_UNIT : (legend->width() - borderLeft()) / 2; 140 140 paintRect.setWidth(paintRect.width() - xOff); 141 141 paintRect.setX(paintRect.x() + xOff); … … 184 184 // https://bugs.webkit.org/show_bug.cgi?id=47236 185 185 if (style()->isHorizontalWritingMode()) { 186 LayoutUnit yOff = (legend->y() > 0) ? zeroLayoutUnit: (legend->height() - borderTop()) / 2;186 LayoutUnit yOff = (legend->y() > 0) ? ZERO_LAYOUT_UNIT : (legend->height() - borderTop()) / 2; 187 187 paintRect.expand(0, -yOff); 188 188 paintRect.move(0, yOff); 189 189 } else { 190 LayoutUnit xOff = (legend->x() > 0) ? zeroLayoutUnit: (legend->width() - borderLeft()) / 2;190 LayoutUnit xOff = (legend->x() > 0) ? ZERO_LAYOUT_UNIT : (legend->width() - borderLeft()) / 2; 191 191 paintRect.expand(-xOff, 0); 192 192 paintRect.move(xOff, 0); -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r113097 r113665 297 297 void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(FlexOrderIterator& iterator, WTF::Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge) 298 298 { 299 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? zeroLayoutUnit: lineContexts[0].crossAxisOffset;299 LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? ZERO_LAYOUT_UNIT : lineContexts[0].crossAxisOffset; 300 300 packFlexLines(iterator, lineContexts); 301 301 … … 691 691 LayoutUnit height = computeContentLogicalHeightUsing(style()->logicalHeight()); 692 692 if (height == -1) 693 height = std::numeric_limits<LayoutUnit>::max();693 height = MAX_LAYOUT_UNIT; 694 694 LayoutUnit maxHeight = computeContentLogicalHeightUsing(style()->logicalMaxHeight()); 695 695 if (maxHeight != -1) … … 1039 1039 RenderBox* child = iterator.first(); 1040 1040 for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) { 1041 LayoutUnit minMarginAfterBaseline = std::numeric_limits<LayoutUnit>::max();1041 LayoutUnit minMarginAfterBaseline = MAX_LAYOUT_UNIT; 1042 1042 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent; 1043 1043 LayoutUnit maxAscent = lineContexts[lineNumber].maxAscent; … … 1114 1114 // FIXME: Handle min-width and max-width. 1115 1115 LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child); 1116 child->setOverrideWidth(std::max( zeroLayoutUnit, childWidth));1116 child->setOverrideWidth(std::max(ZERO_LAYOUT_UNIT, childWidth)); 1117 1117 child->setChildNeedsLayout(true); 1118 1118 child->layoutIfNeeded(); -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r113222 r113665 201 201 LayoutRect regionRect; 202 202 if (isHorizontalWritingMode()) { 203 regionRect = LayoutRect(style()->direction() == LTR ? zeroLayoutUnit: logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight());203 regionRect = LayoutRect(style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth() - region->contentWidth(), logicalHeight, region->contentWidth(), region->contentHeight()); 204 204 logicalHeight += regionRect.height(); 205 205 } else { 206 regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? zeroLayoutUnit: logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight());206 regionRect = LayoutRect(logicalHeight, style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth() - region->contentHeight(), region->contentWidth(), region->contentHeight()); 207 207 logicalHeight += regionRect.width(); 208 208 } … … 247 247 LayoutUnit regionLogicalWidth = isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight(); 248 248 if (regionLogicalWidth != logicalWidth) { 249 LayoutUnit logicalLeft = style()->direction() == LTR ? zeroLayoutUnit: logicalWidth - regionLogicalWidth;249 LayoutUnit logicalLeft = style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth - regionLogicalWidth; 250 250 region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false); 251 251 } -
trunk/Source/WebCore/rendering/RenderInline.cpp
r113497 r113665 979 979 980 980 // Return the width of the minimal left side and the maximal right side. 981 LayoutUnit logicalLeftSide = numeric_limits<LayoutUnit>::max();982 LayoutUnit logicalRightSide = numeric_limits<LayoutUnit>::min();981 LayoutUnit logicalLeftSide = MAX_LAYOUT_UNIT; 982 LayoutUnit logicalRightSide = MIN_LAYOUT_UNIT; 983 983 for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) { 984 984 logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow()); -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r113611 r113665 1859 1859 styledElement->setInlineStyleProperty(CSSPropertyMarginRight, String::number(renderer->marginRight() / zoomFactor) + "px", false); 1860 1860 } 1861 LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? zeroLayoutUnit: renderer->borderAndPaddingWidth());1861 LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? ZERO_LAYOUT_UNIT : renderer->borderAndPaddingWidth()); 1862 1862 baseWidth = baseWidth / zoomFactor; 1863 1863 styledElement->setInlineStyleProperty(CSSPropertyWidth, String::number(roundToInt(baseWidth + difference.width())) + "px", false); … … 1870 1870 styledElement->setInlineStyleProperty(CSSPropertyMarginBottom, String::number(renderer->marginBottom() / zoomFactor) + "px", false); 1871 1871 } 1872 LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? zeroLayoutUnit: renderer->borderAndPaddingHeight());1872 LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? ZERO_LAYOUT_UNIT : renderer->borderAndPaddingHeight()); 1873 1873 baseHeight = baseHeight / zoomFactor; 1874 1874 styledElement->setInlineStyleProperty(CSSPropertyHeight, String::number(roundToInt(baseHeight + difference.height())) + "px", false); -
trunk/Source/WebCore/rendering/RenderListMarker.cpp
r112238 r113665 1505 1505 break; 1506 1506 default: 1507 marginStart = m_text.isEmpty() ? zeroLayoutUnit: -minPreferredLogicalWidth() - offset / 2;1507 marginStart = m_text.isEmpty() ? ZERO_LAYOUT_UNIT : -minPreferredLogicalWidth() - offset / 2; 1508 1508 } 1509 1509 } -
trunk/Source/WebCore/rendering/RenderMarquee.cpp
r113222 r113665 126 126 if (dir == MRIGHT) { 127 127 if (stopAtContentEdge) 128 return max( zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));128 return max(ZERO_LAYOUT_UNIT, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth)); 129 129 else 130 130 return ltr ? contentWidth : clientWidth; … … 132 132 else { 133 133 if (stopAtContentEdge) 134 return min( zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));134 return min(ZERO_LAYOUT_UNIT, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth)); 135 135 else 136 136 return ltr ? -clientWidth : -contentWidth; -
trunk/Source/WebCore/rendering/RenderObject.cpp
r113581 r113665 1424 1424 1425 1425 int borderRight = isBox() ? toRenderBox(this)->borderRight() : 0; 1426 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : zeroLayoutUnit;1426 LayoutUnit boxWidth = isBox() ? toRenderBox(this)->width() : ZERO_LAYOUT_UNIT; 1427 1427 LayoutUnit borderWidth = max<LayoutUnit>(-outlineStyle->outlineOffset(), max<LayoutUnit>(borderRight, max<LayoutUnit>(valueForLength(style()->borderTopRightRadius().width(), boxWidth, v), valueForLength(style()->borderBottomRightRadius().width(), boxWidth, v)))) + max<LayoutUnit>(ow, shadowRight); 1428 1428 LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth, … … 1443 1443 1444 1444 int borderBottom = isBox() ? toRenderBox(this)->borderBottom() : 0; 1445 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : zeroLayoutUnit;1445 LayoutUnit boxHeight = isBox() ? toRenderBox(this)->height() : ZERO_LAYOUT_UNIT; 1446 1446 LayoutUnit borderHeight = max<LayoutUnit>(-outlineStyle->outlineOffset(), max<LayoutUnit>(borderBottom, max<LayoutUnit>(valueForLength(style()->borderBottomLeftRadius().height(), boxHeight, v), valueForLength(style()->borderBottomRightRadius().height(), boxHeight, v)))) + max<LayoutUnit>(ow, shadowBottom); 1447 1447 LayoutRect bottomRect(newOutlineBox.x(), -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r112936 r113665 361 361 LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth); 362 362 LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), logicalWidth); 363 logicalWidth = max( zeroLayoutUnit, logicalWidth - (marginStart + marginEnd + (width() - clientWidth())));363 logicalWidth = max(ZERO_LAYOUT_UNIT, logicalWidth - (marginStart + marginEnd + (width() - clientWidth()))); 364 364 if (isPercentageIntrinsicSize) 365 365 logicalWidth = roundToInt(logicalWidth * intrinsicSize.width() / 100); … … 426 426 427 427 if (style()->maxWidth().isFixed()) 428 m_maxPreferredLogicalWidth = min<LayoutUnit>(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : zeroLayoutUnit));428 m_maxPreferredLogicalWidth = min<LayoutUnit>(m_maxPreferredLogicalWidth, style()->maxWidth().value() + (style()->boxSizing() == CONTENT_BOX ? borderAndPadding : ZERO_LAYOUT_UNIT)); 429 429 430 430 if (hasRelativeDimensions()) -
trunk/Source/WebCore/rendering/RenderTable.cpp
r113581 r113665 272 272 if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) { 273 273 recalcBordersInRowDirection(); 274 borders = borderStart() + borderEnd() + (collapseBorders() ? zeroLayoutUnit: paddingStart() + paddingEnd());274 borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd()); 275 275 } 276 276 return minimumValueForLength(styleLogicalWidth, availableWidth, view()) + borders; … … 384 384 } 385 385 386 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? zeroLayoutUnit: paddingBefore());387 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? zeroLayoutUnit: paddingAfter());386 LayoutUnit borderAndPaddingBefore = borderBefore() + (collapsing ? ZERO_LAYOUT_UNIT : paddingBefore()); 387 LayoutUnit borderAndPaddingAfter = borderAfter() + (collapsing ? ZERO_LAYOUT_UNIT : paddingAfter()); 388 388 389 389 setLogicalHeight(logicalHeight() + borderAndPaddingBefore); … … 396 396 if (logicalHeightLength.isFixed()) { 397 397 // HTML tables size as though CSS height includes border/padding, CSS tables do not. 398 LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : zeroLayoutUnit;398 LayoutUnit borders = node() && node()->hasTagName(tableTag) ? (borderAndPaddingBefore + borderAndPaddingAfter) : ZERO_LAYOUT_UNIT; 399 399 computedLogicalHeight = logicalHeightLength.value() - borders; 400 400 } else if (logicalHeightLength.isPercent()) -
trunk/Source/WebCore/rendering/RenderTable.h
r113497 r113665 173 173 { 174 174 return borderStart() + borderEnd() + 175 (collapseBorders() ? zeroLayoutUnit: (paddingStart() + paddingEnd() + static_cast<LayoutUnit>(numEffCols() + 1) * hBorderSpacing()));175 (collapseBorders() ? ZERO_LAYOUT_UNIT : (paddingStart() + paddingEnd() + static_cast<LayoutUnit>(numEffCols() + 1) * hBorderSpacing())); 176 176 } 177 177 -
trunk/Source/WebCore/rendering/RenderText.cpp
r112776 r113665 1516 1516 1517 1517 // Return the width of the minimal left side and the maximal right side. 1518 LayoutUnit logicalLeftSide = numeric_limits<LayoutUnit>::max();1519 LayoutUnit logicalRightSide = numeric_limits<LayoutUnit>::min();1518 LayoutUnit logicalLeftSide = MAX_LAYOUT_UNIT; 1519 LayoutUnit logicalRightSide = MIN_LAYOUT_UNIT; 1520 1520 for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) { 1521 1521 logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow());
Note: See TracChangeset
for help on using the changeset viewer.