style: Adding parsing support for text-decoration-skip-ink

Differential Revision: https://phabricator.services.mozilla.com/D35831
This commit is contained in:
Charlie Marlow 2019-06-27 21:34:33 +00:00 committed by Emilio Cobos Álvarez
parent 3530ea9862
commit 034557a717
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
6 changed files with 41 additions and 2 deletions

View file

@ -336,6 +336,7 @@ class Longhand(object):
"MozScriptLevel",
"MozScriptMinSize",
"MozScriptSizeMultiplier",
"TextDecorationSkipInk",
"NonNegativeNumber",
"Number",
"OffsetRotate",

View file

@ -384,3 +384,15 @@ ${helpers.predefined_type(
gecko_pref="layout.css.text-underline-offset.enabled",
spec="https://drafts.csswg.org/css-text-decor-4/#underline-offset",
)}
// text decoration skip ink
${helpers.predefined_type(
"text-decoration-skip-ink",
"TextDecorationSkipInk",
"computed::TextDecorationSkipInk::Auto",
products="gecko",
needs_context=False,
animation_value_type="discrete",
gecko_pref="layout.css.text-decoration-skip-ink.enabled",
spec="https://drafts.csswg.org/css-text-decor-4/#text-decoration-skip-ink-property",
)}

View file

@ -78,6 +78,7 @@ pub use self::table::XSpan;
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::text::TextDecorationSkipInk;
pub use self::time::Time;
pub use self::transform::{Rotate, Scale, Transform, TransformOperation};
pub use self::transform::{TransformOrigin, TransformStyle, Translate};

View file

@ -19,7 +19,7 @@ use std::fmt::{self, Write};
use style_traits::{CssWriter, ToCss};
pub use crate::values::specified::TextAlignKeyword as TextAlign;
pub use crate::values::specified::TextTransform;
pub use crate::values::specified::{TextTransform, TextDecorationSkipInk};
pub use crate::values::specified::{LineBreak, OverflowWrap, WordBreak};
pub use crate::values::specified::{TextDecorationLine, TextEmphasisPosition};

View file

@ -78,7 +78,7 @@ pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
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::{TextTransform, TextDecorationSkipInk};
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};

View file

@ -1054,3 +1054,28 @@ pub enum OverflowWrap {
BreakWord,
Anywhere,
}
/// Implements text-decoration-skip-ink which takes the keywords auto | none
///
/// https://drafts.csswg.org/css-text-decor-4/#text-decoration-skip-ink-property
#[repr(u8)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(
Clone,
Copy,
Debug,
Eq,
MallocSizeOf,
Parse,
PartialEq,
SpecifiedValueInfo,
ToComputedValue,
ToCss,
ToResolvedValue,
ToShmem,
)]
#[allow(missing_docs)]
pub enum TextDecorationSkipInk {
Auto,
None,
}