mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
parent
566f1ea600
commit
cf7b0e13b6
7 changed files with 59 additions and 9 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue