- Revision
- 270611
- Author
- [email protected]
- Date
- 2020-12-09 17:12:19 -0800 (Wed, 09 Dec 2020)
Log Message
[GPU Process] Allow form controls to be painted when iOS form control refresh is enabled
https://bugs.webkit.org/show_bug.cgi?id=219718
Reviewed by Tim Horton.
Ensures that form controls show up when using the GPU process, when the iOS form control refresh setting is
enabled. All form controls post-refresh are implemented in such a way that they're compatible with graphics
contexts in the web process that are not backed by platform graphics context objects. See below for more
details.
This was added as a temporary workaround to avoid crashing when enabling GPU process in r199037.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
Makes `RenderTheme::canPaint` true by default on the base `RenderTheme` class, so that all platforms don't need
to individually override it and return true. Additionally plumbs a `WebCore::Settings` object through this
method, so that we can consult it on iOS.
(WebCore::RenderTheme::canPaint const):
* rendering/RenderThemeAdwaita.h:
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::canPaint const): Deleted.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::canPaint const):
When iOS form control refresh is enabled, return true; otherwise, return true only if there is a platform
`CGContextRef`.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::canPaint const):
Preserve existing behavior by returning true here if (and only if) there is a platform `CGContextRef`.
* rendering/RenderThemePlayStation.h:
* rendering/RenderThemeWin.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (270610 => 270611)
--- trunk/Source/WebCore/ChangeLog 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/ChangeLog 2020-12-10 01:12:19 UTC (rev 270611)
@@ -1,3 +1,46 @@
+2020-12-09 Wenson Hsieh <[email protected]>
+
+ [GPU Process] Allow form controls to be painted when iOS form control refresh is enabled
+ https://bugs.webkit.org/show_bug.cgi?id=219718
+
+ Reviewed by Tim Horton.
+
+ Ensures that form controls show up when using the GPU process, when the iOS form control refresh setting is
+ enabled. All form controls post-refresh are implemented in such a way that they're compatible with graphics
+ contexts in the web process that are not backed by platform graphics context objects. See below for more
+ details.
+
+ This was added as a temporary workaround to avoid crashing when enabling GPU process in r199037.
+
+ * rendering/RenderTheme.cpp:
+ (WebCore::RenderTheme::paint):
+ * rendering/RenderTheme.h:
+
+ Makes `RenderTheme::canPaint` true by default on the base `RenderTheme` class, so that all platforms don't need
+ to individually override it and return true. Additionally plumbs a `WebCore::Settings` object through this
+ method, so that we can consult it on iOS.
+
+ (WebCore::RenderTheme::canPaint const):
+ * rendering/RenderThemeAdwaita.h:
+ * rendering/RenderThemeCocoa.h:
+ * rendering/RenderThemeCocoa.mm:
+ (WebCore::RenderThemeCocoa::canPaint const): Deleted.
+ * rendering/RenderThemeIOS.h:
+ * rendering/RenderThemeIOS.mm:
+ (WebCore::RenderThemeIOS::canPaint const):
+
+ When iOS form control refresh is enabled, return true; otherwise, return true only if there is a platform
+ `CGContextRef`.
+
+ * rendering/RenderThemeMac.h:
+ * rendering/RenderThemeMac.mm:
+ (WebCore::RenderThemeMac::canPaint const):
+
+ Preserve existing behavior by returning true here if (and only if) there is a platform `CGContextRef`.
+
+ * rendering/RenderThemePlayStation.h:
+ * rendering/RenderThemeWin.h:
+
2020-12-09 Andres Gonzalez <[email protected]>
Fix for focus tracking in isolated tree mode.
Modified: trunk/Source/WebCore/rendering/RenderTheme.cpp (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderTheme.cpp 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderTheme.cpp 2020-12-10 01:12:19 UTC (rev 270611)
@@ -291,7 +291,7 @@
if (paintInfo.context().paintingDisabled())
return false;
- if (UNLIKELY(!canPaint(paintInfo)))
+ if (UNLIKELY(!canPaint(paintInfo, box.settings())))
return false;
ControlPart part = box.style().appearance();
Modified: trunk/Source/WebCore/rendering/RenderTheme.h (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderTheme.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderTheme.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -46,6 +46,7 @@
class RenderObject;
class RenderProgress;
class RenderStyle;
+class Settings;
class RenderTheme {
protected:
@@ -263,7 +264,7 @@
#endif
protected:
- virtual bool canPaint(const PaintInfo&) const = 0;
+ virtual bool canPaint(const PaintInfo&, const Settings&) const { return true; }
virtual FontCascadeDescription& cachedSystemFontDescription(CSSValueID systemFontID) const;
virtual void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const = 0;
Modified: trunk/Source/WebCore/rendering/RenderThemeAdwaita.h (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeAdwaita.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeAdwaita.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -34,8 +34,6 @@
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 (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeCocoa.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -39,7 +39,6 @@
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 (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeCocoa.mm 2020-12-10 01:12:19 UTC (rev 270611)
@@ -55,11 +55,6 @@
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/RenderThemeIOS.h (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -68,6 +68,8 @@
WEBCORE_EXPORT static Color systemFocusRingColor();
private:
+ bool canPaint(const PaintInfo&, const Settings&) const final;
+
LengthBox popupInternalPaddingBox(const RenderStyle&) const override;
int baselinePosition(const RenderBox&) const override;
Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm 2020-12-10 01:12:19 UTC (rev 270611)
@@ -375,6 +375,17 @@
CGContextStrokePath(context);
}
+bool RenderThemeIOS::canPaint(const PaintInfo& paintInfo, const Settings& settings) const
+{
+#if ENABLE(IOS_FORM_CONTROL_REFRESH)
+ if (settings.iOSFormControlRefreshEnabled())
+ return true;
+#else
+ UNUSED_PARAM(settings);
+#endif
+ return paintInfo.context().hasPlatformContext();
+}
+
void RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
{
#if ENABLE(IOS_FORM_CONTROL_REFRESH)
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.h (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeMac.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -102,6 +102,8 @@
private:
RenderThemeMac();
+ bool canPaint(const PaintInfo&, const Settings&) const final;
+
#if ENABLE(VIDEO)
// Media controls
String mediaControlsStyleSheet() final;
Modified: trunk/Source/WebCore/rendering/RenderThemeMac.mm (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeMac.mm 2020-12-10 01:12:19 UTC (rev 270611)
@@ -280,6 +280,11 @@
return theme;
}
+bool RenderThemeMac::canPaint(const PaintInfo& paintInfo, const Settings&) const
+{
+ return paintInfo.context().hasPlatformContext();
+}
+
CFStringRef RenderThemeMac::contentSizeCategory() const
{
return kCTFontContentSizeCategoryL;
Modified: trunk/Source/WebCore/rendering/RenderThemePlayStation.h (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemePlayStation.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemePlayStation.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -34,8 +34,6 @@
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 (270610 => 270611)
--- trunk/Source/WebCore/rendering/RenderThemeWin.h 2020-12-10 00:35:58 UTC (rev 270610)
+++ trunk/Source/WebCore/rendering/RenderThemeWin.h 2020-12-10 01:12:19 UTC (rev 270611)
@@ -139,8 +139,6 @@
RenderThemeWin();
virtual ~RenderThemeWin();
- bool canPaint(const PaintInfo&) const final { return true; }
-
// System fonts.
void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const override;