From 4ad844f7bdaff6594cd2b133cb5ac2f32463b461 Mon Sep 17 00:00:00 2001 From: Simon Sapin Date: Sun, 26 Feb 2017 18:50:06 +0100 Subject: [PATCH] Rename PropertyBitField to LonghandIdSet --- components/style/keyframes.rs | 4 ++-- components/style/properties/helpers.mako.rs | 2 +- components/style/properties/properties.mako.rs | 14 +++++++------- ports/geckolib/glue.rs | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/style/keyframes.rs b/components/style/keyframes.rs index 7281f11692c..87bebc308d2 100644 --- a/components/style/keyframes.rs +++ b/components/style/keyframes.rs @@ -12,10 +12,10 @@ use parking_lot::RwLock; use parser::{ParserContext, ParserContextExtraData, log_css_error}; use properties::{Importance, PropertyDeclaration, PropertyDeclarationBlock, PropertyId}; use properties::{PropertyDeclarationId, LonghandId, DeclaredValue}; +use properties::LonghandIdSet; use properties::PropertyDeclarationParseResult; use properties::animated_properties::TransitionProperty; use properties::longhands::transition_timing_function::single_value::SpecifiedValue as SpecifiedTimingFunction; -use properties::PropertyBitField; use std::fmt; use std::sync::Arc; use style_traits::ToCss; @@ -248,7 +248,7 @@ pub struct KeyframesAnimation { /// Get all the animated properties in a keyframes animation. fn get_animated_properties(keyframes: &[Arc>]) -> Vec { let mut ret = vec![]; - let mut seen = PropertyBitField::new(); + let mut seen = LonghandIdSet::new(); // NB: declarations are already deduplicated, so we don't have to check for // it here. for keyframe in keyframes { diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 44a893a671e..ca5806fc2de 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -230,7 +230,7 @@ use cascade_info::CascadeInfo; use error_reporting::ParseErrorReporter; use properties::longhands; - use properties::PropertyBitField; + use properties::LonghandIdSet; use properties::{ComputedValues, PropertyDeclaration}; use properties::style_structs; use std::boxed::Box as StdBox; diff --git a/components/style/properties/properties.mako.rs b/components/style/properties/properties.mako.rs index 03a8924b78d..0dd9682e5b1 100644 --- a/components/style/properties/properties.mako.rs +++ b/components/style/properties/properties.mako.rs @@ -179,15 +179,15 @@ pub mod animated_properties { } /// A set of longhand properties -pub struct PropertyBitField { +pub struct LonghandIdSet { storage: [u32; (${len(data.longhands)} - 1 + 32) / 32] } -impl PropertyBitField { +impl LonghandIdSet { /// Create an empty set #[inline] - pub fn new() -> PropertyBitField { - PropertyBitField { storage: [0; (${len(data.longhands)} - 1 + 32) / 32] } + pub fn new() -> LonghandIdSet { + LonghandIdSet { storage: [0; (${len(data.longhands)} - 1 + 32) / 32] } } /// Return whether the given property is in the set @@ -233,7 +233,7 @@ impl PropertyBitField { /// A specialized set of PropertyDeclarationId pub struct PropertyDeclarationIdSet { - longhands: PropertyBitField, + longhands: LonghandIdSet, // FIXME: Use a HashSet instead? This Vec is usually small, so linear scan might be ok. custom: Vec<::custom_properties::Name>, @@ -243,7 +243,7 @@ impl PropertyDeclarationIdSet { /// Empty set pub fn new() -> Self { PropertyDeclarationIdSet { - longhands: PropertyBitField::new(), + longhands: LonghandIdSet::new(), custom: Vec::new(), } } @@ -1835,7 +1835,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D, // NB: The cacheable boolean is not used right now, but will be once we // start caching computed values in the rule nodes. let mut cacheable = true; - let mut seen = PropertyBitField::new(); + let mut seen = LonghandIdSet::new(); // Declaration blocks are stored in increasing precedence order, we want // them in decreasing order here. diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 74d556f8da7..ec5afbae022 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -1338,8 +1338,8 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis pres_context: RawGeckoPresContextBorrowed, computed_keyframes: RawGeckoComputedKeyframeValuesListBorrowedMut) { + use style::properties::LonghandIdSet; use style::properties::declaration_block::Importance; - use style::properties::PropertyBitField; use style::values::computed::Context; let style = ComputedValues::as_arc(&style); @@ -1359,7 +1359,7 @@ pub extern "C" fn Servo_GetComputedKeyframeValues(keyframes: RawGeckoKeyframeLis for (index, keyframe) in keyframes.iter().enumerate() { let ref mut animation_values = computed_keyframes[index]; - let mut seen = PropertyBitField::new(); + let mut seen = LonghandIdSet::new(); // mServoDeclarationBlock is null in the case where we have an invalid css property. let iter = keyframe.mPropertyValues.iter() @@ -1429,7 +1429,7 @@ pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSet style: ServoComputedValuesBorrowed, keyframes: RawGeckoKeyframeListBorrowedMut) -> bool { use style::gecko_bindings::structs::Keyframe; - use style::properties::PropertyBitField; + use style::properties::LonghandIdSet; let data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let name = unsafe { Atom::from(name.as_ref().unwrap().as_str_unchecked()) }; @@ -1482,7 +1482,7 @@ pub extern "C" fn Servo_StyleSet_FillKeyframesForName(raw_data: RawServoStyleSet declaration.is_animatable() }); - let mut seen = PropertyBitField::new(); + let mut seen = LonghandIdSet::new(); for (index, &(ref declaration, _)) in animatable.enumerate() { unsafe {