From 2910ca619765484b2ff33014688569ccc9be20e5 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 3 Feb 2020 14:21:32 +0000 Subject: [PATCH] style: Support percentage values for the CSS text-decoration-thickness and text-underline-offset properties. Differential Revision: https://phabricator.services.mozilla.com/D59777 --- components/style/values/computed/text.rs | 2 +- components/style/values/generics/text.rs | 4 ++-- components/style/values/specified/text.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/style/values/computed/text.rs b/components/style/values/computed/text.rs index 3f9ffb2ad0f..57a142860d9 100644 --- a/components/style/values/computed/text.rs +++ b/components/style/values/computed/text.rs @@ -28,7 +28,7 @@ pub use crate::values::specified::{TextDecorationSkipInk, TextTransform}; pub type InitialLetter = GenericInitialLetter; /// Implements type for `text-underline-offset` and `text-decoration-thickness` properties -pub type TextDecorationLength = GenericTextDecorationLength; +pub type TextDecorationLength = GenericTextDecorationLength; /// A computed value for the `letter-spacing` property. #[repr(transparent)] diff --git a/components/style/values/generics/text.rs b/components/style/values/generics/text.rs index fd434cc1273..6ad983e00f9 100644 --- a/components/style/values/generics/text.rs +++ b/components/style/values/generics/text.rs @@ -124,7 +124,7 @@ impl LineHeight { } /// Implements type for text-underline-offset and text-decoration-thickness -/// which take the grammar of auto | from-font | +/// which take the grammar of auto | from-font | | /// /// https://drafts.csswg.org/css-text-decor-4/ #[repr(C, u8)] @@ -148,7 +148,7 @@ impl LineHeight { )] #[allow(missing_docs)] pub enum GenericTextDecorationLength { - Length(L), + LengthPercentage(L), Auto, FromFont, } diff --git a/components/style/values/specified/text.rs b/components/style/values/specified/text.rs index 16df2fa4b4e..835fefa292a 100644 --- a/components/style/values/specified/text.rs +++ b/components/style/values/specified/text.rs @@ -1030,7 +1030,7 @@ pub enum TextDecorationSkipInk { } /// Implements type for `text-underline-offset` and `text-decoration-thickness` properties -pub type TextDecorationLength = GenericTextDecorationLength; +pub type TextDecorationLength = GenericTextDecorationLength; impl TextDecorationLength { /// `Auto` value.