Bug 1729894 - Now that WR is everyhwere, enable backdrop-filter on early-beta / nightly. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D125054
This commit is contained in:
Emilio Cobos Álvarez 2021-09-15 11:33:29 +00:00
Родитель 990245fb6a
Коммит 0fc915272e
12 изменённых файлов: 37 добавлений и 62 удалений

Просмотреть файл

@ -46,10 +46,14 @@ function getTestCases(cssProperties) {
{ total: getSuggestionNumberFor("ba"), current: 0, inserted: 1 },
],
[
"VK_TAB",
"VK_DOWN",
{ total: getSuggestionNumberFor("ba"), current: 1, inserted: 1 },
],
["VK_RETURN", { current: 1, inserted: 1, entered: 1 }],
[
"VK_TAB",
{ total: getSuggestionNumberFor("ba"), current: 2, inserted: 1 },
],
["VK_RETURN", { current: 2, inserted: 1, entered: 1 }],
["b", { total: getSuggestionNumberFor("background", "b"), current: 0 }],
["l", { total: getSuggestionNumberFor("background", "bl"), current: 0 }],
[

Просмотреть файл

@ -3401,6 +3401,31 @@ exports.CSS_PROPERTIES = {
"unset"
]
},
"backdrop-filter": {
"isInherited": false,
"subproperties": [
"backdrop-filter"
],
"supports": [],
"values": [
"blur",
"brightness",
"contrast",
"drop-shadow",
"grayscale",
"hue-rotate",
"inherit",
"initial",
"invert",
"none",
"opacity",
"revert",
"saturate",
"sepia",
"unset",
"url"
]
},
"backface-visibility": {
"isInherited": false,
"subproperties": [

Просмотреть файл

@ -2518,11 +2518,6 @@ void gfxPlatform::InitWebRenderConfig() {
bool prefEnabled = WebRenderPrefEnabled();
bool envvarEnabled = WebRenderEnvvarEnabled();
// This would ideally be in the nsCSSProps code
// but nsCSSProps is initialized before gfxPlatform
// so it has to be done here.
gfxVars::AddReceiver(&nsCSSProps::GfxVarReceiver());
// WR? WR+ => means WR was enabled via gfx.webrender.all.qualified on
// qualified hardware
// WR! WR+ => means WR was enabled via gfx.webrender.{all,enabled} or
@ -2537,9 +2532,6 @@ void gfxPlatform::InitWebRenderConfig() {
// later in this function. For other processes we still want to report
// the state of the feature for crash reports.
if (gfxVars::UseWebRender()) {
// gfxVars doesn't notify receivers when initialized on content processes
// we need to explicitly recompute backdrop-filter's enabled state here.
nsCSSProps::RecomputeEnabledState("layout.css.backdrop-filter.enabled");
reporter.SetSuccessful();
}
return;

Просмотреть файл

@ -76,10 +76,6 @@ void nsCSSProps::RecomputeEnabledState(const char* aPref, void*) {
#else
gPropertyEnabled[pref->mPropID] = Preferences::GetBool(pref->mPref);
#endif
if (pref->mPropID == eCSSProperty_backdrop_filter) {
gPropertyEnabled[pref->mPropID] &=
gfx::gfxVars::GetUseWebRenderOrDefault();
}
}
}
MOZ_ASSERT(foundPref);
@ -216,40 +212,4 @@ bool nsCSSProps::gPropertyEnabled[eCSSProperty_COUNT_with_aliases] = {
#undef IS_ENABLED_BY_DEFAULT
};
/**
* A singleton class to register as a receiver for gfxVars.
* Updates the state of backdrop-filter's pref if the gfx
* WebRender var changes state.
*/
class nsCSSPropsGfxVarReceiver final : public gfx::gfxVarReceiver {
constexpr nsCSSPropsGfxVarReceiver() = default;
// WebRender's last known enabled state.
static bool sLastKnownUseWebRender;
static nsCSSPropsGfxVarReceiver sInstance;
public:
static gfx::gfxVarReceiver& GetInstance() { return sInstance; }
void OnVarChanged(const gfx::GfxVarUpdate&) override {
bool enabled = gfxVars::UseWebRender();
if (sLastKnownUseWebRender != enabled) {
sLastKnownUseWebRender = enabled;
nsCSSProps::RecomputeEnabledState("layout.css.backdrop-filter.enabled");
}
}
};
/* static */
nsCSSPropsGfxVarReceiver nsCSSPropsGfxVarReceiver::sInstance =
nsCSSPropsGfxVarReceiver();
/* static */
bool nsCSSPropsGfxVarReceiver::sLastKnownUseWebRender = false;
/* static */
gfx::gfxVarReceiver& nsCSSProps::GfxVarReceiver() {
return nsCSSPropsGfxVarReceiver::GetInstance();
}
#include "nsCSSPropsGenerated.inc"

Просмотреть файл

@ -6868,7 +6868,7 @@
# Is support for CSS backdrop-filter enabled?
- name: layout.css.backdrop-filter.enabled
type: bool
value: false
value: @IS_EARLY_BETA_OR_EARLIER@
mirror: always
# Should stray control characters be rendered visibly?

Просмотреть файл

@ -1,2 +1,2 @@
prefs: [layout.css.individual-transform.enabled:true, dom.animations-api.compositing.enabled:true]
prefs: [layout.css.individual-transform.enabled:true, dom.animations-api.compositing.enabled:true, layout.css.backdrop-filter.enabled:true]
leak-threshold: [default:51200]

Просмотреть файл

@ -1,4 +0,0 @@
[preserve-3d-flat-grouping-properties.html]
[Preserve-3d element flattened due to backdrop-filter]
expected: FAIL

Просмотреть файл

@ -0,0 +1 @@
prefs: [layout.css.backdrop-filter.enabled:true]

Просмотреть файл

@ -1,2 +0,0 @@
[will-change-fixedpos-cb-003.html]
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[will-change-fixedpos-cb-004.html]
expected: FAIL

Просмотреть файл

@ -1,2 +0,0 @@
[will-change-fixedpos-cb-005.html]
expected: FAIL

Просмотреть файл

@ -0,0 +1,3 @@
[will-change-fixedpos-cb-005.html]
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1423746