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

Changeset 277378 in webkit


Ignore:
Timestamp:
May 12, 2021, 10:58:17 AM (5 years ago)
Author:
svillar@igalia.com
Message:

ASSERTION FAILED: m_clients.contains(&client) in CSSFontFace::removeClient via CSSSegmentedFontFace::~CSSSegmentedFontFace()
https://bugs.webkit.org/show_bug.cgi?id=223790

Reviewed by Ryosuke Niwa.

Source/WebCore:

CSSFontFace does not support adding the same client twice as it uses a HashSet to track them. This means that
it's a mistake to call removeClient() more than once. This could happen when specifying the same font
family more than once in a <font-face> element inside a svg container.

Test: fast/css/svg-font-face-duplicate-crash.html

  • css/CSSFontFaceSet.cpp:

(WebCore::CSSFontFaceSet::fontFace): Skip duplicate CSSFontFace's when before calling appendFontFace().

LayoutTests:

  • fast/css/svg-font-face-duplicate-crash-expected.txt: Added.
  • fast/css/svg-font-face-duplicate-crash.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r277373 r277378  
     12021-05-12  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        ASSERTION FAILED: m_clients.contains(&client) in CSSFontFace::removeClient via CSSSegmentedFontFace::~CSSSegmentedFontFace()
     4        https://bugs.webkit.org/show_bug.cgi?id=223790
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/css/svg-font-face-duplicate-crash-expected.txt: Added.
     9        * fast/css/svg-font-face-duplicate-crash.html: Added.
     10
    1112021-05-12  Ryosuke Niwa  <rniwa@webkit.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r277376 r277378  
     12021-05-12  Sergio Villar Senin  <svillar@igalia.com>
     2
     3        ASSERTION FAILED: m_clients.contains(&client) in CSSFontFace::removeClient via CSSSegmentedFontFace::~CSSSegmentedFontFace()
     4        https://bugs.webkit.org/show_bug.cgi?id=223790
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        CSSFontFace does not support adding the same client twice as it uses a HashSet to track them. This means that
     9        it's a mistake to call removeClient() more than once. This could happen when specifying the same font
     10        family more than once in a <font-face> element inside a svg container.
     11
     12        Test: fast/css/svg-font-face-duplicate-crash.html
     13
     14        * css/CSSFontFaceSet.cpp:
     15        (WebCore::CSSFontFaceSet::fontFace): Skip duplicate CSSFontFace's when before calling appendFontFace().
     16
    1172021-05-12  Chris Dumez  <cdumez@apple.com>
    218
  • trunk/Source/WebCore/css/CSSFontFaceSet.cpp

    r276450 r277378  
    511511            return false;
    512512        });
    513         for (auto& candidate : candidateFontFaces)
     513        CSSFontFace* previousCandidate = nullptr;
     514        for (auto& candidate : candidateFontFaces) {
     515            if (&candidate.get() == previousCandidate)
     516                continue;
     517            previousCandidate = &candidate.get();
    514518            face->appendFontFace(candidate.get());
     519        }
    515520    }
    516521
Note: See TracChangeset for help on using the changeset viewer.