Support vendor prefix keyframes rule.

If there are multiple prefixed/non-prefixed @keyframes with the same name;

* non-prefixed rule overrides earlier rules.
* prefixed rule overrides earlier prefixed rules.
This commit is contained in:
Hiroyuki Ikezoe 2017-04-21 12:17:20 +09:00
parent 17dc598d99
commit 973d8287a9
7 changed files with 73 additions and 23 deletions

View file

@ -7,6 +7,7 @@
#![deny(missing_docs)]
use num_traits::ToPrimitive;
use std::ascii::AsciiExt;
use std::convert::AsRef;
use std::iter::{Filter, Peekable};
use std::str::Split;
@ -144,3 +145,9 @@ pub fn str_join<I, T>(strs: I, join: &str) -> String
acc
})
}
/// Returns true if a given string has a given prefix with case-insensitive match.
pub fn starts_with_ignore_ascii_case(string: &str, prefix: &str) -> bool {
string.len() > prefix.len() &&
string[0..prefix.len()].eq_ignore_ascii_case(prefix)
}