mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -8,11 +8,11 @@ use arrayvec::ArrayVec;
|
|||
use context::SharedStyleContext;
|
||||
use dom::TElement;
|
||||
use invalidation::element::restyle_hints::RestyleHint;
|
||||
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
||||
use properties::ComputedValues;
|
||||
use properties::longhands::display::computed_value as display;
|
||||
use rule_tree::StrongRuleNode;
|
||||
use selector_parser::{EAGER_PSEUDO_COUNT, PseudoElement, RestyleDamage};
|
||||
use shared_lock::{Locked, StylesheetGuards};
|
||||
use shared_lock::StylesheetGuards;
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use stylearc::Arc;
|
||||
|
||||
|
@ -402,29 +402,4 @@ impl ElementData {
|
|||
pub fn clear_restyle_state(&mut self) {
|
||||
self.restyle.clear();
|
||||
}
|
||||
|
||||
/// Returns SMIL overriden value if exists.
|
||||
pub fn get_smil_override(&self) -> Option<&Arc<Locked<PropertyDeclarationBlock>>> {
|
||||
if cfg!(feature = "servo") {
|
||||
// Servo has no knowledge of a SMIL rule, so just avoid looking for it.
|
||||
return None;
|
||||
}
|
||||
|
||||
match self.styles.get_primary() {
|
||||
Some(v) => v.rules().get_smil_animation_rule(),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns AnimationRules that has processed during animation-only restyles.
|
||||
pub fn get_animation_rules(&self) -> AnimationRules {
|
||||
if cfg!(feature = "servo") {
|
||||
return AnimationRules(None, None)
|
||||
}
|
||||
|
||||
match self.styles.get_primary() {
|
||||
Some(v) => v.rules().get_animation_rules(),
|
||||
None => AnimationRules(None, None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue