From b9a699f4f1a4042854cfe39bfd5b3d3bf3a5c711 Mon Sep 17 00:00:00 2001 From: Alan Jeffrey Date: Fri, 28 Jul 2017 14:46:16 -0500 Subject: [PATCH] Used custom_properties::parse_name --- components/script/dom/stylepropertymapreadonly.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/script/dom/stylepropertymapreadonly.rs b/components/script/dom/stylepropertymapreadonly.rs index 38632f3e6e9..02f8a342321 100644 --- a/components/script/dom/stylepropertymapreadonly.rs +++ b/components/script/dom/stylepropertymapreadonly.rs @@ -16,6 +16,7 @@ use servo_atoms::Atom; use std::cmp::Ordering; use std::collections::HashMap; use std::iter::Iterator; +use style::custom_properties; #[dom_struct] pub struct StylePropertyMapReadOnly { @@ -73,14 +74,14 @@ impl StylePropertyMapReadOnlyMethods for StylePropertyMapReadOnly { // https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties // requires this sort order result.sort_by(|key1, key2| { - if key1.starts_with("-") { - if key2.starts_with("-") { + if let Ok(key1) = custom_properties::parse_name(key1) { + if let Ok(key2) = custom_properties::parse_name(key2) { key1.cmp(key2) } else { Ordering::Greater } } else { - if key2.starts_with("-") { + if let Ok(_) = custom_properties::parse_name(key2) { Ordering::Less } else { key1.cmp(key2)