Changeset 112936 in webkit


Ignore:
Timestamp:
Apr 2, 2012 2:00:08 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Correct remaining LayoutUnit misuse in RenderReplaced and RenderFlexibleBox
https://bugs.webkit.org/show_bug.cgi?id=82899

Reviewed by Darin Adler.

Removing remaining LayoutUnit misuse and compiler errors that exist in RenderReplaced
and RenderFlexibleBox once LayoutUnit becomes sub-pixel.

No new tests. No change in behavior.

  • rendering/RenderFlexibleBox.cpp:

(WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Switching
a raw zero in a ternary operation to zeroLayoutUnit.
(WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Ditto for std::max.

  • rendering/RenderReplaced.cpp:

(WebCore::RenderReplaced::paint): Adding missing pixel snapping before painting.
(WebCore::RenderReplaced::computeReplacedLogicalWidth): Like above, switching
a raw zero to zeroLayoutUnit.
(WebCore::RenderReplaced::computePreferredLogicalWidths): Ditto.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112935 r112936  
     12012-04-02  Levi Weintraub  <leviw@chromium.org>
     2
     3        Correct remaining LayoutUnit misuse in RenderReplaced and RenderFlexibleBox
     4        https://bugs.webkit.org/show_bug.cgi?id=82899
     5
     6        Reviewed by Darin Adler.
     7
     8        Removing remaining LayoutUnit misuse and compiler errors that exist in RenderReplaced
     9        and RenderFlexibleBox once LayoutUnit becomes sub-pixel.
     10
     11        No new tests. No change in behavior.
     12
     13        * rendering/RenderFlexibleBox.cpp:
     14        (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems): Switching
     15        a raw zero in a ternary operation to zeroLayoutUnit.
     16        (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild): Ditto for std::max.
     17        * rendering/RenderReplaced.cpp:
     18        (WebCore::RenderReplaced::paint): Adding missing pixel snapping before painting.
     19        (WebCore::RenderReplaced::computeReplacedLogicalWidth): Like above, switching
     20        a raw zero to zeroLayoutUnit.
     21        (WebCore::RenderReplaced::computePreferredLogicalWidths): Ditto.
     22
    1232012-04-02  Ken Buchanan  <kenrb@chromium.org>
    224
  • trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp

    r112544 r112936  
    297297void RenderFlexibleBox::repositionLogicalHeightDependentFlexItems(FlexOrderIterator& iterator, WTF::Vector<LineContext>& lineContexts, LayoutUnit& oldClientAfterEdge)
    298298{
    299     LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? 0 : lineContexts[0].crossAxisOffset;
     299    LayoutUnit crossAxisStartEdge = lineContexts.isEmpty() ? zeroLayoutUnit : lineContexts[0].crossAxisOffset;
    300300    packFlexLines(iterator, lineContexts);
    301301
     
    11211121        // FIXME: Handle min-width and max-width.
    11221122        LayoutUnit childWidth = lineCrossAxisExtent - crossAxisMarginExtentForChild(child);
    1123         child->setOverrideWidth(std::max(0, childWidth));
     1123        child->setOverrideWidth(std::max(zeroLayoutUnit, childWidth));
    11241124        child->setChildNeedsLayout(true);
    11251125        child->layoutIfNeeded();
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r112301 r112936  
    162162        LayoutRect selectionPaintingRect = localSelectionRect();
    163163        selectionPaintingRect.moveBy(adjustedPaintOffset);
    164         paintInfo.context->fillRect(selectionPaintingRect, selectionBackgroundColor(), style()->colorSpace());
     164        paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style()->colorSpace());
    165165    }
    166166}
     
    361361                LayoutUnit marginStart = minimumValueForLength(style()->marginStart(), logicalWidth);
    362362                LayoutUnit marginEnd = minimumValueForLength(style()->marginEnd(), logicalWidth);
    363                 logicalWidth = max(0, logicalWidth - (marginStart + marginEnd + (width() - clientWidth())));
     363                logicalWidth = max(zeroLayoutUnit, 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(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 : zeroLayoutUnit));
    429429
    430430    if (hasRelativeDimensions())
Note: See TracChangeset for help on using the changeset viewer.