Subpixel rendering: Clipping on text areas when shifted by one device pixel.
authorzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 20:46:26 +0000 (20:46 +0000)
committerzalan@apple.com <zalan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Apr 2014 20:46:26 +0000 (20:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=132008

Reviewed by Darin Adler.

Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while
other theme controls are still on integral size/positions.

Source/WebCore:
Test: fast/forms/hidpi-textarea-on-subpixel-position.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
(WebCore::RenderTheme::paintBorderOnly):
(WebCore::RenderTheme::paintDecorations):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::paintTextField):
(WebCore::RenderTheme::paintTextFieldDecorations):
(WebCore::RenderTheme::paintTextArea):
(WebCore::RenderTheme::paintTextAreaDecorations):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintTextFieldDecorations):
(WebCore::RenderThemeIOS::paintTextAreaDecorations):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextField):
(WebCore::RenderThemeMac::paintTextArea):

LayoutTests:
* fast/forms/hidpi-textarea-on-subpixel-position-expected.html: Added.
* fast/forms/hidpi-textarea-on-subpixel-position.html: Added.
* platform/mac-wk2/TestExpectations: Due to defective RenderLayer cliprect calculation (WK2 only): webkit.org/b/132100

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167771 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderTheme.cpp
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/RenderThemeIOS.h
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebCore/rendering/RenderThemeMac.h
Source/WebCore/rendering/RenderThemeMac.mm

index 272dac6..312b4d3 100644 (file)
@@ -1,3 +1,17 @@
+2014-04-24  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel rendering: Clipping on text areas when shifted by one device pixel.
+        https://bugs.webkit.org/show_bug.cgi?id=132008
+
+        Reviewed by Darin Adler.
+
+        Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while
+        other theme controls are still on integral size/positions.
+
+        * fast/forms/hidpi-textarea-on-subpixel-position-expected.html: Added.
+        * fast/forms/hidpi-textarea-on-subpixel-position.html: Added.
+        * platform/mac-wk2/TestExpectations: Due to defective RenderLayer cliprect calculation (WK2 only): webkit.org/b/132100
+
 2014-04-24  Eduardo Lima Mitev  <elima@igalia.com>
 
         Unreviewed GTK gardening
diff --git a/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html b/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html
new file mode 100644 (file)
index 0000000..c76d47f
--- /dev/null
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can subpixel position textareas properly.</title>
+<style>
+  div {
+    position: fixed;
+  }
+
+ .outer {
+    border: 0.5px solid black;
+  }
+    
+ .cover {
+    width: 5px;
+    height: 5px;
+    position: fixed;
+    background: green;
+  }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var container = document.getElementById("container");
+  adjustment = 0.2;
+  w=20; h=20;
+  for (i = 0; i < 15; ++i) {
+    adjustment+=0.1;
+    for (j = 0; j < 15; ++j) {
+      var e = document.createElement("div");
+      var topLeftY = ((w + 10) * i + j * adjustment);
+      var topLeftX = ((w + 10) * j + i * adjustment);
+      e.style.top = topLeftY + "px";
+      e.style.left = topLeftX + "px";
+      e.style.width = w + "px";
+      e.style.height = h + "px";
+      e.className = "outer";
+      container.appendChild(e);
+
+      var cover = document.createElement("div");
+      cover.style.top = (topLeftY + h - h/2 + 1) + "px";
+      cover.style.left = (topLeftX + w - w/2 + 1) + "px";
+      cover.style.width = w/2 + "px";
+      cover.style.height = h/2 + "px";
+      cover.className = "cover";
+      container.appendChild(cover);
+
+      w+=0.1;
+      h+=0.1;
+    }
+  }
+</script>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html b/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html
new file mode 100644 (file)
index 0000000..ea84dad
--- /dev/null
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>This tests that we can subpixel position textareas properly.</title>
+<style>
+  textarea {
+    width: 9px;
+    height: 9px;
+    position: fixed;
+    margin: 0px;
+    padding: 0px;
+    border: 0.5px solid black;
+ }
+ div {
+    width: 5px;
+    height: 5px;
+    position: fixed;
+    background: green;
+ }
+</style>
+</head>
+<body>
+<p id="container"></p>
+<script>
+  var container = document.getElementById("container");
+  adjustment = 0.2;
+  w=20; h=20;
+  for (i = 0; i < 15; ++i) {
+    adjustment+=0.1;
+    for (j = 0; j < 15; ++j) {
+      var e = document.createElement("textarea");
+      var topLeftY = ((w + 10) * i + j * adjustment);
+      var topLeftX = ((w + 10) * j + i * adjustment);
+      e.style.top = topLeftY + "px";
+      e.style.left = topLeftX + "px";
+      e.style.width = w + "px";
+      e.style.height = h + "px";
+      container.appendChild(e);
+
+      var cover = document.createElement("div");
+      cover.style.top = (topLeftY + h - h/2 + 1) + "px";
+      cover.style.left = (topLeftX + w - w/2 + 1) + "px";
+      cover.style.width = w/2 + "px";
+      cover.style.height = h/2 + "px";
+      container.appendChild(cover);
+
+      w+=0.1;
+      h+=0.1;
+    }
+  }
+</script>
+</body>
+</html>
index 4fffffc..3c09f37 100644 (file)
@@ -349,6 +349,9 @@ webkit.org/b/131349 http/tests/xmlhttprequest/cross-origin-no-credential-prompt.
 
 webkit.org/b/131477 fast/repaint/obscured-background-no-repaint.html [ Pass Failure ]
 
+# Subpixel wrong cliprect on WK2
+webkit.org/b/132100 fast/forms/hidpi-textarea-on-subpixel-position.html [ ImageOnlyFailure ]
+
 ### END OF (1) Classified failures with bug reports
 ########################################
 
index 6e63240..264909a 100644 (file)
@@ -1,3 +1,35 @@
+2014-04-24  Zalan Bujtas  <zalan@apple.com>
+
+        Subpixel rendering: Clipping on text areas when shifted by one device pixel.
+        https://bugs.webkit.org/show_bug.cgi?id=132008
+
+        Reviewed by Darin Adler.
+
+        Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while
+        other theme controls are still on integral size/positions.
+
+        Test: fast/forms/hidpi-textarea-on-subpixel-position.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::paintBoxDecorations):
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paint):
+        (WebCore::RenderTheme::paintBorderOnly):
+        (WebCore::RenderTheme::paintDecorations):
+        * rendering/RenderTheme.h:
+        (WebCore::RenderTheme::paintTextField):
+        (WebCore::RenderTheme::paintTextFieldDecorations):
+        (WebCore::RenderTheme::paintTextArea):
+        (WebCore::RenderTheme::paintTextAreaDecorations):
+        * rendering/RenderThemeIOS.h:
+        * rendering/RenderThemeIOS.mm:
+        (WebCore::RenderThemeIOS::paintTextFieldDecorations):
+        (WebCore::RenderThemeIOS::paintTextAreaDecorations):
+        * rendering/RenderThemeMac.h:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintTextField):
+        (WebCore::RenderThemeMac::paintTextArea):
+
 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
 
         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead
index cb368a7..3080a7c 100644 (file)
@@ -1215,8 +1215,6 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
 
     // If we have a native theme appearance, paint that before painting our background.
     // The theme will tell us whether or not we should also paint the CSS background.
-    IntRect snappedPaintRect(pixelSnappedIntRect(paintRect));
-
     ControlStates* controlStates = nullptr;
     if (style().hasAppearance()) {
         if (hasControlStatesForRenderer(this))
@@ -1227,7 +1225,7 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
         }
     }
 
-    bool themePainted = style().hasAppearance() && !theme().paint(*this, controlStates, paintInfo, snappedPaintRect);
+    bool themePainted = style().hasAppearance() && !theme().paint(*this, controlStates, paintInfo, paintRect);
 
     if (controlStates && controlStates->needsRepaint())
         m_repaintTimer.startOneShot(0);
@@ -1239,12 +1237,12 @@ void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
         paintBackground(paintInfo, paintRect, bleedAvoidance);
 
         if (style().hasAppearance())
-            theme().paintDecorations(*this, paintInfo, snappedPaintRect);
+            theme().paintDecorations(*this, paintInfo, paintRect);
     }
     paintBoxShadow(paintInfo, paintRect, style(), Inset);
 
     // The theme will tell us whether or not we should also paint the CSS border.
-    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, snappedPaintRect))) && style().hasBorder())
+    if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style().hasAppearance() || (!themePainted && theme().paintBorderOnly(*this, paintInfo, paintRect))) && style().hasBorder())
         paintBorder(paintInfo, paintRect, style(), bleedAvoidance);
 
     if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
index c01dd43..38280d5 100644 (file)
@@ -263,7 +263,7 @@ void RenderTheme::adjustStyle(StyleResolver& styleResolver, RenderStyle& style,
     }
 }
 
-bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, 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
@@ -277,6 +277,7 @@ bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, con
         return false;
 
     ControlPart part = o.style().appearance();
+    IntRect integralSnappedRect = pixelSnappedIntRect(r);
 
 #if USE(NEW_THEME)
     switch (part) {
@@ -288,7 +289,7 @@ bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, con
     case ButtonPart:
     case InnerSpinButtonPart:
         updateControlStatesForRenderer(o, controlStates);
-        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), r, o.style().effectiveZoom(), &o.view().frameView());
+        m_theme->paint(part, controlStates, const_cast<GraphicsContext*>(paintInfo.context), integralSnappedRect, o.style().effectiveZoom(), &o.view().frameView());
         return false;
     default:
         break;
@@ -301,102 +302,102 @@ bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, con
     switch (part) {
 #if !USE(NEW_THEME)
     case CheckboxPart:
-        return paintCheckbox(o, paintInfo, r);
+        return paintCheckbox(o, paintInfo, integralSnappedRect);
     case RadioPart:
-        return paintRadio(o, paintInfo, r);
+        return paintRadio(o, paintInfo, integralSnappedRect);
     case PushButtonPart:
     case SquareButtonPart:
     case DefaultButtonPart:
     case ButtonPart:
-        return paintButton(o, paintInfo, r);
+        return paintButton(o, paintInfo, integralSnappedRect);
     case InnerSpinButtonPart:
-        return paintInnerSpinButton(o, paintInfo, r);
+        return paintInnerSpinButton(o, paintInfo, integralSnappedRect);
 #endif
     case MenulistPart:
-        return paintMenuList(o, paintInfo, r);
+        return paintMenuList(o, paintInfo, integralSnappedRect);
 #if ENABLE(METER_ELEMENT)
     case MeterPart:
     case RelevancyLevelIndicatorPart:
     case ContinuousCapacityLevelIndicatorPart:
     case DiscreteCapacityLevelIndicatorPart:
     case RatingLevelIndicatorPart:
-        return paintMeter(o, paintInfo, r);
+        return paintMeter(o, paintInfo, integralSnappedRect);
 #endif
 #if ENABLE(PROGRESS_ELEMENT)
     case ProgressBarPart:
-        return paintProgressBar(o, paintInfo, r);
+        return paintProgressBar(o, paintInfo, integralSnappedRect);
 #endif
     case SliderHorizontalPart:
     case SliderVerticalPart:
-        return paintSliderTrack(o, paintInfo, r);
+        return paintSliderTrack(o, paintInfo, integralSnappedRect);
     case SliderThumbHorizontalPart:
     case SliderThumbVerticalPart:
-        return paintSliderThumb(o, paintInfo, r);
+        return paintSliderThumb(o, paintInfo, integralSnappedRect);
     case MediaEnterFullscreenButtonPart:
     case MediaExitFullscreenButtonPart:
-        return paintMediaFullscreenButton(o, paintInfo, r);
+        return paintMediaFullscreenButton(o, paintInfo, integralSnappedRect);
     case MediaPlayButtonPart:
-        return paintMediaPlayButton(o, paintInfo, r);
+        return paintMediaPlayButton(o, paintInfo, integralSnappedRect);
     case MediaOverlayPlayButtonPart:
-        return paintMediaOverlayPlayButton(o, paintInfo, r);
+        return paintMediaOverlayPlayButton(o, paintInfo, integralSnappedRect);
     case MediaMuteButtonPart:
-        return paintMediaMuteButton(o, paintInfo, r);
+        return paintMediaMuteButton(o, paintInfo, integralSnappedRect);
     case MediaSeekBackButtonPart:
-        return paintMediaSeekBackButton(o, paintInfo, r);
+        return paintMediaSeekBackButton(o, paintInfo, integralSnappedRect);
     case MediaSeekForwardButtonPart:
-        return paintMediaSeekForwardButton(o, paintInfo, r);
+        return paintMediaSeekForwardButton(o, paintInfo, integralSnappedRect);
     case MediaRewindButtonPart:
-        return paintMediaRewindButton(o, paintInfo, r);
+        return paintMediaRewindButton(o, paintInfo, integralSnappedRect);
     case MediaReturnToRealtimeButtonPart:
-        return paintMediaReturnToRealtimeButton(o, paintInfo, r);
+        return paintMediaReturnToRealtimeButton(o, paintInfo, integralSnappedRect);
     case MediaToggleClosedCaptionsButtonPart:
-        return paintMediaToggleClosedCaptionsButton(o, paintInfo, r);
+        return paintMediaToggleClosedCaptionsButton(o, paintInfo, integralSnappedRect);
     case MediaSliderPart:
-        return paintMediaSliderTrack(o, paintInfo, r);
+        return paintMediaSliderTrack(o, paintInfo, integralSnappedRect);
     case MediaSliderThumbPart:
-        return paintMediaSliderThumb(o, paintInfo, r);
+        return paintMediaSliderThumb(o, paintInfo, integralSnappedRect);
     case MediaVolumeSliderMuteButtonPart:
-        return paintMediaMuteButton(o, paintInfo, r);
+        return paintMediaMuteButton(o, paintInfo, integralSnappedRect);
     case MediaVolumeSliderContainerPart:
-        return paintMediaVolumeSliderContainer(o, paintInfo, r);
+        return paintMediaVolumeSliderContainer(o, paintInfo, integralSnappedRect);
     case MediaVolumeSliderPart:
-        return paintMediaVolumeSliderTrack(o, paintInfo, r);
+        return paintMediaVolumeSliderTrack(o, paintInfo, integralSnappedRect);
     case MediaVolumeSliderThumbPart:
-        return paintMediaVolumeSliderThumb(o, paintInfo, r);
+        return paintMediaVolumeSliderThumb(o, paintInfo, integralSnappedRect);
     case MediaFullScreenVolumeSliderPart:
-        return paintMediaFullScreenVolumeSliderTrack(o, paintInfo, r);
+        return paintMediaFullScreenVolumeSliderTrack(o, paintInfo, integralSnappedRect);
     case MediaFullScreenVolumeSliderThumbPart:
-        return paintMediaFullScreenVolumeSliderThumb(o, paintInfo, r);
+        return paintMediaFullScreenVolumeSliderThumb(o, paintInfo, integralSnappedRect);
     case MediaTimeRemainingPart:
-        return paintMediaTimeRemaining(o, paintInfo, r);
+        return paintMediaTimeRemaining(o, paintInfo, integralSnappedRect);
     case MediaCurrentTimePart:
-        return paintMediaCurrentTime(o, paintInfo, r);
+        return paintMediaCurrentTime(o, paintInfo, integralSnappedRect);
     case MediaControlsBackgroundPart:
-        return paintMediaControlsBackground(o, paintInfo, r);
+        return paintMediaControlsBackground(o, paintInfo, integralSnappedRect);
     case MenulistButtonPart:
     case TextFieldPart:
     case TextAreaPart:
     case ListboxPart:
         return true;
     case SearchFieldPart:
-        return paintSearchField(o, paintInfo, r);
+        return paintSearchField(o, paintInfo, integralSnappedRect);
     case SearchFieldCancelButtonPart:
-        return paintSearchFieldCancelButton(o, paintInfo, r);
+        return paintSearchFieldCancelButton(o, paintInfo, integralSnappedRect);
     case SearchFieldDecorationPart:
-        return paintSearchFieldDecorationPart(o, paintInfo, r);
+        return paintSearchFieldDecorationPart(o, paintInfo, integralSnappedRect);
     case SearchFieldResultsDecorationPart:
-        return paintSearchFieldResultsDecorationPart(o, paintInfo, r);
+        return paintSearchFieldResultsDecorationPart(o, paintInfo, integralSnappedRect);
     case SearchFieldResultsButtonPart:
-        return paintSearchFieldResultsButton(o, paintInfo, r);
+        return paintSearchFieldResultsButton(o, paintInfo, integralSnappedRect);
     case SnapshottedPluginOverlayPart:
-        return paintSnapshottedPluginOverlay(o, paintInfo, r);
+        return paintSnapshottedPluginOverlay(o, paintInfo, integralSnappedRect);
 #if ENABLE(INPUT_SPEECH)
     case InputSpeechButtonPart:
-        return paintInputFieldSpeechButton(o, paintInfo, r);
+        return paintInputFieldSpeechButton(o, paintInfo, integralSnappedRect);
 #endif
 #if ENABLE(IMAGE_CONTROLS)
     case ImageControlsButtonPart:
-        return paintImageControlsButton(o, paintInfo, r);
+        return paintImageControlsButton(o, paintInfo, integralSnappedRect);
 #endif
     default:
         break;
@@ -405,7 +406,7 @@ bool RenderTheme::paint(const RenderObject& o, ControlStates* controlStates, con
     return true; // We don't support the appearance, so let the normal background/border paint.
 }
 
-bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const LayoutRect& r)
 {
     if (paintInfo.context->paintingDisabled())
         return false;
@@ -414,13 +415,14 @@ bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintI
     UNUSED_PARAM(r);
     return o.style().appearance() != NoControlPart;
 #else
+    FloatRect devicePixelSnappedRect = pixelSnappedForPainting(r, o.document().deviceScaleFactor());
     // Call the appropriate paint method based off the appearance value.
     switch (o.style().appearance()) {
     case TextFieldPart:
-        return paintTextField(o, paintInfo, r);
+        return paintTextField(o, paintInfo, devicePixelSnappedRect);
     case ListboxPart:
     case TextAreaPart:
-        return paintTextArea(o, paintInfo, r);
+        return paintTextArea(o, paintInfo, devicePixelSnappedRect);
     case MenulistButtonPart:
     case SearchFieldPart:
         return true;
@@ -463,36 +465,39 @@ bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintI
 #endif
 }
 
-bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const LayoutRect& rect)
 {
     if (paintInfo.context->paintingDisabled())
         return false;
 
+    IntRect integralSnappedRect = pixelSnappedIntRect(rect);
+    FloatRect devicePixelSnappedRect = pixelSnappedForPainting(rect, renderer.document().deviceScaleFactor());
+
     // Call the appropriate paint method based off the appearance value.
     switch (renderer.style().appearance()) {
     case MenulistButtonPart:
-        return paintMenuListButtonDecorations(renderer, paintInfo, rect);
+        return paintMenuListButtonDecorations(renderer, paintInfo, integralSnappedRect);
     case TextFieldPart:
-        return paintTextFieldDecorations(renderer, paintInfo, rect);
+        return paintTextFieldDecorations(renderer, paintInfo, devicePixelSnappedRect);
     case TextAreaPart:
-        return paintTextAreaDecorations(renderer, paintInfo, rect);
+        return paintTextAreaDecorations(renderer, paintInfo, devicePixelSnappedRect);
     case CheckboxPart:
-        return paintCheckboxDecorations(renderer, paintInfo, rect);
+        return paintCheckboxDecorations(renderer, paintInfo, integralSnappedRect);
     case RadioPart:
-        return paintRadioDecorations(renderer, paintInfo, rect);
+        return paintRadioDecorations(renderer, paintInfo, integralSnappedRect);
     case PushButtonPart:
-        return paintPushButtonDecorations(renderer, paintInfo, rect);
+        return paintPushButtonDecorations(renderer, paintInfo, integralSnappedRect);
     case SquareButtonPart:
-        return paintSquareButtonDecorations(renderer, paintInfo, rect);
+        return paintSquareButtonDecorations(renderer, paintInfo, integralSnappedRect);
     case ButtonPart:
-        return paintButtonDecorations(renderer, paintInfo, rect);
+        return paintButtonDecorations(renderer, paintInfo, integralSnappedRect);
     case MenulistPart:
-        return paintMenuListDecorations(renderer, paintInfo, rect);
+        return paintMenuListDecorations(renderer, paintInfo, integralSnappedRect);
     case SliderThumbHorizontalPart:
     case SliderThumbVerticalPart:
-        return paintSliderThumbDecorations(renderer, paintInfo, rect);
+        return paintSliderThumbDecorations(renderer, paintInfo, integralSnappedRect);
     case SearchFieldPart:
-        return paintSearchFieldDecorations(renderer, paintInfo, rect);
+        return paintSearchFieldDecorations(renderer, paintInfo, integralSnappedRect);
 #if ENABLE(METER_ELEMENT)
     case MeterPart:
     case RelevancyLevelIndicatorPart:
index c7de2d5..a5b5ebf 100644 (file)
@@ -79,9 +79,9 @@ public:
     // This method is called to paint the widget as a background of the RenderObject.  A widget's foreground, e.g., the
     // text of a button, is always rendered by the engine itself.  The boolean return value indicates
     // whether the CSS border/background should also be painted.
-    bool paint(const RenderObject&, ControlStates*, const PaintInfo&, const IntRect&);
-    bool paintBorderOnly(const RenderObject&, const PaintInfo&, const IntRect&);
-    bool paintDecorations(const RenderObject&, const PaintInfo&, const IntRect&);
+    bool paint(const RenderObject&, ControlStates*, const PaintInfo&, const LayoutRect&);
+    bool paintBorderOnly(const RenderObject&, const PaintInfo&, const LayoutRect&);
+    bool paintDecorations(const RenderObject&, const PaintInfo&, const LayoutRect&);
 
     // The remaining methods should be implemented by the platform-specific portion of the theme, e.g.,
     // RenderThemeMac.cpp for Mac OS X.
@@ -287,12 +287,12 @@ protected:
     virtual bool paintButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
 
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
+    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
 
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
-    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
-    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
+    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) { return true; }
 
     virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const;
     virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&) { return true; }
index f37f3f8..6826a9e 100644 (file)
@@ -66,8 +66,8 @@ protected:
 
     virtual bool paintFileUploadIconDecorations(const RenderObject& inputRenderer, const RenderObject& buttonRenderer, const PaintInfo&, const IntRect&, Icon*, FileUploadDecorations) override;
 
-    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
-    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
+    virtual bool paintTextFieldDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override;
+    virtual bool paintTextAreaDecorations(const RenderObject&, const PaintInfo&, const FloatRect&) override;
 
     virtual void adjustMenuListButtonStyle(StyleResolver*, RenderStyle*, Element*) const override;
     virtual bool paintMenuListButtonDecorations(const RenderObject&, const PaintInfo&, const IntRect&) override;
index e9ec2ba..6757a5f 100644 (file)
@@ -473,14 +473,14 @@ bool RenderThemeIOS::paintRadioDecorations(const RenderObject& box, const PaintI
     return false;
 }
 
-bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const PaintInfo& paintInfo, const FloatRect& rect)
 {
     RenderStyle& style = box.style();
-    IntPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth());
+    FloatPoint point(rect.x() + style.borderLeftWidth(), rect.y() + style.borderTopWidth());
 
     GraphicsContextStateSaver stateSaver(*paintInfo.context);
 
-    paintInfo.context->clipRoundedRect(FloatRoundedRect(style.getRoundedBorderFor(rect)));
+    paintInfo.context->clipRoundedRect(FloatRoundedRect(style.getRoundedBorderFor(LayoutRect(rect))));
 
     // This gradient gets drawn black when printing.
     // Do not draw the gradient if there is no visible top border.
@@ -490,7 +490,7 @@ bool RenderThemeIOS::paintTextFieldDecorations(const RenderObject& box, const Pa
     return false;
 }
 
-bool RenderThemeIOS::paintTextAreaDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
+bool RenderThemeIOS::paintTextAreaDecorations(const RenderObject& box, const PaintInfo& paintInfo, const FloatRect& rect)
 {
     return paintTextFieldDecorations(box, paintInfo, rect);
 }
index 2edb113..fb07801 100644 (file)
@@ -123,10 +123,10 @@ protected:
 
     virtual bool supportsSelectionForegroundColors() const { return false; }
 
-    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintTextField(const RenderObject&, const PaintInfo&, const FloatRect&);
     virtual void adjustTextFieldStyle(StyleResolver*, RenderStyle*, Element*) const;
 
-    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const IntRect&);
+    virtual bool paintTextArea(const RenderObject&, const PaintInfo&, const FloatRect&);
     virtual void adjustTextAreaStyle(StyleResolver*, RenderStyle*, Element*) const;
 
     virtual bool paintMenuList(const RenderObject&, const PaintInfo&, const IntRect&);
index cd0e791..8d320d8 100644 (file)
@@ -811,7 +811,7 @@ NSControlSize RenderThemeMac::controlSizeForSystemFont(RenderStyle* style) const
     return NSMiniControlSize;
 }
 
-bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintTextField(const RenderObject& o, const PaintInfo& paintInfo, const FloatRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
 
@@ -842,7 +842,7 @@ bool RenderThemeMac::paintCapsLockIndicator(const RenderObject&, const PaintInfo
     return false;
 }
 
-bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const IntRect& r)
+bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const FloatRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context);
     wkDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o));