mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Deep clone ServoStyleSheets.
MozReview-Commit-ID: 6hYIcOa86Y
This commit is contained in:
parent
bb310efbb9
commit
31584e3c14
9 changed files with 221 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue