⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 270611 in webkit


Ignore:
Timestamp:
Dec 9, 2020, 5:12:19 PM (6 years ago)
Author:
Wenson Hsieh
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:
Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r270609 r270611  
     12020-12-09  Wenson Hsieh  <wenson_hsieh@apple.com>
     2
     3        [GPU Process] Allow form controls to be painted when iOS form control refresh is enabled
     4        https://bugs.webkit.org/show_bug.cgi?id=219718
     5
     6        Reviewed by Tim Horton.
     7
     8        Ensures that form controls show up when using the GPU process, when the iOS form control refresh setting is
     9        enabled. All form controls post-refresh are implemented in such a way that they're compatible with graphics
     10        contexts in the web process that are not backed by platform graphics context objects. See below for more
     11        details.
     12
     13        This was added as a temporary workaround to avoid crashing when enabling GPU process in r199037.
     14
     15        * rendering/RenderTheme.cpp:
     16        (WebCore::RenderTheme::paint):
     17        * rendering/RenderTheme.h:
     18
     19        Makes `RenderTheme::canPaint` true by default on the base `RenderTheme` class, so that all platforms don't need
     20        to individually override it and return true. Additionally plumbs a `WebCore::Settings` object through this
     21        method, so that we can consult it on iOS.
     22
     23        (WebCore::RenderTheme::canPaint const):
     24        * rendering/RenderThemeAdwaita.h:
     25        * rendering/RenderThemeCocoa.h:
     26        * rendering/RenderThemeCocoa.mm:
     27        (WebCore::RenderThemeCocoa::canPaint const): Deleted.
     28        * rendering/RenderThemeIOS.h:
     29        * rendering/RenderThemeIOS.mm:
     30        (WebCore::RenderThemeIOS::canPaint const):
     31
     32        When iOS form control refresh is enabled, return true; otherwise, return true only if there is a platform
     33        `CGContextRef`.
     34
     35        * rendering/RenderThemeMac.h:
     36        * rendering/RenderThemeMac.mm:
     37        (WebCore::RenderThemeMac::canPaint const):
     38
     39        Preserve existing behavior by returning true here if (and only if) there is a platform `CGContextRef`.
     40
     41        * rendering/RenderThemePlayStation.h:
     42        * rendering/RenderThemeWin.h:
     43
    1442020-12-09  Andres Gonzalez  <andresg_22@apple.com>
    245
  • trunk/Source/WebCore/rendering/RenderTheme.cpp

    r270362 r270611  
    292292        return false;
    293293
    294     if (UNLIKELY(!canPaint(paintInfo)))
     294    if (UNLIKELY(!canPaint(paintInfo, box.settings())))
    295295        return false;
    296296
  • trunk/Source/WebCore/rendering/RenderTheme.h

    r270362 r270611  
    4747class RenderProgress;
    4848class RenderStyle;
     49class Settings;
    4950
    5051class RenderTheme {
     
    264265
    265266protected:
    266     virtual bool canPaint(const PaintInfo&) const = 0;
     267    virtual bool canPaint(const PaintInfo&, const Settings&) const { return true; }
    267268    virtual FontCascadeDescription& cachedSystemFontDescription(CSSValueID systemFontID) const;
    268269    virtual void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const = 0;
  • trunk/Source/WebCore/rendering/RenderThemeAdwaita.h

    r270250 r270611  
    3535
    3636private:
    37     bool canPaint(const PaintInfo&) const final { return true; }
    38 
    3937    String extraDefaultStyleSheet() final;
    4038#if ENABLE(VIDEO)
  • trunk/Source/WebCore/rendering/RenderThemeCocoa.h

    r264298 r270611  
    4040
    4141private:
    42     bool canPaint(const PaintInfo&) const final;
    4342    bool shouldHaveCapsLockIndicator(const HTMLInputElement&) const final;
    4443
  • trunk/Source/WebCore/rendering/RenderThemeCocoa.mm

    r266904 r270611  
    5454{
    5555    return static_cast<RenderThemeCocoa&>(RenderTheme::singleton());
    56 }
    57 
    58 bool RenderThemeCocoa::canPaint(const PaintInfo& paintInfo) const
    59 {
    60     return paintInfo.context().hasPlatformContext();
    6156}
    6257
  • trunk/Source/WebCore/rendering/RenderThemeIOS.h

    r270362 r270611  
    6969
    7070private:
     71    bool canPaint(const PaintInfo&, const Settings&) const final;
     72
    7173    LengthBox popupInternalPaddingBox(const RenderStyle&) const override;
    7274
  • trunk/Source/WebCore/rendering/RenderThemeIOS.mm

    r270403 r270611  
    376376}
    377377
     378bool RenderThemeIOS::canPaint(const PaintInfo& paintInfo, const Settings& settings) const
     379{
     380#if ENABLE(IOS_FORM_CONTROL_REFRESH)
     381    if (settings.iOSFormControlRefreshEnabled())
     382        return true;
     383#else
     384    UNUSED_PARAM(settings);
     385#endif
     386    return paintInfo.context().hasPlatformContext();
     387}
     388
    378389void RenderThemeIOS::paintCheckboxDecorations(const RenderObject& box, const PaintInfo& paintInfo, const IntRect& rect)
    379390{
  • trunk/Source/WebCore/rendering/RenderThemeMac.h

    r270362 r270611  
    103103    RenderThemeMac();
    104104
     105    bool canPaint(const PaintInfo&, const Settings&) const final;
     106
    105107#if ENABLE(VIDEO)
    106108    // Media controls
  • trunk/Source/WebCore/rendering/RenderThemeMac.mm

    r270362 r270611  
    279279    static NeverDestroyed<RenderThemeMac> theme;
    280280    return theme;
     281}
     282
     283bool RenderThemeMac::canPaint(const PaintInfo& paintInfo, const Settings&) const
     284{
     285    return paintInfo.context().hasPlatformContext();
    281286}
    282287
  • trunk/Source/WebCore/rendering/RenderThemePlayStation.h

    r264298 r270611  
    3535
    3636private:
    37     bool canPaint(const PaintInfo&) const final { return true; }
    38 
    3937    void updateCachedSystemFontDescription(CSSValueID systemFontID, FontCascadeDescription&) const final;
    4038};
  • trunk/Source/WebCore/rendering/RenderThemeWin.h

    r270250 r270611  
    140140    virtual ~RenderThemeWin();
    141141
    142     bool canPaint(const PaintInfo&) const final { return true; }
    143 
    144142    // System fonts.
    145143    void updateCachedSystemFontDescription(CSSValueID, FontCascadeDescription&) const override;
Note: See TracChangeset for help on using the changeset viewer.