Bug 1354947 - Add clear method for LonghandIdSet. r?SimonSapin
MozReview-Commit-ID: K5GaKcMjhI7
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -246,16 +246,22 @@ impl LonghandIdSet {
/// Remove the given property from the set
#[inline]
pub fn remove(&mut self, id: LonghandId) {
let bit = id as usize;
self.storage[bit / 32] &= !(1 << (bit % 32));
}
+ /// Clear all bits
+ #[inline]
+ pub fn clear(&mut self) {
+ self.storage = [0; (${len(data.longhands)} - 1 + 32) / 32];
+ }
+
/// Set the corresponding bit of TransitionProperty.
/// This function will panic if TransitionProperty::All is given.
pub fn set_transition_property_bit(&mut self, property: &TransitionProperty) {
match *property {
% for prop in data.longhands:
% if prop.animatable:
TransitionProperty::${prop.camel_case} => self.insert(LonghandId::${prop.camel_case}),
% endif