style: Rename initial value of `container-type' from 'none' to 'normal'

Differential Revision: https://phabricator.services.mozilla.com/D157098
This commit is contained in:
Ziran Sun 2022-09-15 13:37:16 +00:00 committed by Martin Robinson
parent 3fc54c24e2
commit f1bf68ef25
3 changed files with 7 additions and 9 deletions

View file

@ -448,7 +448,7 @@ ${helpers.predefined_type(
${helpers.predefined_type( ${helpers.predefined_type(
"container-type", "container-type",
"ContainerType", "ContainerType",
"computed::ContainerType::NONE", "computed::ContainerType::NORMAL",
engines="gecko servo", engines="gecko servo",
animation_value_type="none", animation_value_type="none",
gecko_pref="layout.css.container-queries.enabled", gecko_pref="layout.css.container-queries.enabled",

View file

@ -52,7 +52,7 @@ ${helpers.two_properties_shorthand(
let container_type = if input.try_parse(|input| input.expect_delim('/')).is_ok() { let container_type = if input.try_parse(|input| input.expect_delim('/')).is_ok() {
ContainerType::parse(context, input)? ContainerType::parse(context, input)?
} else { } else {
ContainerType::NONE ContainerType::NORMAL
}; };
Ok(expanded! { Ok(expanded! {
container_name: container_name, container_name: container_name,

View file

@ -1496,21 +1496,19 @@ bitflags! {
#[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToCss, Parse, ToResolvedValue, ToShmem)] #[derive(MallocSizeOf, SpecifiedValueInfo, ToComputedValue, ToCss, Parse, ToResolvedValue, ToShmem)]
#[repr(C)] #[repr(C)]
#[allow(missing_docs)] #[allow(missing_docs)]
#[css(bitflags(single="none", mixed="style,size,inline-size", overlapping_bits))] #[css(bitflags(single="normal", mixed="size,inline-size", overlapping_bits))]
/// https://drafts.csswg.org/css-contain-3/#container-type /// https://drafts.csswg.org/css-contain-3/#container-type
/// ///
/// TODO: block-size is on the spec but it seems it was removed? WPTs don't /// TODO: block-size is on the spec but it seems it was removed? WPTs don't
/// support it, see https://github.com/w3c/csswg-drafts/issues/7179. /// support it, see https://github.com/w3c/csswg-drafts/issues/7179.
pub struct ContainerType: u8 { pub struct ContainerType: u8 {
/// The `none` variant. /// The `none` variant.
const NONE = 0; const NORMAL = 0;
/// The `style` variant.
const STYLE = 1 << 0;
/// The `inline-size` variant. /// The `inline-size` variant.
const INLINE_SIZE = 1 << 1; const INLINE_SIZE = 1 << 0;
/// The `size` variant, exclusive with `inline-size` (they sharing bits /// The `size` variant, exclusive with `inline-size` (they sharing bits
/// guarantees this). /// guarantees this).
const SIZE = 1 << 2 | Self::INLINE_SIZE.bits; const SIZE = 1 << 1 | Self::INLINE_SIZE.bits;
} }
} }
@ -1539,7 +1537,7 @@ impl Parse for ContainerName {
if first.eq_ignore_ascii_case("none") { if first.eq_ignore_ascii_case("none") {
return Ok(Self::none()) return Ok(Self::none())
} }
const DISALLOWED_CONTAINER_NAMES: &'static [&'static str] = &["none", "not", "or", "and"]; const DISALLOWED_CONTAINER_NAMES: &'static [&'static str] = &["none", "not", "or", "and", "auto", "normal"];
idents.push(CustomIdent::from_ident(location, first, DISALLOWED_CONTAINER_NAMES)?); idents.push(CustomIdent::from_ident(location, first, DISALLOWED_CONTAINER_NAMES)?);
while let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) { while let Ok(ident) = input.try_parse(|input| input.expect_ident_cloned()) {
idents.push(CustomIdent::from_ident(location, &ident, DISALLOWED_CONTAINER_NAMES)?); idents.push(CustomIdent::from_ident(location, &ident, DISALLOWED_CONTAINER_NAMES)?);