mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make DeclaredValue store CSSWideKeyword
Rather than having separate variant for each CSS-wide keyword.
This commit is contained in:
parent
29fd30601e
commit
03f6d21cb5
10 changed files with 120 additions and 115 deletions
|
@ -9,7 +9,7 @@
|
|||
use Atom;
|
||||
use cssparser::{Delimiter, Parser, SourcePosition, Token, TokenSerializationType};
|
||||
use parser::ParserContext;
|
||||
use properties::DeclaredValue;
|
||||
use properties::{CSSWideKeyword, DeclaredValue};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
|
@ -362,11 +362,13 @@ pub fn cascade<'a>(custom_properties: &mut Option<HashMap<&'a Name, BorrowedSpec
|
|||
});
|
||||
},
|
||||
DeclaredValue::WithVariables(_) => unreachable!(),
|
||||
DeclaredValue::Initial => {
|
||||
map.remove(&name);
|
||||
DeclaredValue::CSSWideKeyword(keyword) => match keyword {
|
||||
CSSWideKeyword::Initial => {
|
||||
map.remove(&name);
|
||||
}
|
||||
CSSWideKeyword::Unset | // Custom properties are inherited by default.
|
||||
CSSWideKeyword::Inherit => {} // The inherited value is what we already have.
|
||||
}
|
||||
DeclaredValue::Unset | // Custom properties are inherited by default.
|
||||
DeclaredValue::Inherit => {} // The inherited value is what we already have.
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue