Bug 1075617. Log the correct file/line for the @font-face rule for font errors. r=jfkthame

This commit is contained in:
Boris Zbarsky 2014-10-02 00:23:53 -04:00
Родитель 5ab3a5e90d
Коммит aa7f48f11c
1 изменённых файлов: 6 добавлений и 5 удалений

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

@ -1058,13 +1058,13 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
if (rule) {
rv = rule->GetCssText(text);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMCSSStyleSheet> sheet;
rv = rule->GetParentStyleSheet(getter_AddRefs(sheet));
NS_ENSURE_SUCCESS(rv, rv);
CSSStyleSheet* sheet = rule->GetStyleSheet();
// if the style sheet is removed while the font is loading can be null
if (sheet) {
rv = sheet->GetHref(href);
nsAutoCString spec;
rv = sheet->GetSheetURI()->GetSpec(spec);
NS_ENSURE_SUCCESS(rv, rv);
CopyUTF8toUTF16(spec, href);
} else {
NS_WARNING("null parent stylesheet for @font-face rule");
href.AssignLiteral("unknown");
@ -1079,7 +1079,8 @@ FontFaceSet::LogMessage(gfxUserFontEntry* aUserFontEntry,
rv = scriptError->InitWithWindowID(NS_ConvertUTF8toUTF16(message),
href, // file
text, // src line
0, 0, // line & column number
rule->GetLineNumber(),
rule->GetColumnNumber(),
aFlags, // flags
"CSS Loader", // category (make separate?)
innerWindowID);