Diff
Modified: trunk/Source/WebCore/ChangeLog (106733 => 106734)
--- trunk/Source/WebCore/ChangeLog 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/ChangeLog 2012-02-04 09:42:39 UTC (rev 106734)
@@ -1,3 +1,59 @@
+2012-02-04 Emil A Eklund <[email protected]>
+
+ 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):
+
2012-02-04 Stephen White <[email protected]>
[chromium] Fix multi-second hangs in compositor invalidating large layers
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2012-02-04 09:42:39 UTC (rev 106734)
@@ -242,7 +242,7 @@
}
}
-bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const LayoutRect& r)
{
// If painting is disabled, but we aren't updating control tints, then just bail.
// If we are updating control tints, just schedule a repaint if the theme supports tinting
@@ -500,13 +500,13 @@
return formatMediaControlsTime(currentTime - duration);
}
-IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
+LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
{
- int y = -size.height();
+ LayoutUnit y = -size.height();
FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true);
if (absPoint.y() < 0)
y = muteButtonBox->height();
- return IntPoint(0, y);
+ return LayoutPoint(0, y);
}
#endif
@@ -612,7 +612,7 @@
return platformInactiveSelectionForegroundColor();
}
-int RenderTheme::baselinePosition(const RenderObject* o) const
+LayoutUnit RenderTheme::baselinePosition(const RenderObject* o) const
{
if (!o->isBox())
return 0;
@@ -662,7 +662,7 @@
}
}
-void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)
+void RenderTheme::adjustRepaintRect(const RenderObject* o, LayoutRect& r)
{
#if USE(NEW_THEME)
m_theme->inflateControlPaintRect(o->style()->appearance(), controlStatesForRenderer(o), r, o->style()->effectiveZoom());
@@ -919,7 +919,7 @@
style->setBoxShadow(nullptr);
}
-IntSize RenderTheme::meterSizeForBounds(const RenderMeter*, const IntRect& bounds) const
+LayoutSize RenderTheme::meterSizeForBounds(const RenderMeter*, const LayoutRect& bounds) const
{
return bounds.size();
}
Modified: trunk/Source/WebCore/rendering/RenderTheme.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderTheme.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderTheme.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -97,7 +97,7 @@
// A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline
// position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
// controls that need to do this.
- virtual int baselinePosition(const RenderObject*) const;
+ virtual LayoutUnit baselinePosition(const RenderObject*) const;
// A method for asking if a control is a container or not. Leaf controls have to have some special behavior (like
// the baseline position API above).
@@ -114,7 +114,7 @@
// Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint,
// the theme needs to communicate this inflated rect to the engine so that it can invalidate the whole control.
- virtual void adjustRepaintRect(const RenderObject*, IntRect&);
+ virtual void adjustRepaintRect(const RenderObject*, LayoutRect&);
// This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed
// or a control becomes disabled.
@@ -176,7 +176,7 @@
virtual ScrollbarControlSize scrollbarControlSizeForPart(ControlPart) { return RegularScrollbar; }
// Method for painting the caps lock indicator
- virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&) { return 0; };
+ virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const LayoutRect&) { return 0; };
#if ENABLE(PROGRESS_TAG)
// Returns the repeat interval of the animation for the progress bar.
@@ -198,11 +198,11 @@
virtual String formatMediaControlsRemainingTime(float currentTime, float duration) const;
// Returns the media volume slider container's offset from the mute button.
- virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
+ virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
#endif
#if ENABLE(METER_TAG)
- virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
+ virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const;
virtual bool supportsMeter(ControlPart) const;
#endif
Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumMac.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeChromiumMac.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumMac.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -49,7 +49,7 @@
virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
- virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
+ virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
virtual bool usesMediaControlStatusDisplay() { return false; }
virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; }
#endif
Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm 2012-02-04 09:42:39 UTC (rev 106734)
@@ -211,7 +211,7 @@
return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
}
-IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
+LayoutPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
{
return RenderTheme::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
}
Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp 2012-02-04 09:42:39 UTC (rev 106734)
@@ -260,10 +260,10 @@
style->setHeight(Length(cancelButtonSize, Fixed));
}
-IntRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const
+LayoutRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const
{
// Compute an offset between the part renderer and the input renderer.
- IntSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));
+ LayoutSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));
// Move the rect into partRenderer's coords.
partRect.move(offsetFromInputRenderer);
// Account for the local drawing offset.
@@ -279,17 +279,17 @@
if (!input->renderer()->isBox())
return false;
RenderBox* inputRenderBox = toRenderBox(input->renderer());
- IntRect inputContentBox = inputRenderBox->contentBoxRect();
+ LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
// Make sure the scaled button stays square and will fit in its parent's box.
- int cancelButtonSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
+ LayoutUnit cancelButtonSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), r.height()));
// Calculate cancel button's coordinates relative to the input element.
// Center the button vertically. Round up though, so if it has to be one pixel off-center, it will
// be one pixel closer to the bottom of the field. This tends to look better with the text.
- IntRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
- inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
- cancelButtonSize, cancelButtonSize);
- IntRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
+ LayoutRect cancelButtonRect(cancelButtonObject->offsetFromAncestorContainer(inputRenderBox).width(),
+ inputContentBox.y() + (inputContentBox.height() - cancelButtonSize + 1) / 2,
+ cancelButtonSize, cancelButtonSize);
+ LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, cancelButtonObject, cancelButtonRect, r);
static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef();
static Image* cancelPressedImage = Image::loadPlatformResource("searchCancelPressed").leakRef();
@@ -322,17 +322,17 @@
if (!input->renderer()->isBox())
return false;
RenderBox* inputRenderBox = toRenderBox(input->renderer());
- IntRect inputContentBox = inputRenderBox->contentBoxRect();
+ LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
// Make sure the scaled decoration stays square and will fit in its parent's box.
- int magnifierSize = std::min(inputContentBox.width(), std::min(inputContentBox.height(), r.height()));
+ LayoutUnit magnifierSize = std::min(inputContentBox.width(), std::min<LayoutUnit>(inputContentBox.height(), r.height()));
// Calculate decoration's coordinates relative to the input element.
// Center the decoration vertically. Round up though, so if it has to be one pixel off-center, it will
// be one pixel closer to the bottom of the field. This tends to look better with the text.
- IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
- inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2,
- magnifierSize, magnifierSize);
- IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
+ LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
+ inputContentBox.y() + (inputContentBox.height() - magnifierSize + 1) / 2,
+ magnifierSize, magnifierSize);
+ LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef();
paintInfo.context->drawImage(magnifierImage, magnifierObject->style()->colorSpace(), paintingRect);
@@ -357,15 +357,15 @@
if (!input->renderer()->isBox())
return false;
RenderBox* inputRenderBox = toRenderBox(input->renderer());
- IntRect inputContentBox = inputRenderBox->contentBoxRect();
+ LayoutRect inputContentBox = inputRenderBox->contentBoxRect();
// Make sure the scaled decoration will fit in its parent's box.
- int magnifierHeight = std::min(inputContentBox.height(), r.height());
- int magnifierWidth = std::min(inputContentBox.width(), static_cast<int>(magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
- IntRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
- inputContentBox.y() + (inputContentBox.height() - magnifierHeight + 1) / 2,
- magnifierWidth, magnifierHeight);
- IntRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
+ LayoutUnit magnifierHeight = std::min<LayoutUnit>(inputContentBox.height(), r.height());
+ LayoutUnit magnifierWidth = std::min<LayoutUnit>(inputContentBox.width(), magnifierHeight * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize);
+ LayoutRect magnifierRect(magnifierObject->offsetFromAncestorContainer(inputRenderBox).width(),
+ inputContentBox.y() + (inputContentBox.height() - magnifierHeight + 1) / 2,
+ magnifierWidth, magnifierHeight);
+ LayoutRect paintingRect = convertToPaintingRect(inputRenderBox, magnifierObject, magnifierRect, r);
static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef();
paintInfo.context->drawImage(magnifierImage, magnifierObject->style()->colorSpace(), paintingRect);
Modified: trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -157,7 +157,7 @@
int menuListInternalPadding(RenderStyle*, int paddingType) const;
bool paintMediaButtonInternal(GraphicsContext*, const IntRect&, Image*);
- IntRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const;
+ LayoutRect convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeMac.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -45,7 +45,7 @@
// A general method asking if any control tinting is supported at all.
virtual bool supportsControlTints() const { return true; }
- virtual void adjustRepaintRect(const RenderObject*, IntRect&);
+ virtual void adjustRepaintRect(const RenderObject*, LayoutRect&);
virtual bool isControlStyled(const RenderStyle*, const BorderData&,
const FillLayer&, const Color& backgroundColor) const;
@@ -74,12 +74,12 @@
virtual int popupInternalPaddingTop(RenderStyle*) const;
virtual int popupInternalPaddingBottom(RenderStyle*) const;
- virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);
+ virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const LayoutRect&);
virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; }
#if ENABLE(METER_TAG)
- virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;
+ virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const;
virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool supportsMeter(ControlPart) const;
#endif
@@ -169,7 +169,7 @@
virtual bool usesMediaControlStatusDisplay();
virtual bool usesMediaControlVolumeSlider() const;
virtual void adjustMediaSliderThumbSize(RenderStyle*) const;
- virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
+ virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
#endif
virtual bool shouldShowPlaceholderWhenFocused() const;
@@ -177,14 +177,14 @@
private:
virtual String fileListNameForWidth(const Vector<String>& filenames, const Font&, int width, bool multipleFilesAllowed);
- IntRect inflateRect(const IntRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
+ LayoutRect inflateRect(const LayoutRect&, const IntSize&, const int* margins, float zoomLevel = 1.0f) const;
FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const;
// Get the control size based off the font. Used by some of the controls (like buttons).
NSControlSize controlSizeForFont(RenderStyle*) const;
NSControlSize controlSizeForSystemFont(RenderStyle*) const;
- void setControlSize(NSCell*, const IntSize* sizes, const IntSize& minSize, float zoomLevel = 1.0f);
+ void setControlSize(NSCell*, const IntSize* sizes, const LayoutSize& minSize, float zoomLevel = 1.0f);
void setSizeFromFont(RenderStyle*, const IntSize* sizes) const;
IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const;
IntSize sizeForSystemFont(RenderStyle*, const IntSize* sizes) const;
@@ -199,7 +199,7 @@
// Helpers for adjusting appearance and for painting
- void setPopupButtonCellState(const RenderObject*, const IntRect&);
+ void setPopupButtonCellState(const RenderObject*, const LayoutRect&);
const IntSize* popupButtonSizes() const;
const int* popupButtonMargins() const;
const int* popupButtonPadding(NSControlSize) const;
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2012-02-04 09:42:39 UTC (rev 106734)
@@ -500,7 +500,7 @@
return RenderTheme::isControlStyled(style, border, background, backgroundColor);
}
-void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)
+void RenderThemeMac::adjustRepaintRect(const RenderObject* o, LayoutRect& r)
{
ControlPart part = o->style()->appearance();
@@ -531,13 +531,13 @@
}
}
-IntRect RenderThemeMac::inflateRect(const IntRect& r, const IntSize& size, const int* margins, float zoomLevel) const
+LayoutRect RenderThemeMac::inflateRect(const LayoutRect& r, const IntSize& size, const int* margins, float zoomLevel) const
{
// Only do the inflation if the available width/height are too small. Otherwise try to
// fit the glow/check space into the available box's width/height.
- int widthDelta = r.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
- int heightDelta = r.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
- IntRect result(r);
+ LayoutUnit widthDelta = r.width() - (size.width() + margins[leftMargin] * zoomLevel + margins[rightMargin] * zoomLevel);
+ LayoutUnit heightDelta = r.height() - (size.height() + margins[topMargin] * zoomLevel + margins[bottomMargin] * zoomLevel);
+ LayoutRect result(r);
if (widthDelta < 0) {
result.setX(result.x() - margins[leftMargin] * zoomLevel);
result.setWidth(result.width() - widthDelta);
@@ -639,14 +639,14 @@
return NSMiniControlSize;
}
-void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize, float zoomLevel)
+void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const LayoutSize& minSize, float zoomLevel)
{
NSControlSize size;
- if (minSize.width() >= static_cast<int>(sizes[NSRegularControlSize].width() * zoomLevel) &&
- minSize.height() >= static_cast<int>(sizes[NSRegularControlSize].height() * zoomLevel))
+ if (minSize.width() >= static_cast<LayoutUnit>(sizes[NSRegularControlSize].width() * zoomLevel) &&
+ minSize.height() >= static_cast<LayoutUnit>(sizes[NSRegularControlSize].height() * zoomLevel))
size = NSRegularControlSize;
- else if (minSize.width() >= static_cast<int>(sizes[NSSmallControlSize].width() * zoomLevel) &&
- minSize.height() >= static_cast<int>(sizes[NSSmallControlSize].height() * zoomLevel))
+ else if (minSize.width() >= static_cast<LayoutUnit>(sizes[NSSmallControlSize].width() * zoomLevel) &&
+ minSize.height() >= static_cast<LayoutUnit>(sizes[NSSmallControlSize].height() * zoomLevel))
size = NSSmallControlSize;
else
size = NSMiniControlSize;
@@ -729,7 +729,7 @@
{
}
-bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const LayoutRect& r)
{
if (paintInfo.context->paintingDisabled())
return true;
@@ -792,7 +792,7 @@
size.setWidth(r.width());
// Now inflate it to account for the shadow.
- IntRect inflatedRect = r;
+ LayoutRect inflatedRect = r;
if (r.width() >= minimumMenuListSize(o->style()))
inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
@@ -817,16 +817,16 @@
#if ENABLE(METER_TAG)
-IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const IntRect& bounds) const
+LayoutSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const LayoutRect& bounds) const
{
if (NoControlPart == renderMeter->style()->appearance())
return bounds.size();
NSLevelIndicatorCell* cell = levelIndicatorFor(renderMeter);
// Makes enough room for cell's intrinsic size.
- NSSize cellSize = [cell cellSizeForBounds:IntRect(IntPoint(), bounds.size())];
- return IntSize(bounds.width() < cellSize.width ? cellSize.width : bounds.width(),
- bounds.height() < cellSize.height ? cellSize.height : bounds.height());
+ NSSize cellSize = [cell cellSizeForBounds:LayoutRect(LayoutPoint(), bounds.size())];
+ return LayoutSize(bounds.width() < cellSize.width ? cellSize.width : bounds.width(),
+ bounds.height() < cellSize.height ? cellSize.height : bounds.height());
}
bool RenderThemeMac::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
@@ -1106,7 +1106,7 @@
{
GraphicsContextStateSaver stateSaver(*paintInfo.context);
CGContextClipToRect(context, topGradient);
- paintInfo.context->addRoundedRectClip(RoundedRect(enclosingLayoutRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
+ paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
context = cgContextContainer.context();
CGContextDrawShading(context, topShading.get());
}
@@ -1114,7 +1114,7 @@
if (!bottomGradient.isEmpty()) {
GraphicsContextStateSaver stateSaver(*paintInfo.context);
CGContextClipToRect(context, bottomGradient);
- paintInfo.context->addRoundedRectClip(RoundedRect(enclosingLayoutRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
+ paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
context = cgContextContainer.context();
CGContextDrawShading(context, bottomShading.get());
}
@@ -1276,7 +1276,7 @@
style->setLineHeight(RenderStyle::initialLineHeight());
}
-void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const IntRect& r)
+void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const LayoutRect& r)
{
NSPopUpButtonCell* popupButton = this->popupButton();
@@ -1538,9 +1538,9 @@
#if ENABLE(INPUT_SPEECH)
// Take care of cases where the cancel button was not aligned with the right border of the input element (for e.g.
// when speech input is enabled for the input element.
- IntRect absBoundingBox = input->renderer()->absoluteBoundingBoxRect();
- int absRight = absBoundingBox.x() + absBoundingBox.width() - input->renderBox()->paddingRight() - input->renderBox()->borderRight();
- int spaceToRightOfCancelButton = absRight - (r.x() + r.width());
+ LayoutRect absBoundingBox = input->renderer()->absoluteBoundingBoxRect();
+ LayoutUnit absRight = absBoundingBox.x() + absBoundingBox.width() - input->renderBox()->paddingRight() - input->renderBox()->borderRight();
+ LayoutUnit spaceToRightOfCancelButton = absRight - (r.x() + r.width());
localBounds.setX(localBounds.x() - spaceToRightOfCancelButton);
#endif
@@ -2024,7 +2024,7 @@
return mediaControllerTheme() == MediaControllerThemeQuickTime;
}
-IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
+LayoutPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
{
return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
}
Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.cpp (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeSafari.cpp 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.cpp 2012-02-04 09:42:39 UTC (rev 106734)
@@ -312,7 +312,7 @@
return result;
}
-int RenderThemeSafari::baselinePosition(const RenderObject* o) const
+LayoutUnit RenderThemeSafari::baselinePosition(const RenderObject* o) const
{
if (!o->isBox())
return 0;
Modified: trunk/Source/WebCore/rendering/RenderThemeSafari.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeSafari.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeSafari.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -52,7 +52,7 @@
// A method to obtain the baseline position for a "leaf" control. This will only be used if a baseline
// position cannot be determined by examining child content. Checkboxes and radio buttons are examples of
// controls that need to do this.
- virtual int baselinePosition(const RenderObject*) const;
+ virtual LayoutUnit baselinePosition(const RenderObject*) const;
// A method asking if the control changes its tint when the window has focus or not.
virtual bool controlSupportsTints(const RenderObject*) const;
Modified: trunk/Source/WebCore/rendering/RenderThemeWin.cpp (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.cpp 2012-02-04 09:42:39 UTC (rev 106734)
@@ -874,14 +874,14 @@
bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- IntRect bounds = r;
+ LayoutRect bounds = r;
ASSERT(o->parent());
if (!o->parent() || !o->parent()->isBox())
return false;
RenderBox* parentRenderBox = toRenderBox(o->parent());
- IntRect parentBox = parentRenderBox->absoluteContentBox();
+ LayoutRect parentBox = parentRenderBox->absoluteContentBox();
// Make sure the scaled button stays square and will fit in its parent's box
bounds.setHeight(min(parentBox.width(), min(parentBox.height(), bounds.height())));
@@ -925,13 +925,13 @@
bool RenderThemeWin::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- IntRect bounds = r;
+ LayoutRect bounds = r;
ASSERT(o->parent());
if (!o->parent() || !o->parent()->isBox())
return false;
RenderBox* parentRenderBox = toRenderBox(o->parent());
- IntRect parentBox = parentRenderBox->absoluteContentBox();
+ LayoutRect parentBox = parentRenderBox->absoluteContentBox();
// Make sure the scaled decoration stays square and will fit in its parent's box
bounds.setHeight(min(parentBox.width(), min(parentBox.height(), bounds.height())));
@@ -959,7 +959,7 @@
bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
{
- IntRect bounds = r;
+ LayoutRect bounds = r;
ASSERT(o->parent());
if (!o->parent())
return false;
@@ -967,11 +967,11 @@
return false;
RenderBox* parentRenderBox = toRenderBox(o->parent());
- IntRect parentBox = parentRenderBox->absoluteContentBox();
+ LayoutRect parentBox = parentRenderBox->absoluteContentBox();
// Make sure the scaled decoration will fit in its parent's box
bounds.setHeight(min(parentBox.height(), bounds.height()));
- bounds.setWidth(min(parentBox.width(), static_cast<int>(bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize)));
+ bounds.setWidth(min<LayoutUnit>(parentBox.width(), bounds.height() * defaultSearchFieldResultsButtonWidth / defaultSearchFieldResultsDecorationSize));
// Center the button vertically. Round up though, so if it has to be one pixel off-center, it will
// be one pixel closer to the bottom of the field. This tends to look better with the text.
@@ -1117,7 +1117,7 @@
return RenderMediaControls::paintMediaControlsPart(MediaVolumeSliderThumb, o, paintInfo, r);
}
-IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const
+LayoutPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const
{
return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size);
}
Modified: trunk/Source/WebCore/rendering/RenderThemeWin.h (106733 => 106734)
--- trunk/Source/WebCore/rendering/RenderThemeWin.h 2012-02-04 09:40:39 UTC (rev 106733)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h 2012-02-04 09:42:39 UTC (rev 106734)
@@ -141,7 +141,7 @@
virtual bool paintMediaVolumeSliderContainer(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&);
virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
- virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;
+ virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const;
#endif
virtual bool shouldShowPlaceholderWhenFocused() const { return true; }