mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Derive ToCss for ViewportLength
This commit is contained in:
parent
6e19fe6a8f
commit
15dcd8a8ea
1 changed files with 2 additions and 14 deletions
|
@ -143,26 +143,14 @@ trait FromMeta: Sized {
|
||||||
/// See:
|
/// See:
|
||||||
/// * http://dev.w3.org/csswg/css-device-adapt/#min-max-width-desc
|
/// * http://dev.w3.org/csswg/css-device-adapt/#min-max-width-desc
|
||||||
/// * http://dev.w3.org/csswg/css-device-adapt/#extend-to-zoom
|
/// * http://dev.w3.org/csswg/css-device-adapt/#extend-to-zoom
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
|
||||||
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
|
||||||
#[allow(missing_docs)]
|
#[allow(missing_docs)]
|
||||||
|
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
|
||||||
|
#[derive(Clone, Debug, PartialEq, ToCss)]
|
||||||
pub enum ViewportLength {
|
pub enum ViewportLength {
|
||||||
Specified(LengthOrPercentageOrAuto),
|
Specified(LengthOrPercentageOrAuto),
|
||||||
ExtendToZoom
|
ExtendToZoom
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToCss for ViewportLength {
|
|
||||||
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
|
|
||||||
where
|
|
||||||
W: Write,
|
|
||||||
{
|
|
||||||
match *self {
|
|
||||||
ViewportLength::Specified(ref length) => length.to_css(dest),
|
|
||||||
ViewportLength::ExtendToZoom => dest.write_str("extend-to-zoom"),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FromMeta for ViewportLength {
|
impl FromMeta for ViewportLength {
|
||||||
fn from_meta(value: &str) -> Option<ViewportLength> {
|
fn from_meta(value: &str) -> Option<ViewportLength> {
|
||||||
macro_rules! specified {
|
macro_rules! specified {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue