mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Bug 1317209 - Part 5: Support transition cascade level. r=emilio
Support a new enum, EffectCompositor_CascadeLevel, which is an equivalent of EffectCompositor::CascadeLevel in Gecko.
This commit is contained in:
parent
3a89e89952
commit
19aea7ea78
7 changed files with 52 additions and 18 deletions
|
@ -8,7 +8,7 @@
|
|||
|
||||
use {Atom, LocalName};
|
||||
use data::ComputedStyle;
|
||||
use dom::{PresentationalHintsSynthetizer, TElement};
|
||||
use dom::{AnimationRules, PresentationalHintsSynthetizer, TElement};
|
||||
use error_reporting::StdoutErrorReporter;
|
||||
use keyframes::KeyframesAnimation;
|
||||
use media_queries::Device;
|
||||
|
@ -21,7 +21,7 @@ use rule_tree::{RuleTree, StrongRuleNode, StyleSource};
|
|||
use selector_parser::{ElementExt, SelectorImpl, PseudoElement, Snapshot};
|
||||
use selectors::Element;
|
||||
use selectors::bloom::BloomFilter;
|
||||
use selectors::matching::AFFECTED_BY_ANIMATIONS;
|
||||
use selectors::matching::{AFFECTED_BY_ANIMATIONS, AFFECTED_BY_TRANSITIONS};
|
||||
use selectors::matching::{AFFECTED_BY_STYLE_ATTRIBUTE, AFFECTED_BY_PRESENTATIONAL_HINTS};
|
||||
use selectors::matching::{MatchingReason, StyleRelations, matches_complex_selector};
|
||||
use selectors::parser::{Selector, SimpleSelector, LocalName as LocalNameSelector, ComplexSelector};
|
||||
|
@ -387,7 +387,7 @@ impl Stylist {
|
|||
self.push_applicable_declarations(element,
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
AnimationRules(None, None),
|
||||
Some(pseudo),
|
||||
&mut declarations,
|
||||
MatchingReason::ForStyling);
|
||||
|
@ -492,7 +492,7 @@ impl Stylist {
|
|||
element: &E,
|
||||
parent_bf: Option<&BloomFilter>,
|
||||
style_attribute: Option<&Arc<RwLock<PropertyDeclarationBlock>>>,
|
||||
animation_rule: Option<Arc<RwLock<PropertyDeclarationBlock>>>,
|
||||
animation_rules: AnimationRules,
|
||||
pseudo_element: Option<&PseudoElement>,
|
||||
applicable_declarations: &mut V,
|
||||
reason: MatchingReason) -> StyleRelations
|
||||
|
@ -564,7 +564,9 @@ impl Stylist {
|
|||
debug!("style attr: {:?}", relations);
|
||||
|
||||
// Step 5: Animations.
|
||||
if let Some(anim) = animation_rule {
|
||||
// The animations sheet (CSS animations, script-generated animations,
|
||||
// and CSS transitions that are no longer tied to CSS markup)
|
||||
if let Some(anim) = animation_rules.0 {
|
||||
relations |= AFFECTED_BY_ANIMATIONS;
|
||||
Push::push(
|
||||
applicable_declarations,
|
||||
|
@ -617,6 +619,16 @@ impl Stylist {
|
|||
|
||||
debug!("UA important: {:?}", relations);
|
||||
|
||||
// Step 10: Transitions.
|
||||
// The transitions sheet (CSS transitions that are tied to CSS markup)
|
||||
if let Some(anim) = animation_rules.1 {
|
||||
relations |= AFFECTED_BY_TRANSITIONS;
|
||||
Push::push(
|
||||
applicable_declarations,
|
||||
ApplicableDeclarationBlock::from_declarations(anim.clone(), Importance::Normal));
|
||||
}
|
||||
debug!("transition: {:?}", relations);
|
||||
|
||||
debug!("push_applicable_declarations: shareable: {:?}", relations);
|
||||
|
||||
relations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue