Title: [177269] trunk/Source/WebCore
Revision
177269
Author
[email protected]
Date
2014-12-14 18:50:22 -0800 (Sun, 14 Dec 2014)

Log Message

Unreviewed, rolling out r177238 and r177244.
https://bugs.webkit.org/show_bug.cgi?id=139632

Introduced memory corruption (Requested by ap on #webkit).

Reverted changesets:

"REGRESSION (r168217): Images are cropped out during animation
at jetblue.com"
https://bugs.webkit.org/show_bug.cgi?id=136410
http://trac.webkit.org/changeset/177238

https://bugs.webkit.org/show_bug.cgi?id=139596
http://trac.webkit.org/changeset/177244

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (177268 => 177269)


--- trunk/Source/WebCore/ChangeLog	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/ChangeLog	2014-12-15 02:50:22 UTC (rev 177269)
@@ -1,5 +1,22 @@
 2014-12-14  Commit Queue  <[email protected]>
 
+        Unreviewed, rolling out r177238 and r177244.
+        https://bugs.webkit.org/show_bug.cgi?id=139632
+
+        Introduced memory corruption (Requested by ap on #webkit).
+
+        Reverted changesets:
+
+        "REGRESSION (r168217): Images are cropped out during animation
+        at jetblue.com"
+        https://bugs.webkit.org/show_bug.cgi?id=136410
+        http://trac.webkit.org/changeset/177238
+
+        https://bugs.webkit.org/show_bug.cgi?id=139596
+        http://trac.webkit.org/changeset/177244
+
+2014-12-14  Commit Queue  <[email protected]>
+
         Unreviewed, rolling out r177223 and r177226.
         https://bugs.webkit.org/show_bug.cgi?id=139631
 

Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (177268 => 177269)


--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp	2014-12-15 02:50:22 UTC (rev 177269)
@@ -1705,6 +1705,7 @@
     RenderObject* renderer = styledNode->renderer();
 
     if (renderer && renderer->isComposited() && AnimationController::supportsAcceleratedAnimationOfProperty(propertyID)) {
+        AnimationUpdateBlock animationUpdateBlock(&renderer->animation());
         RefPtr<RenderStyle> style = renderer->animation().getAnimatedStyleForRenderer(downcast<RenderElement>(*renderer));
         if (pseudoElementSpecifier && !styledNode->isPseudoElement()) {
             // FIXME: This cached pseudo style will only exist if the animation has been run at least once.

Modified: trunk/Source/WebCore/dom/Document.cpp (177268 => 177269)


--- trunk/Source/WebCore/dom/Document.cpp	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/dom/Document.cpp	2014-12-15 02:50:22 UTC (rev 177269)
@@ -1765,7 +1765,6 @@
         return; // Guard against re-entrancy. -dwh
 
     RenderView::RepaintRegionAccumulator repaintRegionAccumulator(renderView());
-    AnimationUpdateBlock animationUpdateBlock(&m_frame->animation());
 
     // FIXME: We should update style on our ancestor chain before proceeding (especially for seamless),
     // however doing so currently causes several tests to crash, as Frame::setDocument calls Document::attach
@@ -1838,6 +1837,7 @@
     if ((!m_pendingStyleRecalcShouldForce && !childNeedsStyleRecalc()) || inPageCache())
         return;
 
+    AnimationUpdateBlock animationUpdateBlock(m_frame ? &m_frame->animation() : nullptr);
     recalcStyle(Style::NoChange);
 }
 

Modified: trunk/Source/WebCore/page/FrameView.cpp (177268 => 177269)


--- trunk/Source/WebCore/page/FrameView.cpp	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/page/FrameView.cpp	2014-12-15 02:50:22 UTC (rev 177269)
@@ -1153,8 +1153,7 @@
         return;
 
     InspectorInstrumentationCookie cookie = InspectorInstrumentation::willLayout(&frame());
-    AnimationUpdateBlock animationUpdateBlock(&frame().animation());
-    
+
     if (!allowSubtree && m_layoutRoot) {
         m_layoutRoot->markContainingBlocksForLayout(false);
         m_layoutRoot = 0;
@@ -3939,8 +3938,6 @@
     // region but then become included later by the second frame adding rects to the dirty region
     // when it lays out.
 
-    AnimationUpdateBlock animationUpdateBlock(&frame().animation());
-
     frame().document()->updateStyleIfNeeded();
 
     if (needsLayout())

Modified: trunk/Source/WebCore/page/animation/AnimationController.cpp (177268 => 177269)


--- trunk/Source/WebCore/page/animation/AnimationController.cpp	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/page/animation/AnimationController.cpp	2014-12-15 02:50:22 UTC (rev 177269)
@@ -51,22 +51,6 @@
 static const double cAnimationTimerDelay = 0.025;
 static const double cBeginAnimationUpdateTimeNotSet = -1;
 
-class AnimationPrivateUpdateBlock {
-public:
-    AnimationPrivateUpdateBlock(AnimationControllerPrivate& animationController)
-        : m_animationController(animationController)
-    {
-        m_animationController.beginAnimationUpdate();
-    }
-    
-    ~AnimationPrivateUpdateBlock()
-    {
-        m_animationController.endAnimationUpdate();
-    }
-    
-    AnimationControllerPrivate& m_animationController;
-};
-
 AnimationControllerPrivate::AnimationControllerPrivate(Frame& frame)
     : m_animationTimer(*this, &AnimationControllerPrivate::animationTimerFired)
     , m_updateStyleIfNeededDispatcher(*this, &AnimationControllerPrivate::updateStyleIfNeededDispatcherFired)
@@ -74,7 +58,6 @@
     , m_beginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet)
     , m_animationsWaitingForStyle()
     , m_animationsWaitingForStartTimeResponse()
-    , m_beginAnimationUpdateCount(0)
     , m_waitingForAsyncStartNotification(false)
     , m_isSuspended(false)
     , m_allowsNewAnimationsWhileSuspended(false)
@@ -247,7 +230,7 @@
 {
     // Make sure animationUpdateTime is updated, so that it is current even if no
     // styleChange has happened (e.g. accelerated animations)
-    AnimationPrivateUpdateBlock updateBlock(*this);
+    setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
 
     // When the timer fires, all we do is call setChanged on all DOM nodes with running animations and then do an immediate
     // updateStyleIfNeeded.  It will then call back to us with new information.
@@ -304,7 +287,7 @@
 
 void AnimationControllerPrivate::suspendAnimationsForDocument(Document* document)
 {
-    AnimationPrivateUpdateBlock updateBlock(*this);
+    setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
 
     for (auto it = m_compositeAnimations.begin(), end = m_compositeAnimations.end(); it != end; ++it) {
         if (&it->key->document() == document)
@@ -316,7 +299,7 @@
 
 void AnimationControllerPrivate::resumeAnimationsForDocument(Document* document)
 {
-    AnimationPrivateUpdateBlock updateBlock(*this);
+    setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
 
     for (auto it = m_compositeAnimations.begin(), end = m_compositeAnimations.end(); it != end; ++it) {
         if (&it->key->document() == document)
@@ -369,29 +352,16 @@
 
 double AnimationControllerPrivate::beginAnimationUpdateTime()
 {
-    ASSERT(m_beginAnimationUpdateCount);
     if (m_beginAnimationUpdateTime == cBeginAnimationUpdateTimeNotSet)
         m_beginAnimationUpdateTime = monotonicallyIncreasingTime();
-
     return m_beginAnimationUpdateTime;
 }
 
-void AnimationControllerPrivate::beginAnimationUpdate()
-{
-    if (!m_beginAnimationUpdateCount)
-        setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
-    ++m_beginAnimationUpdateCount;
-}
-
 void AnimationControllerPrivate::endAnimationUpdate()
 {
-    ASSERT(m_beginAnimationUpdateCount > 0);
-    if (m_beginAnimationUpdateCount == 1) {
-        styleAvailable();
-        if (!m_waitingForAsyncStartNotification)
-            startTimeResponse(beginAnimationUpdateTime());
-    }
-    --m_beginAnimationUpdateCount;
+    styleAvailable();
+    if (!m_waitingForAsyncStartNotification)
+        startTimeResponse(beginAnimationUpdateTime());
 }
 
 void AnimationControllerPrivate::receivedStartTimeResponse(double time)
@@ -402,8 +372,6 @@
 
 PassRefPtr<RenderStyle> AnimationControllerPrivate::getAnimatedStyleForRenderer(RenderElement& renderer)
 {
-    AnimationPrivateUpdateBlock animationUpdateBlock(*this);
-
     ASSERT(renderer.isCSSAnimating());
     ASSERT(m_compositeAnimations.contains(&renderer));
     const CompositeAnimation& rendererAnimations = *m_compositeAnimations.get(&renderer);
@@ -501,6 +469,7 @@
 
 AnimationController::AnimationController(Frame& frame)
     : m_data(std::make_unique<AnimationControllerPrivate>(frame))
+    , m_beginAnimationUpdateCount(0)
 {
 }
 
@@ -576,13 +545,11 @@
 
 void AnimationController::notifyAnimationStarted(RenderElement&, double startTime)
 {
-    AnimationUpdateBlock animationUpdateBlock(this);
     m_data->receivedStartTimeResponse(startTime);
 }
 
 bool AnimationController::pauseAnimationAtTime(RenderElement* renderer, const AtomicString& name, double t)
 {
-    AnimationUpdateBlock animationUpdateBlock(this);
     return m_data->pauseAnimationAtTime(renderer, name, t);
 }
 
@@ -593,7 +560,6 @@
 
 bool AnimationController::pauseTransitionAtTime(RenderElement* renderer, const String& property, double t)
 {
-    AnimationUpdateBlock animationUpdateBlock(this);
     return m_data->pauseTransitionAtTime(renderer, property, t);
 }
 
@@ -650,26 +616,28 @@
 void AnimationController::resumeAnimationsForDocument(Document* document)
 {
     LOG(Animations, "resuming animations for document %p", document);
-    AnimationUpdateBlock animationUpdateBlock(this);
     m_data->resumeAnimationsForDocument(document);
 }
 
 void AnimationController::startAnimationsIfNotSuspended(Document* document)
 {
     LOG(Animations, "animations may start for document %p", document);
-
-    AnimationUpdateBlock animationUpdateBlock(this);
     m_data->startAnimationsIfNotSuspended(document);
 }
 
 void AnimationController::beginAnimationUpdate()
 {
-    m_data->beginAnimationUpdate();
+    if (!m_beginAnimationUpdateCount)
+        m_data->setBeginAnimationUpdateTime(cBeginAnimationUpdateTimeNotSet);
+    ++m_beginAnimationUpdateCount;
 }
 
 void AnimationController::endAnimationUpdate()
 {
-    m_data->endAnimationUpdate();
+    ASSERT(m_beginAnimationUpdateCount > 0);
+    --m_beginAnimationUpdateCount;
+    if (!m_beginAnimationUpdateCount)
+        m_data->endAnimationUpdate();
 }
 
 bool AnimationController::supportsAcceleratedAnimationOfProperty(CSSPropertyID property)

Modified: trunk/Source/WebCore/page/animation/AnimationController.h (177268 => 177269)


--- trunk/Source/WebCore/page/animation/AnimationController.h	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/page/animation/AnimationController.h	2014-12-15 02:50:22 UTC (rev 177269)
@@ -82,6 +82,7 @@
 
 private:
     const std::unique_ptr<AnimationControllerPrivate> m_data;
+    int m_beginAnimationUpdateCount;
 };
 
 class AnimationUpdateBlock {

Modified: trunk/Source/WebCore/page/animation/AnimationControllerPrivate.h (177268 => 177269)


--- trunk/Source/WebCore/page/animation/AnimationControllerPrivate.h	2014-12-15 02:38:01 UTC (rev 177268)
+++ trunk/Source/WebCore/page/animation/AnimationControllerPrivate.h	2014-12-15 02:50:22 UTC (rev 177269)
@@ -97,8 +97,6 @@
 
     double beginAnimationUpdateTime();
     void setBeginAnimationUpdateTime(double t) { m_beginAnimationUpdateTime = t; }
-    
-    void beginAnimationUpdate();
     void endAnimationUpdate();
     void receivedStartTimeResponse(double);
     
@@ -143,9 +141,6 @@
     typedef HashSet<RefPtr<AnimationBase>> WaitingAnimationsSet;
     WaitingAnimationsSet m_animationsWaitingForStyle;
     WaitingAnimationsSet m_animationsWaitingForStartTimeResponse;
-
-    int m_beginAnimationUpdateCount;
-
     bool m_waitingForAsyncStartNotification;
     bool m_isSuspended;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to