mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add get_initial_specified_value to many longhands
This commit is contained in:
parent
ce46e6d034
commit
2e07ce7e84
10 changed files with 90 additions and 4 deletions
|
@ -344,6 +344,12 @@ impl NoCalcLength {
|
|||
*self == NoCalcLength::Absolute(Au(0))
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Returns a `medium` length.
|
||||
pub fn medium() -> NoCalcLength {
|
||||
NoCalcLength::Absolute(Au::from_px(FONT_MEDIUM_PX))
|
||||
}
|
||||
|
||||
/// Get an absolute length from a px value.
|
||||
#[inline]
|
||||
pub fn from_px(px_value: CSSFloat) -> NoCalcLength {
|
||||
|
|
|
@ -78,6 +78,27 @@ impl ToCss for CSSColor {
|
|||
}
|
||||
}
|
||||
|
||||
impl CSSColor {
|
||||
#[inline]
|
||||
/// Returns currentcolor value.
|
||||
pub fn currentcolor() -> CSSColor {
|
||||
CSSColor {
|
||||
parsed: cssparser::Color::CurrentColor,
|
||||
authored: None,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
/// Returns transparent value.
|
||||
pub fn transparent() -> CSSColor {
|
||||
CSSColor {
|
||||
parsed: cssparser::Color::RGBA(cssparser::RGBA::transparent()),
|
||||
// This should probably be "transparent", but maybe it doesn't matter.
|
||||
authored: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
#[allow(missing_docs)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue