From b78d8bd4ff55d33628a7b74896c58ebccdd24505 Mon Sep 17 00:00:00 2001 From: Cameron McCormack Date: Wed, 20 Feb 2013 11:24:42 +1100 Subject: [PATCH] Bug 842772 - Don't test for mask-type when the pref is disabled. r=dbaron --- layout/style/test/ListCSSProperties.cpp | 19 ++++++++++++++----- layout/style/test/property_database.js | 19 +++++++++++-------- layout/style/test/test_property_database.html | 12 ++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) diff --git a/layout/style/test/ListCSSProperties.cpp b/layout/style/test/ListCSSProperties.cpp index edba65c42f2..92023d5cfd6 100644 --- a/layout/style/test/ListCSSProperties.cpp +++ b/layout/style/test/ListCSSProperties.cpp @@ -12,6 +12,7 @@ struct PropertyInfo { const char *propName; const char *domName; + const char *pref; }; const PropertyInfo gLonghandProperties[] = { @@ -19,7 +20,7 @@ const PropertyInfo gLonghandProperties[] = { #define CSS_PROP_DOMPROP_PREFIXED(prop_) Moz ## prop_ #define CSS_PROP(name_, id_, method_, flags_, pref_, parsevariant_, kwtable_, \ stylestruct_, stylestructoffset_, animtype_) \ - { #name_, #method_ }, + { #name_, #method_, pref_ }, #include "nsCSSPropList.h" @@ -52,9 +53,9 @@ const PropertyInfo gShorthandProperties[] = { #define CSS_PROP_DOMPROP_PREFIXED(prop_) Moz ## prop_ // Need an extra level of macro nesting to force expansion of method_ // params before they get pasted. -#define LISTCSSPROPERTIES_INNER_MACRO(method_) #method_, +#define LISTCSSPROPERTIES_INNER_MACRO(method_) #method_ #define CSS_PROP_SHORTHAND(name_, id_, method_, flags_, pref_) \ - { #name_, LISTCSSPROPERTIES_INNER_MACRO(method_) }, + { #name_, LISTCSSPROPERTIES_INNER_MACRO(method_), pref_ }, #include "nsCSSPropList.h" @@ -63,7 +64,7 @@ const PropertyInfo gShorthandProperties[] = { #undef CSS_PROP_DOMPROP_PREFIXED #define CSS_PROP_ALIAS(name_, id_, method_, pref_) \ - { #name_, #method_ }, + { #name_, #method_, #pref_ }, #include "nsCSSPropAliasList.h" @@ -191,7 +192,15 @@ print_array(const char *aName, // lowercase the first letter printf("\"%c%s\"", p->domName[0] + 32, p->domName + 1); } - printf("}"); + if (p->pref && p->pref[0]) { + printf(", pref: "); + if (p->pref[0] == '\"') { + printf("%s", p->pref); + } else { + printf("\"%s\"", p->pref); + } + } + printf(" }"); } if (j != aDOMPropsLength) { diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js index 2e502f8afb9..f7783a378b1 100644 --- a/layout/style/test/property_database.js +++ b/layout/style/test/property_database.js @@ -3583,14 +3583,6 @@ var gCSSProperties = { other_values: [ "url(#mymask)" ], invalid_values: [] }, - "mask-type": { - domProp: "maskType", - inherited: false, - type: CSS_TYPE_LONGHAND, - initial_values: [ "luminance" ], - other_values: [ "alpha" ], - invalid_values: [] - }, "shape-rendering": { domProp: "shapeRendering", inherited: true, @@ -4257,6 +4249,17 @@ if (SpecialPowers.getBoolPref("layout.css.flexbox.enabled")) { gCSSProperties["display"].other_values.push("inline-flex"); } +if (SpecialPowers.getBoolPref("layout.css.masking.enabled")) { + gCSSProperties["mask-type"] = { + domProp: "maskType", + inherited: false, + type: CSS_TYPE_LONGHAND, + initial_values: [ "luminance" ], + other_values: [ "alpha" ], + invalid_values: [] + }; +} + if (SpecialPowers.getBoolPref("svg.paint-order.enabled")) { gCSSProperties["paint-order"] = { domProp: "paintOrder", diff --git a/layout/style/test/test_property_database.html b/layout/style/test/test_property_database.html index 8f5425a4716..dfceb125435 100644 --- a/layout/style/test/test_property_database.html +++ b/layout/style/test/test_property_database.html @@ -33,6 +33,9 @@ for (var idx in gLonghandProperties) { var prop = gLonghandProperties[idx]; + if (prop.pref && !SpecialPowers.getBoolPref(prop.pref)) { + continue; + } var present = prop.name in gCSSProperties; ok(present, "'" + prop.name + "' listed in gCSSProperties"); @@ -45,6 +48,9 @@ for (var idx in gLonghandProperties) { } for (var idx in gShorthandProperties) { var prop = gShorthandProperties[idx]; + if (prop.pref && !SpecialPowers.getBoolPref(prop.pref)) { + continue; + } var present = prop.name in gCSSProperties; ok(present, "'" + prop.name + "' listed in gCSSProperties"); @@ -58,6 +64,9 @@ for (var idx in gShorthandProperties) { } for (var idx in gShorthandPropertiesLikeLonghand) { var prop = gShorthandPropertiesLikeLonghand[idx]; + if (prop.pref && !SpecialPowers.getBoolPref(prop.pref)) { + continue; + } var present = prop.name in gCSSProperties; ok(present, "'" + prop.name + "' listed in gCSSProperties"); @@ -75,6 +84,9 @@ for (var idx in gShorthandPropertiesLikeLonghand) { */ for (var prop in gCSSProperties) { var info = gCSSProperties[prop]; + if (info.pref && !SpecialPowers.getBoolPref(info.pref)) { + continue; + } if (info.type == CSS_TYPE_LONGHAND) { ok(!("subproperties" in info), "longhand property '" + prop + "' must not have subproperty list");