Deep clone ServoStyleSheets.

MozReview-Commit-ID: 6hYIcOa86Y
This commit is contained in:
Brad Werth 2017-05-22 12:55:43 -07:00 committed by Brad Werth
parent bb310efbb9
commit 31584e3c14
9 changed files with 221 additions and 10 deletions

View file

@ -71,7 +71,7 @@ impl KeyframePercentage {
/// A keyframes selector is a list of percentages or from/to symbols, which are
/// converted at parse time to percentages.
#[derive(Debug, PartialEq, Eq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct KeyframeSelector(Vec<KeyframePercentage>);
impl ToCss for KeyframeSelector {
@ -150,6 +150,16 @@ impl Keyframe {
};
parse_one_rule(&mut input, &mut rule_parser)
}
/// Deep clones this Keyframe.
pub fn deep_clone_with_lock(&self,
lock: &SharedRwLock) -> Keyframe {
let guard = lock.read();
Keyframe {
selector: self.selector.clone(),
block: Arc::new(lock.wrap(self.block.read_with(&guard).clone())),
}
}
}
/// A keyframes step value. This can be a synthetised keyframes animation, that