mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Rename PropertyBitField to LonghandIdSet
This commit is contained in:
parent
c81ebca7df
commit
4ad844f7bd
4 changed files with 14 additions and 14 deletions
|
@ -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<RwLock<Keyframe>>]) -> Vec<TransitionProperty> {
|
||||
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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<Au>,
|
|||
// 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.
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue