Changeset 106734 in webkit
- Timestamp:
- Feb 4, 2012 1:42:39 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106732 r106734 1 2012-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 1 57 2012-02-04 Stephen White <senorblanco@chromium.org> 2 58 -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r105403 r106734 243 243 } 244 244 245 bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)245 bool RenderTheme::paint(RenderObject* o, const PaintInfo& paintInfo, const LayoutRect& r) 246 246 { 247 247 // If painting is disabled, but we aren't updating control tints, then just bail. … … 501 501 } 502 502 503 IntPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const504 { 505 int y = -size.height();503 LayoutPoint RenderTheme::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const 504 { 505 LayoutUnit y = -size.height(); 506 506 FloatPoint absPoint = muteButtonBox->localToAbsolute(FloatPoint(muteButtonBox->offsetLeft(), y), true, true); 507 507 if (absPoint.y() < 0) 508 508 y = muteButtonBox->height(); 509 return IntPoint(0, y);509 return LayoutPoint(0, y); 510 510 } 511 511 … … 613 613 } 614 614 615 int RenderTheme::baselinePosition(const RenderObject* o) const615 LayoutUnit RenderTheme::baselinePosition(const RenderObject* o) const 616 616 { 617 617 if (!o->isBox()) … … 663 663 } 664 664 665 void RenderTheme::adjustRepaintRect(const RenderObject* o, IntRect& r)665 void RenderTheme::adjustRepaintRect(const RenderObject* o, LayoutRect& r) 666 666 { 667 667 #if USE(NEW_THEME) … … 920 920 } 921 921 922 IntSize RenderTheme::meterSizeForBounds(const RenderMeter*, const IntRect& bounds) const922 LayoutSize RenderTheme::meterSizeForBounds(const RenderMeter*, const LayoutRect& bounds) const 923 923 { 924 924 return bounds.size(); -
trunk/Source/WebCore/rendering/RenderTheme.h
r105253 r106734 98 98 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 99 99 // controls that need to do this. 100 virtual int baselinePosition(const RenderObject*) const;100 virtual LayoutUnit baselinePosition(const RenderObject*) const; 101 101 102 102 // A method for asking if a control is a container or not. Leaf controls have to have some special behavior (like … … 115 115 // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, 116 116 // 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&); 118 118 119 119 // This method is called whenever a relevant state changes on a particular themed object, e.g., the mouse becomes pressed … … 177 177 178 178 // 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; }; 180 180 181 181 #if ENABLE(PROGRESS_TAG) … … 199 199 200 200 // 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; 202 202 #endif 203 203 204 204 #if ENABLE(METER_TAG) 205 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;205 virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const; 206 206 virtual bool supportsMeter(ControlPart) const; 207 207 #endif -
trunk/Source/WebCore/rendering/RenderThemeChromiumMac.h
r104494 r106734 50 50 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&); 51 51 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&); 52 virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;52 virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const; 53 53 virtual bool usesMediaControlStatusDisplay() { return false; } 54 54 virtual bool hasOwnDisabledStateHandlingFor(ControlPart) const { return true; } -
trunk/Source/WebCore/rendering/RenderThemeChromiumMac.mm
r104494 r106734 212 212 } 213 213 214 IntPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const214 LayoutPoint RenderThemeChromiumMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const 215 215 { 216 216 return RenderTheme::volumeSliderOffsetFromMuteButton(muteButtonBox, size); -
trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.cpp
r101848 r106734 261 261 } 262 262 263 IntRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, IntRect partRect, const IntRect& localOffset) const263 LayoutRect RenderThemeChromiumSkia::convertToPaintingRect(RenderObject* inputRenderer, const RenderObject* partRenderer, LayoutRect partRect, const IntRect& localOffset) const 264 264 { 265 265 // Compute an offset between the part renderer and the input renderer. 266 IntSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer));266 LayoutSize offsetFromInputRenderer = -(partRenderer->offsetFromAncestorContainer(inputRenderer)); 267 267 // Move the rect into partRenderer's coords. 268 268 partRect.move(offsetFromInputRenderer); … … 280 280 return false; 281 281 RenderBox* inputRenderBox = toRenderBox(input->renderer()); 282 IntRect inputContentBox = inputRenderBox->contentBoxRect();282 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); 283 283 284 284 // 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())); 286 286 // Calculate cancel button's coordinates relative to the input element. 287 287 // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will 288 288 // 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); 293 293 294 294 static Image* cancelImage = Image::loadPlatformResource("searchCancel").leakRef(); … … 323 323 return false; 324 324 RenderBox* inputRenderBox = toRenderBox(input->renderer()); 325 IntRect inputContentBox = inputRenderBox->contentBoxRect();325 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); 326 326 327 327 // 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())); 329 329 // Calculate decoration's coordinates relative to the input element. 330 330 // Center the decoration vertically. Round up though, so if it has to be one pixel off-center, it will 331 331 // 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); 336 336 337 337 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifier").leakRef(); … … 358 358 return false; 359 359 RenderBox* inputRenderBox = toRenderBox(input->renderer()); 360 IntRect inputContentBox = inputRenderBox->contentBoxRect();360 LayoutRect inputContentBox = inputRenderBox->contentBoxRect(); 361 361 362 362 // 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); 369 369 370 370 static Image* magnifierImage = Image::loadPlatformResource("searchMagnifierResults").leakRef(); -
trunk/Source/WebCore/rendering/RenderThemeChromiumSkia.h
r102660 r106734 158 158 int menuListInternalPadding(RenderStyle*, int paddingType) const; 159 159 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; 161 161 }; 162 162 -
trunk/Source/WebCore/rendering/RenderThemeMac.h
r105253 r106734 46 46 virtual bool supportsControlTints() const { return true; } 47 47 48 virtual void adjustRepaintRect(const RenderObject*, IntRect&);48 virtual void adjustRepaintRect(const RenderObject*, LayoutRect&); 49 49 50 50 virtual bool isControlStyled(const RenderStyle*, const BorderData&, … … 75 75 virtual int popupInternalPaddingBottom(RenderStyle*) const; 76 76 77 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const IntRect&);77 virtual bool paintCapsLockIndicator(RenderObject*, const PaintInfo&, const LayoutRect&); 78 78 79 79 virtual bool popsMenuByArrowKeys() const OVERRIDE { return true; } 80 80 81 81 #if ENABLE(METER_TAG) 82 virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const;82 virtual LayoutSize meterSizeForBounds(const RenderMeter*, const LayoutRect&) const; 83 83 virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&); 84 84 virtual bool supportsMeter(ControlPart) const; … … 170 170 virtual bool usesMediaControlVolumeSlider() const; 171 171 virtual void adjustMediaSliderThumbSize(RenderStyle*) const; 172 virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;172 virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const; 173 173 #endif 174 174 … … 178 178 virtual String fileListNameForWidth(const Vector<String>& filenames, const Font&, int width, bool multipleFilesAllowed); 179 179 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; 181 181 182 182 FloatRect convertToPaintingRect(const RenderObject* inputRenderer, const RenderObject* partRenderer, const FloatRect& inputRect, const IntRect& r) const; … … 185 185 NSControlSize controlSizeForFont(RenderStyle*) const; 186 186 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); 188 188 void setSizeFromFont(RenderStyle*, const IntSize* sizes) const; 189 189 IntSize sizeForFont(RenderStyle*, const IntSize* sizes) const; … … 200 200 // Helpers for adjusting appearance and for painting 201 201 202 void setPopupButtonCellState(const RenderObject*, const IntRect&);202 void setPopupButtonCellState(const RenderObject*, const LayoutRect&); 203 203 const IntSize* popupButtonSizes() const; 204 204 const int* popupButtonMargins() const; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r105032 r106734 501 501 } 502 502 503 void RenderThemeMac::adjustRepaintRect(const RenderObject* o, IntRect& r)503 void RenderThemeMac::adjustRepaintRect(const RenderObject* o, LayoutRect& r) 504 504 { 505 505 ControlPart part = o->style()->appearance(); … … 532 532 } 533 533 534 IntRect RenderThemeMac::inflateRect(const IntRect& r, const IntSize& size, const int* margins, float zoomLevel) const534 LayoutRect RenderThemeMac::inflateRect(const LayoutRect& r, const IntSize& size, const int* margins, float zoomLevel) const 535 535 { 536 536 // Only do the inflation if the available width/height are too small. Otherwise try to 537 537 // 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); 541 541 if (widthDelta < 0) { 542 542 result.setX(result.x() - margins[leftMargin] * zoomLevel); … … 640 640 } 641 641 642 void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const IntSize& minSize, float zoomLevel)642 void RenderThemeMac::setControlSize(NSCell* cell, const IntSize* sizes, const LayoutSize& minSize, float zoomLevel) 643 643 { 644 644 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)) 647 647 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)) 650 650 size = NSSmallControlSize; 651 651 else … … 730 730 } 731 731 732 bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)732 bool RenderThemeMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const LayoutRect& r) 733 733 { 734 734 if (paintInfo.context->paintingDisabled()) … … 793 793 794 794 // Now inflate it to account for the shadow. 795 IntRect inflatedRect = r;795 LayoutRect inflatedRect = r; 796 796 if (r.width() >= minimumMenuListSize(o->style())) 797 797 inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel); … … 818 818 #if ENABLE(METER_TAG) 819 819 820 IntSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const IntRect& bounds) const820 LayoutSize RenderThemeMac::meterSizeForBounds(const RenderMeter* renderMeter, const LayoutRect& bounds) const 821 821 { 822 822 if (NoControlPart == renderMeter->style()->appearance()) … … 825 825 NSLevelIndicatorCell* cell = levelIndicatorFor(renderMeter); 826 826 // 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()); 830 830 } 831 831 … … 1107 1107 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1108 1108 CGContextClipToRect(context, topGradient); 1109 paintInfo.context->addRoundedRectClip(RoundedRect(enclosing LayoutRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));1109 paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize())); 1110 1110 context = cgContextContainer.context(); 1111 1111 CGContextDrawShading(context, topShading.get()); … … 1115 1115 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1116 1116 CGContextClipToRect(context, bottomGradient); 1117 paintInfo.context->addRoundedRectClip(RoundedRect(enclosing LayoutRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));1117 paintInfo.context->addRoundedRectClip(RoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight())); 1118 1118 context = cgContextContainer.context(); 1119 1119 CGContextDrawShading(context, bottomShading.get()); … … 1277 1277 } 1278 1278 1279 void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const IntRect& r)1279 void RenderThemeMac::setPopupButtonCellState(const RenderObject* o, const LayoutRect& r) 1280 1280 { 1281 1281 NSPopUpButtonCell* popupButton = this->popupButton(); … … 1539 1539 // Take care of cases where the cancel button was not aligned with the right border of the input element (for e.g. 1540 1540 // 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()); 1544 1544 localBounds.setX(localBounds.x() - spaceToRightOfCancelButton); 1545 1545 #endif … … 2025 2025 } 2026 2026 2027 IntPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const2027 LayoutPoint RenderThemeMac::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const 2028 2028 { 2029 2029 return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size); -
trunk/Source/WebCore/rendering/RenderThemeSafari.cpp
r96859 r106734 313 313 } 314 314 315 int RenderThemeSafari::baselinePosition(const RenderObject* o) const315 LayoutUnit RenderThemeSafari::baselinePosition(const RenderObject* o) const 316 316 { 317 317 if (!o->isBox()) -
trunk/Source/WebCore/rendering/RenderThemeSafari.h
r93146 r106734 53 53 // position cannot be determined by examining child content. Checkboxes and radio buttons are examples of 54 54 // controls that need to do this. 55 virtual int baselinePosition(const RenderObject*) const;55 virtual LayoutUnit baselinePosition(const RenderObject*) const; 56 56 57 57 // A method asking if the control changes its tint when the window has focus or not. -
trunk/Source/WebCore/rendering/RenderThemeWin.cpp
r96547 r106734 875 875 bool RenderThemeWin::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 876 876 { 877 IntRect bounds = r;877 LayoutRect bounds = r; 878 878 ASSERT(o->parent()); 879 879 if (!o->parent() || !o->parent()->isBox()) … … 882 882 RenderBox* parentRenderBox = toRenderBox(o->parent()); 883 883 884 IntRect parentBox = parentRenderBox->absoluteContentBox();884 LayoutRect parentBox = parentRenderBox->absoluteContentBox(); 885 885 886 886 // Make sure the scaled button stays square and will fit in its parent's box … … 926 926 bool RenderThemeWin::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 927 927 { 928 IntRect bounds = r;928 LayoutRect bounds = r; 929 929 ASSERT(o->parent()); 930 930 if (!o->parent() || !o->parent()->isBox()) … … 932 932 933 933 RenderBox* parentRenderBox = toRenderBox(o->parent()); 934 IntRect parentBox = parentRenderBox->absoluteContentBox();934 LayoutRect parentBox = parentRenderBox->absoluteContentBox(); 935 935 936 936 // Make sure the scaled decoration stays square and will fit in its parent's box … … 960 960 bool RenderThemeWin::paintSearchFieldResultsButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r) 961 961 { 962 IntRect bounds = r;962 LayoutRect bounds = r; 963 963 ASSERT(o->parent()); 964 964 if (!o->parent()) … … 968 968 969 969 RenderBox* parentRenderBox = toRenderBox(o->parent()); 970 IntRect parentBox = parentRenderBox->absoluteContentBox();970 LayoutRect parentBox = parentRenderBox->absoluteContentBox(); 971 971 972 972 // Make sure the scaled decoration will fit in its parent's box 973 973 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)); 975 975 976 976 // Center the button vertically. Round up though, so if it has to be one pixel off-center, it will … … 1118 1118 } 1119 1119 1120 IntPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const IntSize& size) const1120 LayoutPoint RenderThemeWin::volumeSliderOffsetFromMuteButton(RenderBox* muteButtonBox, const LayoutSize& size) const 1121 1121 { 1122 1122 return RenderMediaControls::volumeSliderOffsetFromMuteButton(muteButtonBox, size); -
trunk/Source/WebCore/rendering/RenderThemeWin.h
r93146 r106734 142 142 virtual bool paintMediaVolumeSliderTrack(RenderObject*, const PaintInfo&, const IntRect&); 143 143 virtual bool paintMediaVolumeSliderThumb(RenderObject*, const PaintInfo&, const IntRect&); 144 virtual IntPoint volumeSliderOffsetFromMuteButton(RenderBox*, const IntSize&) const;144 virtual LayoutPoint volumeSliderOffsetFromMuteButton(RenderBox*, const LayoutSize&) const; 145 145 #endif 146 146
Note: See TracChangeset
for help on using the changeset viewer.