mirror of
https://github.com/servo/servo.git
synced 2025-06-22 08:08:59 +01:00
style: Add support for parsing the content-visibility
property from the CSS Contain specification
Add initial parsing support for the CSS `content-visibility` attribute. Currently these parsed values have no effect. Differential Revision: https://phabricator.services.mozilla.com/D140834
This commit is contained in:
parent
8016c434b0
commit
eb96b29af0
7 changed files with 44 additions and 6 deletions
|
@ -120,5 +120,4 @@ COUNTED_UNKNOWN_PROPERTIES = [
|
||||||
"-webkit-columns",
|
"-webkit-columns",
|
||||||
"-webkit-column-rule-color",
|
"-webkit-column-rule-color",
|
||||||
"-webkit-shape-margin",
|
"-webkit-shape-margin",
|
||||||
"content-visibility",
|
|
||||||
]
|
]
|
||||||
|
|
|
@ -462,6 +462,7 @@ class Longhand(Property):
|
||||||
"Clear",
|
"Clear",
|
||||||
"ColumnCount",
|
"ColumnCount",
|
||||||
"Contain",
|
"Contain",
|
||||||
|
"ContentVisibility",
|
||||||
"Display",
|
"Display",
|
||||||
"FillRule",
|
"FillRule",
|
||||||
"Float",
|
"Float",
|
||||||
|
|
|
@ -613,6 +613,16 @@ ${helpers.predefined_type(
|
||||||
spec="https://drafts.csswg.org/css-contain/#contain-property",
|
spec="https://drafts.csswg.org/css-contain/#contain-property",
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
${helpers.predefined_type(
|
||||||
|
"content-visibility",
|
||||||
|
"ContentVisibility",
|
||||||
|
"computed::ContentVisibility::Visible",
|
||||||
|
engines="gecko",
|
||||||
|
spec="https://drafts.csswg.org/css-contain/#content-visibility",
|
||||||
|
gecko_pref="layout.css.content-visibility.enabled",
|
||||||
|
animation_value_type="none",
|
||||||
|
)}
|
||||||
|
|
||||||
${helpers.predefined_type(
|
${helpers.predefined_type(
|
||||||
"appearance",
|
"appearance",
|
||||||
"Appearance",
|
"Appearance",
|
||||||
|
|
|
@ -13,9 +13,9 @@ use crate::values::specified::box_ as specified;
|
||||||
|
|
||||||
pub use crate::values::specified::box_::{
|
pub use crate::values::specified::box_::{
|
||||||
AnimationName, AnimationTimeline, Appearance, BreakBetween, BreakWithin,
|
AnimationName, AnimationTimeline, Appearance, BreakBetween, BreakWithin,
|
||||||
Clear as SpecifiedClear, Contain, Display, Float as SpecifiedFloat, Overflow, OverflowAnchor,
|
Clear as SpecifiedClear, Contain, ContentVisibility, Display, Float as SpecifiedFloat, Overflow,
|
||||||
OverflowClipBox, OverscrollBehavior, ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness,
|
OverflowAnchor, OverflowClipBox, OverscrollBehavior, ScrollSnapAlign, ScrollSnapAxis,
|
||||||
ScrollSnapType, ScrollbarGutter, TouchAction, TransitionProperty, WillChange,
|
ScrollSnapStrictness, ScrollSnapType, ScrollbarGutter, TouchAction, TransitionProperty, WillChange,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A computed value for the `vertical-align` property.
|
/// A computed value for the `vertical-align` property.
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub use self::border::{BorderCornerRadius, BorderRadius, BorderSpacing};
|
||||||
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
||||||
pub use self::border::{BorderImageSlice, BorderImageWidth};
|
pub use self::border::{BorderImageSlice, BorderImageWidth};
|
||||||
pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, Contain};
|
pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, Contain};
|
||||||
pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, Float};
|
pub use self::box_::{Appearance, BreakBetween, BreakWithin, Clear, ContentVisibility, Float};
|
||||||
pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty};
|
pub use self::box_::{Display, Overflow, OverflowAnchor, TransitionProperty};
|
||||||
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
|
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
|
||||||
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
||||||
|
|
|
@ -1450,6 +1450,34 @@ impl Parse for Contain {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(missing_docs)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
|
||||||
|
#[derive(
|
||||||
|
Clone,
|
||||||
|
Copy,
|
||||||
|
Debug,
|
||||||
|
Eq,
|
||||||
|
MallocSizeOf,
|
||||||
|
Parse,
|
||||||
|
PartialEq,
|
||||||
|
SpecifiedValueInfo,
|
||||||
|
ToComputedValue,
|
||||||
|
ToCss,
|
||||||
|
ToResolvedValue,
|
||||||
|
ToShmem,
|
||||||
|
)]
|
||||||
|
#[repr(u8)]
|
||||||
|
pub enum ContentVisibility {
|
||||||
|
/// `auto` variant, the element turns on layout containment, style containment, and paint
|
||||||
|
/// containment. In addition, if the element is not relevant to the user (such as by being
|
||||||
|
/// offscreen) it also skips its content
|
||||||
|
Auto,
|
||||||
|
/// `hidden` variant, the element skips its content
|
||||||
|
Hidden,
|
||||||
|
/// 'visible' variant, no effect
|
||||||
|
Visible,
|
||||||
|
}
|
||||||
|
|
||||||
/// A specified value for the `perspective` property.
|
/// A specified value for the `perspective` property.
|
||||||
pub type Perspective = GenericPerspective<NonNegativeLength>;
|
pub type Perspective = GenericPerspective<NonNegativeLength>;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ pub use self::border::{BorderImageRepeat, BorderImageSideWidth};
|
||||||
pub use self::border::{BorderRadius, BorderSideWidth, BorderSpacing, BorderStyle};
|
pub use self::border::{BorderRadius, BorderSideWidth, BorderSpacing, BorderStyle};
|
||||||
pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, Contain, Display};
|
pub use self::box_::{AnimationIterationCount, AnimationName, AnimationTimeline, Contain, Display};
|
||||||
pub use self::box_::{Appearance, BreakBetween, BreakWithin};
|
pub use self::box_::{Appearance, BreakBetween, BreakWithin};
|
||||||
pub use self::box_::{Clear, Float, Overflow, OverflowAnchor};
|
pub use self::box_::{Clear, ContentVisibility, Float, Overflow, OverflowAnchor};
|
||||||
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
|
pub use self::box_::{OverflowClipBox, OverscrollBehavior, Perspective, Resize, ScrollbarGutter};
|
||||||
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
pub use self::box_::{ScrollSnapAlign, ScrollSnapAxis, ScrollSnapStrictness, ScrollSnapType};
|
||||||
pub use self::box_::{TouchAction, TransitionProperty, VerticalAlign, WillChange};
|
pub use self::box_::{TouchAction, TransitionProperty, VerticalAlign, WillChange};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue