Bug 1408841 - Remove preference "layout.css.filters.enabled". r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D5467

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2018-09-10 22:45:20 +00:00
parent 2f2111a2f5
commit 513be2f9d5
10 changed files with 230 additions and 279 deletions

View File

@ -510,22 +510,6 @@ nsLayoutUtils::AnimatedImageLayersEnabled()
return sAnimatedImageLayersEnabled;
}
bool
nsLayoutUtils::CSSFiltersEnabled()
{
static bool sCSSFiltersEnabled;
static bool sCSSFiltersPrefCached = false;
if (!sCSSFiltersPrefCached) {
sCSSFiltersPrefCached = true;
Preferences::AddBoolVarCache(&sCSSFiltersEnabled,
"layout.css.filters.enabled",
false);
}
return sCSSFiltersEnabled;
}
bool
nsLayoutUtils::IsInterCharacterRubyEnabled()
{

View File

@ -2401,11 +2401,6 @@ public:
*/
static bool AnimatedImageLayersEnabled();
/**
* Checks if we should enable parsing for CSS Filters.
*/
static bool CSSFiltersEnabled();
/**
* Checks whether support for inter-character ruby is enabled.
*/

View File

@ -40,8 +40,8 @@ fuzzy-if(azureSkia||d2d||gtkWidget,0-1,0-40000) pref(layout.css.background-blend
#fuzzy due to inconsistencies in rounded rect cliping between parent and child; may be related to antialiasing. Between platforms, the max difference is the same, and the number of different pixels is either 36 or 37. (Win, Mac and Lin)
fuzzy(0-65,0-53) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-952051.html mix-blend-mode-952051-ref.html
fuzzy-if(d3d11,0-49,0-200) pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.html mix-blend-mode-and-filter-ref.html
fuzzy-if(d3d11,0-1,0-5) pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.svg mix-blend-mode-and-filter-ref.svg
fuzzy-if(d3d11,0-49,0-200) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-and-filter.html mix-blend-mode-and-filter-ref.html
fuzzy-if(d3d11,0-1,0-5) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-and-filter.svg mix-blend-mode-and-filter-ref.svg
fuzzy(0-2,0-14400) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-child-of-blended-has-opacity.html mix-blend-mode-child-of-blended-has-opacity-ref.html

View File

@ -1,8 +1,6 @@
# These tests verify that CSS filter chains behave properly.
# e.g. filter: blur(3px) grayscale(0.5) invert(0.2);
default-preferences pref(layout.css.filters.enabled,true)
# Some platforms render this complex filter chain a little differently, and that's ok.
fuzzy(0-5,0-13638) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&layersGPUAccelerated,0-35,0-13638) fuzzy-if(webrender,5-6,17922-18643) == long-chain.html long-chain-ref.html # Win10: Bug 1258241
== moz-element.html moz-element-ref.html

View File

@ -1,8 +1,6 @@
# These tests verify that CSS filters behave properly.
# e.g. filter: blur(3px)
default-preferences pref(layout.css.filters.enabled,true)
fuzzy-if(webrender,9-9,4780-4784) == blur.html blur-ref.html
== blur.svg blur-ref.svg
== blur-calc.html blur-calc-ref.html

View File

@ -2,8 +2,6 @@
# properly.
# e.g. filter: url(#f1) blur(3px) url(#2) grayscale(0.5);
default-preferences pref(layout.css.filters.enabled,true)
== clip-input-css-filter.html clip-input-css-filter-ref.html
== css-filter-first.html css-filter-first-ref.html
== css-filter-last.html css-filter-last-ref.html

View File

@ -1,8 +1,6 @@
# These tests verify that SVG filter chains behave properly.
# e.g. filter: url(#f1) url(#f2) url(#f3)
default-preferences pref(layout.css.filters.enabled,true)
== clip-input.svg clip-input-ref.svg
== clip-original-SourceGraphic.svg clip-original-SourceGraphic-ref.svg
== clip-output.svg clip-output-ref.svg

View File

@ -4889,8 +4889,234 @@ var gCSSProperties = {
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "url(#myfilt)" ],
invalid_values: [ "url(#myfilt) none" ]
other_values: [
// SVG reference filters
"url(#my-filter)",
"url(#my-filter-1) url(#my-filter-2)",
// Filter functions
"opacity(50%) saturate(1.0)",
"invert(50%) sepia(0.1) brightness(90%)",
// Mixed SVG reference filters and filter functions
"grayscale(1) url(#my-filter-1)",
"url(#my-filter-1) brightness(50%) contrast(0.9)",
// Bad URLs
"url('badscheme:badurl')",
"blur(3px) url('badscheme:badurl') grayscale(50%)",
"blur(0)",
"blur(0px)",
"blur(0.5px)",
"blur(3px)",
"blur(100px)",
"blur(0.1em)",
"blur(calc(-1px))", // Parses and becomes blur(0px).
"blur(calc(0px))",
"blur(calc(5px))",
"blur(calc(2 * 5px))",
"brightness(0)",
"brightness(50%)",
"brightness(1)",
"brightness(1.0)",
"brightness(2)",
"brightness(350%)",
"brightness(4.567)",
"contrast(0)",
"contrast(50%)",
"contrast(1)",
"contrast(1.0)",
"contrast(2)",
"contrast(350%)",
"contrast(4.567)",
"drop-shadow(2px 2px)",
"drop-shadow(2px 2px 1px)",
"drop-shadow(2px 2px green)",
"drop-shadow(2px 2px 1px green)",
"drop-shadow(green 2px 2px)",
"drop-shadow(green 2px 2px 1px)",
"drop-shadow(currentColor 3px 3px)",
"drop-shadow(2px 2px calc(-5px))", /* clamped */
"drop-shadow(calc(3em - 2px) 2px green)",
"drop-shadow(green calc(3em - 2px) 2px)",
"drop-shadow(2px calc(2px + 0.2em))",
"drop-shadow(blue 2px calc(2px + 0.2em))",
"drop-shadow(2px calc(2px + 0.2em) blue)",
"drop-shadow(calc(-2px) calc(-2px))",
"drop-shadow(-2px -2px)",
"drop-shadow(calc(2px) calc(2px))",
"drop-shadow(calc(2px) calc(2px) calc(2px))",
"grayscale(0)",
"grayscale(50%)",
"grayscale(1)",
"grayscale(1.0)",
"grayscale(2)",
"grayscale(350%)",
"grayscale(4.567)",
"hue-rotate(0)",
"hue-rotate(0deg)",
"hue-rotate(90deg)",
"hue-rotate(540deg)",
"hue-rotate(-90deg)",
"hue-rotate(10grad)",
"hue-rotate(1.6rad)",
"hue-rotate(-1.6rad)",
"hue-rotate(0.5turn)",
"hue-rotate(-2turn)",
"invert(0)",
"invert(50%)",
"invert(1)",
"invert(1.0)",
"invert(2)",
"invert(350%)",
"invert(4.567)",
"opacity(0)",
"opacity(50%)",
"opacity(1)",
"opacity(1.0)",
"opacity(2)",
"opacity(350%)",
"opacity(4.567)",
"saturate(0)",
"saturate(50%)",
"saturate(1)",
"saturate(1.0)",
"saturate(2)",
"saturate(350%)",
"saturate(4.567)",
"sepia(0)",
"sepia(50%)",
"sepia(1)",
"sepia(1.0)",
"sepia(2)",
"sepia(350%)",
"sepia(4.567)",
],
invalid_values: [
// none
"none none",
"url(#my-filter) none",
"none url(#my-filter)",
"blur(2px) none url(#my-filter)",
// Nested filters
"grayscale(invert(1.0))",
// Comma delimited filters
"url(#my-filter),",
"invert(50%), url(#my-filter), brightness(90%)",
// Test the following situations for each filter function:
// - Invalid number of arguments
// - Comma delimited arguments
// - Wrong argument type
// - Argument value out of range
"blur()",
"blur(3px 5px)",
"blur(3px,)",
"blur(3px, 5px)",
"blur(#my-filter)",
"blur(0.5)",
"blur(50%)",
"blur(calc(0))", // Unitless zero in calc is not a valid length.
"blur(calc(0.1))",
"blur(calc(10%))",
"blur(calc(20px - 5%))",
"blur(-3px)",
"brightness()",
"brightness(0.5 0.5)",
"brightness(0.5,)",
"brightness(0.5, 0.5)",
"brightness(#my-filter)",
"brightness(10px)",
"brightness(-1)",
"contrast()",
"contrast(0.5 0.5)",
"contrast(0.5,)",
"contrast(0.5, 0.5)",
"contrast(#my-filter)",
"contrast(10px)",
"contrast(-1)",
"drop-shadow()",
"drop-shadow(3% 3%)",
"drop-shadow(2px 2px -5px)",
"drop-shadow(2px 2px 2px 2px)",
"drop-shadow(2px 2px, none)",
"drop-shadow(none, 2px 2px)",
"drop-shadow(inherit, 2px 2px)",
"drop-shadow(2px 2px, inherit)",
"drop-shadow(2 2px)",
"drop-shadow(2px 2)",
"drop-shadow(2px 2px 2)",
"drop-shadow(2px 2px 2px 2)",
"drop-shadow(calc(2px) calc(2px) calc(2px) calc(2px))",
"drop-shadow(green 2px 2px, blue 1px 3px 4px)",
"drop-shadow(blue 2px 2px, currentColor 1px 2px)",
"drop-shadow(unset, 2px 2px)",
"drop-shadow(2px 2px, unset)",
"grayscale()",
"grayscale(0.5 0.5)",
"grayscale(0.5,)",
"grayscale(0.5, 0.5)",
"grayscale(#my-filter)",
"grayscale(10px)",
"grayscale(-1)",
"hue-rotate()",
"hue-rotate(0.5 0.5)",
"hue-rotate(0.5,)",
"hue-rotate(0.5, 0.5)",
"hue-rotate(#my-filter)",
"hue-rotate(10px)",
"hue-rotate(-1)",
"hue-rotate(45deg,)",
"invert()",
"invert(0.5 0.5)",
"invert(0.5,)",
"invert(0.5, 0.5)",
"invert(#my-filter)",
"invert(10px)",
"invert(-1)",
"opacity()",
"opacity(0.5 0.5)",
"opacity(0.5,)",
"opacity(0.5, 0.5)",
"opacity(#my-filter)",
"opacity(10px)",
"opacity(-1)",
"saturate()",
"saturate(0.5 0.5)",
"saturate(0.5,)",
"saturate(0.5, 0.5)",
"saturate(#my-filter)",
"saturate(10px)",
"saturate(-1)",
"sepia()",
"sepia(0.5 0.5)",
"sepia(0.5,)",
"sepia(0.5, 0.5)",
"sepia(#my-filter)",
"sepia(10px)",
"sepia(-1)",
]
},
"flood-color": {
domProp: "floodColor",
@ -6264,242 +6490,6 @@ if (IsCSSPropertyPrefEnabled("layout.css.shape-outside.enabled")) {
};
}
if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) {
gCSSProperties["filter"] = {
domProp: "filter",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [
// SVG reference filters
"url(#my-filter)",
"url(#my-filter-1) url(#my-filter-2)",
// Filter functions
"opacity(50%) saturate(1.0)",
"invert(50%) sepia(0.1) brightness(90%)",
// Mixed SVG reference filters and filter functions
"grayscale(1) url(#my-filter-1)",
"url(#my-filter-1) brightness(50%) contrast(0.9)",
// Bad URLs
"url('badscheme:badurl')",
"blur(3px) url('badscheme:badurl') grayscale(50%)",
"blur(0)",
"blur(0px)",
"blur(0.5px)",
"blur(3px)",
"blur(100px)",
"blur(0.1em)",
"blur(calc(-1px))", // Parses and becomes blur(0px).
"blur(calc(0px))",
"blur(calc(5px))",
"blur(calc(2 * 5px))",
"brightness(0)",
"brightness(50%)",
"brightness(1)",
"brightness(1.0)",
"brightness(2)",
"brightness(350%)",
"brightness(4.567)",
"contrast(0)",
"contrast(50%)",
"contrast(1)",
"contrast(1.0)",
"contrast(2)",
"contrast(350%)",
"contrast(4.567)",
"drop-shadow(2px 2px)",
"drop-shadow(2px 2px 1px)",
"drop-shadow(2px 2px green)",
"drop-shadow(2px 2px 1px green)",
"drop-shadow(green 2px 2px)",
"drop-shadow(green 2px 2px 1px)",
"drop-shadow(currentColor 3px 3px)",
"drop-shadow(2px 2px calc(-5px))", /* clamped */
"drop-shadow(calc(3em - 2px) 2px green)",
"drop-shadow(green calc(3em - 2px) 2px)",
"drop-shadow(2px calc(2px + 0.2em))",
"drop-shadow(blue 2px calc(2px + 0.2em))",
"drop-shadow(2px calc(2px + 0.2em) blue)",
"drop-shadow(calc(-2px) calc(-2px))",
"drop-shadow(-2px -2px)",
"drop-shadow(calc(2px) calc(2px))",
"drop-shadow(calc(2px) calc(2px) calc(2px))",
"grayscale(0)",
"grayscale(50%)",
"grayscale(1)",
"grayscale(1.0)",
"grayscale(2)",
"grayscale(350%)",
"grayscale(4.567)",
"hue-rotate(0)",
"hue-rotate(0deg)",
"hue-rotate(90deg)",
"hue-rotate(540deg)",
"hue-rotate(-90deg)",
"hue-rotate(10grad)",
"hue-rotate(1.6rad)",
"hue-rotate(-1.6rad)",
"hue-rotate(0.5turn)",
"hue-rotate(-2turn)",
"invert(0)",
"invert(50%)",
"invert(1)",
"invert(1.0)",
"invert(2)",
"invert(350%)",
"invert(4.567)",
"opacity(0)",
"opacity(50%)",
"opacity(1)",
"opacity(1.0)",
"opacity(2)",
"opacity(350%)",
"opacity(4.567)",
"saturate(0)",
"saturate(50%)",
"saturate(1)",
"saturate(1.0)",
"saturate(2)",
"saturate(350%)",
"saturate(4.567)",
"sepia(0)",
"sepia(50%)",
"sepia(1)",
"sepia(1.0)",
"sepia(2)",
"sepia(350%)",
"sepia(4.567)",
],
invalid_values: [
// none
"none none",
"url(#my-filter) none",
"none url(#my-filter)",
"blur(2px) none url(#my-filter)",
// Nested filters
"grayscale(invert(1.0))",
// Comma delimited filters
"url(#my-filter),",
"invert(50%), url(#my-filter), brightness(90%)",
// Test the following situations for each filter function:
// - Invalid number of arguments
// - Comma delimited arguments
// - Wrong argument type
// - Argument value out of range
"blur()",
"blur(3px 5px)",
"blur(3px,)",
"blur(3px, 5px)",
"blur(#my-filter)",
"blur(0.5)",
"blur(50%)",
"blur(calc(0))", // Unitless zero in calc is not a valid length.
"blur(calc(0.1))",
"blur(calc(10%))",
"blur(calc(20px - 5%))",
"blur(-3px)",
"brightness()",
"brightness(0.5 0.5)",
"brightness(0.5,)",
"brightness(0.5, 0.5)",
"brightness(#my-filter)",
"brightness(10px)",
"brightness(-1)",
"contrast()",
"contrast(0.5 0.5)",
"contrast(0.5,)",
"contrast(0.5, 0.5)",
"contrast(#my-filter)",
"contrast(10px)",
"contrast(-1)",
"drop-shadow()",
"drop-shadow(3% 3%)",
"drop-shadow(2px 2px -5px)",
"drop-shadow(2px 2px 2px 2px)",
"drop-shadow(2px 2px, none)",
"drop-shadow(none, 2px 2px)",
"drop-shadow(inherit, 2px 2px)",
"drop-shadow(2px 2px, inherit)",
"drop-shadow(2 2px)",
"drop-shadow(2px 2)",
"drop-shadow(2px 2px 2)",
"drop-shadow(2px 2px 2px 2)",
"drop-shadow(calc(2px) calc(2px) calc(2px) calc(2px))",
"drop-shadow(green 2px 2px, blue 1px 3px 4px)",
"drop-shadow(blue 2px 2px, currentColor 1px 2px)",
"grayscale()",
"grayscale(0.5 0.5)",
"grayscale(0.5,)",
"grayscale(0.5, 0.5)",
"grayscale(#my-filter)",
"grayscale(10px)",
"grayscale(-1)",
"hue-rotate()",
"hue-rotate(0.5 0.5)",
"hue-rotate(0.5,)",
"hue-rotate(0.5, 0.5)",
"hue-rotate(#my-filter)",
"hue-rotate(10px)",
"hue-rotate(-1)",
"hue-rotate(45deg,)",
"invert()",
"invert(0.5 0.5)",
"invert(0.5,)",
"invert(0.5, 0.5)",
"invert(#my-filter)",
"invert(10px)",
"invert(-1)",
"opacity()",
"opacity(0.5 0.5)",
"opacity(0.5,)",
"opacity(0.5, 0.5)",
"opacity(#my-filter)",
"opacity(10px)",
"opacity(-1)",
"saturate()",
"saturate(0.5 0.5)",
"saturate(0.5,)",
"saturate(0.5, 0.5)",
"saturate(#my-filter)",
"saturate(10px)",
"saturate(-1)",
"sepia()",
"sepia(0.5 0.5)",
"sepia(0.5,)",
"sepia(0.5, 0.5)",
"sepia(#my-filter)",
"sepia(10px)",
"sepia(-1)",
]
};
}
var isGridTemplateSubgridValueEnabled =
IsCSSPropertyPrefEnabled("layout.css.grid-template-subgrid-value.enabled");
@ -8103,10 +8093,6 @@ if (false) {
};
}
if (IsCSSPropertyPrefEnabled("layout.css.filters.enabled")) {
gCSSProperties["filter"].invalid_values.push("drop-shadow(unset, 2px 2px)", "drop-shadow(2px 2px, unset)");
}
if (IsCSSPropertyPrefEnabled("layout.css.prefixes.gradients")) {
gCSSProperties["background-image"].invalid_values.push(
"-moz-linear-gradient(unset, 10px 10px, from(blue))",

View File

@ -1807,9 +1807,6 @@ function test_path_function(prop) {
}
function test_filter_transition(prop) {
if (!SpecialPowers.getBoolPref("layout.css.filters.enabled")) {
return;
}
for (var i in filterTests) {
var test = filterTests[i];
div.style.setProperty("transition-property", "none", "");

View File

@ -2931,9 +2931,6 @@ pref("layout.css.mix-blend-mode.enabled", true);
// Is support for isolation enabled?
pref("layout.css.isolation.enabled", true);
// Is support for CSS Filters enabled?
pref("layout.css.filters.enabled", true);
// Is support for CSS Scrollbar color properties enabled?
pref("layout.css.scrollbar-colors.enabled", false);