mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
style: Evaluate MediaConditions, and glue it all together.
Bug: 1422225 Reviewed-by: xidorn MozReview-Commit-ID: 3MThE2FvfDf
This commit is contained in:
parent
d2a1895752
commit
3a92fd1cfc
4 changed files with 96 additions and 58 deletions
|
@ -8,7 +8,7 @@ use app_units::Au;
|
|||
use cssparser::{Delimiter, Parser, Token};
|
||||
#[cfg(feature = "gecko")]
|
||||
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
|
||||
use media_queries::{Device, MediaFeatureExpression};
|
||||
use media_queries::{Device, MediaCondition};
|
||||
use parser::{Parse, ParserContext};
|
||||
use selectors::context::QuirksMode;
|
||||
use style_traits::ParseError;
|
||||
|
@ -19,9 +19,7 @@ use values::specified::{Length, NoCalcLength, ViewportPercentageLength};
|
|||
///
|
||||
/// https://html.spec.whatwg.org/multipage/#source-size
|
||||
pub struct SourceSize {
|
||||
// FIXME(emilio): This should be a `MediaCondition`, and support `and` and
|
||||
// `or`.
|
||||
condition: MediaFeatureExpression,
|
||||
condition: MediaCondition,
|
||||
value: Length,
|
||||
}
|
||||
|
||||
|
@ -30,7 +28,7 @@ impl Parse for SourceSize {
|
|||
context: &ParserContext,
|
||||
input: &mut Parser<'i, 't>,
|
||||
) -> Result<Self, ParseError<'i>> {
|
||||
let condition = MediaFeatureExpression::parse(context, input)?;
|
||||
let condition = MediaCondition::parse(context, input)?;
|
||||
let value = Length::parse_non_negative(context, input)?;
|
||||
|
||||
Ok(Self { condition, value })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue