Rearrange PropertyDeclaration to avoid embedding DeclaredValue.

From https://bugzilla.mozilla.org/show_bug.cgi?id=1347719

This effectively combines the discriminants of the two enums and reduces the
size of PropertyDeclaration by one word.

MozReview-Commit-ID: 9rCRiSVZTQT
This commit is contained in:
Bobby Holley 2017-03-15 11:59:53 -07:00
parent e34aac03ff
commit 8cf331a498
14 changed files with 378 additions and 333 deletions

View file

@ -329,7 +329,7 @@ pub fn cascade<'a>(custom_properties: &mut Option<HashMap<&'a Name, BorrowedSpec
inherited: &'a Option<Arc<HashMap<Name, ComputedValue>>>,
seen: &mut HashSet<&'a Name>,
name: &'a Name,
specified_value: &'a DeclaredValue<Box<SpecifiedValue>>) {
specified_value: DeclaredValue<'a, Box<SpecifiedValue>>) {
let was_already_present = !seen.insert(name);
if was_already_present {
return;
@ -352,7 +352,7 @@ pub fn cascade<'a>(custom_properties: &mut Option<HashMap<&'a Name, BorrowedSpec
custom_properties.as_mut().unwrap()
}
};
match *specified_value {
match specified_value {
DeclaredValue::Value(ref specified_value) => {
map.insert(name, BorrowedSpecifiedValue {
css: &specified_value.css,