2008-09-11 Dean Jackson <dino@apple.com>
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2008 21:59:08 +0000 (21:59 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Sep 2008 21:59:08 +0000 (21:59 +0000)
        Reviewed by Dan Bernstein.

        Fix assertion on transition property "none"
        https://bugs.webkit.org/show_bug.cgi?id=20751

        Test: transitions/transition-end-event-set-none.html

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@36341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/transitions/transition-end-event-set-none-expected.txt [new file with mode: 0644]
LayoutTests/transitions/transition-end-event-set-none.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/animation/CompositeAnimation.cpp

index 824e382b97c51ad356b6c5dd242f5fa0602c6a74..1d26a5cf49f898efd6daa456d82181c6ee46c3cd 100644 (file)
@@ -1,3 +1,13 @@
+2008-09-11  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Test for assertion of transition property "none"
+        https://bugs.webkit.org/show_bug.cgi?id=20751
+
+        * transitions/transition-end-event-set-none-expected.txt: Added.
+        * transitions/transition-end-event-set-none.html: Added.
+
 2008-09-11  Kevin McCullough  <kmccullough@apple.com>
 
         Reviewed by Adele and Tim.
diff --git a/LayoutTests/transitions/transition-end-event-set-none-expected.txt b/LayoutTests/transitions/transition-end-event-set-none-expected.txt
new file mode 100644 (file)
index 0000000..7929dda
--- /dev/null
@@ -0,0 +1,4 @@
+Initiating transitions on various properties of all boxes.
+
+Expected Property: left Target: box1 Type: webkitTransitionEnd Elapsed Time: 0.2 -- PASS
+
diff --git a/LayoutTests/transitions/transition-end-event-set-none.html b/LayoutTests/transitions/transition-end-event-set-none.html
new file mode 100644 (file)
index 0000000..079d4b9
--- /dev/null
@@ -0,0 +1,70 @@
+<html>
+<head>
+  <title>Transition End Events</title>
+  <style type="text/css" media="screen">
+    .box {
+      position: relative;
+      left: 0;
+      height: 100px;
+      width: 100px;
+      margin: 10px;
+      background-color: blue;
+      -webkit-transition-property: width, left, background-color, height, top;
+      -webkit-transition-duration: 0.2s;
+    }
+    
+    .box1 {
+      left: 50px;
+    }
+    
+    .box2 {
+      background-color: red;
+      left: 100px;
+    }
+  </style>
+  <script src="end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        layoutTestController.waitUntilDone();
+    }
+
+    var expected = [
+      ["left", "box1", "webkitTransitionEnd", 0.2],
+    ];
+    
+    function startTransition1()
+    {
+      var box = document.getElementById("box1");
+      box.addEventListener("webkitTransitionEnd", handleEndEvent1, false);
+      box.className = "box box1";
+    }
+
+    function handleEndEvent1(event) {
+      recordEvent(event);
+      event.target.style.webkitTransitionProperty = "none";
+      window.setTimeout(startTransition2, 100);
+      window.setTimeout(cleanup, 200);
+    }
+
+    function startTransition2()
+    {
+      var box = document.getElementById("box1");
+      box.className = "box box2";
+    }
+
+    window.addEventListener('load', startTransition1, false);
+  </script>
+</head>
+<body>
+
+<p>Initiating transitions on various properties of all boxes.</p>
+
+<div id="container">
+  <div id="box1" class="box"></div>
+</div>
+
+<div id="result"></div>
+
+</body>
+</html>
index 2eaae748324d24b66b5b4d02763512ffbf195832..e5ab016c1ed22b5c2c71222c4f12d3e4fb1b0558 100644 (file)
@@ -1,3 +1,15 @@
+2008-09-11  Dean Jackson  <dino@apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Fix assertion on transition property "none"
+        https://bugs.webkit.org/show_bug.cgi?id=20751
+
+        Test: transitions/transition-end-event-set-none.html
+
+        * page/animation/CompositeAnimation.cpp:
+        (WebCore::CompositeAnimation::updateTransitions):
+
 2008-09-11  David Smith  <catfish.man@gmail.com>
 
         Rubber-stamped by mitzpettel.
index d840900caa48520c2e959936d89d2c719d5fc0a9..9ecb0cbbbbe674f06fa964e5da248620c59ae4a8 100644 (file)
@@ -59,6 +59,10 @@ void CompositeAnimation::updateTransitions(RenderObject* renderer, const RenderS
             continue;
          
         int prop = anim->property();
+
+        if (prop == cAnimateNone)
+            continue;
+        
         bool all = prop == cAnimateAll;
         
         // Handle both the 'all' and single property cases. For the single prop case, we make only one pass