Bug 1543398 - Don't pass unknown descriptors to Servo. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Fri, 12 Apr 2019 05:08:18 +0000
changeset 469251 11fb8048959d0d2a1e12027680684ff9fbebf760
parent 469250 894487fe3fa04ee0c91aef059bcbab4005f6e3e2
child 469252 0fd4c1a6ade556a67ed86d89235d3f1e0e6ce036
push id112776
push usershindli@mozilla.com
push dateFri, 12 Apr 2019 16:20:17 +0000
treeherdermozilla-inbound@b4501ced5619 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1543398
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1543398 - Don't pass unknown descriptors to Servo. r=heycam Differential Revision: https://phabricator.services.mozilla.com/D26914
layout/style/CSSFontFaceRule.cpp
layout/style/test/test_font_face_parser.html
--- a/layout/style/CSSFontFaceRule.cpp
+++ b/layout/style/CSSFontFaceRule.cpp
@@ -51,17 +51,20 @@ void CSSFontFaceRuleDecl::SetCssText(con
                                      ErrorResult& aRv) {
   aRv.Throw(NS_ERROR_NOT_IMPLEMENTED);  // bug 443978
 }
 
 NS_IMETHODIMP
 CSSFontFaceRuleDecl::GetPropertyValue(const nsAString& aPropName,
                                       nsAString& aResult) {
   aResult.Truncate();
-  GetPropertyValue(nsCSSProps::LookupFontDesc(aPropName), aResult);
+  nsCSSFontDesc descID = nsCSSProps::LookupFontDesc(aPropName);
+  if (descID != eCSSFontDesc_UNKNOWN) {
+    GetPropertyValue(descID, aResult);
+  }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 CSSFontFaceRuleDecl::RemoveProperty(const nsAString& aPropName,
                                     nsAString& aResult) {
   nsCSSFontDesc descID = nsCSSProps::LookupFontDesc(aPropName);
   NS_ASSERTION(descID >= eCSSFontDesc_UNKNOWN && descID < eCSSFontDesc_COUNT,
--- a/layout/style/test/test_font_face_parser.html
+++ b/layout/style/test/test_font_face_parser.html
@@ -327,16 +327,18 @@ function runTest() {
            testset[curTest].rule + " rule count");
            is(sheet.cssRules[0].type, 5 /*FONT_FACE_RULE*/,
            testset[curTest].rule + " rule type");
 
         var d = testset[curTest].d;
         var s = sheet.cssRules[0].style;
         var n = 0;
 
+        is(s.getPropertyValue("pointless"), "", "Unknown descriptors don't assert");
+
         // everything is set that should be
         for (var name in d) {
           is(s.getPropertyValue(name), d[name],
              testset[curTest].rule + " (prop " + name + ")");
           n++;
         }
         // nothing else is set
         is(s.length, n, testset[curTest].rule + "prop count");