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

Changeset 245190 in webkit


Ignore:
Timestamp:
May 10, 2019, 1:10:59 PM (7 years ago)
Author:
Brent Fulgham
Message:

Gracefully handle inaccessible font face data
https://bugs.webkit.org/show_bug.cgi?id=197762
<rdar://problem/50433861>

Reviewed by Per Arne Vollan.

Make sure CSS Font Face handling gracefully recovers from
missing font data.

Test: fast/text/missing-font-crash.html

  • css/CSSFontFace.cpp:

(WebCore::CSSFontFace::fontLoadEventOccurred):
(WebCore::CSSFontFace::timeoutFired):
(WebCore::CSSFontFace::fontLoaded):
(WebCore::CSSFontFace::font):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245181 r245190  
     12019-05-10  Brent Fulgham  <bfulgham@apple.com>
     2
     3        Gracefully handle inaccessible font face data
     4        https://bugs.webkit.org/show_bug.cgi?id=197762
     5        <rdar://problem/50433861>
     6
     7        Reviewed by Per Arne Vollan.
     8
     9        Make sure CSS Font Face handling gracefully recovers from
     10        missing font data.
     11
     12        Test: fast/text/missing-font-crash.html
     13
     14        * css/CSSFontFace.cpp:
     15        (WebCore::CSSFontFace::fontLoadEventOccurred):
     16        (WebCore::CSSFontFace::timeoutFired):
     17        (WebCore::CSSFontFace::fontLoaded):
     18        (WebCore::CSSFontFace::font):
     19
    1202019-05-10  Simon Fraser  <simon.fraser@apple.com>
    221
  • trunk/Source/WebCore/css/CSSFontFace.cpp

    r239461 r245190  
    11/*
    2  * Copyright (C) 2007, 2008, 2011, 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2007-2019 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    474474void CSSFontFace::fontLoadEventOccurred()
    475475{
    476     Ref<CSSFontFace> protectedThis(*this);
    477 
    478476    // If the font is already in the cache, CSSFontFaceSource may report it's loaded before it is added here as a source.
    479477    // Let's not pump the state machine until we've got all our sources. font() and load() are smart enough to act correctly
     
    492490void CSSFontFace::timeoutFired()
    493491{
     492    Ref<CSSFontFace> protectedThis(*this);
     493   
    494494    switch (status()) {
    495495    case Status::Loading:
     
    685685void CSSFontFace::fontLoaded(CSSFontFaceSource&)
    686686{
     687    Ref<CSSFontFace> protectedThis(*this);
     688   
    687689    fontLoadEventOccurred();
    688690}
     
    784786        return nullptr;
    785787
     788    Ref<CSSFontFace> protectedThis(*this);
     789   
    786790    // Our status is derived from the first non-failed source. However, this source may
    787791    // return null from font(), which means we need to continue looping through the remainder
Note: See TracChangeset for help on using the changeset viewer.