Title: [264298] trunk/Source/WebCore
Revision
264298
Author
[email protected]
Date
2020-07-13 05:17:04 -0700 (Mon, 13 Jul 2020)

Log Message

[WPE][GTK4] Form controls are not painted when using threaded rendering
https://bugs.webkit.org/show_bug.cgi?id=214178

Reviewed by Žan Doberšek.

Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given
GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the
platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
* rendering/RenderThemeAdwaita.h:
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::canPaint const):
* rendering/RenderThemePlayStation.h:
* rendering/RenderThemeWin.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264297 => 264298)


--- trunk/Source/WebCore/ChangeLog	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/ChangeLog	2020-07-13 12:17:04 UTC (rev 264298)
@@ -1,3 +1,24 @@
+2020-07-13  Carlos Garcia Campos  <[email protected]>
+
+        [WPE][GTK4] Form controls are not painted when using threaded rendering
+        https://bugs.webkit.org/show_bug.cgi?id=214178
+
+        Reviewed by Žan Doberšek.
+
+        Which is the default for GTK4 since r263888. The problem is that RenderTheme::paint() returns early if the given
+        GraphicsContext doesn't have a platform context, assuming all RenderTheme implementations paint directly to the
+        platform context. This patch adds a pure virtual canPaint() to RenderTheme to be used as the early return.
+
+        * rendering/RenderTheme.cpp:
+        (WebCore::RenderTheme::paint):
+        * rendering/RenderTheme.h:
+        * rendering/RenderThemeAdwaita.h:
+        * rendering/RenderThemeCocoa.h:
+        * rendering/RenderThemeCocoa.mm:
+        (WebCore::RenderThemeCocoa::canPaint const):
+        * rendering/RenderThemePlayStation.h:
+        * rendering/RenderThemeWin.h:
+
 2020-07-13  Xabier Rodriguez Calvar  <[email protected]>
 
         [GStreamer] Unreviewed, remove private debug code

Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderTheme.cpp	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp	2020-07-13 12:17:04 UTC (rev 264298)
@@ -295,7 +295,7 @@
     if (paintInfo.context().paintingDisabled())
         return false;
 
-    if (UNLIKELY(!paintInfo.context().hasPlatformContext()))
+    if (UNLIKELY(!canPaint(paintInfo)))
         return false;
 
     ControlPart part = box.style().appearance();

Modified: trunk/Source/WebCore/rendering/RenderTheme.h (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderTheme.h	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderTheme.h	2020-07-13 12:17:04 UTC (rev 264298)
@@ -276,6 +276,7 @@
 #endif
 
 protected:
+    virtual bool canPaint(const PaintInfo&) const = 0;
     virtual FontCascadeDescription& cachedSystemFontDescription(CSSValueID systemFontID) const;
     virtual void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const = 0;
 

Modified: trunk/Source/WebCore/rendering/RenderThemeAdwaita.h (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderThemeAdwaita.h	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderThemeAdwaita.h	2020-07-13 12:17:04 UTC (rev 264298)
@@ -34,6 +34,8 @@
     virtual ~RenderThemeAdwaita() = default;
 
 private:
+    bool canPaint(const PaintInfo&) const final { return true; }
+
     String extraDefaultStyleSheet() final;
 #if ENABLE(VIDEO)
     String extraMediaControlsStyleSheet() final;

Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.h (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderThemeCocoa.h	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.h	2020-07-13 12:17:04 UTC (rev 264298)
@@ -39,6 +39,7 @@
     virtual CFStringRef contentSizeCategory() const = 0;
 
 private:
+    bool canPaint(const PaintInfo&) const final;
     bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;
 
 #if ENABLE(APPLE_PAY)

Modified: trunk/Source/WebCore/rendering/RenderThemeCocoa.mm (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm	2020-07-13 12:17:04 UTC (rev 264298)
@@ -54,6 +54,11 @@
     return static_cast<RenderThemeCocoa&>(RenderTheme::singleton());
 }
 
+bool RenderThemeCocoa::canPaint(const PaintInfo& paintInfo) const
+{
+    return paintInfo.context().hasPlatformContext();
+}
+
 bool RenderThemeCocoa::shouldHaveCapsLockIndicator(const HTMLInputElement& element) const
 {
     return element.isPasswordField();

Modified: trunk/Source/WebCore/rendering/RenderThemePlayStation.h (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderThemePlayStation.h	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderThemePlayStation.h	2020-07-13 12:17:04 UTC (rev 264298)
@@ -34,6 +34,8 @@
     friend NeverDestroyed<RenderThemePlayStation>;
 
 private:
+    bool canPaint(const PaintInfo&) const final { return true; }
+
     void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const final;
 };
 

Modified: trunk/Source/WebCore/rendering/RenderThemeWin.h (264297 => 264298)


--- trunk/Source/WebCore/rendering/RenderThemeWin.h	2020-07-13 09:32:07 UTC (rev 264297)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h	2020-07-13 12:17:04 UTC (rev 264298)
@@ -141,6 +141,8 @@
     RenderThemeWin();
     virtual ~RenderThemeWin();
 
+    bool canPaint(const PaintInfo&) const final { return true; }
+
     // System fonts.
     void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to