aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCharlie Marlow <cmarlow@mozilla.com>2019-06-27 21:34:33 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-07-08 12:45:14 +0200
commit034557a7171b3fecc57dffa0c464a0ed23e99600 (patch)
tree51a0d48269615ec9729673a9e9aaa143121fa608
parent3530ea9862dab4a054b98a82d36e49b63a12fd56 (diff)
downloadservo-034557a7171b3fecc57dffa0c464a0ed23e99600.tar.gz
servo-034557a7171b3fecc57dffa0c464a0ed23e99600.zip
style: Adding parsing support for text-decoration-skip-ink
Differential Revision: https://phabricator.services.mozilla.com/D35831
-rw-r--r--components/style/properties/data.py1
-rw-r--r--components/style/properties/longhands/inherited_text.mako.rs12
-rw-r--r--components/style/values/computed/mod.rs1
-rw-r--r--components/style/values/computed/text.rs2
-rw-r--r--components/style/values/specified/mod.rs2
-rw-r--r--components/style/values/specified/text.rs25
6 files changed, 41 insertions, 2 deletions
diff --git a/components/style/properties/data.py b/components/style/properties/data.py
index 25d82e7de68..99485f454ce 100644
--- a/components/style/properties/data.py
+++ b/components/style/properties/data.py
@@ -336,6 +336,7 @@ class Longhand(object):
"MozScriptLevel",
"MozScriptMinSize",
"MozScriptSizeMultiplier",
+ "TextDecorationSkipInk",
"NonNegativeNumber",
"Number",
"OffsetRotate",
diff --git a/components/style/properties/longhands/inherited_text.mako.rs b/components/style/properties/longhands/inherited_text.mako.rs
index f10f347e7f8..c81e8392f94 100644
--- a/components/style/properties/longhands/inherited_text.mako.rs
+++ b/components/style/properties/longhands/inherited_text.mako.rs
@@ -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",
+)}
diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs
index 6e38eeeda75..6fcb4f3a4a8 100644
--- a/components/style/values/computed/mod.rs
+++ b/components/style/values/computed/mod.rs
@@ -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};
diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs
index bc4086a2b9c..9d6f5f4968a 100644
--- a/components/style/values/computed/text.rs
+++ b/components/style/values/computed/text.rs
@@ -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};
diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs
index ba54ecbeb69..10937f0cf42 100644
--- a/components/style/values/specified/mod.rs
+++ b/components/style/values/specified/mod.rs
@@ -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};
diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs
index 188eb18f720..c66e93803f6 100644
--- a/components/style/values/specified/text.rs
+++ b/components/style/values/specified/text.rs
@@ -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,
+}