Bug 1760734 - Put overflow: -moz-hidden-unscrollable behind a pref on Nightly. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D141759
This commit is contained in:
Emilio Cobos Álvarez
2022-03-23 08:41:51 +00:00
parent b5ffaf31cd
commit d159e502ee
5 changed files with 44 additions and 26 deletions

View File

@@ -9010,7 +9010,6 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"-moz-hidden-unscrollable",
"auto",
"clip",
"hidden",
@@ -9046,7 +9045,6 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"-moz-hidden-unscrollable",
"auto",
"clip",
"hidden",
@@ -9066,7 +9064,6 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"-moz-hidden-unscrollable",
"auto",
"clip",
"hidden",
@@ -9103,7 +9100,6 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"-moz-hidden-unscrollable",
"auto",
"clip",
"hidden",
@@ -9123,7 +9119,6 @@ exports.CSS_PROPERTIES = {
],
"supports": [],
"values": [
"-moz-hidden-unscrollable",
"auto",
"clip",
"hidden",

View File

@@ -6815,14 +6815,12 @@ var gCSSProperties = {
"auto",
"scroll",
"hidden",
"-moz-hidden-unscrollable",
"clip",
"auto auto",
"auto scroll",
"hidden scroll",
"auto hidden",
"clip clip",
"-moz-hidden-unscrollable -moz-hidden-unscrollable",
],
invalid_values: [
"clip -moz-scrollbars-none",
@@ -6842,13 +6840,7 @@ var gCSSProperties = {
contain: "none",
},
initial_values: ["visible"],
other_values: [
"auto",
"scroll",
"hidden",
"clip",
"-moz-hidden-unscrollable",
],
other_values: ["auto", "scroll", "hidden", "clip"],
invalid_values: [],
},
"overflow-y": {
@@ -6862,13 +6854,7 @@ var gCSSProperties = {
contain: "none",
},
initial_values: ["visible"],
other_values: [
"auto",
"scroll",
"hidden",
"clip",
"-moz-hidden-unscrollable",
],
other_values: ["auto", "scroll", "hidden", "clip"],
invalid_values: [],
},
"overflow-inline": {
@@ -6883,7 +6869,7 @@ var gCSSProperties = {
contain: "none",
},
initial_values: ["visible"],
other_values: ["auto", "scroll", "hidden", "-moz-hidden-unscrollable"],
other_values: ["auto", "scroll", "hidden", "clip"],
invalid_values: [],
},
"overflow-block": {
@@ -6898,7 +6884,7 @@ var gCSSProperties = {
contain: "none",
},
initial_values: ["visible"],
other_values: ["auto", "scroll", "hidden", "-moz-hidden-unscrollable"],
other_values: ["auto", "scroll", "hidden", "clip"],
invalid_values: [],
},
padding: {
@@ -11639,6 +11625,20 @@ if (IsCSSPropertyPrefEnabled("layout.css.caption-side-non-standard.enabled")) {
);
}
{
const enabled = IsCSSPropertyPrefEnabled(
"layout.css.overflow-moz-hidden-unscrollable.enabled"
);
for (let p of ["overflow", "overflow-x", "overflow-y"]) {
let prop = gCSSProperties[p];
let values = enabled ? prop.other_values : prop.invalid_values;
values.push("-moz-hidden-unscrollable");
if (p == "overflow") {
values.push("-moz-hidden-unscrollable -moz-hidden-unscrollable");
}
}
}
if (IsCSSPropertyPrefEnabled("layout.css.individual-transform.enabled")) {
gCSSProperties.rotate = {
domProp: "rotate",

View File

@@ -7721,6 +7721,13 @@
value: false
mirror: always
# Is support for CSS overflow: -moz-hidden-unscrollable enabled
- name: layout.css.overflow-moz-hidden-unscrollable.enabled
type: RelaxedAtomicBool
value: @IS_NOT_NIGHTLY_BUILD@
mirror: always
rust: true
# Is support for overscroll-behavior enabled?
- name: layout.css.overscroll-behavior.enabled
type: bool

View File

@@ -2067,7 +2067,6 @@ impl BreakWithin {
Eq,
Hash,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToCss,
@@ -2082,10 +2081,28 @@ pub enum Overflow {
Scroll,
Auto,
#[cfg(feature = "gecko")]
#[parse(aliases = "-moz-hidden-unscrollable")]
Clip,
}
// This can be derived once we remove or keep `-moz-hidden-unscrollable`
// indefinitely.
impl Parse for Overflow {
fn parse<'i, 't>(_: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
Ok(try_match_ident_ignore_ascii_case! { input,
"visible" => Self::Visible,
"hidden" => Self::Hidden,
"scroll" => Self::Scroll,
"auto" => Self::Auto,
#[cfg(feature = "gecko")]
"clip" => Self::Clip,
#[cfg(feature = "gecko")]
"-moz-hidden-unscrollable" if static_prefs::pref!("layout.css.overflow-moz-hidden-unscrollable.enabled") => {
Overflow::Clip
},
})
}
}
impl Overflow {
/// Return true if the value will create a scrollable box.
#[inline]

View File

@@ -7,7 +7,6 @@
<link rel="match" href="overflow-body-propagation-010-ref.html">
<style>
body {
overflow: -moz-hidden-unscrollable; /* will be removed in bug 1531609 */
overflow: clip;
contain: paint;
width: 30px;