Title: [167771] trunk
Revision
167771
Author
[email protected]
Date
2014-04-24 13:46:26 -0700 (Thu, 24 Apr 2014)

Log Message

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.

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

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (167770 => 167771)


--- trunk/LayoutTests/ChangeLog	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/LayoutTests/ChangeLog	2014-04-24 20:46:26 UTC (rev 167771)
@@ -1,3 +1,17 @@
+2014-04-24  Zalan Bujtas  <[email protected]>
+
+        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  <[email protected]>
 
         Unreviewed GTK gardening

Added: trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html (0 => 167771)


--- trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position-expected.html	2014-04-24 20:46:26 UTC (rev 167771)
@@ -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>

Added: trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html (0 => 167771)


--- trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/hidpi-textarea-on-subpixel-position.html	2014-04-24 20:46:26 UTC (rev 167771)
@@ -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>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (167770 => 167771)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2014-04-24 20:46:26 UTC (rev 167771)
@@ -349,6 +349,9 @@
 
 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
 ########################################
 

Modified: trunk/Source/WebCore/ChangeLog (167770 => 167771)


--- trunk/Source/WebCore/ChangeLog	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/ChangeLog	2014-04-24 20:46:26 UTC (rev 167771)
@@ -1,3 +1,35 @@
+2014-04-24  Zalan Bujtas  <[email protected]>
+
+        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  <[email protected]>
 
         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2014-04-24 20:46:26 UTC (rev 167771)
@@ -1215,8 +1215,6 @@
 
     // 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 @@
         }
     }
 
-    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 @@
         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)

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2014-04-24 20:46:26 UTC (rev 167771)
@@ -263,7 +263,7 @@
     }
 }
 
-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 @@
         return false;
 
     ControlPart part = o.style().appearance();
+    IntRect integralSnappedRect = pixelSnappedIntRect(r);
 
 #if USE(NEW_THEME)
     switch (part) {
@@ -288,7 +289,7 @@
     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 @@
     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 @@
     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 @@
     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 @@
 #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:

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2014-04-24 20:46:26 UTC (rev 167771)
@@ -79,9 +79,9 @@
     // 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 @@
     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; }

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.h (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.h	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h	2014-04-24 20:46:26 UTC (rev 167771)
@@ -66,8 +66,8 @@
 
     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;

Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm	2014-04-24 20:46:26 UTC (rev 167771)
@@ -473,14 +473,14 @@
     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 @@
     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);
 }

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderThemeMac.h	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h	2014-04-24 20:46:26 UTC (rev 167771)
@@ -123,10 +123,10 @@
 
     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&);

Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (167770 => 167771)


--- trunk/Source/WebCore/rendering/RenderThemeMac.mm	2014-04-24 20:24:13 UTC (rev 167770)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm	2014-04-24 20:46:26 UTC (rev 167771)
@@ -811,7 +811,7 @@
     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 @@
     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));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to