Bug 1466963: Remove unused PropertyDeclarationBlock::set_importance. r=xidorn
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 05 Jun 2018 21:13:04 +0200
changeset 805252 43cf976e4f548fbdf3b8077aa7e9d134e3d1a813
parent 805251 dac3de03713653e515d3e44649dbc874c39e0459
child 805253 3e80f0aa86c50d1cf89ea2f69de8b596e490e46f
push id112610
push userbmo:gl@mozilla.com
push dateThu, 07 Jun 2018 15:48:24 +0000
reviewersxidorn
bugs1466963
milestone62.0a1
Bug 1466963: Remove unused PropertyDeclarationBlock::set_importance. r=xidorn MozReview-Commit-ID: 1YrlOvktag9
servo/components/style/properties/declaration_block.rs
--- a/servo/components/style/properties/declaration_block.rs
+++ b/servo/components/style/properties/declaration_block.rs
@@ -559,33 +559,16 @@ impl PropertyDeclarationBlock {
         if let Some(id) = longhand_id {
             self.longhands.insert(id);
         }
         self.declarations.push(declaration);
         self.declarations_importance.push(importance.important());
         true
     }
 
-    /// Set the declaration importance for a given property, if found.
-    ///
-    /// Returns whether any declaration was updated.
-    pub fn set_importance(&mut self, property: &PropertyId, new_importance: Importance) -> bool {
-        let mut updated_at_least_one = false;
-        for (i, declaration) in self.declarations.iter().enumerate() {
-            if declaration.id().is_or_is_longhand_of(property) {
-                let is_important = new_importance.important();
-                if self.declarations_importance[i] != is_important {
-                    self.declarations_importance.set(i, is_important);
-                    updated_at_least_one = true;
-                }
-            }
-        }
-        updated_at_least_one
-    }
-
     /// <https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty>
     ///
     /// Returns whether any declaration was actually removed.
     pub fn remove_property(&mut self, property: &PropertyId) -> bool {
         let longhand_id = property.longhand_id();
         if let Some(id) = longhand_id {
             if !self.longhands.contains(id) {
                 return false