mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
style: Undo the optimization for grabbing animation rules from the style data.
This is unfortunate, but for now it complicates things, I would like not needing a ElementData to get the style of an Element in order to fix all the getDefaultComputedStyle bugs. MozReview-Commit-ID: LZvsdFEqrDE
This commit is contained in:
parent
95a2ac51c4
commit
cc94a8b7cb
5 changed files with 51 additions and 86 deletions
|
@ -9,7 +9,7 @@
|
|||
use applicable_declarations::ApplicableDeclarationList;
|
||||
#[cfg(feature = "servo")]
|
||||
use heapsize::HeapSizeOf;
|
||||
use properties::{AnimationRules, Importance, LonghandIdSet, PropertyDeclarationBlock};
|
||||
use properties::{Importance, LonghandIdSet, PropertyDeclarationBlock};
|
||||
use shared_lock::{Locked, StylesheetGuards, SharedRwLockReadGuard};
|
||||
use smallvec::SmallVec;
|
||||
use std::io::{self, Write};
|
||||
|
@ -1321,32 +1321,6 @@ impl StrongRuleNode {
|
|||
.find(|node| node.cascade_level() == CascadeLevel::SMILOverride)
|
||||
.map(|node| node.get_animation_style())
|
||||
}
|
||||
|
||||
/// Returns AnimationRules that has processed during animation-only restyles.
|
||||
pub fn get_animation_rules(&self) -> AnimationRules {
|
||||
if cfg!(feature = "servo") {
|
||||
return AnimationRules(None, None);
|
||||
}
|
||||
|
||||
let mut animation = None;
|
||||
let mut transition = None;
|
||||
|
||||
for node in self.self_and_ancestors()
|
||||
.take_while(|node| node.cascade_level() >= CascadeLevel::Animations) {
|
||||
match node.cascade_level() {
|
||||
CascadeLevel::Animations => {
|
||||
debug_assert!(animation.is_none());
|
||||
animation = Some(node.get_animation_style())
|
||||
},
|
||||
CascadeLevel::Transitions => {
|
||||
debug_assert!(transition.is_none());
|
||||
transition = Some(node.get_animation_style())
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
AnimationRules(animation, transition)
|
||||
}
|
||||
}
|
||||
|
||||
/// An iterator over a rule node and its ancestors.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue