Bug 473815 - Improve diagnostics for malformed @font-face rules; r+sr=dbaron
authorZack Weinberg <zweinberg@mozilla.com>
Thu, 12 Feb 2009 05:15:56 +0100
changeset 24934 692c543f7b554e062cb00e35bfdef231f6c92259
parent 24933 f050934dd42e604384ebc5b1519e96403339c990
child 24935 db7d1a86b94ab9c92497d170c7fc5cc4f8b2a9b4
push idunknown
push userunknown
push dateunknown
bugs473815
milestone1.9.2a1pre
Bug 473815 - Improve diagnostics for malformed @font-face rules; r+sr=dbaron
dom/locales/en-US/chrome/layout/css.properties
layout/style/nsCSSParser.cpp
--- a/dom/locales/en-US/chrome/layout/css.properties
+++ b/dom/locales/en-US/chrome/layout/css.properties
@@ -130,8 +130,10 @@ SEUnterminatedString=Found unclosed stri
 PEFontDescExpected=Expected font descriptor but found '%1$S'.
 PEUnknownFontDesc=Unknown descriptor '%1$S' in @font-face rule.
 PEMQExpectedExpressionStart=Expected '(' to start media query expression but found '%1$S'.
 PEMQExpressionEOF=contents of media query expression
 PEMQExpectedFeatureName=Expected media feature name but found '%1$S'.
 PEMQExpectedFeatureNameEnd=Expected ':' or ')' after media feature name but found '%1$S'.
 PEMQNoMinMaxWithoutValue=Media features with min- or max- must have a value.
 PEMQExpectedFeatureValue=Found invalid value for media feature.
+PEBadFontBlockStart=Expected '{' to begin @font-face rule but found '%1$S'.
+PEBadFontBlockEnd=Expected '}' to end @font-face rule but found '%1$S'.
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -2033,17 +2033,17 @@ CSSParserImpl::ProcessNameSpace(const ns
 }
 
 // font-face-rule: '@font-face' '{' font-description '}'
 // font-description: font-descriptor+
 PRBool
 CSSParserImpl::ParseFontFaceRule(RuleAppendFunc aAppendFunc, void* aData)
 {
   if (!ExpectSymbol('{', PR_TRUE)) {
-    REPORT_UNEXPECTED_TOKEN(PEBadDeclBlockStart);
+    REPORT_UNEXPECTED_TOKEN(PEBadFontBlockStart);
     return PR_FALSE;
   }
 
   nsRefPtr<nsCSSFontFaceRule> rule(new nsCSSFontFaceRule());
   if (!rule) {
     mScanner.SetLowLevelError(NS_ERROR_OUT_OF_MEMORY);
     return PR_FALSE;
   }
@@ -2065,17 +2065,17 @@ CSSParserImpl::ParseFontFaceRule(RuleApp
     if (!ParseFontDescriptor(rule)) {
       REPORT_UNEXPECTED(PEDeclSkipped);
       OUTPUT_ERROR();
       if (!SkipDeclaration(PR_TRUE))
         break;
     }
   }
   if (!ExpectSymbol('}', PR_TRUE)) {
-    REPORT_UNEXPECTED_TOKEN(PEBadDeclOrRuleEnd2);
+    REPORT_UNEXPECTED_TOKEN(PEBadFontBlockEnd);
     return PR_FALSE;
   }
   (*aAppendFunc)(rule, aData);
   return PR_TRUE;
 }
 
 // font-descriptor: font-family-desc
 //                | font-style-desc