diff --git a/components/style/properties/declaration_block.rs b/components/style/properties/declaration_block.rs index 204c874fc1c..d5cdb425022 100644 --- a/components/style/properties/declaration_block.rs +++ b/components/style/properties/declaration_block.rs @@ -754,6 +754,14 @@ impl PropertyDeclarationBlock { self.declarations.remove(i); } + /// Clears all the declarations from this block. + #[inline] + pub fn clear(&mut self) { + self.declarations_importance.clear(); + self.declarations.clear(); + self.longhands.clear(); + } + /// /// /// `first_declaration` needs to be the result of