Bug 522515 - omit null urls from inclusion in userfont src descriptor array. r=dbaron

This commit is contained in:
John Daggett 2013-09-11 10:36:58 +09:00
Родитель a103db7527
Коммит c23a17de07
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -622,7 +622,12 @@ nsUserFontSet::InsertRule(nsCSSFontFaceRule *aRule, uint8_t aSheetType,
case eCSSUnit_URL: case eCSSUnit_URL:
face->mIsLocal = false; face->mIsLocal = false;
face->mURI = val.GetURLValue(); face->mURI = val.GetURLValue();
NS_ASSERTION(face->mURI, "null url in @font-face rule"); if (!face->mURI) {
// if URI not valid, omit from src array
srcArray.RemoveElementAt(srcArray.Length() - 1);
NS_WARNING("null url in @font-face rule");
continue;
}
face->mReferrer = val.GetURLStructValue()->mReferrer; face->mReferrer = val.GetURLStructValue()->mReferrer;
face->mOriginPrincipal = val.GetURLStructValue()->mOriginPrincipal; face->mOriginPrincipal = val.GetURLStructValue()->mOriginPrincipal;
NS_ASSERTION(face->mOriginPrincipal, "null origin principal in @font-face rule"); NS_ASSERTION(face->mOriginPrincipal, "null origin principal in @font-face rule");