diff options
Diffstat (limited to 'components/script/dom/element.rs')
-rw-r--r-- | components/script/dom/element.rs | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/components/script/dom/element.rs b/components/script/dom/element.rs index 26ad3eaee40..2d57ddab4d6 100644 --- a/components/script/dom/element.rs +++ b/components/script/dom/element.rs @@ -362,8 +362,11 @@ impl LayoutElementHelpers for LayoutJS<Element> { if let Some(url) = background { hints.push(from_declaration( PropertyDeclaration::BackgroundImage(DeclaredValue::Value( - background_image::SpecifiedValue(Some( - specified::Image::Url(url, specified::UrlExtraData { }))))))); + background_image::SpecifiedValue(vec![ + background_image::single_value::SpecifiedValue(Some( + specified::Image::Url(url, specified::UrlExtraData { }) + )) + ]))))); } let color = if let Some(this) = self.downcast::<HTMLFontElement>() { @@ -774,8 +777,6 @@ impl Element { Arc::make_mut(&mut declarations.declarations).remove(index); if importance.unwrap().important() { declarations.important_count -= 1; - } else { - declarations.normal_count -= 1; } } } @@ -802,11 +803,9 @@ impl Element { if existing_declaration.0.name() == incoming_declaration.name() { match (existing_declaration.1, importance) { (Importance::Normal, Importance::Important) => { - declaration_block.normal_count -= 1; declaration_block.important_count += 1; } (Importance::Important, Importance::Normal) => { - declaration_block.normal_count += 1; declaration_block.important_count -= 1; } _ => {} @@ -818,23 +817,20 @@ impl Element { existing_declarations.push((incoming_declaration, importance)); if importance.important() { declaration_block.important_count += 1; - } else { - declaration_block.normal_count += 1; } } } return; } - let (normal_count, important_count) = if importance.important() { - (0, declarations.len() as u32) + let important_count = if importance.important() { + declarations.len() as u32 } else { - (declarations.len() as u32, 0) + 0 }; *inline_declarations = Some(PropertyDeclarationBlock { declarations: Arc::new(declarations.into_iter().map(|d| (d, importance)).collect()), - normal_count: normal_count, important_count: important_count, }); } @@ -856,11 +852,9 @@ impl Element { if properties.iter().any(|p| declaration.name() == **p) { match (*importance, new_importance) { (Importance::Normal, Importance::Important) => { - block.normal_count -= 1; block.important_count += 1; } (Importance::Important, Importance::Normal) => { - block.normal_count += 1; block.important_count -= 1; } _ => {} |