Changeset 113665 in webkit


Ignore:
Timestamp:
Apr 9, 2012 7:54:29 PM (12 years ago)
Author:
eae@chromium.org
Message:

Replace numeric_limits<LayoutUnit>::min/max with constants
https://bugs.webkit.org/show_bug.cgi?id=83497

Reviewed by Eric Seidel.

Replace all uses of numeric_limits<LayoutUnit>::min/max with
MIN_LAYOUT_UNIT and MAX_LAYOUT_UNIT respectively in preparation for the
switch to subpixel layout.

Also rename zeroLayoutUnit to ZERO_LAYOUT_UNIT to be consistent and
change it to be a define as to avoid global initializer warnings once we
change the definition of LayoutUnit from int to FractionalLayoutUnit.

No new tests, no change in functionality.

  • dom/ElementRareData.h:

(WebCore::defaultMinimumSizeForResizing):

  • editing/FrameSelection.cpp:

(WebCore::NoXPosForVerticalArrowNavigation):

  • platform/graphics/transforms/TransformationMatrix.cpp:

(WebCore::clampEdgeValue):
(WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad):

  • rendering/AutoTableLayout.cpp:

(WebCore::AutoTableLayout::computePreferredLogicalWidths):

  • rendering/InlineFlowBox.cpp:

(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment):

  • rendering/LayoutTypes.h:

(WebCore):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::MarginInfo::MarginInfo):
(WebCore::RenderBlock::computeInitialRegionRangeForBlock):
(WebCore::RenderBlock::adjustFloatingBlock):
(WebCore::RenderBlock::paintColumnRules):
(WebCore::RenderBlock::removeFloatingObject):
(WebCore::RenderBlock::nextFloatLogicalBottomBelow):
(WebCore::RenderBlock::markLinesDirtyInBlockRange):
(WebCore::RenderBlock::clearFloats):
(WebCore::RenderBlock::addOverhangingFloats):
(WebCore::RenderBlock::getClearDelta):
(WebCore::RenderBlock::computeInlinePreferredLogicalWidths):
(WebCore::getHeightForLineCount):
(WebCore::RenderBlock::borderFitAdjust):
(WebCore::RenderBlock::adjustForUnsplittableChild):

  • rendering/RenderBlock.h:

(WebCore::RenderBlock::paginationStrut):
(WebCore::RenderBlock::pageLogicalOffset):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::LineLayoutState::updateRepaintRangeFromBox):
(WebCore::RenderBlock::checkFloatsInCleanLine):
(WebCore::RenderBlock::addOverflowFromInlineChildren):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
(WebCore::RenderBox::positionForPoint):

  • rendering/RenderBox.h:

(WebCore::RenderBox::minYVisualOverflow):
(WebCore::RenderBox::minXVisualOverflow):
(RenderBox):

  • rendering/RenderBoxModelObject.cpp:

(WebCore::RenderBoxModelObject::offsetLeft):
(WebCore::RenderBoxModelObject::offsetTop):
(WebCore::RenderBoxModelObject::paintFillLayerExtended):

  • rendering/RenderDeprecatedFlexibleBox.cpp:

(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
(WebCore::RenderDeprecatedFlexibleBox::allowedChildFlex):

  • rendering/RenderFieldset.cpp:

(WebCore::RenderFieldset::paintBoxDecorations):
(WebCore::RenderFieldset::paintMask):

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
(WebCore::RenderFlexibleBox::lineBreakLength):
(WebCore::RenderFlexibleBox::alignChildren):
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::layout):
(WebCore::RenderFlowThread::computeLogicalWidth):

  • rendering/RenderInline.cpp:

(WebCore::RenderInline::linesVisualOverflowBoundingBox):

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::resize):

  • rendering/RenderListMarker.cpp:

(WebCore::RenderListMarker::updateMargins):

  • rendering/RenderMarquee.cpp:

(WebCore::RenderMarquee::computePosition):

  • rendering/RenderObject.cpp:

(WebCore::RenderObject::repaintAfterLayoutIfNeeded):

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::computeReplacedLogicalWidth):
(WebCore::RenderReplaced::computePreferredLogicalWidths):

  • rendering/RenderTable.cpp:

(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::layout):

  • rendering/RenderTable.h:

(WebCore::RenderTable::bordersPaddingAndSpacingInRowDirection):

  • rendering/RenderText.cpp:

(WebCore::RenderText::linesVisualOverflowBoundingBox):

Location:
trunk/Source/WebCore
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r113663 r113665  
     12012-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
    11052012-04-09  Levi Weintraub  <leviw@chromium.org>
    2106
  • trunk/Source/WebCore/dom/ElementRareData.h

    r112919 r113665  
    8484inline IntSize defaultMinimumSizeForResizing()
    8585{
    86     return IntSize(std::numeric_limits<LayoutUnit>::max(), std::numeric_limits<LayoutUnit>::max());
     86    return IntSize(MAX_LAYOUT_UNIT, MAX_LAYOUT_UNIT);
    8787}
    8888
  • trunk/Source/WebCore/editing/FrameSelection.cpp

    r111689 r113665  
    7777static inline LayoutUnit NoXPosForVerticalArrowNavigation()
    7878{
    79     return std::numeric_limits<LayoutUnit>::min();
     79    return MIN_LAYOUT_UNIT;
    8080}
    8181
  • trunk/Source/WebCore/platform/graphics/transforms/TransformationMatrix.cpp

    r110322 r113665  
    589589{
    590590    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);
    592592}
    593593
     
    601601    float right;
    602602    if (isinf(mappedQuadBounds.x()) && isinf(mappedQuadBounds.width()))
    603         right = numeric_limits<LayoutUnit>::max() / 2;
     603        right = MAX_LAYOUT_UNIT / 2;
    604604    else
    605605        right = clampEdgeValue(ceilf(mappedQuadBounds.maxX()));
     
    607607    float bottom;
    608608    if (isinf(mappedQuadBounds.y()) && isinf(mappedQuadBounds.height()))
    609         bottom = numeric_limits<LayoutUnit>::max() / 2;
     609        bottom = MAX_LAYOUT_UNIT / 2;
    610610    else
    611611        bottom = clampEdgeValue(ceilf(mappedQuadBounds.maxY()));
  • trunk/Source/WebCore/rendering/AutoTableLayout.cpp

    r112752 r113665  
    252252    if (scaleColumns) {
    253253        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)));
    256256    }
    257257
     
    268268    } else if (!remainingPercent && maxNonPercent) {
    269269        // if there was no remaining percent, maxWidth is invalid
    270         maxWidth = std::numeric_limits<LayoutUnit>::max();
     270        maxWidth = MAX_LAYOUT_UNIT;
    271271    }
    272272
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r112725 r113665  
    665665                RenderRubyRun* rubyRun = toRenderRubyRun(curr->renderer());
    666666                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);
    669669                    newLogicalTop += !renderer()->style()->isFlippedLinesWritingMode() ? topRubyBaseLeading : bottomRubyBaseLeading;
    670670                    boxHeight -= (topRubyBaseLeading + bottomRubyBaseLeading);
     
    795795    style->getBorderImageInlineDirectionOutsets(borderOutsetLogicalLeft, borderOutsetLogicalRight);
    796796
    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;
    799799
    800800    LayoutUnit logicalLeftVisualOverflow = min(pixelSnappedLogicalLeft() - outsetLogicalLeft, logicalVisualOverflow.x());
     
    11241124                totalLogicalWidth += curr->logicalWidth();
    11251125        }
    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);
    11281128        LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : static_cast<LayoutUnit>(width());
    11291129        LayoutUnit stripHeight = isHorizontal() ? static_cast<LayoutUnit>(height()) : totalLogicalWidth;
     
    12551255                for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    12561256                    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);
    12591259                LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
    12601260                LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
     
    13261326        for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox())
    13271327            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);
    13301330        LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width();
    13311331        LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth;
     
    14241424           
    14251425            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);
    14271427                if (topOfFirstRubyTextLine >= 0)
    14281428                    continue;
  • trunk/Source/WebCore/rendering/LayoutTypes.h

    r112977 r113665  
    4848typedef IntRect LayoutRect;
    4949
    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
    5153
    5254inline LayoutRect enclosingLayoutRect(const FloatRect& rect)
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r113607 r113665  
    191191        || blockStyle->marginAfterCollapse() == MDISCARD;
    192192
    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;
    195195}
    196196
     
    13371337        LayoutUnit oldHeight =  logicalHeight();
    13381338        LayoutUnit oldLogicalTop = logicalTop();
    1339         setLogicalHeight(numeric_limits<LayoutUnit>::max() / 2);
     1339        setLogicalHeight(MAX_LAYOUT_UNIT / 2);
    13401340        computeLogicalHeight();
    13411341        enclosingRenderFlowThread()->setRegionRangeForBox(this, offsetFromLogicalTopOfFirstPage());
     
    17241724    // http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/046.html for
    17251725    // an example of this scenario.
    1726     LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? zeroLayoutUnit : marginInfo.margin();
     1726    LayoutUnit marginOffset = marginInfo.canCollapseWithMarginBefore() ? ZERO_LAYOUT_UNIT : marginInfo.margin();
    17271727    setLogicalHeight(logicalHeight() + marginOffset);
    17281728    positionNewFloats();
     
    26152615
    26162616    if (colInfo->progressionAxis() == ColumnInfo::InlineAxis) {
    2617         LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? zeroLayoutUnit : contentLogicalWidth();
     2617        LayoutUnit currLogicalLeftOffset = style()->isLeftToRightDirection() ? ZERO_LAYOUT_UNIT : contentLogicalWidth();
    26182618        LayoutUnit ruleAdd = logicalLeftOffsetForContent();
    2619         LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? zeroLayoutUnit : contentLogicalWidth();
     2619        LayoutUnit ruleLogicalLeft = style()->isLeftToRightDirection() ? ZERO_LAYOUT_UNIT : contentLogicalWidth();
    26202620        LayoutUnit inlineDirectionSize = colInfo->desiredColumnWidth();
    26212621        BoxSide boxSide = isHorizontalWritingMode()
     
    35323532
    35333533                // 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;
    35363536                else {
    35373537                    // Special-case zero- and less-than-zero-height floats: those don't touch
     
    39773977        return logicalHeight;
    39783978
    3979     LayoutUnit bottom = numeric_limits<LayoutUnit>::max();
     3979    LayoutUnit bottom = MAX_LAYOUT_UNIT;
    39803980    const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
    39813981    FloatingObjectSetIterator end = floatingObjectSet.end();
     
    39873987    }
    39883988
    3989     return bottom == numeric_limits<LayoutUnit>::max() ? zeroLayoutUnit : bottom;
     3989    return bottom == MAX_LAYOUT_UNIT ? ZERO_LAYOUT_UNIT : bottom;
    39903990}
    39913991
     
    40124012    RootInlineBox* lowestDirtyLine = lastRootBox();
    40134013    RootInlineBox* afterLowest = lowestDirtyLine;
    4014     while (lowestDirtyLine && lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && logicalBottom < numeric_limits<LayoutUnit>::max()) {
     4014    while (lowestDirtyLine && lowestDirtyLine->lineBottomWithLeading() >= logicalBottom && logicalBottom < MAX_LAYOUT_UNIT) {
    40154015        afterLowest = lowestDirtyLine;
    40164016        lowestDirtyLine = lowestDirtyLine->prevRootBox();
     
    41384138
    41394139    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;
    41424142        if (m_floatingObjects) {
    41434143            const FloatingObjectSet& floatingObjectSet = m_floatingObjects->set();
     
    42164216    for (FloatingObjectSetIterator childIt = child->m_floatingObjects->set().begin(); childIt != childEnd; ++childIt) {
    42174217        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);
    42194219        LayoutUnit logicalBottom = childLogicalTop + logicalBottomForFloat;
    42204220        lowestFloatLogicalBottom = max(lowestFloatLogicalBottom, logicalBottom);
     
    44074407
    44084408    // 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;
    44104410    if (!result && child->avoidsFloats()) {
    44114411        LayoutUnit newLogicalTop = logicalTop;
     
    53965396    RenderStyle* styleToUse = style();
    53975397    RenderBlock* containingBlock = this->containingBlock();
    5398     LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : zeroLayoutUnit;
     5398    LayoutUnit cw = containingBlock ? containingBlock->contentLogicalWidth() : ZERO_LAYOUT_UNIT;
    53995399
    54005400    // If we are at the start of a line, we want to ignore all white-space.
     
    61766176            for (RootInlineBox* box = block->firstRootBox(); box; box = box->nextRootBox()) {
    61776177                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);
    61796179            }
    61806180        }
     
    61856185                    int result = getHeightForLineCount(toRenderBlock(obj), l, false, count);
    61866186                    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);
    61886188                }
    61896189                else if (!obj->isFloatingOrPositioned() && !obj->isRunIn())
     
    62756275
    62766276    // 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;
    62796279    LayoutUnit oldWidth = rect.width();
    62806280    adjustForBorderFit(0, left, right);
    6281     if (left != numeric_limits<LayoutUnit>::max()) {
     6281    if (left != MAX_LAYOUT_UNIT) {
    62826282        left = min(left, oldWidth - (borderRight() + paddingRight()));
    62836283
     
    62886288        }
    62896289    }
    6290     if (right != numeric_limits<LayoutUnit>::min()) {
     6290    if (right != MIN_LAYOUT_UNIT) {
    62916291        right = max(right, borderLeft() + paddingLeft());
    62926292
     
    67186718    if (!isUnsplittable)
    67196719        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);
    67216721    LayoutState* layoutState = view()->layoutState();
    67226722    if (layoutState->m_columnInfo)
  • trunk/Source/WebCore/rendering/RenderBlock.h

    r113597 r113665  
    258258    LayoutRect columnRectAt(ColumnInfo*, unsigned) const;
    259259
    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; }
    261261    void setPaginationStrut(LayoutUnit);
    262262   
    263263    // The page logical offset is the object's offset from the top of the page in the page progression
    264264    // 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; }
    266266    void setPageLogicalOffset(LayoutUnit);
    267267
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r112555 r113665  
    10971097    {
    10981098        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));
    11011101    }
    11021102   
     
    15571557            LayoutUnit floatHeight = isHorizontalWritingMode() ? max(floats[floatIndex].rect.height(), newSize.height())
    15581558                                                                 : max(floats[floatIndex].rect.width(), newSize.width());
    1559             floatHeight = min(floatHeight, numeric_limits<LayoutUnit>::max() - floatTop);
     1559            floatHeight = min(floatHeight, MAX_LAYOUT_UNIT - floatTop);
    15601560            line->markDirty();
    15611561            markLinesDirtyInBlockRange(line->lineBottomWithLeading(), floatTop + floatHeight, line);
     
    26662666void RenderBlock::addOverflowFromInlineChildren()
    26672667{
    2668     LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : zeroLayoutUnit;
     2668    LayoutUnit endPadding = hasOverflowClip() ? paddingEnd() : ZERO_LAYOUT_UNIT;
    26692669    // FIXME: Need to find another way to do this, since scrollbars could show when we don't want them to.
    26702670    if (hasOverflowClip() && !endPadding && node() && node()->rendererIsEditable() && node() == node()->rootEditableElement() && style()->isLeftToRightDirection())
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r113581 r113665  
    13271327    LayoutUnit adjustedPageOffsetForContainingBlock = offsetFromLogicalTopOfFirstPage - logicalTop();
    13281328    if (region) {
    1329         LayoutUnit offsetFromLogicalTopOfRegion = region ? region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage : zeroLayoutUnit;
     1329        LayoutUnit offsetFromLogicalTopOfRegion = region ? region->offsetFromLogicalTopOfFirstPage() - offsetFromLogicalTopOfFirstPage : ZERO_LAYOUT_UNIT;
    13301330        logicalTopPosition = max(logicalTopPosition, logicalTopPosition + offsetFromLogicalTopOfRegion);
    13311331        containingBlockRegion = cb->clampToStartAndEndRegions(region);
     
    35443544
    35453545    // Pass off to the closest child.
    3546     LayoutUnit minDist = numeric_limits<LayoutUnit>::max();
     3546    LayoutUnit minDist = MAX_LAYOUT_UNIT;
    35473547    RenderBox* closestRenderer = 0;
    35483548    LayoutPoint adjustedPoint = point;
     
    35603560        RenderBox* renderer = toRenderBox(renderObject);
    35613561
    3562         LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? zeroLayoutUnit : renderer->y());
     3562        LayoutUnit top = renderer->borderTop() + renderer->paddingTop() + (isTableRow() ? ZERO_LAYOUT_UNIT : renderer->y());
    35633563        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());
    35653565        LayoutUnit right = left + renderer->contentWidth();
    35663566       
  • trunk/Source/WebCore/rendering/RenderBox.h

    r113611 r113665  
    168168   
    169169    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; }
    171171    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; }
    173173    LayoutUnit maxXVisualOverflow() const { return m_overflow ? m_overflow->maxXVisualOverflow() : width(); }
    174174    LayoutUnit logicalLeftVisualOverflow() const { return style()->isHorizontalWritingMode() ? minXVisualOverflow() : minYVisualOverflow(); }
     
    326326
    327327    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);
    329329
    330330    bool stretchesToViewport() const
  • trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp

    r112749 r113665  
    487487   
    488488    RenderBoxModelObject* offsetPar = offsetParent();
    489     LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : zeroLayoutUnit);
     489    LayoutUnit xPos = (isBox() ? toRenderBox(this)->left() : ZERO_LAYOUT_UNIT);
    490490   
    491491    // If the offsetParent of the element is null, or is the HTML body element,
     
    521521   
    522522    RenderBoxModelObject* offsetPar = offsetParent();
    523     LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : zeroLayoutUnit);
     523    LayoutUnit yPos = (isBox() ? toRenderBox(this)->top() : ZERO_LAYOUT_UNIT);
    524524   
    525525    // If the offsetParent of the element is null, or is the HTML body element,
     
    764764    int bLeft = includeLeftEdge ? borderLeft() : 0;
    765765    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;
    768768
    769769    GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithLocalScrolling);
     
    788788        // Clip to the padding or content boxes as necessary.
    789789        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));
    794794        backgroundClipStateSaver.save();
    795795        context->clip(clipRect);
  • trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp

    r112425 r113665  
    518518                        LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
    519519                        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()));
    521521                            spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
    522522                        }
     
    772772                        LayoutUnit allowedFlex = allowedChildFlex(child, expanding, i);
    773773                        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()));
    775775                            spaceAvailableThisPass = expanding ? min(spaceAvailableThisPass, projectedFlex) : max(spaceAvailableThisPass, projectedFlex);
    776776                        }
     
    10011001        if (isHorizontal()) {
    10021002            // FIXME: For now just handle fixed values.
    1003             LayoutUnit maxWidth = numeric_limits<LayoutUnit>::max();
     1003            LayoutUnit maxWidth = MAX_LAYOUT_UNIT;
    10041004            LayoutUnit width = child->overrideWidth() - child->borderAndPaddingWidth();
    10051005            if (!child->style()->maxWidth().isUndefined() && child->style()->maxWidth().isFixed())
     
    10091009            else if (child->style()->maxWidth().type() == MinIntrinsic)
    10101010                maxWidth = child->minPreferredLogicalWidth();
    1011             if (maxWidth == numeric_limits<LayoutUnit>::max())
     1011            if (maxWidth == MAX_LAYOUT_UNIT)
    10121012                return maxWidth;
    10131013            return max<LayoutUnit>(0, maxWidth - width);
    10141014        } else {
    10151015            // FIXME: For now just handle fixed values.
    1016             LayoutUnit maxHeight = numeric_limits<LayoutUnit>::max();
     1016            LayoutUnit maxHeight = MAX_LAYOUT_UNIT;
    10171017            LayoutUnit height = child->overrideHeight() - child->borderAndPaddingHeight();
    10181018            if (!child->style()->maxHeight().isUndefined() && child->style()->maxHeight().isFixed())
    10191019                maxHeight = child->style()->maxHeight().value();
    1020             if (maxHeight == numeric_limits<LayoutUnit>::max())
     1020            if (maxHeight == MAX_LAYOUT_UNIT)
    10211021                return maxHeight;
    10221022            return max<LayoutUnit>(0, maxHeight - height);
  • trunk/Source/WebCore/rendering/RenderFieldset.cpp

    r112158 r113665  
    133133    // https://bugs.webkit.org/show_bug.cgi?id=47236
    134134    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;
    136136        paintRect.setHeight(paintRect.height() - yOff);
    137137        paintRect.setY(paintRect.y() + yOff);
    138138    } 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;
    140140        paintRect.setWidth(paintRect.width() - xOff);
    141141        paintRect.setX(paintRect.x() + xOff);
     
    184184    // https://bugs.webkit.org/show_bug.cgi?id=47236
    185185    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;
    187187        paintRect.expand(0, -yOff);
    188188        paintRect.move(0, yOff);
    189189    } 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;
    191191        paintRect.expand(-xOff, 0);
    192192        paintRect.move(xOff, 0);
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r113097 r113665  
    297297void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(FlexOrderIterator& iterator, WTF::Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge)
    298298{
    299     LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? zeroLayoutUnit : lineContexts[0].crossAxisOffset;
     299    LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? ZERO_LAYOUT_UNIT : lineContexts[0].crossAxisOffset;
    300300    packFlexLines(iterator, lineContexts);
    301301
     
    691691    LayoutUnit height = computeContentLogicalHeightUsing(style()->logicalHeight());
    692692    if (height == -1)
    693         height = std::numeric_limits<LayoutUnit>::max();
     693        height = MAX_LAYOUT_UNIT;
    694694    LayoutUnit maxHeight = computeContentLogicalHeightUsing(style()->logicalMaxHeight());
    695695    if (maxHeight != -1)
     
    10391039    RenderBox* child = iterator.first();
    10401040    for (size_t lineNumber = 0; lineNumber < lineContexts.size(); ++lineNumber) {
    1041         LayoutUnit minMarginAfterBaseline = std::numeric_limits<LayoutUnit>::max();
     1041        LayoutUnit minMarginAfterBaseline = MAX_LAYOUT_UNIT;
    10421042        LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisExtent;
    10431043        LayoutUnit maxAscent = lineContexts[lineNumber].maxAscent;
     
    11141114        // FIXME: Handle min-width and max-width.
    11151115        LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
    1116         child->setOverrideWidth(std::max(zeroLayoutUnit, childWidth));
     1116        child->setOverrideWidth(std::max(ZERO_LAYOUT_UNIT, childWidth));
    11171117        child->setChildNeedsLayout(true);
    11181118        child->layoutIfNeeded();
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r113222 r113665  
    201201                LayoutRect regionRect;
    202202                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());
    204204                    logicalHeight += regionRect.height();
    205205                } 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());
    207207                    logicalHeight += regionRect.width();
    208208                }
     
    247247        LayoutUnit regionLogicalWidth = isHorizontalWritingMode() ? region->contentWidth() : region->contentHeight();
    248248        if (regionLogicalWidth != logicalWidth) {
    249             LayoutUnit logicalLeft = style()->direction() == LTR ? zeroLayoutUnit : logicalWidth - regionLogicalWidth;
     249            LayoutUnit logicalLeft = style()->direction() == LTR ? ZERO_LAYOUT_UNIT : logicalWidth - regionLogicalWidth;
    250250            region->setRenderBoxRegionInfo(this, logicalLeft, regionLogicalWidth, false);
    251251        }
  • trunk/Source/WebCore/rendering/RenderInline.cpp

    r113497 r113665  
    979979
    980980    // 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;
    983983    for (InlineFlowBox* curr = firstLineBox(); curr; curr = curr->nextLineBox()) {
    984984        logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow());
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r113611 r113665  
    18591859            styledElement->setInlineStyleProperty(CSSPropertyMarginRight, String::number(renderer->marginRight() / zoomFactor) + "px", false);
    18601860        }
    1861         LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? zeroLayoutUnit : renderer->borderAndPaddingWidth());
     1861        LayoutUnit baseWidth = renderer->width() - (isBoxSizingBorder ? ZERO_LAYOUT_UNIT : renderer->borderAndPaddingWidth());
    18621862        baseWidth = baseWidth / zoomFactor;
    18631863        styledElement->setInlineStyleProperty(CSSPropertyWidth, String::number(roundToInt(baseWidth + difference.width())) + "px", false);
     
    18701870            styledElement->setInlineStyleProperty(CSSPropertyMarginBottom, String::number(renderer->marginBottom() / zoomFactor) + "px", false);
    18711871        }
    1872         LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? zeroLayoutUnit : renderer->borderAndPaddingHeight());
     1872        LayoutUnit baseHeight = renderer->height() - (isBoxSizingBorder ? ZERO_LAYOUT_UNIT : renderer->borderAndPaddingHeight());
    18731873        baseHeight = baseHeight / zoomFactor;
    18741874        styledElement->setInlineStyleProperty(CSSPropertyHeight, String::number(roundToInt(baseHeight + difference.height())) + "px", false);
  • trunk/Source/WebCore/rendering/RenderListMarker.cpp

    r112238 r113665  
    15051505                        break;
    15061506                    default:
    1507                         marginStart = m_text.isEmpty() ? zeroLayoutUnit : -minPreferredLogicalWidth() - offset / 2;
     1507                        marginStart = m_text.isEmpty() ? ZERO_LAYOUT_UNIT : -minPreferredLogicalWidth() - offset / 2;
    15081508                }
    15091509            }
  • trunk/Source/WebCore/rendering/RenderMarquee.cpp

    r113222 r113665  
    126126        if (dir == MRIGHT) {
    127127            if (stopAtContentEdge)
    128                 return max(zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
     128                return max(ZERO_LAYOUT_UNIT, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
    129129            else
    130130                return ltr ? contentWidth : clientWidth;
     
    132132        else {
    133133            if (stopAtContentEdge)
    134                 return min(zeroLayoutUnit, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
     134                return min(ZERO_LAYOUT_UNIT, ltr ? (contentWidth - clientWidth) : (clientWidth - contentWidth));
    135135            else
    136136                return ltr ? -clientWidth : -contentWidth;
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r113581 r113665  
    14241424
    14251425        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;
    14271427        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);
    14281428        LayoutRect rightRect(newOutlineBox.x() + min(newOutlineBox.width(), oldOutlineBox.width()) - borderWidth,
     
    14431443
    14441444        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;
    14461446        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);
    14471447        LayoutRect bottomRect(newOutlineBox.x(),
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r112936 r113665  
    361361                LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth);
    362362                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())));
    364364                if (isPercentageIntrinsicSize)
    365365                    logicalWidth = roundToInt(logicalWidth * intrinsicSize.width() / 100);
     
    426426
    427427    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));
    429429
    430430    if (hasRelativeDimensions())
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r113581 r113665  
    272272    if (isCSSTable && styleLogicalWidth.isFixed() && styleLogicalWidth.isPositive()) {
    273273        recalcBordersInRowDirection();
    274         borders = borderStart() + borderEnd() + (collapseBorders() ? zeroLayoutUnit : paddingStart() + paddingEnd());
     274        borders = borderStart() + borderEnd() + (collapseBorders() ? ZERO_LAYOUT_UNIT : paddingStart() + paddingEnd());
    275275    }
    276276    return minimumValueForLength(styleLogicalWidth, availableWidth, view()) + borders;
     
    384384    }
    385385
    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());
    388388
    389389    setLogicalHeight(logicalHeight() + borderAndPaddingBefore);
     
    396396    if (logicalHeightLength.isFixed()) {
    397397        // 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;
    399399        computedLogicalHeight = logicalHeightLength.value() - borders;
    400400    } else if (logicalHeightLength.isPercent())
  • trunk/Source/WebCore/rendering/RenderTable.h

    r113497 r113665  
    173173    {
    174174        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()));
    176176    }
    177177
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r112776 r113665  
    15161516
    15171517    // 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;
    15201520    for (InlineTextBox* curr = firstTextBox(); curr; curr = curr->nextTextBox()) {
    15211521        logicalLeftSide = min(logicalLeftSide, curr->logicalLeftVisualOverflow());
Note: See TracChangeset for help on using the changeset viewer.