Title: [194955] trunk/Source/WebCore
Revision
194955
Author
[email protected]
Date
2016-01-12 22:47:10 -0800 (Tue, 12 Jan 2016)

Log Message

[GTK] Fix return value of some paint methods in RenderThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=153015

Reviewed by Michael Catanzaro.

The bool value returned by paint methods in RenderTheme means
whether the appearance is supported or not, so we should return
true when not supported (so we didn't paint anything) and false
when supported (so we actually painted the theme part).

* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
(WebCore::RenderThemeGtk::paintMediaButton):
(WebCore::RenderThemeGtk::paintMediaMuteButton):
(WebCore::RenderThemeGtk::paintMediaPlayButton):
(WebCore::RenderThemeGtk::paintMediaSliderTrack):
(WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
* rendering/RenderThemeGtk.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (194954 => 194955)


--- trunk/Source/WebCore/ChangeLog	2016-01-13 05:55:33 UTC (rev 194954)
+++ trunk/Source/WebCore/ChangeLog	2016-01-13 06:47:10 UTC (rev 194955)
@@ -1,3 +1,25 @@
+2016-01-12  Carlos Garcia Campos  <[email protected]>
+
+        [GTK] Fix return value of some paint methods in RenderThemeGtk
+        https://bugs.webkit.org/show_bug.cgi?id=153015
+
+        Reviewed by Michael Catanzaro.
+
+        The bool value returned by paint methods in RenderTheme means
+        whether the appearance is supported or not, so we should return
+        true when not supported (so we didn't paint anything) and false
+        when supported (so we actually painted the theme part).
+
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
+        (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
+        (WebCore::RenderThemeGtk::paintMediaButton):
+        (WebCore::RenderThemeGtk::paintMediaMuteButton):
+        (WebCore::RenderThemeGtk::paintMediaPlayButton):
+        (WebCore::RenderThemeGtk::paintMediaSliderTrack):
+        (WebCore::RenderThemeGtk::paintMediaVolumeSliderContainer): Deleted.
+        * rendering/RenderThemeGtk.h:
+
 2016-01-12  Andy Estes  <[email protected]>
 
         [Content Filtering] De-virtualize PlatformContentFilter::{needsMoreData, didBlockData}()

Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (194954 => 194955)


--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp	2016-01-13 05:55:33 UTC (rev 194954)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp	2016-01-13 06:47:10 UTC (rev 194955)
@@ -1007,9 +1007,9 @@
 {
     IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     if (iconRect.isEmpty())
-        return false;
+        return true;
 
-    return paintEntryIcon(EntryIconLeft, "edit-find-symbolic", paintInfo.context(), iconRect, gtkTextDirection(renderObject.style().direction()),
+    return !paintEntryIcon(EntryIconLeft, "edit-find-symbolic", paintInfo.context(), iconRect, gtkTextDirection(renderObject.style().direction()),
         gtkIconStateFlags(this, renderObject));
 }
 
@@ -1022,9 +1022,9 @@
 {
     IntRect iconRect = centerRectVerticallyInParentInputElement(renderObject, rect);
     if (iconRect.isEmpty())
-        return false;
+        return true;
 
-    return paintEntryIcon(EntryIconRight, "edit-clear-symbolic", paintInfo.context(), iconRect, gtkTextDirection(renderObject.style().direction()),
+    return !paintEntryIcon(EntryIconRight, "edit-clear-symbolic", paintInfo.context(), iconRect, gtkTextDirection(renderObject.style().direction()),
         gtkIconStateFlags(this, renderObject));
 }
 
@@ -1382,7 +1382,7 @@
     gtk_style_context_set_state(context.get(), gtkIconStateFlags(this, renderObject));
     static const unsigned mediaIconSize = 16;
     IntRect iconRect(rect.x() + (rect.width() - mediaIconSize) / 2, rect.y() + (rect.height() - mediaIconSize) / 2, mediaIconSize, mediaIconSize);
-    return paintIcon(context.get(), graphicsContext, iconRect, iconName);
+    return !paintIcon(context.get(), graphicsContext, iconRect, iconName);
 }
 
 bool RenderThemeGtk::hasOwnDisabledStateHandlingFor(ControlPart part) const
@@ -1399,10 +1399,10 @@
 {
     Node* node = renderObject.node();
     if (!node)
-        return false;
+        return true;
     Node* mediaNode = node->shadowHost();
     if (!is<HTMLMediaElement>(mediaNode))
-        return false;
+        return true;
 
     HTMLMediaElement* mediaElement = downcast<HTMLMediaElement>(mediaNode);
     return paintMediaButton(renderObject, paintInfo.context(), rect, mediaElement->muted() ? "audio-volume-muted-symbolic" : "audio-volume-high-symbolic");
@@ -1412,10 +1412,9 @@
 {
     Node* node = renderObject.node();
     if (!node)
-        return false;
-
+        return true;
     if (!nodeHasPseudo(node, "-webkit-media-controls-play-button"))
-        return false;
+        return true;
 
     return paintMediaButton(renderObject, paintInfo.context(), rect, nodeHasClass(node, "paused") ? "media-playback-start-symbolic" : "media-playback-pause-symbolic");
 }
@@ -1450,7 +1449,7 @@
 {
     HTMLMediaElement* mediaElement = parentMediaElement(o);
     if (!mediaElement)
-        return false;
+        return true;
 
     GraphicsContext& context = paintInfo.context();
     context.save();
@@ -1486,11 +1485,6 @@
     return false;
 }
 
-bool RenderThemeGtk::paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&)
-{
-    return true;
-}
-
 bool RenderThemeGtk::paintMediaVolumeSliderTrack(const RenderObject& renderObject, const PaintInfo& paintInfo, const IntRect& rect)
 {
     HTMLMediaElement* mediaElement = parentMediaElement(renderObject);

Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.h (194954 => 194955)


--- trunk/Source/WebCore/rendering/RenderThemeGtk.h	2016-01-13 05:55:33 UTC (rev 194954)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.h	2016-01-13 06:47:10 UTC (rev 194955)
@@ -162,7 +162,6 @@
     virtual bool paintMediaSeekForwardButton(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual bool paintMediaSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual bool paintMediaSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) override;
-    virtual bool paintMediaVolumeSliderContainer(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual bool paintMediaVolumeSliderTrack(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual bool paintMediaVolumeSliderThumb(const RenderObject&, const PaintInfo&, const IntRect&) override;
     virtual bool paintMediaCurrentTime(const RenderObject&, const PaintInfo&, const IntRect&) override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to