From d441d6f39bb846989d95bcf5caf387b42414718d Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 13 Sep 2013 12:51:20 +0200 Subject: Import Qt5x2 branch of QtWebkit for Qt 5.2 Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen --- Source/WebCore/css/CSSFontFaceSource.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'Source/WebCore/css/CSSFontFaceSource.cpp') diff --git a/Source/WebCore/css/CSSFontFaceSource.cpp b/Source/WebCore/css/CSSFontFaceSource.cpp index 2fd63f6fa..8334b1836 100644 --- a/Source/WebCore/css/CSSFontFaceSource.cpp +++ b/Source/WebCore/css/CSSFontFaceSource.cpp @@ -111,8 +111,8 @@ PassRefPtr CSSFontFaceSource::getFontData(const FontDescription& } // See if we have a mapping in our FontData cache. - unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 6 | fontDescription.widthVariant() << 4 - | (fontDescription.textOrientation() == TextOrientationUpright ? 8 : 0) | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0); + unsigned hashKey = (fontDescription.computedPixelSize() + 1) << 5 | fontDescription.widthVariant() << 3 + | (fontDescription.orientation() == Vertical ? 4 : 0) | (syntheticBold ? 2 : 0) | (syntheticItalic ? 1 : 0); RefPtr& fontData = m_fontDataTable.add(hashKey, 0).iterator->value; if (fontData) @@ -165,7 +165,7 @@ PassRefPtr CSSFontFaceSource::getFontData(const FontDescription& return 0; fontData = SimpleFontData::create(m_font->platformDataFromCustomData(fontDescription.computedPixelSize(), syntheticBold, syntheticItalic, - fontDescription.orientation(), fontDescription.textOrientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false); + fontDescription.orientation(), fontDescription.widthVariant(), fontDescription.renderingMode()), true, false); } } else { #if ENABLE(SVG_FONTS) @@ -205,4 +205,24 @@ bool CSSFontFaceSource::isSVGFontFaceSource() const } #endif +#if ENABLE(FONT_LOAD_EVENTS) +bool CSSFontFaceSource::isDecodeError() const +{ + if (m_font) + return m_font->status() == CachedResource::DecodeError; + return false; +} + +bool CSSFontFaceSource::ensureFontData() +{ + if (!m_font) + return false; +#if ENABLE(SVG_FONTS) + if (m_hasExternalSVGFont) + return m_font->ensureSVGFontData(); +#endif + return m_font->ensureCustomFontData(); +} +#endif + } -- cgit v1.2.1