style: Handle servo-prefixed stuff correctly.

This commit is contained in:
Emilio Cobos Álvarez 2017-12-15 21:43:29 +01:00
parent 8fbdbc8f95
commit 5b8f65190a
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C

View file

@ -409,7 +409,7 @@ pub fn where_predicate(
/// Transforms "FooBar" to "foo-bar".
///
/// If the first Camel segment is "Moz" or "Webkit", the result string
/// If the first Camel segment is "Moz", "Webkit", or "Servo", the result string
/// is prepended with "-".
pub fn to_css_identifier(mut camel_case: &str) -> String {
camel_case = camel_case.trim_right_matches('_');
@ -418,7 +418,7 @@ pub fn to_css_identifier(mut camel_case: &str) -> String {
while let Some(segment) = split_camel_segment(&mut camel_case) {
if first {
match segment {
"Moz" | "Webkit" => first = false,
"Moz" | "Webkit" | "Servo" => first = false,
_ => {},
}
}