Ignore:
Timestamp:
Jan 24, 2016, 9:23:49 PM (9 years ago)
Author:
[email protected]
Message:

[Font Loading] General cleanup
https://bugs.webkit.org/show_bug.cgi?id=153403

Reviewed by Darin Adler.

It turns out that CSSFontFaceSource::m_hasExternalSVGFont exactly equals
whether or not CSSFontFaceSource::m_font is a CachedSVGFont. Therefore,
the variable is redundant.

In addition, it was being passed to functions on CSSFontFaceSource::m_font,
which means it was always true inside the CachedSVGFont subclass and
always false for the CachedFont. Therefore, there is no reason pass this
variable to these functions because its value can be determined at
authorship time.

No new tests because there is no behavior change.

  • css/CSSFontFaceSource.cpp:

(WebCore::CSSFontFaceSource::font):
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.

  • css/CSSFontFaceSource.h:
  • css/CSSFontSelector.cpp:

(WebCore::createFontFace):

  • loader/cache/CachedFont.cpp:

(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createFont):

  • loader/cache/CachedFont.h:
  • loader/cache/CachedSVGFont.cpp:

(WebCore::CachedSVGFont::createFont):
(WebCore::CachedSVGFont::ensureCustomFontData):

  • loader/cache/CachedSVGFont.h:
  • platform/network/HTTPParsers.cpp:

(WebCore::isValidHTTPToken):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/CSSFontFaceSource.cpp

    r194923 r195523  
    5858    , m_font(font)
    5959    , m_face(0)
    60 #if ENABLE(SVG_FONTS)
    61     , m_hasExternalSVGFont(false)
    62 #endif
    6360{
    6461    if (m_font)
     
    120117    if (!m_font || m_font->isLoaded()) {
    121118        if (m_font) {
    122             bool hasExternalSVGFont = false;
    123 #if ENABLE(SVG_FONTS)
    124             hasExternalSVGFont = m_hasExternalSVGFont;
    125 #endif
    126             if (!m_font->ensureCustomFontData(hasExternalSVGFont, m_string))
     119            if (!m_font->ensureCustomFontData(m_string))
    127120                return nullptr;
    128121
    129             font = m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, hasExternalSVGFont, fontFaceFeatures, fontFaceVariantSettings);
     122            font = m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings);
    130123        } else {
    131124#if ENABLE(SVG_FONTS)
     
    165158}
    166159
     160#if ENABLE(SVG_FONTS)
     161bool CSSFontFaceSource::isSVGFontFaceSource() const
     162{
     163    return m_svgFontFaceElement || is<CachedSVGFont>(m_font.get());
     164}
     165#endif
     166
    167167#if ENABLE(FONT_LOAD_EVENTS)
    168168bool CSSFontFaceSource::isDecodeError() const
Note: See TracChangeset for help on using the changeset viewer.