Changeset 112158 in webkit


Ignore:
Timestamp:
Mar 26, 2012 3:41:28 PM (12 years ago)
Author:
leviw@chromium.org
Message:

Correct LayoutUnit usage in RenderFieldSet and RenderMenuItem
https://bugs.webkit.org/show_bug.cgi?id=82179

Reviewed by Julien Chaffraix.

Correcting small misuses of ints vs LayoutUnits in RenderFieldSet and RenderMenuItem. Also
adding zeroLayoutUnit where necessary to fix the sub-pixel build. See below for details.

No new tests. No change in behavior.

  • rendering/RenderFieldset.cpp:

(WebCore::RenderFieldset::paintBoxDecorations): Clip rects need to be pixel snapped to mirror
the actual coordinates we paint.
(WebCore::RenderFieldset::paintMask): Using zeroLayoutUnit for ternary operation to fix the
sub-pixel build.

  • rendering/RenderMenuList.cpp:

(WebCore::RenderMenuList::showPopup): Correctly using an IntRect for absoluteBoundingBoxRect.
(WebCore::RenderMenuList::clientPaddingLeft): Correcting mismatched return type with header.
(WebCore::RenderMenuList::clientPaddingRight): Ditto.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r112156 r112158  
     12012-03-26  Levi Weintraub  <leviw@chromium.org>
     2
     3        Correct LayoutUnit usage in RenderFieldSet and RenderMenuItem
     4        https://bugs.webkit.org/show_bug.cgi?id=82179
     5
     6        Reviewed by Julien Chaffraix.
     7
     8        Correcting small misuses of ints vs LayoutUnits in RenderFieldSet and RenderMenuItem. Also
     9        adding zeroLayoutUnit where necessary to fix the sub-pixel build. See below for details.
     10
     11        No new tests. No change in behavior.
     12
     13        * rendering/RenderFieldset.cpp:
     14        (WebCore::RenderFieldset::paintBoxDecorations): Clip rects need to be pixel snapped to mirror
     15        the actual coordinates we paint.
     16        (WebCore::RenderFieldset::paintMask): Using zeroLayoutUnit for ternary operation to fix the
     17        sub-pixel build.
     18        * rendering/RenderMenuList.cpp:
     19        (WebCore::RenderMenuList::showPopup): Correctly using an IntRect for absoluteBoundingBoxRect.
     20        (WebCore::RenderMenuList::clientPaddingLeft): Correcting mismatched return type with header.
     21        (WebCore::RenderMenuList::clientPaddingRight): Ditto.
     22
    1232012-03-26  Dan Bernstein  <mitz@apple.com>
    224
  • trunk/Source/WebCore/rendering/RenderFieldset.cpp

    r111818 r112158  
    160160        LayoutUnit clipTop = paintRect.y();
    161161        LayoutUnit clipHeight = max(static_cast<LayoutUnit>(style()->borderTopWidth()), legend->height() - ((legend->height() - borderTop()) / 2));
    162         graphicsContext->clipOut(LayoutRect(paintRect.x() + legend->x(), clipTop, legend->width(), clipHeight));
     162        graphicsContext->clipOut(pixelSnappedIntRect(paintRect.x() + legend->x(), clipTop, legend->width(), clipHeight));
    163163    } else {
    164164        LayoutUnit clipLeft = paintRect.x();
    165165        LayoutUnit clipWidth = max(static_cast<LayoutUnit>(style()->borderLeftWidth()), legend->width());
    166         graphicsContext->clipOut(LayoutRect(clipLeft, paintRect.y() + legend->y(), clipWidth, legend->height()));
     166        graphicsContext->clipOut(pixelSnappedIntRect(clipLeft, paintRect.y() + legend->y(), clipWidth, legend->height()));
    167167    }
    168168
     
    184184    // https://bugs.webkit.org/show_bug.cgi?id=47236
    185185    if (style()->isHorizontalWritingMode()) {
    186         LayoutUnit yOff = (legend->y() > 0) ? 0 : (legend->height() - borderTop()) / 2;
     186        LayoutUnit yOff = (legend->y() > 0) ? zeroLayoutUnit : (legend->height() - borderTop()) / 2;
    187187        paintRect.expand(0, -yOff);
    188188        paintRect.move(0, yOff);
    189189    } else {
    190         LayoutUnit xOff = (legend->x() > 0) ? 0 : (legend->width() - borderLeft()) / 2;
     190        LayoutUnit xOff = (legend->x() > 0) ? zeroLayoutUnit : (legend->width() - borderLeft()) / 2;
    191191        paintRect.expand(-xOff, 0);
    192192        paintRect.move(xOff, 0);
  • trunk/Source/WebCore/rendering/RenderMenuList.cpp

    r111539 r112158  
    309309    // the actual width of the element to size the popup.
    310310    FloatPoint absTopLeft = localToAbsolute(FloatPoint(), false, true);
    311     LayoutRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
     311    IntRect absBounds = absoluteBoundingBoxRectIgnoringTransforms();
    312312    int scale = document()->page()->settings()->defaultDeviceScaleFactor();
    313313    if (scale && scale != 1)
    314314        absBounds.scale(scale);
    315     absBounds.setLocation(roundedLayoutPoint(absTopLeft));
     315    absBounds.setLocation(roundedIntPoint(absTopLeft));
    316316    HTMLSelectElement* select = toHTMLSelectElement(node());
    317317    m_popup->show(absBounds, document()->view(), select->optionToListIndex(select->selectedIndex()));
     
    512512}
    513513
    514 int RenderMenuList::clientPaddingLeft() const
     514LayoutUnit RenderMenuList::clientPaddingLeft() const
    515515{
    516516    return paddingLeft() + m_innerBlock->paddingLeft();
     
    518518
    519519const int endOfLinePadding = 2;
    520 int RenderMenuList::clientPaddingRight() const
     520LayoutUnit RenderMenuList::clientPaddingRight() const
    521521{
    522522    if (style()->appearance() == MenulistPart || style()->appearance() == MenulistButtonPart) {
Note: See TracChangeset for help on using the changeset viewer.