Diff
Modified: trunk/Source/WebCore/ChangeLog (221979 => 221980)
--- trunk/Source/WebCore/ChangeLog 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/ChangeLog 2017-09-13 18:20:12 UTC (rev 221980)
@@ -1,3 +1,72 @@
+2017-09-13 Antti Koivisto <[email protected]>
+
+ Make more of the CSS animation system internals element based
+ https://bugs.webkit.org/show_bug.cgi?id=176832
+
+ Reviewed by Zalan Bujtas.
+
+ CSS animations animate element style. Continue moving away from renderers in the animation code.
+
+ Also do some general modernization.
+
+ * css/CSSComputedStyleDeclaration.cpp:
+ (WebCore::computeRenderStyleForProperty):
+ * page/animation/AnimationBase.cpp:
+ (WebCore::AnimationBase::AnimationBase):
+ * page/animation/AnimationBase.h:
+ * page/animation/CSSAnimationController.cpp:
+ (WebCore::CSSAnimationControllerPrivate::ensureCompositeAnimation):
+ (WebCore::CSSAnimationControllerPrivate::clear):
+ (WebCore::CSSAnimationControllerPrivate::updateAnimations):
+ (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForElement):
+ (WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
+ (WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
+ (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
+ (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
+ (WebCore::CSSAnimationControllerPrivate::animatedStyleForElement):
+ (WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
+ (WebCore::CSSAnimationController::cancelAnimations):
+ (WebCore::CSSAnimationController::updateAnimations):
+ (WebCore::CSSAnimationController::animatedStyleForRenderer):
+ (WebCore::CSSAnimationController::computeExtentOfAnimation const):
+ (WebCore::CSSAnimationController::pauseAnimationAtTime):
+ (WebCore::CSSAnimationController::pauseTransitionAtTime):
+ (WebCore::CSSAnimationControllerPrivate::updateAnimationTimerForRenderer): Deleted.
+ (WebCore::CSSAnimationControllerPrivate::getAnimatedStyleForRenderer): Deleted.
+ (WebCore::CSSAnimationController::getAnimatedStyleForRenderer): Deleted.
+ * page/animation/CSSAnimationController.h:
+ * page/animation/CSSAnimationControllerPrivate.h:
+ * page/animation/CompositeAnimation.cpp:
+ (WebCore::CompositeAnimation::~CompositeAnimation):
+ (WebCore::CompositeAnimation::clearElement):
+ (WebCore::CompositeAnimation::updateTransitions):
+ (WebCore::CompositeAnimation::updateKeyframeAnimations):
+ (WebCore::CompositeAnimation::animate):
+ (WebCore::CompositeAnimation::clearRenderer): Deleted.
+ * page/animation/CompositeAnimation.h:
+ * page/animation/ImplicitAnimation.cpp:
+ (WebCore::ImplicitAnimation::ImplicitAnimation):
+ (WebCore::ImplicitAnimation::animate):
+ * page/animation/ImplicitAnimation.h:
+ (WebCore::ImplicitAnimation::create):
+ * page/animation/KeyframeAnimation.cpp:
+ (WebCore::KeyframeAnimation::KeyframeAnimation):
+ (WebCore::KeyframeAnimation::animate):
+ * page/animation/KeyframeAnimation.h:
+ * rendering/RenderElement.cpp:
+ (WebCore::RenderElement::willBeDestroyed):
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::currentTransform const):
+ * style/RenderTreeUpdater.cpp:
+ (WebCore::RenderTreeUpdater::createRenderer):
+ * style/StyleTreeResolver.cpp:
+ (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
+ * testing/Internals.cpp:
+ (WebCore::Internals::pauseAnimationAtTimeOnElement):
+ (WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
+ (WebCore::Internals::pauseTransitionAtTimeOnElement):
+ (WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
+
2017-09-13 Daniel Bates <[email protected]>
Make history.pushState()/replaceState() more closely aligned to the HTML standard
Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (221979 => 221980)
--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -2477,7 +2477,7 @@
auto* renderer = element.renderer();
if (renderer && renderer->isComposited() && CSSAnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
- ownedStyle = renderer->animation().getAnimatedStyleForRenderer(*renderer);
+ ownedStyle = renderer->animation().animatedStyleForRenderer(*renderer);
if (pseudoElementSpecifier && !element.isPseudoElement()) {
// FIXME: This cached pseudo style will only exist if the animation has been run at least once.
return ownedStyle->getCachedPseudoStyle(pseudoElementSpecifier);
Modified: trunk/Source/WebCore/page/animation/AnimationBase.cpp (221979 => 221980)
--- trunk/Source/WebCore/page/animation/AnimationBase.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/AnimationBase.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -76,12 +76,11 @@
return solver.solve(t * duration);
}
-AnimationBase::AnimationBase(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation)
- : m_element(renderer->element())
- , m_compositeAnimation(compositeAnimation)
+AnimationBase::AnimationBase(const Animation& animation, Element& element, CompositeAnimation& compositeAnimation)
+ : m_element(&element)
+ , m_compositeAnimation(&compositeAnimation)
, m_animation(const_cast<Animation&>(animation))
{
- ASSERT(m_element);
// Compute the total duration
if (m_animation->iterationCount() > 0)
m_totalDuration = m_animation->duration() * m_animation->iterationCount();
Modified: trunk/Source/WebCore/page/animation/AnimationBase.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/AnimationBase.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/AnimationBase.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -48,7 +48,7 @@
friend class CSSPropertyAnimation;
WTF_MAKE_FAST_ALLOCATED;
public:
- AnimationBase(const Animation& transition, RenderElement*, CompositeAnimation*);
+ AnimationBase(const Animation& transition, Element&, CompositeAnimation&);
virtual ~AnimationBase() { }
RenderElement* renderer() const;
@@ -134,8 +134,6 @@
double progress(double scale = 1, double offset = 0, const TimingFunction* = nullptr) const;
- // Returns true if the animation state changed.
- virtual bool animate(CompositeAnimation&, RenderElement*, const RenderStyle* /*currentStyle*/, const RenderStyle& /*targetStyle*/, std::unique_ptr<RenderStyle>& /*animatedStyle*/, bool& didBlendStyle) = 0;
virtual void getAnimatedStyle(std::unique_ptr<RenderStyle>& /*animatedStyle*/) = 0;
virtual bool computeExtentOfTransformAnimation(LayoutRect&) const = 0;
Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.cpp (221979 => 221980)
--- trunk/Source/WebCore/page/animation/CSSAnimationController.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -83,34 +83,32 @@
{
}
-CompositeAnimation& CSSAnimationControllerPrivate::ensureCompositeAnimation(RenderElement& renderer)
+CompositeAnimation& CSSAnimationControllerPrivate::ensureCompositeAnimation(Element& element)
{
- auto result = m_compositeAnimations.ensure(&renderer, [&] {
+ auto result = m_compositeAnimations.ensure(&element, [&] {
return CompositeAnimation::create(*this);
});
- if (animationsAreSuspendedForDocument(&renderer.document()))
+ if (animationsAreSuspendedForDocument(&element.document()))
result.iterator->value->suspendAnimations();
return *result.iterator->value;
}
-bool CSSAnimationControllerPrivate::clear(RenderElement& renderer)
+bool CSSAnimationControllerPrivate::clear(Element& element)
{
- auto it = m_compositeAnimations.find(&renderer);
+ auto it = m_compositeAnimations.find(&element);
if (it == m_compositeAnimations.end())
return false;
- LOG(Animations, "CSSAnimationControllerPrivate %p clear: %p", this, &renderer);
+ LOG(Animations, "CSSAnimationControllerPrivate %p clear: %p", this, &element);
- Element* element = renderer.element();
-
- m_eventsToDispatch.removeAllMatching([element] (const EventToDispatch& info) {
- return info.element.ptr() == element;
+ m_eventsToDispatch.removeAllMatching([&] (const EventToDispatch& info) {
+ return info.element.ptr() == &element;
});
- m_elementChangesToDispatch.removeAllMatching([element](auto& currentElement) {
- return currentElement.ptr() == element;
+ m_elementChangesToDispatch.removeAllMatching([&](auto& currentElement) {
+ return currentElement.ptr() == &element;
});
// Return false if we didn't do anything OR we are suspended (so we don't try to
@@ -118,7 +116,7 @@
// FIXME: The code below does the opposite of what the comment above says regarding suspended state.
auto& animation = *it->value;
bool result = animation.isSuspended();
- animation.clearRenderer();
+ animation.clearElement();
m_compositeAnimations.remove(it);
@@ -140,10 +138,9 @@
if (timeToNextService && timeToNextService.value() == 0_s) {
if (callSetChanged != CallSetChanged)
break;
- Element* element = compositeAnimation.key->element();
- ASSERT(element);
- ASSERT(element->document().pageCacheState() == Document::NotInPageCache);
- element->invalidateStyleAndLayerComposition();
+ Element& element = *compositeAnimation.key;
+ ASSERT(element.document().pageCacheState() == Document::NotInPageCache);
+ element.invalidateStyleAndLayerComposition();
calledSetChanged = true;
}
}
@@ -155,11 +152,11 @@
return timeToNextService;
}
-void CSSAnimationControllerPrivate::updateAnimationTimerForRenderer(RenderElement& renderer)
+void CSSAnimationControllerPrivate::updateAnimationTimerForElement(Element& element)
{
std::optional<Seconds> timeToNextService;
- const CompositeAnimation* compositeAnimation = m_compositeAnimations.get(&renderer);
+ const CompositeAnimation* compositeAnimation = m_compositeAnimations.get(&element);
if (!compositeAnimation->isSuspended() && compositeAnimation->hasAnimations())
timeToNextService = compositeAnimation->timeToNextService();
@@ -289,7 +286,9 @@
bool CSSAnimationControllerPrivate::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const
{
- auto* animation = m_compositeAnimations.get(&renderer);
+ if (!renderer.element())
+ return false;
+ auto* animation = m_compositeAnimations.get(renderer.element());
if (!animation)
return false;
return animation->isAnimatingProperty(property, false, runningState);
@@ -297,7 +296,9 @@
bool CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const
{
- auto* animation = m_compositeAnimations.get(&renderer);
+ if (!renderer.element())
+ return false;
+ auto* animation = m_compositeAnimations.get(renderer.element());
if (!animation)
return false;
return animation->isAnimatingProperty(property, true, runningState);
@@ -402,14 +403,11 @@
m_allowsNewAnimationsWhileSuspended = allowed;
}
-bool CSSAnimationControllerPrivate::pauseAnimationAtTime(RenderElement* renderer, const AtomicString& name, double t)
+bool CSSAnimationControllerPrivate::pauseAnimationAtTime(Element& element, const AtomicString& name, double t)
{
- if (!renderer)
- return false;
-
- CompositeAnimation& compositeAnimation = ensureCompositeAnimation(*renderer);
+ CompositeAnimation& compositeAnimation = ensureCompositeAnimation(element);
if (compositeAnimation.pauseAnimationAtTime(name, t)) {
- renderer->element()->invalidateStyleAndLayerComposition();
+ element.invalidateStyleAndLayerComposition();
startUpdateStyleIfNeededDispatcher();
return true;
}
@@ -417,14 +415,11 @@
return false;
}
-bool CSSAnimationControllerPrivate::pauseTransitionAtTime(RenderElement* renderer, const String& property, double t)
+bool CSSAnimationControllerPrivate::pauseTransitionAtTime(Element& element, const String& property, double t)
{
- if (!renderer)
- return false;
-
- CompositeAnimation& compositeAnimation = ensureCompositeAnimation(*renderer);
+ CompositeAnimation& compositeAnimation = ensureCompositeAnimation(element);
if (compositeAnimation.pauseTransitionAtTime(cssPropertyID(property), t)) {
- renderer->element()->invalidateStyleAndLayerComposition();
+ element.invalidateStyleAndLayerComposition();
startUpdateStyleIfNeededDispatcher();
return true;
}
@@ -467,24 +462,24 @@
startTimeResponse(time);
}
-std::unique_ptr<RenderStyle> CSSAnimationControllerPrivate::getAnimatedStyleForRenderer(RenderElement& renderer)
+std::unique_ptr<RenderStyle> CSSAnimationControllerPrivate::animatedStyleForElement(Element& element)
{
- auto* animation = m_compositeAnimations.get(&renderer);
+ auto* animation = m_compositeAnimations.get(&element);
if (!animation)
- return RenderStyle::clonePtr(renderer.style());
+ return nullptr;
AnimationPrivateUpdateBlock animationUpdateBlock(*this);
- std::unique_ptr<RenderStyle> animatingStyle = animation->getAnimatedStyle();
+ auto animatingStyle = animation->getAnimatedStyle();
if (!animatingStyle)
- animatingStyle = RenderStyle::clonePtr(renderer.style());
+ return nullptr;
return animatingStyle;
}
-bool CSSAnimationControllerPrivate::computeExtentOfAnimation(RenderElement& renderer, LayoutRect& bounds) const
+bool CSSAnimationControllerPrivate::computeExtentOfAnimation(Element& element, LayoutRect& bounds) const
{
- auto* animation = m_compositeAnimations.get(&renderer);
+ auto* animation = m_compositeAnimations.get(&element);
if (!animation)
return true;
@@ -631,29 +626,29 @@
{
}
-void CSSAnimationController::cancelAnimations(RenderElement& renderer)
+void CSSAnimationController::cancelAnimations(Element& element)
{
- if (!m_data->clear(renderer))
+ if (!m_data->clear(element))
return;
- Element* element = renderer.element();
- if (!element || element->document().renderTreeBeingDestroyed())
+ if (element.document().renderTreeBeingDestroyed())
return;
- ASSERT(element->document().pageCacheState() == Document::NotInPageCache);
- element->invalidateStyleAndLayerComposition();
+ ASSERT(element.document().pageCacheState() == Document::NotInPageCache);
+ element.invalidateStyleAndLayerComposition();
}
-bool CSSAnimationController::updateAnimations(RenderElement& renderer, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle)
+bool CSSAnimationController::updateAnimations(Element& element, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle)
{
- auto* oldStyle = renderer.hasInitializedStyle() ? &renderer.style() : nullptr;
+ auto* renderer = element.renderer();
+ auto* oldStyle = (renderer && renderer->hasInitializedStyle()) ? &renderer->style() : nullptr;
if ((!oldStyle || (!oldStyle->animations() && !oldStyle->transitions())) && (!newStyle.animations() && !newStyle.transitions()))
return false;
- if (renderer.document().pageCacheState() != Document::NotInPageCache)
+ if (element.document().pageCacheState() != Document::NotInPageCache)
return false;
// Don't run transitions when printing.
- if (renderer.view().printing())
+ if (element.document().renderView()->printing())
return false;
// Fetch our current set of implicit animations from a hashtable. We then compare them
@@ -661,17 +656,14 @@
// have changed, we reset the animation. We then do a blend to get new values and we return
// a new style.
- // We don't support anonymous pseudo elements like :first-line or :first-letter.
- ASSERT(renderer.element());
+ CompositeAnimation& compositeAnimation = m_data->ensureCompositeAnimation(element);
+ bool animationStateChanged = compositeAnimation.animate(element, oldStyle, newStyle, animatedStyle);
- CompositeAnimation& rendererAnimations = m_data->ensureCompositeAnimation(renderer);
- bool animationStateChanged = rendererAnimations.animate(renderer, oldStyle, newStyle, animatedStyle);
-
- if (renderer.parent() || newStyle.animations() || (oldStyle && oldStyle->animations())) {
- auto& frameView = renderer.view().frameView();
- if (rendererAnimations.hasAnimationThatDependsOnLayout())
+ if ((renderer && renderer->parent()) || newStyle.animations() || (oldStyle && oldStyle->animations())) {
+ auto& frameView = *element.document().view();
+ if (compositeAnimation.hasAnimationThatDependsOnLayout())
m_data->setRequiresLayout();
- m_data->updateAnimationTimerForRenderer(renderer);
+ m_data->updateAnimationTimerForElement(element);
frameView.scheduleAnimation();
}
@@ -678,20 +670,27 @@
return animationStateChanged;
}
-std::unique_ptr<RenderStyle> CSSAnimationController::getAnimatedStyleForRenderer(RenderElement& renderer)
+std::unique_ptr<RenderStyle> CSSAnimationController::animatedStyleForRenderer(RenderElement& renderer)
{
- if (!renderer.style().hasAnimationsOrTransitions())
- return RenderStyle::clonePtr(renderer.style());
+ std::unique_ptr<RenderStyle> result;
- return m_data->getAnimatedStyleForRenderer(renderer);
+ if (renderer.style().hasAnimationsOrTransitions() && renderer.element())
+ result = m_data->animatedStyleForElement(*renderer.element());
+
+ if (!result)
+ result = RenderStyle::clonePtr(renderer.style());
+
+ return result;
}
bool CSSAnimationController::computeExtentOfAnimation(RenderElement& renderer, LayoutRect& bounds) const
{
+ if (!renderer.element())
+ return true;
if (!renderer.style().hasAnimationsOrTransitions())
return true;
- return m_data->computeExtentOfAnimation(renderer, bounds);
+ return m_data->computeExtentOfAnimation(*renderer.element(), bounds);
}
void CSSAnimationController::notifyAnimationStarted(RenderElement& renderer, double startTime)
@@ -703,10 +702,10 @@
m_data->receivedStartTimeResponse(startTime);
}
-bool CSSAnimationController::pauseAnimationAtTime(RenderElement* renderer, const AtomicString& name, double t)
+bool CSSAnimationController::pauseAnimationAtTime(Element& element, const AtomicString& name, double t)
{
AnimationUpdateBlock animationUpdateBlock(this);
- return m_data->pauseAnimationAtTime(renderer, name, t);
+ return m_data->pauseAnimationAtTime(element, name, t);
}
unsigned CSSAnimationController::numberOfActiveAnimations(Document* document) const
@@ -714,10 +713,10 @@
return m_data->numberOfActiveAnimations(document);
}
-bool CSSAnimationController::pauseTransitionAtTime(RenderElement* renderer, const String& property, double t)
+bool CSSAnimationController::pauseTransitionAtTime(Element& element, const String& property, double t)
{
AnimationUpdateBlock animationUpdateBlock(this);
- return m_data->pauseTransitionAtTime(renderer, property, t);
+ return m_data->pauseTransitionAtTime(element, property, t);
}
bool CSSAnimationController::isRunningAnimationOnRenderer(RenderElement& renderer, CSSPropertyID property, AnimationBase::RunningState runningState) const
Modified: trunk/Source/WebCore/page/animation/CSSAnimationController.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/CSSAnimationController.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/CSSAnimationController.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -48,9 +48,9 @@
explicit CSSAnimationController(Frame&);
~CSSAnimationController();
- void cancelAnimations(RenderElement&);
- bool updateAnimations(RenderElement&, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle);
- std::unique_ptr<RenderStyle> getAnimatedStyleForRenderer(RenderElement&);
+ void cancelAnimations(Element&);
+ bool updateAnimations(Element&, const RenderStyle& newStyle, std::unique_ptr<RenderStyle>& animatedStyle);
+ std::unique_ptr<RenderStyle> animatedStyleForRenderer(RenderElement&);
// If possible, compute the visual extent of any transform animation on the given renderer
// using the given rect, returning the result in the rect. Return false if there is some
@@ -60,8 +60,8 @@
// This is called when an accelerated animation or transition has actually started to animate.
void notifyAnimationStarted(RenderElement&, double startTime);
- WEBCORE_EXPORT bool pauseAnimationAtTime(RenderElement*, const AtomicString& name, double t); // To be used only for testing
- WEBCORE_EXPORT bool pauseTransitionAtTime(RenderElement*, const String& property, double t); // To be used only for testing
+ WEBCORE_EXPORT bool pauseAnimationAtTime(Element&, const AtomicString& name, double t); // To be used only for testing
+ WEBCORE_EXPORT bool pauseTransitionAtTime(Element&, const String& property, double t); // To be used only for testing
WEBCORE_EXPORT unsigned numberOfActiveAnimations(Document*) const; // To be used only for testing
bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const;
Modified: trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/CSSAnimationControllerPrivate.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -52,8 +52,8 @@
std::optional<Seconds> updateAnimations(SetChanged callSetChanged = DoNotCallSetChanged);
void updateAnimationTimer(SetChanged callSetChanged = DoNotCallSetChanged);
- CompositeAnimation& ensureCompositeAnimation(RenderElement&);
- bool clear(RenderElement&);
+ CompositeAnimation& ensureCompositeAnimation(Element&);
+ bool clear(Element&);
void updateStyleIfNeededDispatcherFired();
void startUpdateStyleIfNeededDispatcher();
@@ -79,13 +79,13 @@
bool isRunningAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const;
bool isRunningAcceleratedAnimationOnRenderer(RenderElement&, CSSPropertyID, AnimationBase::RunningState) const;
- bool pauseAnimationAtTime(RenderElement*, const AtomicString& name, double t);
- bool pauseTransitionAtTime(RenderElement*, const String& property, double t);
+ bool pauseAnimationAtTime(Element&, const AtomicString& name, double t);
+ bool pauseTransitionAtTime(Element&, const String& property, double t);
unsigned numberOfActiveAnimations(Document*) const;
- std::unique_ptr<RenderStyle> getAnimatedStyleForRenderer(RenderElement&);
+ std::unique_ptr<RenderStyle> animatedStyleForElement(Element&);
- bool computeExtentOfAnimation(RenderElement&, LayoutRect&) const;
+ bool computeExtentOfAnimation(Element&, LayoutRect&) const;
double beginAnimationUpdateTime();
@@ -101,7 +101,7 @@
void animationWillBeRemoved(AnimationBase*);
- void updateAnimationTimerForRenderer(RenderElement&);
+ void updateAnimationTimerForElement(Element&);
bool allowsNewAnimationsWhileSuspended() const { return m_allowsNewAnimationsWhileSuspended; }
void setAllowsNewAnimationsWhileSuspended(bool);
@@ -124,7 +124,7 @@
void fireEventsAndUpdateStyle();
void startTimeResponse(double t);
- HashMap<RenderElement*, RefPtr<CompositeAnimation>> m_compositeAnimations;
+ HashMap<Element*, RefPtr<CompositeAnimation>> m_compositeAnimations;
Timer m_animationTimer;
Timer m_updateStyleIfNeededDispatcher;
Frame& m_frame;
Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.cpp (221979 => 221980)
--- trunk/Source/WebCore/page/animation/CompositeAnimation.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -53,12 +53,12 @@
// Toss the refs to all animations, but make sure we remove them from
// any waiting lists first.
- clearRenderer();
+ clearElement();
m_transitions.clear();
m_keyframeAnimations.clear();
}
-void CompositeAnimation::clearRenderer()
+void CompositeAnimation::clearElement()
{
if (!m_transitions.isEmpty()) {
// Clear the renderers from all running animations, in case we are in the middle of
@@ -77,10 +77,10 @@
}
}
-void CompositeAnimation::updateTransitions(RenderElement* renderer, const RenderStyle* currentStyle, const RenderStyle* targetStyle)
+void CompositeAnimation::updateTransitions(Element& element, const RenderStyle* currentStyle, const RenderStyle& targetStyle)
{
// If currentStyle is null or there are no old or new transitions, just skip it
- if (!currentStyle || (!targetStyle->transitions() && m_transitions.isEmpty()))
+ if (!currentStyle || (!targetStyle.transitions() && m_transitions.isEmpty()))
return;
// Mark all existing transitions as no longer active. We will mark the still active ones
@@ -91,9 +91,9 @@
std::unique_ptr<RenderStyle> modifiedCurrentStyle;
// Check to see if we need to update the active transitions
- if (targetStyle->transitions()) {
- for (size_t i = 0; i < targetStyle->transitions()->size(); ++i) {
- auto& animation = targetStyle->transitions()->animation(i);
+ if (targetStyle.transitions()) {
+ for (size_t i = 0; i < targetStyle.transitions()->size(); ++i) {
+ auto& animation = targetStyle.transitions()->animation(i);
bool isActiveTransition = animation.duration() || animation.delay() > 0;
Animation::AnimationMode mode = animation.animationMode();
@@ -143,7 +143,7 @@
// you have both an explicit transition-property and 'all' in the same
// list. In this case, the latter one overrides the earlier one, so we
// behave as though this is a running animation being replaced.
- if (!implAnim->isTargetPropertyEqual(prop, targetStyle)) {
+ if (!implAnim->isTargetPropertyEqual(prop, &targetStyle)) {
// For accelerated animations we need to return a new RenderStyle with the _current_ value
// of the property, so that restarted transitions use the correct starting point.
if (CSSPropertyAnimation::animationOfPropertyIsAccelerated(prop) && implAnim->isAccelerated()) {
@@ -159,7 +159,7 @@
}
} else {
// We need to start a transition if it is active and the properties don't match
- equal = !isActiveTransition || CSSPropertyAnimation::propertiesEqual(prop, fromStyle, targetStyle);
+ equal = !isActiveTransition || CSSPropertyAnimation::propertiesEqual(prop, fromStyle, &targetStyle);
}
// We can be in this loop with an inactive transition (!isActiveTransition). We need
@@ -168,11 +168,11 @@
// <https://bugs.webkit.org/show_bug.cgi?id=24787>
if (!equal && isActiveTransition) {
// Add the new transition
- auto implicitAnimation = ImplicitAnimation::create(animation, prop, renderer, this, modifiedCurrentStyle ? modifiedCurrentStyle.get() : fromStyle);
+ auto implicitAnimation = ImplicitAnimation::create(animation, prop, element, *this, modifiedCurrentStyle ? *modifiedCurrentStyle : *fromStyle);
if (m_suspended && implicitAnimation->hasStyle())
implicitAnimation->updatePlayState(AnimPlayStatePaused);
- LOG(Animations, "Created ImplicitAnimation %p on renderer %p for property %s duration %.2f delay %.2f", implicitAnimation.ptr(), renderer, getPropertyName(prop), animation.duration(), animation.delay());
+ LOG(Animations, "Created ImplicitAnimation %p on element %p for property %s duration %.2f delay %.2f", implicitAnimation.ptr(), &element, getPropertyName(prop), animation.duration(), animation.delay());
m_transitions.set(prop, WTFMove(implicitAnimation));
}
@@ -189,7 +189,7 @@
if (!transition->active()) {
animationController().animationWillBeRemoved(transition.get());
toBeRemoved.append(transition->animatingProperty());
- LOG(Animations, "Removing ImplicitAnimation %p from renderer %p for property %s", transition.get(), renderer, getPropertyName(transition->animatingProperty()));
+ LOG(Animations, "Removing ImplicitAnimation %p from element %p for property %s", transition.get(), &element, getPropertyName(transition->animatingProperty()));
}
}
@@ -198,15 +198,15 @@
m_transitions.remove(propertyToRemove);
}
-void CompositeAnimation::updateKeyframeAnimations(RenderElement* renderer, const RenderStyle* currentStyle, const RenderStyle* targetStyle)
+void CompositeAnimation::updateKeyframeAnimations(Element& element, const RenderStyle* currentStyle, const RenderStyle& targetStyle)
{
// Nothing to do if we don't have any animations, and didn't have any before
- if (m_keyframeAnimations.isEmpty() && !targetStyle->hasAnimations())
+ if (m_keyframeAnimations.isEmpty() && !targetStyle.hasAnimations())
return;
m_keyframeAnimations.checkConsistency();
- if (currentStyle && currentStyle->hasAnimations() && targetStyle->hasAnimations() && *(currentStyle->animations()) == *(targetStyle->animations()))
+ if (currentStyle && currentStyle->hasAnimations() && targetStyle.hasAnimations() && *(currentStyle->animations()) == *(targetStyle.animations()))
return;
#if ENABLE(CSS_ANIMATIONS_LEVEL_2)
@@ -221,10 +221,10 @@
static NeverDestroyed<const AtomicString> none("none", AtomicString::ConstructFromLiteral);
// Now mark any still active animations as active and add any new animations.
- if (targetStyle->animations()) {
- int numAnims = targetStyle->animations()->size();
+ if (targetStyle.animations()) {
+ int numAnims = targetStyle.animations()->size();
for (int i = 0; i < numAnims; ++i) {
- auto& animation = targetStyle->animations()->animation(i);
+ auto& animation = targetStyle.animations()->animation(i);
AtomicString animationName(animation.name());
if (!animation.isValidAnimation())
@@ -249,8 +249,8 @@
// Set the saved animation to this new one, just in case the play state has changed.
keyframeAnim->setAnimation(animation);
} else if ((animation.duration() || animation.delay()) && animation.iterationCount() && animationName != none) {
- keyframeAnim = KeyframeAnimation::create(animation, renderer, this, targetStyle);
- LOG(Animations, "Creating KeyframeAnimation %p on renderer %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f", keyframeAnim.get(), renderer, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
+ keyframeAnim = KeyframeAnimation::create(animation, element, *this, targetStyle);
+ LOG(Animations, "Creating KeyframeAnimation %p on element %p with keyframes %s, duration %.2f, delay %.2f, iterations %.2f", keyframeAnim.get(), &element, animation.name().utf8().data(), animation.duration(), animation.delay(), animation.iterationCount());
if (m_suspended) {
keyframeAnim->updatePlayState(AnimPlayStatePaused);
@@ -280,7 +280,7 @@
if (!newAnimations.contains(animation->name().impl())) {
animationController().animationWillBeRemoved(animation.get());
animation->clear();
- LOG(Animations, "Removing KeyframeAnimation %p from renderer %p", animation.get(), renderer);
+ LOG(Animations, "Removing KeyframeAnimation %p from element %p", animation.get(), &element);
}
}
@@ -287,11 +287,11 @@
std::swap(newAnimations, m_keyframeAnimations);
}
-bool CompositeAnimation::animate(RenderElement& renderer, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle)
+bool CompositeAnimation::animate(Element& element, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle)
{
// We don't do any transitions if we don't have a currentStyle (on startup).
- updateTransitions(&renderer, currentStyle, &targetStyle);
- updateKeyframeAnimations(&renderer, currentStyle, &targetStyle);
+ updateTransitions(element, currentStyle, targetStyle);
+ updateKeyframeAnimations(element, currentStyle, targetStyle);
m_keyframeAnimations.checkConsistency();
bool animationStateChanged = false;
@@ -303,7 +303,7 @@
bool checkForStackingContext = false;
for (auto& transition : m_transitions.values()) {
bool didBlendStyle = false;
- if (transition->animate(*this, &renderer, currentStyle, targetStyle, blendedStyle, didBlendStyle))
+ if (transition->animate(*this, targetStyle, blendedStyle, didBlendStyle))
animationStateChanged = true;
if (didBlendStyle)
@@ -333,7 +333,7 @@
RefPtr<KeyframeAnimation> keyframeAnim = m_keyframeAnimations.get(name);
if (keyframeAnim) {
bool didBlendStyle = false;
- if (keyframeAnim->animate(*this, &renderer, currentStyle, targetStyle, blendedStyle, didBlendStyle))
+ if (keyframeAnim->animate(*this, targetStyle, blendedStyle, didBlendStyle))
animationStateChanged = true;
forceStackingContext |= didBlendStyle && keyframeAnim->triggersStackingContext();
Modified: trunk/Source/WebCore/page/animation/CompositeAnimation.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/CompositeAnimation.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/CompositeAnimation.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -52,9 +52,9 @@
~CompositeAnimation();
- void clearRenderer();
+ void clearElement();
- bool animate(RenderElement&, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle);
+ bool animate(Element&, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& blendedStyle);
std::unique_ptr<RenderStyle> getAnimatedStyle() const;
bool computeExtentOfTransformAnimation(LayoutRect&) const;
@@ -88,8 +88,8 @@
private:
CompositeAnimation(CSSAnimationControllerPrivate&);
- void updateTransitions(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle);
- void updateKeyframeAnimations(RenderElement*, const RenderStyle* currentStyle, const RenderStyle* targetStyle);
+ void updateTransitions(Element&, const RenderStyle* currentStyle, const RenderStyle& targetStyle);
+ void updateKeyframeAnimations(Element&, const RenderStyle* currentStyle, const RenderStyle& targetStyle);
typedef HashMap<int, RefPtr<ImplicitAnimation>> CSSPropertyTransitionsMap;
typedef HashMap<AtomicStringImpl*, RefPtr<KeyframeAnimation>> AnimationNameMap;
Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp (221979 => 221980)
--- trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -40,9 +40,9 @@
namespace WebCore {
-ImplicitAnimation::ImplicitAnimation(const Animation& transition, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compAnim, const RenderStyle* fromStyle)
- : AnimationBase(transition, renderer, compAnim)
- , m_fromStyle(RenderStyle::clonePtr(*fromStyle))
+ImplicitAnimation::ImplicitAnimation(const Animation& transition, CSSPropertyID animatingProperty, Element& element, CompositeAnimation& compositeAnimation, const RenderStyle& fromStyle)
+ : AnimationBase(transition, element, compositeAnimation)
+ , m_fromStyle(RenderStyle::clonePtr(fromStyle))
, m_transitionProperty(transition.property())
, m_animatingProperty(animatingProperty)
{
@@ -61,7 +61,7 @@
return m_element->document().hasListenerType(inListenerType);
}
-bool ImplicitAnimation::animate(CompositeAnimation& compositeAnimation, RenderElement*, const RenderStyle*, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle)
+bool ImplicitAnimation::animate(CompositeAnimation& compositeAnimation, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle)
{
// If we get this far and the animation is done, it means we are cleaning up a just finished animation.
// So just return. Everything is already all cleaned up.
Modified: trunk/Source/WebCore/page/animation/ImplicitAnimation.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/ImplicitAnimation.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/ImplicitAnimation.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -40,9 +40,9 @@
// for a single RenderElement.
class ImplicitAnimation : public AnimationBase {
public:
- static Ref<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* fromStyle)
+ static Ref<ImplicitAnimation> create(const Animation& animation, CSSPropertyID animatingProperty, Element& element, CompositeAnimation& compositeAnimation, const RenderStyle& fromStyle)
{
- return adoptRef(*new ImplicitAnimation(animation, animatingProperty, renderer, compositeAnimation, fromStyle));
+ return adoptRef(*new ImplicitAnimation(animation, animatingProperty, element, compositeAnimation, fromStyle));
};
CSSPropertyID transitionProperty() const { return m_transitionProperty; }
@@ -53,7 +53,7 @@
void pauseAnimation(double timeOffset) override;
void endAnimation() override;
- bool animate(CompositeAnimation&, RenderElement*, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle) override;
+ bool animate(CompositeAnimation&, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle);
void getAnimatedStyle(std::unique_ptr<RenderStyle>& animatedStyle) override;
void reset(const RenderStyle& to, CompositeAnimation&);
@@ -86,7 +86,7 @@
#endif
private:
- ImplicitAnimation(const Animation&, CSSPropertyID, RenderElement*, CompositeAnimation*, const RenderStyle*);
+ ImplicitAnimation(const Animation&, CSSPropertyID, Element&, CompositeAnimation&, const RenderStyle&);
virtual ~ImplicitAnimation();
// The two styles that we are blending.
Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp (221979 => 221980)
--- trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -45,10 +45,10 @@
namespace WebCore {
-KeyframeAnimation::KeyframeAnimation(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* unanimatedStyle)
- : AnimationBase(animation, renderer, compositeAnimation)
+KeyframeAnimation::KeyframeAnimation(const Animation& animation, Element& element, CompositeAnimation& compositeAnimation, const RenderStyle& unanimatedStyle)
+ : AnimationBase(animation, element, compositeAnimation)
, m_keyframes(animation.name())
- , m_unanimatedStyle(RenderStyle::clonePtr(*unanimatedStyle))
+ , m_unanimatedStyle(RenderStyle::clonePtr(unanimatedStyle))
{
resolveKeyframeStyles();
@@ -154,7 +154,7 @@
prog = progress(scale, offset, prevKeyframe.timingFunction(name()));
}
-bool KeyframeAnimation::animate(CompositeAnimation& compositeAnimation, RenderElement*, const RenderStyle*, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle)
+bool KeyframeAnimation::animate(CompositeAnimation& compositeAnimation, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle)
{
// Fire the start timeout if needed
fireAnimationEventsIfNeeded();
Modified: trunk/Source/WebCore/page/animation/KeyframeAnimation.h (221979 => 221980)
--- trunk/Source/WebCore/page/animation/KeyframeAnimation.h 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/page/animation/KeyframeAnimation.h 2017-09-13 18:20:12 UTC (rev 221980)
@@ -39,12 +39,12 @@
// A KeyframeAnimation tracks the state of an explicit animation for a single RenderElement.
class KeyframeAnimation final : public AnimationBase {
public:
- static Ref<KeyframeAnimation> create(const Animation& animation, RenderElement* renderer, CompositeAnimation* compositeAnimation, const RenderStyle* unanimatedStyle)
+ static Ref<KeyframeAnimation> create(const Animation& animation, Element& element, CompositeAnimation& compositeAnimation, const RenderStyle& unanimatedStyle)
{
- return adoptRef(*new KeyframeAnimation(animation, renderer, compositeAnimation, unanimatedStyle));
+ return adoptRef(*new KeyframeAnimation(animation, element, compositeAnimation, unanimatedStyle));
}
- bool animate(CompositeAnimation&, RenderElement*, const RenderStyle* currentStyle, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle) override;
+ bool animate(CompositeAnimation&, const RenderStyle& targetStyle, std::unique_ptr<RenderStyle>& animatedStyle, bool& didBlendStyle);
void getAnimatedStyle(std::unique_ptr<RenderStyle>&) override;
bool computeExtentOfTransformAnimation(LayoutRect&) const override;
@@ -93,7 +93,7 @@
#endif
private:
- KeyframeAnimation(const Animation&, RenderElement*, CompositeAnimation*, const RenderStyle* unanimatedStyle);
+ KeyframeAnimation(const Animation&, Element&, CompositeAnimation&, const RenderStyle& unanimatedStyle);
virtual ~KeyframeAnimation();
// Get the styles for the given property surrounding the current animation time and the progress between them.
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (221979 => 221980)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -1104,7 +1104,8 @@
if (m_style.hasFixedBackgroundImage() && !settings().fixedBackgroundsPaintRelativeToDocument())
view().frameView().removeSlowRepaintObject(this);
- animation().cancelAnimations(*this);
+ if (element())
+ animation().cancelAnimations(*element());
destroyLeftoverChildren();
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (221979 => 221980)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -1005,7 +1005,7 @@
if (renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused)) {
TransformationMatrix currTransform;
FloatRect pixelSnappedBorderRect = snapRectToDevicePixels(box->borderBoxRect(), box->document().deviceScaleFactor());
- std::unique_ptr<RenderStyle> style = renderer().animation().getAnimatedStyleForRenderer(renderer());
+ std::unique_ptr<RenderStyle> style = renderer().animation().animatedStyleForRenderer(renderer());
style->applyTransform(currTransform, pixelSnappedBorderRect, applyOrigin);
makeMatrixRenderable(currTransform, canRender3DTransforms());
return currTransform;
Modified: trunk/Source/WebCore/style/RenderTreeUpdater.cpp (221979 => 221980)
--- trunk/Source/WebCore/style/RenderTreeUpdater.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/style/RenderTreeUpdater.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -398,7 +398,7 @@
auto& initialStyle = newRenderer->style();
std::unique_ptr<RenderStyle> animatedStyle;
- newRenderer->animation().updateAnimations(*newRenderer, initialStyle, animatedStyle);
+ newRenderer->animation().updateAnimations(element, initialStyle, animatedStyle);
if (animatedStyle) {
newRenderer->setStyleInternal(WTFMove(*animatedStyle));
newRenderer->setHasInitialAnimatedStyle(true);
Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (221979 => 221980)
--- trunk/Source/WebCore/style/StyleTreeResolver.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -266,7 +266,7 @@
}
std::unique_ptr<RenderStyle> animatedStyle;
- if (element.document().frame()->animation().updateAnimations(*renderer, *newStyle, animatedStyle))
+ if (element.document().frame()->animation().updateAnimations(element, *newStyle, animatedStyle))
recompositeLayer = true;
if (animatedStyle) {
Modified: trunk/Source/WebCore/testing/Internals.cpp (221979 => 221980)
--- trunk/Source/WebCore/testing/Internals.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebCore/testing/Internals.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -907,7 +907,7 @@
{
if (pauseTime < 0)
return Exception { InvalidAccessError };
- return frame()->animation().pauseAnimationAtTime(element.renderer(), AtomicString(animationName), pauseTime);
+ return frame()->animation().pauseAnimationAtTime(element, AtomicString(animationName), pauseTime);
}
ExceptionOr<bool> Internals::pauseAnimationAtTimeOnPseudoElement(const String& animationName, double pauseTime, Element& element, const String& pseudoId)
@@ -922,7 +922,7 @@
if (!pseudoElement)
return Exception { InvalidAccessError };
- return frame()->animation().pauseAnimationAtTime(pseudoElement->renderer(), AtomicString(animationName), pauseTime);
+ return frame()->animation().pauseAnimationAtTime(*pseudoElement, AtomicString(animationName), pauseTime);
}
ExceptionOr<bool> Internals::pauseTransitionAtTimeOnElement(const String& propertyName, double pauseTime, Element& element)
@@ -929,7 +929,7 @@
{
if (pauseTime < 0)
return Exception { InvalidAccessError };
- return frame()->animation().pauseTransitionAtTime(element.renderer(), propertyName, pauseTime);
+ return frame()->animation().pauseTransitionAtTime(element, propertyName, pauseTime);
}
ExceptionOr<bool> Internals::pauseTransitionAtTimeOnPseudoElement(const String& property, double pauseTime, Element& element, const String& pseudoId)
@@ -944,7 +944,7 @@
if (!pseudoElement)
return Exception { InvalidAccessError };
- return frame()->animation().pauseTransitionAtTime(pseudoElement->renderer(), property, pauseTime);
+ return frame()->animation().pauseTransitionAtTime(*pseudoElement, property, pauseTime);
}
ExceptionOr<String> Internals::elementRenderTreeAsText(Element& element)
Modified: trunk/Source/WebKitLegacy/win/WebFrame.cpp (221979 => 221980)
--- trunk/Source/WebKitLegacy/win/WebFrame.cpp 2017-09-13 18:15:23 UTC (rev 221979)
+++ trunk/Source/WebKitLegacy/win/WebFrame.cpp 2017-09-13 18:20:12 UTC (rev 221980)
@@ -1171,7 +1171,7 @@
if (!domNode)
return E_FAIL;
- *animationWasRunning = frame->animation().pauseAnimationAtTime(downcast<RenderElement>(domNode->node()->renderer()), String(animationName, SysStringLen(animationName)), secondsFromNow);
+ *animationWasRunning = frame->animation().pauseAnimationAtTime(downcast<Element>(*domNode->node()), String(animationName, SysStringLen(animationName)), secondsFromNow);
return S_OK;
}
@@ -1190,7 +1190,7 @@
if (!domNode)
return E_FAIL;
- *transitionWasRunning = frame->animation().pauseTransitionAtTime(downcast<RenderElement>(domNode->node()->renderer()), String(propertyName, SysStringLen(propertyName)), secondsFromNow);
+ *transitionWasRunning = frame->animation().pauseTransitionAtTime(downcast<Element>(*domNode->node()), String(propertyName, SysStringLen(propertyName)), secondsFromNow);
return S_OK;
}