diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs index 3a66eee9a3f..9065de3145c 100644 --- a/components/style/properties/longhands/inherited_text.mako.rs +++ b/components/style/properties/longhands/inherited_text.mako.rs @@ -373,3 +373,15 @@ ${helpers.predefined_type( animation_value_type="discrete", spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-skip-ink-property", )} + +// hyphenation character +${helpers.predefined_type( + "hyphenate-character", + "HyphenateCharacter", + "computed::HyphenateCharacter::Auto", + engines="gecko", + gecko_pref="layout.css.hyphenate-character.enabled", + has_effect_on_gecko_scrollbars=False, + animation_value_type="discrete", + spec="https://www.w3.org/TR/css-text-4/#hyphenate-character", +)} diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 6990fc65fe6..c18b9e09b71 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -89,6 +89,7 @@ pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight}; pub use self::text::{OverflowWrap, RubyPosition, TextOverflow, WordBreak, WordSpacing}; pub use self::text::{TextAlign, TextAlignLast, TextEmphasisPosition, TextEmphasisStyle}; pub use self::text::{TextDecorationLength, TextDecorationSkipInk, TextJustify}; +pub use self::text::HyphenateCharacter; pub use self::time::Time; pub use self::transform::{Rotate, Scale, Transform, TransformOperation}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index 0920156108f..c9e67e137f3 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -24,6 +24,7 @@ pub use crate::values::specified::text::{ pub use crate::values::specified::{LineBreak, OverflowWrap, RubyPosition, WordBreak}; pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition}; pub use crate::values::specified::{TextDecorationSkipInk, TextJustify, TextTransform}; +pub use crate::values::specified::HyphenateCharacter; /// A computed value for the `initial-letter` property. pub type InitialLetter = GenericInitialLetter; diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index c776af5f201..c3388344dab 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -90,6 +90,7 @@ pub use self::text::{InitialLetter, LetterSpacing, LineBreak, LineHeight, TextAl pub use self::text::{OverflowWrap, TextEmphasisPosition, TextEmphasisStyle, WordBreak}; pub use self::text::{TextAlignKeyword, TextDecorationLine, TextOverflow, WordSpacing}; pub use self::text::{TextDecorationLength, TextDecorationSkipInk, TextJustify, TextTransform}; +pub use self::text::HyphenateCharacter; pub use self::time::Time; pub use self::transform::{Rotate, Scale, Transform}; pub use self::transform::{TransformOrigin, TransformStyle, Translate}; diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs index 893c5232c5e..299f4eb4774 100644 --- a/components/style/values/specified/text.rs +++ b/components/style/values/specified/text.rs @@ -37,6 +37,27 @@ pub type WordSpacing = Spacing; /// A specified value for the `line-height` property. pub type LineHeight = GenericLineHeight; +/// A value for the `hyphenate-character` property. +#[derive( + Clone, + Debug, + MallocSizeOf, + Parse, + PartialEq, + SpecifiedValueInfo, + ToComputedValue, + ToCss, + ToResolvedValue, + ToShmem, +)] +#[repr(C, u8)] +pub enum HyphenateCharacter { + /// `auto` + Auto, + /// `` + String(crate::OwnedStr), +} + impl Parse for InitialLetter { fn parse<'i, 't>( context: &ParserContext,