mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Wrap in Arc<_> every object reflected in CSSOM.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1281962#c5
This commit is contained in:
parent
94d5b28fe9
commit
ef5977f059
4 changed files with 50 additions and 49 deletions
|
@ -164,7 +164,7 @@ fn get_animated_properties(keyframe: &Keyframe) -> Vec<TransitionProperty> {
|
|||
}
|
||||
|
||||
impl KeyframesAnimation {
|
||||
pub fn from_keyframes(keyframes: &[Keyframe]) -> Option<Self> {
|
||||
pub fn from_keyframes(keyframes: &[Arc<Keyframe>]) -> Option<Self> {
|
||||
if keyframes.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ struct KeyframeListParser<'a> {
|
|||
context: &'a ParserContext<'a>,
|
||||
}
|
||||
|
||||
pub fn parse_keyframe_list(context: &ParserContext, input: &mut Parser) -> Vec<Keyframe> {
|
||||
pub fn parse_keyframe_list(context: &ParserContext, input: &mut Parser) -> Vec<Arc<Keyframe>> {
|
||||
RuleListParser::new_for_nested_rule(input, KeyframeListParser { context: context })
|
||||
.filter_map(Result::ok)
|
||||
.collect()
|
||||
|
@ -225,12 +225,12 @@ pub fn parse_keyframe_list(context: &ParserContext, input: &mut Parser) -> Vec<K
|
|||
enum Void {}
|
||||
impl<'a> AtRuleParser for KeyframeListParser<'a> {
|
||||
type Prelude = Void;
|
||||
type AtRule = Keyframe;
|
||||
type AtRule = Arc<Keyframe>;
|
||||
}
|
||||
|
||||
impl<'a> QualifiedRuleParser for KeyframeListParser<'a> {
|
||||
type Prelude = KeyframeSelector;
|
||||
type QualifiedRule = Keyframe;
|
||||
type QualifiedRule = Arc<Keyframe>;
|
||||
|
||||
fn parse_prelude(&self, input: &mut Parser) -> Result<Self::Prelude, ()> {
|
||||
let start = input.position();
|
||||
|
@ -263,10 +263,10 @@ impl<'a> QualifiedRuleParser for KeyframeListParser<'a> {
|
|||
}
|
||||
// `parse_important` is not called here, `!important` is not allowed in keyframe blocks.
|
||||
}
|
||||
Ok(Keyframe {
|
||||
Ok(Arc::new(Keyframe {
|
||||
selector: prelude,
|
||||
declarations: Arc::new(declarations),
|
||||
})
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue