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

Changeset 239847 in webkit


Ignore:
Timestamp:
Jan 10, 2019, 2:50:13 PM (8 years ago)
Author:
Simon Fraser
Message:

Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
​https://bugs.webkit.org/show_bug.cgi?id=193337
rdar://problem/47179993

Reviewed by Zalan Bujtas.

Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
which tried to get at the platform context, and then crashed.

So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
that other scrollbar-related painting code paths were already protected.

Hard to test because it depends on async image decoding timing.

  • platform/mac/ScrollbarThemeMac.mm:

(WebCore::ScrollbarThemeMac::paint):
(WebCore::ScrollbarThemeMac::paintScrollCorner):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239844 r239847  
     12019-01-10  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
     4        https://bugs.webkit.org/show_bug.cgi?id=193337
     5        rdar://problem/47179993
     6
     7        Reviewed by Zalan Bujtas.
     8       
     9        Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
     10        which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
     11        which tried to get at the platform context, and then crashed.
     12       
     13        So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
     14        that other scrollbar-related painting code paths were already protected.
     15
     16        Hard to test because it depends on async image decoding timing.
     17
     18        * platform/mac/ScrollbarThemeMac.mm:
     19        (WebCore::ScrollbarThemeMac::paint):
     20        (WebCore::ScrollbarThemeMac::paintScrollCorner):
     21
    1222019-01-10  Myles C. Maxfield  <mmaxfield@apple.com>
    223
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm

    r233116 r239847  
    551551bool ScrollbarThemeMac::paint(Scrollbar& scrollbar, GraphicsContext& context, const IntRect& damageRect)
    552552{
     553    if (context.paintingDisabled())
     554        return false;
     555
    553556    setPaintCharacteristicsForScrollbar(scrollbar);
    554557
    … …  
    569572void ScrollbarThemeMac::paintScrollCorner(GraphicsContext& context, const IntRect& cornerRect)
    570573{
     574    if (context.paintingDisabled())
     575        return;
     576
    571577    LocalCurrentGraphicsContext localContext(context);
    572578
Note: See TracChangeset for help on using the changeset viewer.