mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
parent
473934c989
commit
36ff89bd28
61 changed files with 73 additions and 437 deletions
|
@ -9,7 +9,7 @@ use cssparser::{Parser, Token, BasicParseError};
|
|||
use parser::{Parse, ParserContext};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::mem;
|
||||
use style_traits::{HasViewportPercentage, ParseError, StyleParseError};
|
||||
use style_traits::{ParseError, StyleParseError};
|
||||
use values::{CSSFloat, CustomIdent};
|
||||
use values::generics::grid::{GridTemplateComponent, RepeatCount, TrackBreadth, TrackKeyword, TrackRepeat};
|
||||
use values::generics::grid::{LineNameList, TrackSize, TrackList, TrackListType};
|
||||
|
@ -38,17 +38,6 @@ impl Parse for TrackBreadth<LengthOrPercentage> {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasViewportPercentage for TrackBreadth<LengthOrPercentage> {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
if let TrackBreadth::Breadth(ref lop) = *self {
|
||||
lop.has_viewport_percentage()
|
||||
} else {
|
||||
false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for TrackSize<LengthOrPercentage> {
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
if let Ok(b) = input.try(|i| TrackBreadth::parse(context, i)) {
|
||||
|
@ -175,13 +164,6 @@ impl TrackRepeat<LengthOrPercentage> {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasViewportPercentage for TrackRepeat<LengthOrPercentage> {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
self.track_sizes.iter().any(|ref v| v.has_viewport_percentage())
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for TrackList<LengthOrPercentage> {
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
// Merge the line names while parsing values. The resulting values will
|
||||
|
@ -278,13 +260,6 @@ impl Parse for TrackList<LengthOrPercentage> {
|
|||
}
|
||||
}
|
||||
|
||||
impl HasViewportPercentage for TrackList<LengthOrPercentage> {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
self.values.iter().any(|ref v| v.has_viewport_percentage())
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for GridTemplateComponent<LengthOrPercentage> {
|
||||
// FIXME: Derive Parse (probably with None_)
|
||||
fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result<Self, ParseError<'i>> {
|
||||
|
@ -307,13 +282,3 @@ impl GridTemplateComponent<LengthOrPercentage> {
|
|||
LineNameList::parse(context, input).map(GridTemplateComponent::Subgrid)
|
||||
}
|
||||
}
|
||||
|
||||
impl HasViewportPercentage for GridTemplateComponent<LengthOrPercentage> {
|
||||
#[inline]
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
match *self {
|
||||
GridTemplateComponent::TrackList(ref l) => l.has_viewport_percentage(),
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue