Changeset 106734 in webkit


Ignore:
Timestamp:
Feb 4, 2012 1:42:39 AM (12 years ago)
Author:
eae@chromium.org
Message:

Convert RenderTheme over to new layout abstraction
https://bugs.webkit.org/show_bug.cgi?id=77783

Reviewed by Eric Seidel.

Change the RenderTheme classes to use the new layout abstraction as a
part of the ongoing conversion work.

No new tests.

  • rendering/RenderTheme.cpp:

(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
(WebCore::RenderTheme::baselinePosition):
(WebCore::RenderTheme::adjustRepaintRect):
(WebCore::RenderTheme::meterSizeForBounds):

  • rendering/RenderTheme.h:

(RenderTheme):
(WebCore::RenderTheme::paintCapsLockIndicator):

  • rendering/RenderThemeChromiumMac.h:

(RenderThemeChromiumMac):

  • rendering/RenderThemeChromiumMac.mm:

(WebCore::RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton):

  • rendering/RenderThemeChromiumSkia.cpp:

(WebCore::RenderThemeChromiumSkia::convertToPaintingRect):
(WebCore::RenderThemeChromiumSkia::paintSearchFieldCancelButton):
(WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsButton):

  • rendering/RenderThemeChromiumSkia.h:
  • rendering/RenderThemeMac.h:

(RenderThemeMac):

  • rendering/RenderThemeMac.mm:

(WebCore::RenderThemeMac::adjustRepaintRect):
(WebCore::RenderThemeMac::inflateRect):
(WebCore::RenderThemeMac::setControlSize):
(WebCore::RenderThemeMac::paintCapsLockIndicator):
(WebCore::RenderThemeMac::paintMenuList):
(WebCore::RenderThemeMac::meterSizeForBounds):
(WebCore::RenderThemeMac::paintMenuListButtonGradients):
(WebCore::RenderThemeMac::setPopupButtonCellState):
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
(WebCore::RenderThemeMac::volumeSliderOffsetFromMuteButton):

  • rendering/RenderThemeSafari.cpp:

(WebCore::RenderThemeSafari::baselinePosition):

  • rendering/RenderThemeSafari.h:

(RenderThemeSafari):

  • rendering/RenderThemeWin.cpp:

(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecoration):
(WebCore::RenderThemeWin::paintSearchFieldResultsButton):
(WebCore::RenderThemeWin::volumeSliderOffsetFromMuteButton):

  • rendering/RenderThemeWin.h:

(RenderThemeWin):

Location:
trunk/Source/WebCore
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106732 r106734  
     12012-02-04  Emil A Eklund  <eae@chromium.org>
     2
     3        Convert RenderTheme over to new layout abstraction
     4        https://bugs.webkit.org/show_bug.cgi?id=77783
     5
     6        Reviewed by Eric Seidel.
     7
     8        Change the RenderTheme classes to use the new layout abstraction as a
     9        part of the ongoing conversion work.
     10
     11        No new tests.
     12
     13        * rendering/RenderTheme.cpp:
     14        (WebCore::RenderTheme::paint):
     15        (WebCore::RenderTheme::volumeSliderOffsetFromMuteButton):
     16        (WebCore::RenderTheme::baselinePosition):
     17        (WebCore::RenderTheme::adjustRepaintRect):
     18        (WebCore::RenderTheme::meterSizeForBounds):
     19        * rendering/RenderTheme.h:
     20        (RenderTheme):
     21        (WebCore::RenderTheme::paintCapsLockIndicator):
     22        * rendering/RenderThemeChromiumMac.h:
     23        (RenderThemeChromiumMac):
     24        * rendering/RenderThemeChromiumMac.mm:
     25        (WebCore::RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton):
     26        * rendering/RenderThemeChromiumSkia.cpp:
     27        (WebCore::RenderThemeChromiumSkia::convertToPaintingRect):
     28        (WebCore::RenderThemeChromiumSkia::paintSearchFieldCancelButton):
     29        (WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsDecoration):
     30        (WebCore::RenderThemeChromiumSkia::paintSearchFieldResultsButton):
     31        * rendering/RenderThemeChromiumSkia.h:
     32        * rendering/RenderThemeMac.h:
     33        (RenderThemeMac):
     34        * rendering/RenderThemeMac.mm:
     35        (WebCore::RenderThemeMac::adjustRepaintRect):
     36        (WebCore::RenderThemeMac::inflateRect):
     37        (WebCore::RenderThemeMac::setControlSize):
     38        (WebCore::RenderThemeMac::paintCapsLockIndicator):
     39        (WebCore::RenderThemeMac::paintMenuList):
     40        (WebCore::RenderThemeMac::meterSizeForBounds):
     41        (WebCore::RenderThemeMac::paintMenuListButtonGradients):
     42        (WebCore::RenderThemeMac::setPopupButtonCellState):
     43        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
     44        (WebCore::RenderThemeMac::volumeSliderOffsetFromMuteButton):
     45        * rendering/RenderThemeSafari.cpp:
     46        (WebCore::RenderThemeSafari::baselinePosition):
     47        * rendering/RenderThemeSafari.h:
     48        (RenderThemeSafari):
     49        * rendering/RenderThemeWin.cpp:
     50        (WebCore::RenderThemeWin::paintSearchFieldCancelButton):
     51        (WebCore::RenderThemeWin::paintSearchFieldResultsDecoration):
     52        (WebCore::RenderThemeWin::paintSearchFieldResultsButton):
     53        (WebCore::RenderThemeWin::volumeSliderOffsetFromMuteButton):
     54        * rendering/RenderThemeWin.h:
     55        (RenderThemeWin):
     56
    1572012-02-04  Stephen White  <senorblanco@chromium.org>
    258
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r105403 r106734  
    243243}
    244244
    245 bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
     245bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const LayoutRect& r)
    246246{
    247247    // If painting is disabled, but we aren't updating control tints, then just bail.
     
    501501}
    502502
    503 IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
    504 {
    505     int y = -size.height();
     503LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
     504{
     505    LayoutUnit y = -size.height();
    506506    FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true);
    507507    if (absPoint.y() < 0)
    508508        y = muteButtonBox->height();
    509     return IntPoint(0, y);
     509    return LayoutPoint(0, y);
    510510}
    511511
     
    613613}
    614614
    615 int RenderTheme::baselinePosition(const RenderObject* o) const
     615LayoutUnit RenderTheme::baselinePosition(const RenderObject* o) const
    616616{
    617617    if (!o->isBox())
     
    663663}
    664664
    665 void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
     665void RenderTheme::adjustRepaintRect(const RenderObject* o, LayoutRect& r)
    666666{
    667667#if USE(NEW_THEME)
     
    920920}
    921921
    922 IntSize RenderTheme::meterSizeForBounds(const RenderMeter*, const IntRect& bounds) const
     922LayoutSize RenderTheme::meterSizeForBounds(const RenderMeter*, const LayoutRect& bounds) const
    923923{
    924924    return bounds.size();
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r105253 r106734  
    9898    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    9999    // controls that need to do this.
    100     virtual int baselinePosition(const RenderObject*) const;
     100    virtual LayoutUnit baselinePosition(const RenderObject*) const;
    101101
    102102    // A method for asking if a control is a container or not.  Leaf controls have to have some special behavior (like
     
    115115    // Some controls may spill out of their containers (e.g., the check on an OS X checkbox).  When these controls repaint,
    116116    // the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
    117     virtual void adjustRepaintRect(const RenderObject*, IntRect&);
     117    virtual void adjustRepaintRect(const RenderObject*, LayoutRect&);
    118118
    119119    // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
     
    177177
    178178    // Method for painting the caps lock indicator
    179     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) { return 0; };
     179    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const LayoutRect&) { return 0; };
    180180
    181181#if ENABLE(PROGRESS_TAG)
     
    199199   
    200200    // Returns the media volume slider container's offset from the mute button.
    201     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
     201    virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
    202202#endif
    203203
    204204#if ENABLE(METER_TAG)
    205     virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
     205    virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const;
    206206    virtual bool supportsMeter(ControlPart) const;
    207207#endif
  • trunk/Source/WebCore/rendering/RenderThemeChromiumMac.h

    r104494 r106734  
    5050    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    5151    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    52     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
     52    virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
    5353    virtual bool usesMediaControlStatusDisplay() { return false; }
    5454    virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; }
  • trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm

    r104494 r106734  
    212212}
    213213
    214 IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
     214LayoutPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
    215215{
    216216    return RenderTheme::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
  • trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp

    r101848 r106734  
    261261}
    262262
    263 IntRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const
     263LayoutRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const
    264264{
    265265    // Compute an offset between the part renderer and the input renderer.
    266     IntSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));
     266    LayoutSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));
    267267    // Move the rect into partRenderer's coords.
    268268    partRect.move(offsetFromInputRenderer);
     
    280280        return false;
    281281    RenderBox* inputRenderBox = toRenderBox(input->renderer());
    282     IntRect inputContentBox = inputRenderBox->contentBoxRect();
     282    LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
    283283
    284284    // Make sure the scaled button stays square and will fit in its parent's box.
    285     int cancelButtonSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
     285    LayoutUnit cancelButtonSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), r.height()));
    286286    // Calculate cancel button's coordinates relative to the input element.
    287287    // Center the button vertically.  Round up though, so if it has to be one pixel off-center, it will
    288288    // be one pixel closer to the bottom of the field.  This tends to look better with the text.
    289     IntRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
    290                              inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
    291                              cancelButtonSize, cancelButtonSize);
    292     IntRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
     289    LayoutRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
     290                                inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
     291                                cancelButtonSize, cancelButtonSize);
     292    LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
    293293
    294294    static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
     
    323323        return false;
    324324    RenderBox* inputRenderBox = toRenderBox(input->renderer());
    325     IntRect inputContentBox = inputRenderBox->contentBoxRect();
     325    LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
    326326
    327327    // Make sure the scaled decoration stays square and will fit in its parent's box.
    328     int magnifierSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
     328    LayoutUnit magnifierSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), r.height()));
    329329    // Calculate decoration's coordinates relative to the input element.
    330330    // Center the decoration vertically.  Round up though, so if it has to be one pixel off-center, it will
    331331    // be one pixel closer to the bottom of the field.  This tends to look better with the text.
    332     IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
    333                           inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2,
    334                           magnifierSize, magnifierSize);
    335     IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
     332    LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
     333                             inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2,
     334                             magnifierSize, magnifierSize);
     335    LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
    336336
    337337    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
     
    358358        return false;
    359359    RenderBox* inputRenderBox = toRenderBox(input->renderer());
    360     IntRect inputContentBox = inputRenderBox->contentBoxRect();
     360    LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
    361361
    362362    // Make sure the scaled decoration will fit in its parent's box.
    363     int magnifierHeight = std::min(inputContentBox.height(), r.height());
    364     int magnifierWidth = std::min(inputContentBox.width(), static_cast<int>(magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
    365     IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
    366                           inputContentBox.y() + (inputContentBox.height() - magnifierHeight + 1) / 2,
    367                           magnifierWidth, magnifierHeight);
    368     IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
     363    LayoutUnit magnifierHeight = std::min<LayoutUnit>(inputContentBox.height(), r.height());
     364    LayoutUnit magnifierWidth = std::min<LayoutUnit>(inputContentBox.width(), magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize);
     365    LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
     366                             inputContentBox.y() + (inputContentBox.height() - magnifierHeight + 1) / 2,
     367                             magnifierWidth, magnifierHeight);
     368    LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
    369369
    370370    static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
  • trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h

    r102660 r106734  
    158158    int menuListInternalPadding(RenderStyle*, int paddingType) const;
    159159    bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
    160     IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const;
     160    LayoutRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const;
    161161};
    162162
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r105253 r106734  
    4646    virtual bool supportsControlTints() const { return true; }
    4747
    48     virtual void adjustRepaintRect(const RenderObject*, IntRect&);
     48    virtual void adjustRepaintRect(const RenderObject*, LayoutRect&);
    4949
    5050    virtual bool isControlStyled(const RenderStyle*, const BorderData&,
     
    7575    virtual int popupInternalPaddingBottom(RenderStyle*) const;
    7676   
    77     virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
     77    virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const LayoutRect&);
    7878
    7979    virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; }
    8080
    8181#if ENABLE(METER_TAG)
    82     virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
     82    virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const;
    8383    virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
    8484    virtual bool supportsMeter(ControlPart) const;
     
    170170    virtual bool usesMediaControlVolumeSlider() const;
    171171    virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
    172     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
     172    virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
    173173#endif
    174174   
     
    178178    virtual String fileListNameForWidth(const Vector<String>& filenames, const Font&, int width, bool multipleFilesAllowed);
    179179
    180     IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
     180    LayoutRect inflateRect(const LayoutRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
    181181
    182182    FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const;
     
    185185    NSControlSize controlSizeForFont(RenderStyle*) const;
    186186    NSControlSize controlSizeForSystemFont(RenderStyle*) const;
    187     void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f);
     187    void setControlSize(NSCell*, const IntSize* sizes, const LayoutSize& minSize, float zoomLevel = 1.0f);
    188188    void setSizeFromFont(RenderStyle*, const IntSize* sizes) const;
    189189    IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const;
     
    200200    // Helpers for adjusting appearance and for painting
    201201
    202     void setPopupButtonCellState(const RenderObject*, const IntRect&);
     202    void setPopupButtonCellState(const RenderObject*, const LayoutRect&);
    203203    const IntSize* popupButtonSizes() const;
    204204    const int* popupButtonMargins() const;
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r105032 r106734  
    501501}
    502502
    503 void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
     503void RenderThemeMac::adjustRepaintRect(const RenderObject* o, LayoutRect& r)
    504504{
    505505    ControlPart part = o->style()->appearance();
     
    532532}
    533533
    534 IntRect RenderThemeMac::inflateRect(const IntRect& r, const IntSize& size, const int* margins, float zoomLevel) const
     534LayoutRect RenderThemeMac::inflateRect(const LayoutRect& r, const IntSize& size, const int* margins, float zoomLevel) const
    535535{
    536536    // Only do the inflation if the available width/height are too small.  Otherwise try to
    537537    // fit the glow/check space into the available box's width/height.
    538     int widthDelta = r.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
    539     int heightDelta = r.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
    540     IntRect result(r);
     538    LayoutUnit widthDelta = r.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
     539    LayoutUnit heightDelta = r.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
     540    LayoutRect result(r);
    541541    if (widthDelta < 0) {
    542542        result.setX(result.x() - margins[leftMargin] * zoomLevel);
     
    640640}
    641641
    642 void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize, float zoomLevel)
     642void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const LayoutSize& minSize, float zoomLevel)
    643643{
    644644    NSControlSize size;
    645     if (minSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomLevel) &&
    646         minSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomLevel))
     645    if (minSize.width() >= static_cast<LayoutUnit>(sizes[NSRegularControlSize].width() * zoomLevel) &&
     646        minSize.height() >= static_cast<LayoutUnit>(sizes[NSRegularControlSize].height() * zoomLevel))
    647647        size = NSRegularControlSize;
    648     else if (minSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomLevel) &&
    649              minSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomLevel))
     648    else if (minSize.width() >= static_cast<LayoutUnit>(sizes[NSSmallControlSize].width() * zoomLevel) &&
     649             minSize.height() >= static_cast<LayoutUnit>(sizes[NSSmallControlSize].height() * zoomLevel))
    650650        size = NSSmallControlSize;
    651651    else
     
    730730}
    731731
    732 bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)
     732bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const LayoutRect& r)
    733733{
    734734    if (paintInfo.context->paintingDisabled())
     
    793793
    794794    // Now inflate it to account for the shadow.
    795     IntRect inflatedRect = r;
     795    LayoutRect inflatedRect = r;
    796796    if (r.width() >= minimumMenuListSize(o->style()))
    797797        inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
     
    818818#if ENABLE(METER_TAG)
    819819
    820 IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const IntRect& bounds) const
     820LayoutSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const LayoutRect& bounds) const
    821821{
    822822    if (NoControlPart == renderMeter->style()->appearance())
     
    825825    NSLevelIndicatorCell* cell = levelIndicatorFor(renderMeter);
    826826    // Makes enough room for cell's intrinsic size.
    827     NSSize cellSize = [cell cellSizeForBounds:IntRect(IntPoint(), bounds.size())];
    828     return IntSize(bounds.width() < cellSize.width ? cellSize.width : bounds.width(),
    829                    bounds.height() < cellSize.height ? cellSize.height : bounds.height());
     827    NSSize cellSize = [cell cellSizeForBounds:LayoutRect(LayoutPoint(), bounds.size())];
     828    return LayoutSize(bounds.width() < cellSize.width ? cellSize.width : bounds.width(),
     829                      bounds.height() < cellSize.height ? cellSize.height : bounds.height());
    830830}
    831831
     
    11071107        GraphicsContextStateSaver stateSaver(*paintInfo.context);
    11081108        CGContextClipToRect(context, topGradient);
    1109         paintInfo.context->addRoundedRectClip(RoundedRect(enclosingLayoutRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
     1109        paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
    11101110        context = cgContextContainer.context();
    11111111        CGContextDrawShading(context, topShading.get());
     
    11151115        GraphicsContextStateSaver stateSaver(*paintInfo.context);
    11161116        CGContextClipToRect(context, bottomGradient);
    1117         paintInfo.context->addRoundedRectClip(RoundedRect(enclosingLayoutRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
     1117        paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
    11181118        context = cgContextContainer.context();
    11191119        CGContextDrawShading(context, bottomShading.get());
     
    12771277}
    12781278
    1279 void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const IntRect& r)
     1279void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const LayoutRect& r)
    12801280{
    12811281    NSPopUpButtonCell* popupButton = this->popupButton();
     
    15391539    // Take care of cases where the cancel button was not aligned with the right border of the input element (for e.g.
    15401540    // when speech input is enabled for the input element.
    1541     IntRect absBoundingBox = input->renderer()->absoluteBoundingBoxRect();
    1542     int absRight = absBoundingBox.x() + absBoundingBox.width() - input->renderBox()->paddingRight() - input->renderBox()->borderRight();
    1543     int spaceToRightOfCancelButton = absRight - (r.x() + r.width());
     1541    LayoutRect absBoundingBox = input->renderer()->absoluteBoundingBoxRect();
     1542    LayoutUnit absRight = absBoundingBox.x() + absBoundingBox.width() - input->renderBox()->paddingRight() - input->renderBox()->borderRight();
     1543    LayoutUnit spaceToRightOfCancelButton = absRight - (r.x() + r.width());
    15441544    localBounds.setX(localBounds.x() - spaceToRightOfCancelButton);
    15451545#endif
     
    20252025}
    20262026
    2027 IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
     2027LayoutPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
    20282028{
    20292029    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
  • trunk/Source/WebCore/rendering/RenderThemeSafari.cpp

    r96859 r106734  
    313313}
    314314
    315 int RenderThemeSafari::baselinePosition(const RenderObject* o) const
     315LayoutUnit RenderThemeSafari::baselinePosition(const RenderObject* o) const
    316316{
    317317    if (!o->isBox())
  • trunk/Source/WebCore/rendering/RenderThemeSafari.h

    r93146 r106734  
    5353    // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
    5454    // controls that need to do this.
    55     virtual int baselinePosition(const RenderObject*) const;
     55    virtual LayoutUnit baselinePosition(const RenderObject*) const;
    5656
    5757    // A method asking if the control changes its tint when the window has focus or not.
  • trunk/Source/WebCore/rendering/RenderThemeWin.cpp

    r96547 r106734  
    875875bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    876876{
    877     IntRect bounds = r;
     877    LayoutRect bounds = r;
    878878    ASSERT(o->parent());
    879879    if (!o->parent() || !o->parent()->isBox())
     
    882882    RenderBox* parentRenderBox = toRenderBox(o->parent());
    883883
    884     IntRect parentBox = parentRenderBox->absoluteContentBox();
     884    LayoutRect parentBox = parentRenderBox->absoluteContentBox();
    885885   
    886886    // Make sure the scaled button stays square and will fit in its parent's box
     
    926926bool RenderThemeWin::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    927927{
    928     IntRect bounds = r;
     928    LayoutRect bounds = r;
    929929    ASSERT(o->parent());
    930930    if (!o->parent() || !o->parent()->isBox())
     
    932932   
    933933    RenderBox* parentRenderBox = toRenderBox(o->parent());
    934     IntRect parentBox = parentRenderBox->absoluteContentBox();
     934    LayoutRect parentBox = parentRenderBox->absoluteContentBox();
    935935   
    936936    // Make sure the scaled decoration stays square and will fit in its parent's box
     
    960960bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
    961961{
    962     IntRect bounds = r;
     962    LayoutRect bounds = r;
    963963    ASSERT(o->parent());
    964964    if (!o->parent())
     
    968968   
    969969    RenderBox* parentRenderBox = toRenderBox(o->parent());
    970     IntRect parentBox = parentRenderBox->absoluteContentBox();
     970    LayoutRect parentBox = parentRenderBox->absoluteContentBox();
    971971   
    972972    // Make sure the scaled decoration will fit in its parent's box
    973973    bounds.setHeight(min(parentBox.height(), bounds.height()));
    974     bounds.setWidth(min(parentBox.width(), static_cast<int>(bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize)));
     974    bounds.setWidth(min<LayoutUnit>(parentBox.width(), bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
    975975
    976976    // Center the button vertically.  Round up though, so if it has to be one pixel off-center, it will
     
    11181118}
    11191119
    1120 IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
     1120LayoutPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
    11211121{
    11221122    return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
  • trunk/Source/WebCore/rendering/RenderThemeWin.h

    r93146 r106734  
    142142    virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
    143143    virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
    144     virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
     144    virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
    145145#endif
    146146
Note: See TracChangeset for help on using the changeset viewer.