Skip to content

Commit

Permalink
style: Ignore case in media feature names inside media query expressi…
Browse files Browse the repository at this point in the history
…ons.

Media feature names are converted to lower case before being processed, making
them effectively case-insensitive.
Prefixes ("min-", etc.) and values are already treated in a case-insensitive
manner.

Bug: 1464091
Reviewed-by: heycam
MozReview-Commit-ID: JUeeEQEMIi4
  • Loading branch information
squelart authored and emilio committed Jun 18, 2018
1 parent 1f562af commit 9d679c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/style/gecko/media_queries.rs
Expand Up @@ -23,7 +23,7 @@ use properties::ComputedValues;
use servo_arc::Arc;
use std::fmt::{self, Write};
use std::sync::atomic::{AtomicBool, AtomicIsize, AtomicUsize, Ordering};
use str::starts_with_ignore_ascii_case;
use str::{starts_with_ignore_ascii_case, string_as_ascii_lowercase};
use string_cache::Atom;
use style_traits::{CSSPixel, CssWriter, DevicePixel};
use style_traits::{ParseError, StyleParseErrorKind, ToCss};
Expand Down Expand Up @@ -596,7 +596,7 @@ impl Expression {
Range::Equal
};

let atom = Atom::from(feature_name);
let atom = Atom::from(string_as_ascii_lowercase(feature_name));
match find_feature(|f| atom.as_ptr() == unsafe { *f.mName as *mut _ }) {
Some(f) => Ok((f, range)),
None => Err(()),
Expand Down

0 comments on commit 9d679c9

Please sign in to comment.