Bug 1466963: Remove unused PropertyDeclarationBlock::set_importance. r?xidorn draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Tue, 05 Jun 2018 21:13:04 +0200
changeset 804467 f714a8062c5740e2d5701e2cc33db0eb293ac6e9
parent 804466 208ed4fb712f24e04013b250db860b1b45b56b8e
child 804468 be95a8e48f6b5c5e872d6821fce7fb20b3c164c5
push id112373
push userbmo:emilio@crisal.io
push dateTue, 05 Jun 2018 22:12:13 +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