mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Backed out changeset 80c0c730e1aa (bug 1729894) for causing mochitest failures on browser_styleeditor_autocomplete.js. CLOSED TREE
This commit is contained in:
parent
72115b2010
commit
fd405f793b
@ -3401,31 +3401,6 @@ 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,6 +2518,11 @@ 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
|
||||
@ -2532,6 +2537,9 @@ 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,6 +76,10 @@ 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);
|
||||
@ -212,4 +216,40 @@ 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"
|
||||
|
@ -6856,7 +6856,7 @@
|
||||
# Is support for CSS backdrop-filter enabled?
|
||||
- name: layout.css.backdrop-filter.enabled
|
||||
type: bool
|
||||
value: @IS_EARLY_BETA_OR_EARLIER@
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Should stray control characters be rendered visibly?
|
||||
|
Loading…
Reference in New Issue
Block a user