summaryrefslogtreecommitdiff
path: root/Source/WebCore/css/CSSFontFaceSource.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/css/CSSFontFaceSource.cpp
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/css/CSSFontFaceSource.cpp')
-rw-r--r--Source/WebCore/css/CSSFontFaceSource.cpp26
1 files changed, 23 insertions, 3 deletions
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<SimpleFontData> 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<SimpleFontData>& fontData = m_fontDataTable.add(hashKey, 0).iterator->value;
if (fontData)
@@ -165,7 +165,7 @@ PassRefPtr<SimpleFontData> 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
+
}