mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Replace NoViewportPercentage with a macro
This commit is contained in:
parent
9204f2aaad
commit
abc40f61c0
19 changed files with 104 additions and 103 deletions
|
@ -8,7 +8,7 @@ use cssparser::Parser;
|
|||
use parser::{Parse, ParserContext};
|
||||
use std::fmt;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
#[derive(PartialEq, Clone, Debug)]
|
||||
|
@ -96,4 +96,4 @@ impl Parse for GridLine {
|
|||
}
|
||||
|
||||
impl ComputedValueAsSpecified for GridLine {}
|
||||
impl NoViewportPercentage for GridLine {}
|
||||
no_viewport_percentage!(GridLine);
|
||||
|
|
|
@ -16,7 +16,7 @@ use std::f32::consts::PI;
|
|||
use std::fmt;
|
||||
use std::ops::Mul;
|
||||
use style_traits::ToCss;
|
||||
use super::{CSSFloat, HasViewportPercentage, NoViewportPercentage, Either, None_};
|
||||
use super::{CSSFloat, HasViewportPercentage, Either, None_};
|
||||
use super::computed::{ComputedValueAsSpecified, Context, ToComputedValue};
|
||||
use super::computed::Shadow as ComputedShadow;
|
||||
|
||||
|
@ -35,7 +35,7 @@ pub mod length;
|
|||
pub mod position;
|
||||
pub mod url;
|
||||
|
||||
impl NoViewportPercentage for i32 {} // For PropertyDeclaration::Order
|
||||
no_viewport_percentage!(i32); // For PropertyDeclaration::Order
|
||||
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
|
@ -60,7 +60,7 @@ impl Parse for CSSColor {
|
|||
}
|
||||
}
|
||||
|
||||
impl NoViewportPercentage for CSSColor {}
|
||||
no_viewport_percentage!(CSSColor);
|
||||
|
||||
impl ToCss for CSSColor {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
|
@ -79,7 +79,7 @@ pub struct CSSRGBA {
|
|||
pub authored: Option<String>,
|
||||
}
|
||||
|
||||
impl NoViewportPercentage for CSSRGBA {}
|
||||
no_viewport_percentage!(CSSRGBA);
|
||||
|
||||
impl ToCss for CSSRGBA {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
|
@ -193,7 +193,7 @@ pub fn parse_number(input: &mut Parser) -> Result<f32, ()> {
|
|||
#[allow(missing_docs)]
|
||||
pub struct BorderRadiusSize(pub Size2D<LengthOrPercentage>);
|
||||
|
||||
impl NoViewportPercentage for BorderRadiusSize {}
|
||||
no_viewport_percentage!(BorderRadiusSize);
|
||||
|
||||
impl BorderRadiusSize {
|
||||
#[allow(missing_docs)]
|
||||
|
@ -402,7 +402,7 @@ define_numbered_css_keyword_enum! { BorderStyle:
|
|||
"outset" => outset = 2,
|
||||
}
|
||||
|
||||
impl NoViewportPercentage for BorderStyle {}
|
||||
no_viewport_percentage!(BorderStyle);
|
||||
|
||||
impl BorderStyle {
|
||||
/// Whether this border style is either none or hidden.
|
||||
|
@ -462,7 +462,7 @@ impl ToCss for Time {
|
|||
#[allow(missing_docs)]
|
||||
pub struct Number(pub CSSFloat);
|
||||
|
||||
impl NoViewportPercentage for Number {}
|
||||
no_viewport_percentage!(Number);
|
||||
|
||||
impl Parse for Number {
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
|
@ -512,7 +512,7 @@ impl ToCss for Number {
|
|||
#[allow(missing_docs)]
|
||||
pub struct Opacity(pub CSSFloat);
|
||||
|
||||
impl NoViewportPercentage for Opacity {}
|
||||
no_viewport_percentage!(Opacity);
|
||||
|
||||
impl Parse for Opacity {
|
||||
fn parse(_context: &ParserContext, input: &mut Parser) -> Result<Self, ()> {
|
||||
|
|
|
@ -15,7 +15,7 @@ use std::borrow::Cow;
|
|||
use std::fmt::{self, Write};
|
||||
use std::sync::Arc;
|
||||
use style_traits::ToCss;
|
||||
use values::NoViewportPercentage;
|
||||
use values::HasViewportPercentage;
|
||||
use values::computed::ComputedValueAsSpecified;
|
||||
|
||||
/// A set of data needed in Gecko to represent a URL.
|
||||
|
@ -202,4 +202,4 @@ impl ToCss for SpecifiedUrl {
|
|||
// TODO(emilio): Maybe consider ComputedUrl to save a word in style structs?
|
||||
impl ComputedValueAsSpecified for SpecifiedUrl {}
|
||||
|
||||
impl NoViewportPercentage for SpecifiedUrl {}
|
||||
no_viewport_percentage!(SpecifiedUrl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue