mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Used custom_properties::parse_name
This commit is contained in:
parent
7e6fd297ff
commit
b9a699f4f1
1 changed files with 4 additions and 3 deletions
|
@ -16,6 +16,7 @@ use servo_atoms::Atom;
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::iter::Iterator;
|
use std::iter::Iterator;
|
||||||
|
use style::custom_properties;
|
||||||
|
|
||||||
#[dom_struct]
|
#[dom_struct]
|
||||||
pub struct StylePropertyMapReadOnly {
|
pub struct StylePropertyMapReadOnly {
|
||||||
|
@ -73,14 +74,14 @@ impl StylePropertyMapReadOnlyMethods for StylePropertyMapReadOnly {
|
||||||
// https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties
|
// https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties
|
||||||
// requires this sort order
|
// requires this sort order
|
||||||
result.sort_by(|key1, key2| {
|
result.sort_by(|key1, key2| {
|
||||||
if key1.starts_with("-") {
|
if let Ok(key1) = custom_properties::parse_name(key1) {
|
||||||
if key2.starts_with("-") {
|
if let Ok(key2) = custom_properties::parse_name(key2) {
|
||||||
key1.cmp(key2)
|
key1.cmp(key2)
|
||||||
} else {
|
} else {
|
||||||
Ordering::Greater
|
Ordering::Greater
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if key2.starts_with("-") {
|
if let Ok(_) = custom_properties::parse_name(key2) {
|
||||||
Ordering::Less
|
Ordering::Less
|
||||||
} else {
|
} else {
|
||||||
key1.cmp(key2)
|
key1.cmp(key2)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue