style: adding from-font support to text-underline-offset and text-decoration-thickness.

Differential Revision: https://phabricator.services.mozilla.com/D41476
This commit is contained in:
Charlie Marlow 2019-08-13 17:43:25 +00:00 committed by Emilio Cobos Álvarez
parent 566f1ea600
commit cf7b0e13b6
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A
7 changed files with 59 additions and 9 deletions

View file

@ -12,7 +12,7 @@ use crate::values::computed::text::TextOverflow as ComputedTextOverflow;
use crate::values::computed::{Context, ToComputedValue};
use crate::values::generics::text::InitialLetter as GenericInitialLetter;
use crate::values::generics::text::LineHeight as GenericLineHeight;
use crate::values::generics::text::Spacing;
use crate::values::generics::text::{Spacing, GenericTextDecorationLength};
use crate::values::specified::length::NonNegativeLengthPercentage;
use crate::values::specified::length::{FontRelativeLength, Length};
use crate::values::specified::length::{LengthPercentage, NoCalcLength};
@ -1039,3 +1039,20 @@ pub enum TextDecorationSkipInk {
Auto,
None,
}
/// Implements type for `text-underline-offset` and `text-decoration-thickness` properties
pub type TextDecorationLength = GenericTextDecorationLength<Length>;
impl TextDecorationLength {
/// `Auto` value.
#[inline]
pub fn auto() -> Self {
GenericTextDecorationLength::Auto
}
/// Whether this is the `Auto` value.
#[inline]
pub fn is_auto(&self) -> bool {
matches!(*self, GenericTextDecorationLength::Auto)
}
}