Bug 1112700 - Fix assertion failure: aPropID != eCSSPropertyExtra_variable r=me
authorMichael Ratcliffe <mratcliffe@mozilla.com>
Thu, 18 Dec 2014 09:31:28 +0000
changeset 246191 a24e89b3b20615bf67acd1da276fe29cb73f3e72
parent 246096 f23bac4bf8062ffc62d220adcf89a07b0d31d7ab
child 246192 88d75d4851495d45bb40b2636b0c7e8fd046b49e
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1112700
milestone37.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 1112700 - Fix assertion failure: aPropID != eCSSPropertyExtra_variable r=me
layout/inspector/inDOMUtils.cpp
layout/inspector/tests/test_css_property_is_valid.html
--- a/layout/inspector/inDOMUtils.cpp
+++ b/layout/inspector/inDOMUtils.cpp
@@ -862,16 +862,21 @@ inDOMUtils::CssPropertyIsValid(const nsA
   nsCSSProperty propertyID =
     nsCSSProps::LookupProperty(aPropertyName, nsCSSProps::eIgnoreEnabledState);
 
   if (propertyID == eCSSProperty_UNKNOWN) {
     *_retval = false;
     return NS_OK;
   }
 
+  if (propertyID == eCSSPropertyExtra_variable) {
+    *_retval = true;
+    return NS_OK;
+  }
+
   // Get a parser, parse the property.
   nsCSSParser parser;
   *_retval = parser.IsValueValidForProperty(propertyID, aPropertyValue);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/layout/inspector/tests/test_css_property_is_valid.html
+++ b/layout/inspector/tests/test_css_property_is_valid.html
@@ -69,16 +69,21 @@
       property: "color",
       value: "red; background:green;",
       expected: false
     },
     {
       property: "content",
       value: "\"hello\"",
       expected: true
+    },
+    {
+      property: "color",
+      value: "var(--some-kind-of-green)",
+      expected: true
     }
   ];
 
   for (let {property, value, expected} of tests) {
     let valid = utils.cssPropertyIsValid(property, value);
 
     if (expected) {
       ok(valid, property + ":" + value + " is valid");