aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/servo
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2018-06-15 21:29:57 -0700
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-07-01 00:03:54 +0200
commite7cc548c35dba9d5ce10c15539e7c483b54a3bff (patch)
tree3e9a21708d6ae03a6d1916bd91074873d7f2f488 /components/style/servo
parentef14e65636ed963b93e5e1f64e907ea40a5247f1 (diff)
downloadservo-e7cc548c35dba9d5ce10c15539e7c483b54a3bff.tar.gz
servo-e7cc548c35dba9d5ce10c15539e7c483b54a3bff.zip
style: Rename Expression to MediaFeatureExpression.
Which is more appropriate, given it represents a `<media-feature>` per spec, and expression is a bit overloaded :) Bug: 1422225 Reviewed-by: xidorn MozReview-Commit-ID: Fed1nJhHxDu
Diffstat (limited to 'components/style/servo')
-rw-r--r--components/style/servo/media_queries.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/style/servo/media_queries.rs b/components/style/servo/media_queries.rs
index 336971f98df..14dec24b261 100644
--- a/components/style/servo/media_queries.rs
+++ b/components/style/servo/media_queries.rs
@@ -170,9 +170,9 @@ pub enum ExpressionKind {
/// <http://dev.w3.org/csswg/mediaqueries-3/#media1>
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
-pub struct Expression(pub ExpressionKind);
+pub struct MediaFeatureExpression(pub ExpressionKind);
-impl Expression {
+impl MediaFeatureExpression {
/// The kind of expression we're, just for unit testing.
///
/// Eventually this will become servo-only.
@@ -196,7 +196,7 @@ impl Expression {
let name = input.expect_ident_cloned()?;
input.expect_colon()?;
// TODO: Handle other media features
- Ok(Expression(match_ignore_ascii_case! { &name,
+ Ok(MediaFeatureExpression(match_ignore_ascii_case! { &name,
"min-width" => {
ExpressionKind::Width(Range::Min(specified::Length::parse_non_negative(context, input)?))
},
@@ -206,7 +206,7 @@ impl Expression {
"width" => {
ExpressionKind::Width(Range::Eq(specified::Length::parse_non_negative(context, input)?))
},
- _ => return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name.clone())))
+ _ => return Err(input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(name)))
}))
})
}
@@ -228,7 +228,7 @@ impl Expression {
}
}
-impl ToCss for Expression {
+impl ToCss for MediaFeatureExpression {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result
where
W: Write,
@@ -246,8 +246,8 @@ impl ToCss for Expression {
/// An enumeration that represents a ranged value.
///
-/// Only public for testing, implementation details of `Expression` may change
-/// for Stylo.
+/// Only public for testing, implementation details of `MediaFeatureExpression`
+/// may change for Stylo.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "servo", derive(MallocSizeOf))]
pub enum Range<T> {