summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/animation/css/css_transition.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/animation/css/css_transition.h')
-rw-r--r--chromium/third_party/blink/renderer/core/animation/css/css_transition.h41
1 files changed, 35 insertions, 6 deletions
diff --git a/chromium/third_party/blink/renderer/core/animation/css/css_transition.h b/chromium/third_party/blink/renderer/core/animation/css/css_transition.h
index 483b2f0e1cb..07b5debd496 100644
--- a/chromium/third_party/blink/renderer/core/animation/css/css_transition.h
+++ b/chromium/third_party/blink/renderer/core/animation/css/css_transition.h
@@ -6,7 +6,9 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_ANIMATION_CSS_CSS_TRANSITION_H_
#include "third_party/blink/renderer/core/animation/animation.h"
+#include "third_party/blink/renderer/core/animation/animation_effect.h"
#include "third_party/blink/renderer/core/core_export.h"
+#include "third_party/blink/renderer/core/dom/element.h"
namespace blink {
@@ -21,20 +23,47 @@ class CORE_EXPORT CSSTransition : public Animation {
bool IsCSSTransition() const final { return true; }
+ void ClearOwningElement() final { owning_element_ = nullptr; }
+ Element* OwningElement() const override { return owning_element_; }
+
AtomicString transitionProperty() const;
const CSSProperty& TransitionCSSProperty() const {
return transition_property_.GetCSSProperty();
}
+ // Animation overrides.
+ // Various operations may affect the computed values of properties on
+ // elements. User agents may, as an optimization, defer recomputing these
+ // values until it becomes necessary; however, all operations included in the
+ // programming interfaces defined in the web-animations and css-transitions
+ // specifications, must produce a result consistent with having fully
+ // processed any such pending changes to computed values. Notably, setting
+ // display:none must update the play state.
+ // https://drafts.csswg.org/css-transitions-2/#requirements-on-pending-style-changes
+ String playState() const override;
+ void Trace(blink::Visitor* visitor) override {
+ Animation::Trace(visitor);
+ visitor->Trace(owning_element_);
+ }
+
+ protected:
+ AnimationEffect::EventDelegate* CreateEventDelegate(
+ Element* target,
+ const AnimationEffect::EventDelegate* old_event_delegate) override;
+
private:
PropertyHandle transition_property_;
+ // The owning element of a transition refers to the element or pseudo-element
+ // to which the transition-property property was applied that generated the
+ // animation.
+ Member<Element> owning_element_;
+};
+template <>
+struct DowncastTraits<CSSTransition> {
+ static bool AllowFrom(const Animation& animation) {
+ return animation.IsCSSTransition();
+ }
};
-
-DEFINE_TYPE_CASTS(CSSTransition,
- Animation,
- animation,
- animation->IsCSSTransition(),
- animation.IsCSSTransition());
} // namespace blink