mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Implement a URL-generic type for list-style-image
This should fix the following two "expected to fail" tests: - getComputedStyle(elem) for url() listStyleImage uses the resolved URL and elem.style uses the original URL - getComputedStyle(elem) for url() listStyle uses the resolved URL and elem.style uses the original URL
This commit is contained in:
parent
8f226f841b
commit
cc838f54e5
26 changed files with 157 additions and 124 deletions
|
@ -11,12 +11,11 @@ use context::QuirksMode;
|
|||
use cssparser::{Parser, Token, serialize_identifier};
|
||||
use num_traits::One;
|
||||
use parser::{ParserContext, Parse};
|
||||
use self::url::{SpecifiedImageUrl, SpecifiedUrl};
|
||||
use std::f32;
|
||||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssWriter, ParseError, StyleParseErrorKind, ToCss};
|
||||
use style_traits::values::specified::AllowedNumericType;
|
||||
use super::{Auto, CSSFloat, CSSInteger, Either, None_};
|
||||
use super::{Auto, CSSFloat, CSSInteger, Either};
|
||||
use super::computed::{Context, ToComputedValue};
|
||||
use super::generics::{GreaterThanOrEqualToOne, NonNegative};
|
||||
use super::generics::grid::{GridLine as GenericGridLine, TrackBreadth as GenericTrackBreadth};
|
||||
|
@ -56,7 +55,7 @@ pub use self::length::{LengthOrPercentage, LengthOrPercentageOrAuto};
|
|||
pub use self::length::{LengthOrPercentageOrNone, MaxLength, MozLength};
|
||||
pub use self::length::{NoCalcLength, ViewportPercentageLength};
|
||||
pub use self::length::{NonNegativeLengthOrPercentage, NonNegativeLengthOrPercentageOrAuto};
|
||||
pub use self::list::{ListStyleImage, Quotes};
|
||||
pub use self::list::Quotes;
|
||||
#[cfg(feature = "gecko")]
|
||||
pub use self::list::ListStyleType;
|
||||
pub use self::outline::OutlineStyle;
|
||||
|
@ -114,14 +113,7 @@ pub mod text;
|
|||
pub mod time;
|
||||
pub mod transform;
|
||||
pub mod ui;
|
||||
|
||||
/// Common handling for the specified value CSS url() values.
|
||||
pub mod url {
|
||||
#[cfg(feature = "servo")]
|
||||
pub use ::servo::url::{SpecifiedUrl, SpecifiedImageUrl};
|
||||
#[cfg(feature = "gecko")]
|
||||
pub use ::gecko::url::{SpecifiedUrl, SpecifiedImageUrl};
|
||||
}
|
||||
pub mod url;
|
||||
|
||||
/// Parse a `<number>` value, with a given clamping mode.
|
||||
fn parse_number_with_clamping_mode<'i, 't>(
|
||||
|
@ -519,12 +511,6 @@ impl Parse for PositiveInteger {
|
|||
}
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub type UrlOrNone = Either<SpecifiedUrl, None_>;
|
||||
|
||||
/// The specified value of a `<url>` for image or `none`.
|
||||
pub type ImageUrlOrNone = Either<SpecifiedImageUrl, None_>;
|
||||
|
||||
/// The specified value of a grid `<track-breadth>`
|
||||
pub type TrackBreadth = GenericTrackBreadth<LengthOrPercentage>;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue