⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169928 in webkit


Ignore:
Timestamp:
Jun 12, 2014, 8:58:46 PM (12 years ago)
Author:
Alan Bujtas
Message:

Subpixel rendering: Make <input type=> and <button> elements' decoration subpixel aware.
​https://bugs.webkit.org/show_bug.cgi?id=133812
<rdar://problem/17286309>

Reviewed by Simon Fraser.

Enable <input type=> and <button> decoration painting on subpixel positions.
The theme size is still integral, but its position is snapped to device pixels.
Theme's label, the InlineTextBox is already subpixel position aware.
webkit.org/b/132005 tracks the rest of the themes.

Source/WebCore:
Not testable.

  • accessibility/AccessibilityObject.cpp:

(WebCore::AccessibilityObject::boundingBoxForQuads): Keep integral snapping for now.

  • platform/Theme.h:

(WebCore::Theme::paint):
(WebCore::Theme::inflateControlPaintRect):

  • platform/mac/ThemeMac.h:
  • platform/mac/ThemeMac.mm:

(WebCore::inflateRect):
(WebCore::configureToggleButton):
(WebCore::sharedRadioCell):
(WebCore::sharedCheckboxCell):
(WebCore::paintToggleButton):
(WebCore::setUpButtonCell):
(WebCore::button):
(WebCore::paintButton):
(WebCore::paintStepper):
(WebCore::ThemeMac::inflateControlPaintRect):
(WebCore::ThemeMac::paint):

  • rendering/RenderBlock.cpp:

(WebCore::RenderBlock::addVisualOverflowFromTheme): Keep integral snapping for now.

  • rendering/RenderFlowThread.cpp:

(WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme): Keep integral snapping for now.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::adjustRepaintRect):

  • rendering/RenderTheme.h:
  • rendering/RenderThemeMac.h:
  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::adjustRepaintRect):

LayoutTests:

  • platform/mac-mountainlion/compositing/contents-opaque/control-layer-expected.txt:
  • platform/mac/compositing/contents-opaque/control-layer-expected.txt:
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169907 r169928  
     12014-06-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: Make <input type=> and <button> elements' decoration subpixel aware.
     4        https://bugs.webkit.org/show_bug.cgi?id=133812
     5        <rdar://problem/17286309>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Enable <input type=> and <button> decoration painting on subpixel positions.
     10        The theme size is still integral, but its position is snapped to device pixels.
     11        Theme's label, the InlineTextBox is already subpixel position aware.
     12        webkit.org/b/132005 tracks the rest of the themes.
     13
     14        * platform/mac-mountainlion/compositing/contents-opaque/control-layer-expected.txt:
     15        * platform/mac/compositing/contents-opaque/control-layer-expected.txt:
     16
    1172014-06-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
    218
  • trunk/LayoutTests/platform/mac-mountainlion/compositing/contents-opaque/control-layer-expected.txt

    r168247 r169928  
    1111          (position 5.00 6.00)
    1212          (anchor 0.50 0.46)
    13           (bounds 129.00 28.00)
     13          (bounds 128.00 28.00)
    1414          (drawsContent 1)
    1515        )
  • trunk/LayoutTests/platform/mac/compositing/contents-opaque/control-layer-expected.txt

    r168247 r169928  
    1111          (position 5.00 6.00)
    1212          (anchor 0.50 0.46)
    13           (bounds 128.00 28.00)
     13          (bounds 127.00 28.00)
    1414          (drawsContent 1)
    1515        )
  • trunk/Source/WebCore/ChangeLog

    r169927 r169928  
     12014-06-12  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: Make <input type=> and <button> elements' decoration subpixel aware.
     4        https://bugs.webkit.org/show_bug.cgi?id=133812
     5        <rdar://problem/17286309>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Enable <input type=> and <button> decoration painting on subpixel positions.
     10        The theme size is still integral, but its position is snapped to device pixels.
     11        Theme's label, the InlineTextBox is already subpixel position aware.
     12        webkit.org/b/132005 tracks the rest of the themes.
     13
     14        Not testable.
     15
     16        * accessibility/AccessibilityObject.cpp:
     17        (WebCore::AccessibilityObject::boundingBoxForQuads): Keep integral snapping for now.
     18        * platform/Theme.h:
     19        (WebCore::Theme::paint):
     20        (WebCore::Theme::inflateControlPaintRect):
     21        * platform/mac/ThemeMac.h:
     22        * platform/mac/ThemeMac.mm:
     23        (WebCore::inflateRect):
     24        (WebCore::configureToggleButton):
     25        (WebCore::sharedRadioCell):
     26        (WebCore::sharedCheckboxCell):
     27        (WebCore::paintToggleButton):
     28        (WebCore::setUpButtonCell):
     29        (WebCore::button):
     30        (WebCore::paintButton):
     31        (WebCore::paintStepper):
     32        (WebCore::ThemeMac::inflateControlPaintRect):
     33        (WebCore::ThemeMac::paint):
     34        * rendering/RenderBlock.cpp:
     35        (WebCore::RenderBlock::addVisualOverflowFromTheme): Keep integral snapping for now.
     36        * rendering/RenderFlowThread.cpp:
     37        (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme): Keep integral snapping for now.
     38        * rendering/RenderTheme.cpp:
     39        (WebCore::RenderTheme::paint):
     40        (WebCore::RenderTheme::adjustRepaintRect):
     41        * rendering/RenderTheme.h:
     42        * rendering/RenderThemeMac.h:
     43        * rendering/RenderThemeMac.mm:
     44        (WebCore::RenderThemeMac::adjustRepaintRect):
     45
    1462014-06-12  Brent Fulgham  <bfulgham@apple.com>
    247
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r169632 r169928  
    727727        return IntRect();
    728728   
    729     IntRect result;
     729    FloatRect result;
    730730    for (const auto& quad : quads) {
    731         IntRect r = quad.enclosingBoundingBox();
     731        FloatRect r = quad.enclosingBoundingBox();
    732732        if (!r.isEmpty()) {
    733733            if (obj->style().hasAppearance())
    … …  
    736736        }
    737737    }
    738     return result;
     738    return pixelSnappedIntRect(LayoutRect(result));
    739739}
    740740   
  • trunk/Source/WebCore/platform/Theme.h

    r166422 r169928  
    9999
    100100    // Method for painting a control. The rect is in zoomed coordinates.
    101     virtual void paint(ControlPart, ControlStates*, GraphicsContext*, const IntRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*) { }
     101    virtual void paint(ControlPart, ControlStates*, GraphicsContext*, const FloatRect& /*zoomedRect*/, float /*zoomFactor*/, ScrollView*) { }
    102102
    103103    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
    … …  
    105105    // The rect passed in is in zoomed coordinates, so the inflation should take that into account and make sure the inflation
    106106    // amount is also scaled by the zoomFactor.
    107     virtual void inflateControlPaintRect(ControlPart, const ControlStates*, IntRect& /*zoomedRect*/, float /*zoomFactor*/) const { }
     107    virtual void inflateControlPaintRect(ControlPart, const ControlStates*, FloatRect& /*zoomedRect*/, float /*zoomFactor*/) const { }
    108108   
    109109    // This method is called once, from RenderTheme::adjustDefaultStyleSheet(), to let each platform adjust
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h

    r169898 r169928  
    5656    virtual bool supportsControlTints() const override { return true; }
    5757
    58     virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;
     58    virtual void adjustRepaintRect(const RenderObject&, FloatRect&) override;
    5959
    6060    // A method to obtain the baseline position for a "leaf" control.  This will only be used if a baseline
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk2.cpp

    r169898 r169928  
    9898#endif
    9999
    100 static void adjustRectForFocus(GtkWidget* widget, IntRect& rect, bool ignoreInteriorFocusProperty = false)
     100static void adjustRectForFocus(GtkWidget* widget, FloatRect& rect, bool ignoreInteriorFocusProperty = false)
    101101{
    102102    gint focusWidth, focusPad;
    … …  
    111111}
    112112
    113 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
     113void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, FloatRect& rect)
    114114{
    115115    ControlPart part = renderObject.style().appearance();
    … …  
    188188
    189189    if (theme->isFocused(renderObject)) {
    190         IntRect focusRect(buttonRect);
     190        FloatRect focusRect(buttonRect);
    191191        adjustRectForFocus(widget, focusRect, true);
    192         widgetContext.gtkPaintFocus(focusRect, widget, toggleState, detail);
     192        // FIXME: adopt device pixel positioned themes.
     193        widgetContext.gtkPaintFocus(IntRect(focusRect), widget, toggleState, detail);
    193194    }
    194195}
  • trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp

    r169898 r169928  
    149149#endif
    150150
    151 static void adjustRectForFocus(GtkStyleContext* context, IntRect& rect)
     151static void adjustRectForFocus(GtkStyleContext* context, FloatRect& rect)
    152152{
    153153    gint focusWidth, focusPad;
    … …  
    158158}
    159159
    160 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)
     160void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, FloatRect& rect)
    161161{
    162162    GtkStyleContext* context = 0;
  • trunk/Source/WebCore/platform/mac/ThemeMac.h

    r166422 r169928  
    5252    virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; }
    5353
    54     virtual void paint(ControlPart, ControlStates*, GraphicsContext*, const IntRect&, float zoomFactor, ScrollView*) override;
    55     virtual void inflateControlPaintRect(ControlPart, const ControlStates*, IntRect&, float zoomFactor) const;
     54    virtual void paint(ControlPart, ControlStates*, GraphicsContext*, const FloatRect&, float zoomFactor, ScrollView*) override;
     55    virtual void inflateControlPaintRect(ControlPart, const ControlStates*, FloatRect&, float zoomFactor) const;
    5656
    5757    // FIXME: Once RenderThemeMac is converted over to use Theme then this can be internal to ThemeMac.
  • trunk/Source/WebCore/platform/mac/ThemeMac.mm

    r169685 r169928  
    253253}
    254254
    255 static IntRect inflateRect(const IntRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
     255static FloatRect inflateRect(const FloatRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)
    256256{
    257257    // Only do the inflation if the available width/height are too small.  Otherwise try to
    … …  
    259259    int widthDelta = zoomedRect.width() - (zoomedSize.width() + margins[leftMargin] * zoomFactor + margins[rightMargin] * zoomFactor);
    260260    int heightDelta = zoomedRect.height() - (zoomedSize.height() + margins[topMargin] * zoomFactor + margins[bottomMargin] * zoomFactor);
    261     IntRect result(zoomedRect);
     261    FloatRect result(zoomedRect);
    262262    if (widthDelta < 0) {
    263263        result.setX(result.x() - margins[leftMargin] * zoomFactor);
    … …  
    351351}
    352352   
    353 static void configureToggleButton(NSCell* cell, ControlPart buttonType, const ControlStates* states, const IntRect& zoomedRect, float zoomFactor, bool isStateChange)
     353static void configureToggleButton(NSCell* cell, ControlPart buttonType, const ControlStates* states, const IntSize& zoomedSize, float zoomFactor, bool isStateChange)
    354354{
    355355    // Set the control size based off the rectangle we're painting into.
    356     setControlSize(cell, buttonType == CheckboxPart ? checkboxSizes() : radioSizes(), zoomedRect.size(), zoomFactor);
     356    setControlSize(cell, buttonType == CheckboxPart ? checkboxSizes() : radioSizes(), zoomedSize, zoomFactor);
    357357
    358358    // Update the various states we respond to.
    … …  
    377377}
    378378   
    379 static NSButtonCell *sharedRadioCell(const ControlStates* states, const IntRect& zoomedRect, float zoomFactor)
     379static NSButtonCell *sharedRadioCell(const ControlStates* states, const IntSize& zoomedSize, float zoomFactor)
    380380{
    381381    static NSButtonCell *radioCell;
    … …  
    383383        radioCell = createToggleButtonCell(RadioPart);
    384384
    385     configureToggleButton(radioCell, RadioPart, states, zoomedRect, zoomFactor, false);
     385    configureToggleButton(radioCell, RadioPart, states, zoomedSize, zoomFactor, false);
    386386    return radioCell;
    387387}
    388388   
    389 static NSButtonCell *sharedCheckboxCell(const ControlStates* states, const IntRect& zoomedRect, float zoomFactor)
     389static NSButtonCell *sharedCheckboxCell(const ControlStates* states, const IntSize& zoomedSize, float zoomFactor)
    390390{
    391391    static NSButtonCell *checkboxCell;
    … …  
    393393        checkboxCell = createToggleButtonCell(CheckboxPart);
    394394
    395     configureToggleButton(checkboxCell, CheckboxPart, states, zoomedRect, zoomFactor, false);
     395    configureToggleButton(checkboxCell, CheckboxPart, states, zoomedSize, zoomFactor, false);
    396396    return checkboxCell;
    397397}
    … …  
    403403}
    404404
    405 static void paintToggleButton(ControlPart buttonType, ControlStates* controlStates, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
     405static void paintToggleButton(ControlPart buttonType, ControlStates* controlStates, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
    406406{
    407407    BEGIN_BLOCK_OBJC_EXCEPTIONS
    408408
    409409    NSButtonCell *toggleButtonCell = static_cast<NSButtonCell*>(controlStates->platformControl());
     410    IntSize zoomedRectSize = IntSize(zoomedRect.size());
    410411
    411412    if (controlStates->isDirty()) {
    412413        if (!toggleButtonCell)
    413414            toggleButtonCell = createToggleButtonCell(buttonType);
    414         configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRect, zoomFactor, true);
     415        configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRectSize, zoomFactor, true);
    415416    } else {
    416417        if (!toggleButtonCell) {
    417418            if (buttonType == CheckboxPart)
    418                 toggleButtonCell = sharedCheckboxCell(controlStates, zoomedRect, zoomFactor);
     419                toggleButtonCell = sharedCheckboxCell(controlStates, zoomedRectSize, zoomFactor);
    419420            else {
    420421                ASSERT(buttonType == RadioPart);
    421                 toggleButtonCell = sharedRadioCell(controlStates, zoomedRect, zoomFactor);
     422                toggleButtonCell = sharedRadioCell(controlStates, zoomedRectSize, zoomFactor);
    422423            }
    423424        }
    424         configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRect, zoomFactor, false);
     425        configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRectSize, zoomFactor, false);
    425426    }
    426427    controlStates->setDirty(false);
    … …  
    433434    zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
    434435    const int* controlMargins = buttonType == CheckboxPart ? checkboxMargins(controlSize) : radioMargins(controlSize);
    435     IntRect inflatedRect = inflateRect(zoomedRect, zoomedSize, controlMargins, zoomFactor);
     436    FloatRect inflatedRect = inflateRect(zoomedRect, zoomedSize, controlMargins, zoomFactor);
    436437
    437438    if (zoomFactor != 1.0f) {
    … …  
    510511}
    511512
    512 static void setUpButtonCell(NSButtonCell *cell, ControlPart part, const ControlStates* states, const IntRect& zoomedRect, float zoomFactor)
     513static void setUpButtonCell(NSButtonCell *cell, ControlPart part, const ControlStates* states, const IntSize& zoomedSize, float zoomFactor)
    513514{
    514515    // Set the control size based off the rectangle we're painting into.
    515516    const std::array<IntSize, 3>& sizes = buttonSizes();
    516     if (part == SquareButtonPart || zoomedRect.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
     517    if (part == SquareButtonPart || zoomedSize.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {
    517518        // Use the square button
    518519        if ([cell bezelStyle] != NSShadowlessSquareBezelStyle)
    … …  
    521522        [cell setBezelStyle:NSRoundedBezelStyle];
    522523
    523     setControlSize(cell, sizes, zoomedRect.size(), zoomFactor);
     524    setControlSize(cell, sizes, zoomedSize, zoomFactor);
    524525
    525526    // Update the various states we respond to.
    … …  
    527528}
    528529
    529 static NSButtonCell *button(ControlPart part, const ControlStates* controlStates, const IntRect& zoomedRect, float zoomFactor)
     530static NSButtonCell *button(ControlPart part, const ControlStates* controlStates, const IntSize& zoomedSize, float zoomFactor)
    530531{
    531532    ControlStates::States states = controlStates->states();
    … …  
    538539        cell = normalCell;
    539540    }
    540     setUpButtonCell(cell, part, controlStates, zoomedRect, zoomFactor);
     541    setUpButtonCell(cell, part, controlStates, zoomedSize, zoomFactor);
    541542    return cell;
    542543}
    543544
    544 static void paintButton(ControlPart part, ControlStates* controlStates, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
     545static void paintButton(ControlPart part, ControlStates* controlStates, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
    545546{
    546547    BEGIN_BLOCK_OBJC_EXCEPTIONS
    … …  
    548549    // Determine the width and height needed for the control and prepare the cell for painting.
    549550    ControlStates::States states = controlStates->states();
    550     NSButtonCell *buttonCell = button(part, controlStates, zoomedRect, zoomFactor);
     551    NSButtonCell *buttonCell = button(part, controlStates, IntSize(zoomedRect.size()), zoomFactor);
    551552    GraphicsContextStateSaver stateSaver(*context);
    552553
    … …  
    555556    zoomedSize.setWidth(zoomedRect.width()); // Buttons don't ever constrain width, so the zoomed width can just be honored.
    556557    zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
    557     IntRect inflatedRect = zoomedRect;
     558    FloatRect inflatedRect = zoomedRect;
    558559    if ([buttonCell bezelStyle] == NSRoundedBezelStyle) {
    559560        // Center the button within the available space.
    … …  
    621622}
    622623
    623 static void paintStepper(ControlStates* states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView*)
     624static void paintStepper(ControlStates* states, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView*)
    624625{
    625626    // We don't use NSStepperCell because there are no ways to draw an
    … …  
    630631    drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states);
    631632    drawInfo.adornment = kThemeAdornmentDefault;
    632     ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
     633    ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), IntSize(zoomedRect.size()), zoomFactor);
    633634    if (controlSize == NSSmallControlSize)
    634635        drawInfo.kind = kThemeIncDecButtonSmall;
    … …  
    775776}
    776777
    777 void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates* states, IntRect& zoomedRect, float zoomFactor) const
     778void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates* states, FloatRect& zoomedRect, float zoomFactor) const
    778779{
    779780    BEGIN_BLOCK_OBJC_EXCEPTIONS
     781    IntSize zoomRectSize = IntSize(zoomedRect.size());
    780782    switch (part) {
    781783        case CheckboxPart: {
    782784            // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox
    783785            // shadow" and the check.  We don't consider this part of the bounds of the control in WebKit.
    784             NSCell *cell = sharedCheckboxCell(states, zoomedRect, zoomFactor);
     786            NSCell *cell = sharedCheckboxCell(states, zoomRectSize, zoomFactor);
    785787            NSControlSize controlSize = [cell controlSize];
    786788            IntSize zoomedSize = checkboxSizes()[controlSize];
    … …  
    793795            // We inflate the rect as needed to account for padding included in the cell to accommodate the radio button
    794796            // shadow".  We don't consider this part of the bounds of the control in WebKit.
    795             NSCell *cell = sharedRadioCell(states, zoomedRect, zoomFactor);
     797            NSCell *cell = sharedRadioCell(states, zoomRectSize, zoomFactor);
    796798            NSControlSize controlSize = [cell controlSize];
    797799            IntSize zoomedSize = radioSizes()[controlSize];
    … …  
    804806        case DefaultButtonPart:
    805807        case ButtonPart: {
    806             NSButtonCell *cell = button(part, states, zoomedRect, zoomFactor);
     808            NSButtonCell *cell = button(part, states, zoomRectSize, zoomFactor);
    807809            NSControlSize controlSize = [cell controlSize];
    808810
    … …  
    818820        case InnerSpinButtonPart: {
    819821            static const int stepperMargin[4] = { 0, 0, 0, 0 };
    820             ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);
     822            ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomRectSize, zoomFactor);
    821823            IntSize zoomedSize = stepperSizes()[controlSize];
    822824            zoomedSize.setHeight(zoomedSize.height() * zoomFactor);
    … …  
    831833}
    832834
    833 void ThemeMac::paint(ControlPart part, ControlStates* states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
     835void ThemeMac::paint(ControlPart part, ControlStates* states, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView)
    834836{
    835837    switch (part) {
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r169639 r169928  
    11721172        return;
    11731173
    1174     IntRect inflatedRect = pixelSnappedBorderBoxRect();
     1174    FloatRect inflatedRect = borderBoxRect();
    11751175    theme().adjustRepaintRect(*this, inflatedRect);
    1176     addVisualOverflow(inflatedRect);
     1176    addVisualOverflow(pixelSnappedIntRect(LayoutRect(inflatedRect)));
    11771177
    11781178    if (RenderFlowThread* flowThread = flowThreadContainingBlock())
  • trunk/Source/WebCore/rendering/RenderFlowThread.cpp

    r169586 r169928  
    13821382        borderBox = region->rectFlowPortionForBox(block, borderBox);
    13831383
    1384         IntRect inflatedRect = pixelSnappedIntRect(borderBox);
     1384        FloatRect inflatedRect = borderBox;
    13851385        block->theme().adjustRepaintRect(*block, inflatedRect);
    13861386
    1387         region->addVisualOverflowForBox(block, inflatedRect);
     1387        region->addVisualOverflowForBox(block, pixelSnappedIntRect(LayoutRect(inflatedRect)));
    13881388        if (region == endRegion)
    13891389            break;
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r169898 r169928  
    291291    case InnerSpinButtonPart:
    292292        updateControlStatesForRenderer(o, controlStates);
    293         m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), integralSnappedRect, o.style().effectiveZoom(), &o.view().frameView());
     293        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), devicePixelSnappedRect, o.style().effectiveZoom(), &o.view().frameView());
    294294        return false;
    295295    default:
    … …  
    721721}
    722722
    723 void RenderTheme::adjustRepaintRect(const RenderObject& o, IntRect& r)
     723void RenderTheme::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect)
    724724{
    725725#if USE(NEW_THEME)
    726     ControlStates states(extractControlStatesForRenderer(o));
    727     m_theme->inflateControlPaintRect(o.style().appearance(), &states, r, o.style().effectiveZoom());
     726    ControlStates states(extractControlStatesForRenderer(renderer));
     727    m_theme->inflateControlPaintRect(renderer.style().appearance(), &states, rect, renderer.style().effectiveZoom());
    728728#else
    729     UNUSED_PARAM(o);
    730     UNUSED_PARAM(r);
     729    UNUSED_PARAM(renderer);
     730    UNUSED_PARAM(rect);
    731731#endif
    732732}
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r169898 r169928  
    125125    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
    126126    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
    127     virtual void adjustRepaintRect(const RenderObject&, IntRect&);
     127    virtual void adjustRepaintRect(const RenderObject&, FloatRect&);
    128128
    129129    // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r169898 r169928  
    5050    virtual bool supportsControlTints() const override { return true; }
    5151
    52     virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;
     52    virtual void adjustRepaintRect(const RenderObject&, FloatRect&) override;
    5353
    5454    virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const override;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r169898 r169928  
    634634}
    635635
    636 void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r)
    637 {
    638     ControlPart part = o.style().appearance();
     636void RenderThemeMac::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect)
     637{
     638    ControlPart part = renderer.style().appearance();
    639639
    640640#if USE(NEW_THEME)
    … …  
    647647        case ButtonPart:
    648648        case InnerSpinButtonPart:
    649             return RenderTheme::adjustRepaintRect(o, r);
     649            return RenderTheme::adjustRepaintRect(renderer, rect);
    650650        default:
    651651            break;
    … …  
    653653#endif
    654654
    655     float zoomLevel = o.style().effectiveZoom();
     655    float zoomLevel = renderer.style().effectiveZoom();
    656656
    657657    if (part == MenulistPart) {
    658         setPopupButtonCellState(o, r.size());
     658        setPopupButtonCellState(renderer, IntSize(rect.size()));
    659659        IntSize size = popupButtonSizes()[[popupButton() controlSize]];
    660660        size.setHeight(size.height() * zoomLevel);
    661         size.setWidth(r.width());
    662         r = IntRect(inflateRect(r, size, popupButtonMargins(), zoomLevel));
     661        size.setWidth(rect.width());
     662        rect = inflateRect(rect, size, popupButtonMargins(), zoomLevel);
    663663    }
    664664}
Note: See TracChangeset for help on using the changeset viewer.