Changeset 169928 in webkit
- Timestamp:
- Jun 12, 2014, 8:58:46 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 17 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-mountainlion/compositing/contents-opaque/control-layer-expected.txt (modified) (1 diff)
-
LayoutTests/platform/mac/compositing/contents-opaque/control-layer-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.cpp (modified) (2 diffs)
-
Source/WebCore/platform/Theme.h (modified) (2 diffs)
-
Source/WebCore/platform/gtk/RenderThemeGtk.h (modified) (1 diff)
-
Source/WebCore/platform/gtk/RenderThemeGtk2.cpp (modified) (3 diffs)
-
Source/WebCore/platform/gtk/RenderThemeGtk3.cpp (modified) (2 diffs)
-
Source/WebCore/platform/mac/ThemeMac.h (modified) (1 diff)
-
Source/WebCore/platform/mac/ThemeMac.mm (modified) (21 diffs)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlowThread.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTheme.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderTheme.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderThemeMac.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderThemeMac.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r169907 r169928 1 2014-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 1 17 2014-06-12 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 18 -
trunk/LayoutTests/platform/mac-mountainlion/compositing/contents-opaque/control-layer-expected.txt
r168247 r169928 11 11 (position 5.00 6.00) 12 12 (anchor 0.50 0.46) 13 (bounds 12 9.00 28.00)13 (bounds 128.00 28.00) 14 14 (drawsContent 1) 15 15 ) -
trunk/LayoutTests/platform/mac/compositing/contents-opaque/control-layer-expected.txt
r168247 r169928 11 11 (position 5.00 6.00) 12 12 (anchor 0.50 0.46) 13 (bounds 12 8.00 28.00)13 (bounds 127.00 28.00) 14 14 (drawsContent 1) 15 15 ) -
trunk/Source/WebCore/ChangeLog
r169927 r169928 1 2014-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 1 46 2014-06-12 Brent Fulgham <bfulgham@apple.com> 2 47 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r169632 r169928 727 727 return IntRect(); 728 728 729 IntRect result;729 FloatRect result; 730 730 for (const auto& quad : quads) { 731 IntRect r = quad.enclosingBoundingBox();731 FloatRect r = quad.enclosingBoundingBox(); 732 732 if (!r.isEmpty()) { 733 733 if (obj->style().hasAppearance()) … … 736 736 } 737 737 } 738 return result;738 return pixelSnappedIntRect(LayoutRect(result)); 739 739 } 740 740 -
trunk/Source/WebCore/platform/Theme.h
r166422 r169928 99 99 100 100 // 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*) { } 102 102 103 103 // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, … … 105 105 // The rect passed in is in zoomed coordinates, so the inflation should take that into account and make sure the inflation 106 106 // 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 { } 108 108 109 109 // This method is called once, from RenderTheme::adjustDefaultStyleSheet(), to let each platform adjust -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk.h
r169898 r169928 56 56 virtual bool supportsControlTints() const override { return true; } 57 57 58 virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;58 virtual void adjustRepaintRect(const RenderObject&, FloatRect&) override; 59 59 60 60 // 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 98 98 #endif 99 99 100 static void adjustRectForFocus(GtkWidget* widget, IntRect& rect, bool ignoreInteriorFocusProperty = false)100 static void adjustRectForFocus(GtkWidget* widget, FloatRect& rect, bool ignoreInteriorFocusProperty = false) 101 101 { 102 102 gint focusWidth, focusPad; … … 111 111 } 112 112 113 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)113 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, FloatRect& rect) 114 114 { 115 115 ControlPart part = renderObject.style().appearance(); … … 188 188 189 189 if (theme->isFocused(renderObject)) { 190 IntRect focusRect(buttonRect);190 FloatRect focusRect(buttonRect); 191 191 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); 193 194 } 194 195 } -
trunk/Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
r169898 r169928 149 149 #endif 150 150 151 static void adjustRectForFocus(GtkStyleContext* context, IntRect& rect)151 static void adjustRectForFocus(GtkStyleContext* context, FloatRect& rect) 152 152 { 153 153 gint focusWidth, focusPad; … … 158 158 } 159 159 160 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, IntRect& rect)160 void RenderThemeGtk::adjustRepaintRect(const RenderObject& renderObject, FloatRect& rect) 161 161 { 162 162 GtkStyleContext* context = 0; -
trunk/Source/WebCore/platform/mac/ThemeMac.h
r166422 r169928 52 52 virtual bool controlRequiresPreWhiteSpace(ControlPart part) const { return part == PushButtonPart; } 53 53 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; 56 56 57 57 // 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 253 253 } 254 254 255 static IntRect inflateRect(const IntRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor)255 static FloatRect inflateRect(const FloatRect& zoomedRect, const IntSize& zoomedSize, const int* margins, float zoomFactor) 256 256 { 257 257 // Only do the inflation if the available width/height are too small. Otherwise try to … … 259 259 int widthDelta = zoomedRect.width() - (zoomedSize.width() + margins[leftMargin] * zoomFactor + margins[rightMargin] * zoomFactor); 260 260 int heightDelta = zoomedRect.height() - (zoomedSize.height() + margins[topMargin] * zoomFactor + margins[bottomMargin] * zoomFactor); 261 IntRect result(zoomedRect);261 FloatRect result(zoomedRect); 262 262 if (widthDelta < 0) { 263 263 result.setX(result.x() - margins[leftMargin] * zoomFactor); … … 351 351 } 352 352 353 static void configureToggleButton(NSCell* cell, ControlPart buttonType, const ControlStates* states, const Int Rect& zoomedRect, float zoomFactor, bool isStateChange)353 static void configureToggleButton(NSCell* cell, ControlPart buttonType, const ControlStates* states, const IntSize& zoomedSize, float zoomFactor, bool isStateChange) 354 354 { 355 355 // Set the control size based off the rectangle we're painting into. 356 setControlSize(cell, buttonType == CheckboxPart ? checkboxSizes() : radioSizes(), zoomed Rect.size(), zoomFactor);356 setControlSize(cell, buttonType == CheckboxPart ? checkboxSizes() : radioSizes(), zoomedSize, zoomFactor); 357 357 358 358 // Update the various states we respond to. … … 377 377 } 378 378 379 static NSButtonCell *sharedRadioCell(const ControlStates* states, const Int Rect& zoomedRect, float zoomFactor)379 static NSButtonCell *sharedRadioCell(const ControlStates* states, const IntSize& zoomedSize, float zoomFactor) 380 380 { 381 381 static NSButtonCell *radioCell; … … 383 383 radioCell = createToggleButtonCell(RadioPart); 384 384 385 configureToggleButton(radioCell, RadioPart, states, zoomed Rect, zoomFactor, false);385 configureToggleButton(radioCell, RadioPart, states, zoomedSize, zoomFactor, false); 386 386 return radioCell; 387 387 } 388 388 389 static NSButtonCell *sharedCheckboxCell(const ControlStates* states, const Int Rect& zoomedRect, float zoomFactor)389 static NSButtonCell *sharedCheckboxCell(const ControlStates* states, const IntSize& zoomedSize, float zoomFactor) 390 390 { 391 391 static NSButtonCell *checkboxCell; … … 393 393 checkboxCell = createToggleButtonCell(CheckboxPart); 394 394 395 configureToggleButton(checkboxCell, CheckboxPart, states, zoomed Rect, zoomFactor, false);395 configureToggleButton(checkboxCell, CheckboxPart, states, zoomedSize, zoomFactor, false); 396 396 return checkboxCell; 397 397 } … … 403 403 } 404 404 405 static void paintToggleButton(ControlPart buttonType, ControlStates* controlStates, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)405 static void paintToggleButton(ControlPart buttonType, ControlStates* controlStates, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView) 406 406 { 407 407 BEGIN_BLOCK_OBJC_EXCEPTIONS 408 408 409 409 NSButtonCell *toggleButtonCell = static_cast<NSButtonCell*>(controlStates->platformControl()); 410 IntSize zoomedRectSize = IntSize(zoomedRect.size()); 410 411 411 412 if (controlStates->isDirty()) { 412 413 if (!toggleButtonCell) 413 414 toggleButtonCell = createToggleButtonCell(buttonType); 414 configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRect , zoomFactor, true);415 configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRectSize, zoomFactor, true); 415 416 } else { 416 417 if (!toggleButtonCell) { 417 418 if (buttonType == CheckboxPart) 418 toggleButtonCell = sharedCheckboxCell(controlStates, zoomedRect , zoomFactor);419 toggleButtonCell = sharedCheckboxCell(controlStates, zoomedRectSize, zoomFactor); 419 420 else { 420 421 ASSERT(buttonType == RadioPart); 421 toggleButtonCell = sharedRadioCell(controlStates, zoomedRect , zoomFactor);422 toggleButtonCell = sharedRadioCell(controlStates, zoomedRectSize, zoomFactor); 422 423 } 423 424 } 424 configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRect , zoomFactor, false);425 configureToggleButton(toggleButtonCell, buttonType, controlStates, zoomedRectSize, zoomFactor, false); 425 426 } 426 427 controlStates->setDirty(false); … … 433 434 zoomedSize.setHeight(zoomedSize.height() * zoomFactor); 434 435 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); 436 437 437 438 if (zoomFactor != 1.0f) { … … 510 511 } 511 512 512 static void setUpButtonCell(NSButtonCell *cell, ControlPart part, const ControlStates* states, const Int Rect& zoomedRect, float zoomFactor)513 static void setUpButtonCell(NSButtonCell *cell, ControlPart part, const ControlStates* states, const IntSize& zoomedSize, float zoomFactor) 513 514 { 514 515 // Set the control size based off the rectangle we're painting into. 515 516 const std::array<IntSize, 3>& sizes = buttonSizes(); 516 if (part == SquareButtonPart || zoomed Rect.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) {517 if (part == SquareButtonPart || zoomedSize.height() > buttonSizes()[NSRegularControlSize].height() * zoomFactor) { 517 518 // Use the square button 518 519 if ([cell bezelStyle] != NSShadowlessSquareBezelStyle) … … 521 522 [cell setBezelStyle:NSRoundedBezelStyle]; 522 523 523 setControlSize(cell, sizes, zoomed Rect.size(), zoomFactor);524 setControlSize(cell, sizes, zoomedSize, zoomFactor); 524 525 525 526 // Update the various states we respond to. … … 527 528 } 528 529 529 static NSButtonCell *button(ControlPart part, const ControlStates* controlStates, const Int Rect& zoomedRect, float zoomFactor)530 static NSButtonCell *button(ControlPart part, const ControlStates* controlStates, const IntSize& zoomedSize, float zoomFactor) 530 531 { 531 532 ControlStates::States states = controlStates->states(); … … 538 539 cell = normalCell; 539 540 } 540 setUpButtonCell(cell, part, controlStates, zoomed Rect, zoomFactor);541 setUpButtonCell(cell, part, controlStates, zoomedSize, zoomFactor); 541 542 return cell; 542 543 } 543 544 544 static void paintButton(ControlPart part, ControlStates* controlStates, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)545 static void paintButton(ControlPart part, ControlStates* controlStates, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView) 545 546 { 546 547 BEGIN_BLOCK_OBJC_EXCEPTIONS … … 548 549 // Determine the width and height needed for the control and prepare the cell for painting. 549 550 ControlStates::States states = controlStates->states(); 550 NSButtonCell *buttonCell = button(part, controlStates, zoomedRect, zoomFactor);551 NSButtonCell *buttonCell = button(part, controlStates, IntSize(zoomedRect.size()), zoomFactor); 551 552 GraphicsContextStateSaver stateSaver(*context); 552 553 … … 555 556 zoomedSize.setWidth(zoomedRect.width()); // Buttons don't ever constrain width, so the zoomed width can just be honored. 556 557 zoomedSize.setHeight(zoomedSize.height() * zoomFactor); 557 IntRect inflatedRect = zoomedRect;558 FloatRect inflatedRect = zoomedRect; 558 559 if ([buttonCell bezelStyle] == NSRoundedBezelStyle) { 559 560 // Center the button within the available space. … … 621 622 } 622 623 623 static void paintStepper(ControlStates* states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView*)624 static void paintStepper(ControlStates* states, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView*) 624 625 { 625 626 // We don't use NSStepperCell because there are no ways to draw an … … 630 631 drawInfo.state = convertControlStatesToThemeDrawState(kThemeIncDecButton, states); 631 632 drawInfo.adornment = kThemeAdornmentDefault; 632 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomedRect.size(), zoomFactor);633 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), IntSize(zoomedRect.size()), zoomFactor); 633 634 if (controlSize == NSSmallControlSize) 634 635 drawInfo.kind = kThemeIncDecButtonSmall; … … 775 776 } 776 777 777 void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates* states, IntRect& zoomedRect, float zoomFactor) const778 void ThemeMac::inflateControlPaintRect(ControlPart part, const ControlStates* states, FloatRect& zoomedRect, float zoomFactor) const 778 779 { 779 780 BEGIN_BLOCK_OBJC_EXCEPTIONS 781 IntSize zoomRectSize = IntSize(zoomedRect.size()); 780 782 switch (part) { 781 783 case CheckboxPart: { 782 784 // We inflate the rect as needed to account for padding included in the cell to accommodate the checkbox 783 785 // shadow" and the check. We don't consider this part of the bounds of the control in WebKit. 784 NSCell *cell = sharedCheckboxCell(states, zoom edRect, zoomFactor);786 NSCell *cell = sharedCheckboxCell(states, zoomRectSize, zoomFactor); 785 787 NSControlSize controlSize = [cell controlSize]; 786 788 IntSize zoomedSize = checkboxSizes()[controlSize]; … … 793 795 // We inflate the rect as needed to account for padding included in the cell to accommodate the radio button 794 796 // shadow". We don't consider this part of the bounds of the control in WebKit. 795 NSCell *cell = sharedRadioCell(states, zoom edRect, zoomFactor);797 NSCell *cell = sharedRadioCell(states, zoomRectSize, zoomFactor); 796 798 NSControlSize controlSize = [cell controlSize]; 797 799 IntSize zoomedSize = radioSizes()[controlSize]; … … 804 806 case DefaultButtonPart: 805 807 case ButtonPart: { 806 NSButtonCell *cell = button(part, states, zoom edRect, zoomFactor);808 NSButtonCell *cell = button(part, states, zoomRectSize, zoomFactor); 807 809 NSControlSize controlSize = [cell controlSize]; 808 810 … … 818 820 case InnerSpinButtonPart: { 819 821 static const int stepperMargin[4] = { 0, 0, 0, 0 }; 820 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoom edRect.size(), zoomFactor);822 ControlSize controlSize = controlSizeFromPixelSize(stepperSizes(), zoomRectSize, zoomFactor); 821 823 IntSize zoomedSize = stepperSizes()[controlSize]; 822 824 zoomedSize.setHeight(zoomedSize.height() * zoomFactor); … … 831 833 } 832 834 833 void ThemeMac::paint(ControlPart part, ControlStates* states, GraphicsContext* context, const IntRect& zoomedRect, float zoomFactor, ScrollView* scrollView)835 void ThemeMac::paint(ControlPart part, ControlStates* states, GraphicsContext* context, const FloatRect& zoomedRect, float zoomFactor, ScrollView* scrollView) 834 836 { 835 837 switch (part) { -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r169639 r169928 1172 1172 return; 1173 1173 1174 IntRect inflatedRect = pixelSnappedBorderBoxRect();1174 FloatRect inflatedRect = borderBoxRect(); 1175 1175 theme().adjustRepaintRect(*this, inflatedRect); 1176 addVisualOverflow( inflatedRect);1176 addVisualOverflow(pixelSnappedIntRect(LayoutRect(inflatedRect))); 1177 1177 1178 1178 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) -
trunk/Source/WebCore/rendering/RenderFlowThread.cpp
r169586 r169928 1382 1382 borderBox = region->rectFlowPortionForBox(block, borderBox); 1383 1383 1384 IntRect inflatedRect = pixelSnappedIntRect(borderBox);1384 FloatRect inflatedRect = borderBox; 1385 1385 block->theme().adjustRepaintRect(*block, inflatedRect); 1386 1386 1387 region->addVisualOverflowForBox(block, inflatedRect);1387 region->addVisualOverflowForBox(block, pixelSnappedIntRect(LayoutRect(inflatedRect))); 1388 1388 if (region == endRegion) 1389 1389 break; -
trunk/Source/WebCore/rendering/RenderTheme.cpp
r169898 r169928 291 291 case InnerSpinButtonPart: 292 292 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()); 294 294 return false; 295 295 default: … … 721 721 } 722 722 723 void RenderTheme::adjustRepaintRect(const RenderObject& o, IntRect& r)723 void RenderTheme::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect) 724 724 { 725 725 #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()); 728 728 #else 729 UNUSED_PARAM( o);730 UNUSED_PARAM(r );729 UNUSED_PARAM(renderer); 730 UNUSED_PARAM(rect); 731 731 #endif 732 732 } -
trunk/Source/WebCore/rendering/RenderTheme.h
r169898 r169928 125 125 // Some controls may spill out of their containers (e.g., the check on an OS X checkbox). When these controls repaint, 126 126 // 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&); 128 128 129 129 // 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 50 50 virtual bool supportsControlTints() const override { return true; } 51 51 52 virtual void adjustRepaintRect(const RenderObject&, IntRect&) override;52 virtual void adjustRepaintRect(const RenderObject&, FloatRect&) override; 53 53 54 54 virtual bool isControlStyled(const RenderStyle*, const BorderData&, const FillLayer&, const Color& backgroundColor) const override; -
trunk/Source/WebCore/rendering/RenderThemeMac.mm
r169898 r169928 634 634 } 635 635 636 void RenderThemeMac::adjustRepaintRect(const RenderObject& o, IntRect& r)637 { 638 ControlPart part = o.style().appearance();636 void RenderThemeMac::adjustRepaintRect(const RenderObject& renderer, FloatRect& rect) 637 { 638 ControlPart part = renderer.style().appearance(); 639 639 640 640 #if USE(NEW_THEME) … … 647 647 case ButtonPart: 648 648 case InnerSpinButtonPart: 649 return RenderTheme::adjustRepaintRect( o, r);649 return RenderTheme::adjustRepaintRect(renderer, rect); 650 650 default: 651 651 break; … … 653 653 #endif 654 654 655 float zoomLevel = o.style().effectiveZoom();655 float zoomLevel = renderer.style().effectiveZoom(); 656 656 657 657 if (part == MenulistPart) { 658 setPopupButtonCellState( o, r.size());658 setPopupButtonCellState(renderer, IntSize(rect.size())); 659 659 IntSize size = popupButtonSizes()[[popupButton() controlSize]]; 660 660 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); 663 663 } 664 664 }
Note:
See TracChangeset
for help on using the changeset viewer.