Commit 1b6dc6ce authored by Andrea Iacovitti's avatar Andrea Iacovitti

Handle webfont loading error.

Small optimization in requestFamilyName.
parent 25d0b096
......@@ -84,10 +84,10 @@ bool CSSFontFaceSource::isValid() const
return true;
}
void CSSFontFaceSource::notifyFinished(khtml::CachedObject */*finishedObj*/)
void CSSFontFaceSource::notifyFinished(khtml::CachedObject *finishedObj)
{
if (m_face->installed()) {
// kWarning() << "Font already added from other src";
// Nothing to do if font already added from other src or failed to load
if (m_face->installed() || finishedObj->hadError()) {
return;
}
......@@ -652,11 +652,16 @@ void CSSFontSelector::requestFamilyName( const DOMString& familyName )
{
QHash<DOMString, CSSFontFace*>::const_iterator it = m_locallyInstalledFontFaces.constBegin();
QHash<DOMString, CSSFontFace*>::const_iterator end = m_locallyInstalledFontFaces.constEnd();
for ( ; it != end; ++it) {
if (it.key() == familyName.lower()) {
if (it == end) {
return;
}
const DOMString familyNameLower = familyName.lower();
do {
if (it.key() == familyNameLower) {
it.value()->refLoaders();
}
}
++it;
} while (it != end);
}
void CSSFontSelector::fontLoaded()
......
......@@ -126,7 +126,7 @@ public:
void setFontFace(CSSFontFace* face) { m_face = face; }
virtual void notifyFinished(khtml::CachedObject * /*finishedObj*/);
virtual void notifyFinished(khtml::CachedObject * finishedObj);
void refLoader();
// SimpleFontData* getFontData(const FontDef&, bool syntheticBold, bool syntheticItalic, CSSFontSelector*);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment