diff --git a/components/style/properties/data.py b/components/style/properties/data.py index 12bd3ce38ae..daeb82ffab9 100644 --- a/components/style/properties/data.py +++ b/components/style/properties/data.py @@ -325,6 +325,7 @@ class Longhand(object): "JustifyContent", "JustifyItems", "JustifySelf", + "LineBreak", "MozForceBrokenImageIcon", "MozListReversed", "MozScriptLevel", diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs index b864bc483f9..94af642713e 100644 --- a/components/style/properties/longhands/inherited_text.mako.rs +++ b/components/style/properties/longhands/inherited_text.mako.rs @@ -264,6 +264,16 @@ ${helpers.predefined_type( spec="https://drafts.csswg.org/css-text-3/#tab-size-property", )} +${helpers.predefined_type( + "line-break", + "LineBreak", + "computed::LineBreak::Auto", + products="gecko", + animation_value_type="discrete", + spec="https://drafts.csswg.org/css-text-3/#line-break-property", + needs_context=False, +)} + // CSS Compatibility // https://compat.spec.whatwg.org ${helpers.predefined_type( diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 993af4177ad..aa3963db804 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -77,7 +77,7 @@ pub use self::svg::MozContextProperties; pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind}; pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth}; pub use self::table::XSpan; -pub use self::text::{InitialLetter, LetterSpacing, LineHeight}; +pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight}; pub use self::text::{OverflowWrap, TextOverflow, WordBreak, WordSpacing}; pub use self::text::{TextAlign, TextEmphasisPosition, TextEmphasisStyle}; pub use self::time::Time; diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index c29d3d45210..7395cf71bb2 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -20,7 +20,7 @@ use style_traits::{CssWriter, ToCss}; pub use crate::values::specified::TextAlignKeyword as TextAlign; pub use crate::values::specified::TextTransform; -pub use crate::values::specified::{OverflowWrap, WordBreak}; +pub use crate::values::specified::{LineBreak, OverflowWrap, WordBreak}; pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition}; /// A computed value for the `initial-letter` property. diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 83fc71444bb..7c59f66e318 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -81,7 +81,7 @@ pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth}; pub use self::svg_path::SVGPathData; pub use self::table::XSpan; pub use self::text::TextTransform; -pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextAlign}; +pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight, TextAlign}; pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle, WordBreak}; pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing}; pub use self::time::Time; diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs index 6be20f58618..a78cb4135c3 100644 --- a/components/style/values/specified/text.rs +++ b/components/style/values/specified/text.rs @@ -1005,6 +1005,32 @@ pub enum WordBreak { BreakWord, } +/// Values for the `line-break` property. +#[repr(u8)] +#[derive( + Clone, + Copy, + Debug, + Eq, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, + ToResolvedValue, + ToShmem, +)] +#[allow(missing_docs)] +pub enum LineBreak { + Auto, + /// TODO: additional values not yet implemented + /// Loose, + /// Normal, + /// Strict, + Anywhere, +} + /// Values for the `overflow-wrap` property. #[repr(u8)] #[derive(