Title: [155105] trunk
Revision
155105
Author
[email protected]
Date
2013-09-05 00:38:46 -0700 (Thu, 05 Sep 2013)

Log Message

NULL ptr in WebCore::RefCountedPropertyWrapper<WebCore::ClipPathOperation>::blend
https://bugs.webkit.org/show_bug.cgi?id=105408

Reviewed by Dean Jackson.

Source/WebCore:

Adding an early return if from or to clip-path values are 'none'. According to the
specification we shall just interpolate between two basic shapes.

http://dev.w3.org/csswg/css-shapes/#basic-shape-interpolation

* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):

LayoutTests:

Test that animation from none to a basic shape on -webkit-clip-path doesn't crash.

* css3/masking/clip-path-animation-expected.txt:
* css3/masking/clip-path-animation.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (155104 => 155105)


--- trunk/LayoutTests/ChangeLog	2013-09-05 07:33:38 UTC (rev 155104)
+++ trunk/LayoutTests/ChangeLog	2013-09-05 07:38:46 UTC (rev 155105)
@@ -1,3 +1,15 @@
+2013-09-05  Dirk Schulze  <[email protected]>
+
+        NULL ptr in WebCore::RefCountedPropertyWrapper<WebCore::ClipPathOperation>::blend
+        https://bugs.webkit.org/show_bug.cgi?id=105408
+
+        Reviewed by Dean Jackson.
+
+        Test that animation from none to a basic shape on -webkit-clip-path doesn't crash.
+
+        * css3/masking/clip-path-animation-expected.txt:
+        * css3/masking/clip-path-animation.html:
+
 2013-09-04  Dirk Schulze  <[email protected]>
 
         Support interpolation between cross-fade() images

Modified: trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt (155104 => 155105)


--- trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt	2013-09-05 07:33:38 UTC (rev 155104)
+++ trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt	2013-09-05 07:38:46 UTC (rev 155105)
@@ -1,6 +1,7 @@
-   
+    
 PASS - "webkitClipPath" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px)
 PASS - "webkitClipPath" property for "circle-box" element at 1s saw something close to: circle(35%, 35%, 35%)
 PASS - "webkitClipPath" property for "ellipse-box" element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%)
 PASS - "webkitClipPath" property for "polygon-box" element at 1s saw something close to: polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)
+PASS - "webkitClipPath" property for "none-box" element at 1s saw something close to: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)
 

Modified: trunk/LayoutTests/css3/masking/clip-path-animation.html (155104 => 155105)


--- trunk/LayoutTests/css3/masking/clip-path-animation.html	2013-09-05 07:33:38 UTC (rev 155104)
+++ trunk/LayoutTests/css3/masking/clip-path-animation.html	2013-09-05 07:38:46 UTC (rev 155105)
@@ -27,6 +27,9 @@
       -webkit-animation: polygon-anim 2s linear
     }
 
+    #none-box {
+      -webkit-animation: none-anim 2s linear
+    }
 
     @-webkit-keyframes rectangle-anim {
         from { -webkit-clip-path: rectangle(0%, 0%, 100%, 100%); }
@@ -48,6 +51,12 @@
         to   { -webkit-clip-path: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%); }
     }
 
+    @-webkit-keyframes none-anim {
+        /* We do not support animations from or to 'none' as specified. */
+        from { -webkit-clip-path: none; }
+        to   { -webkit-clip-path: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%); }
+    }
+
   </style>
   <script src=""
   <script type="text/_javascript_">
@@ -57,6 +66,7 @@
       ["circle-anim",  1, "circle-box", "webkitClipPath", "circle(35%, 35%, 35%)", 0.05],
       ["ellipse-anim",  1, "ellipse-box", "webkitClipPath", "ellipse(35%, 35%, 35%, 30%)", 0.05],
       ["polygon-anim",  1, "polygon-box", "webkitClipPath", "polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)", 0.05],
+      ["none-anim",  1, "none-box", "webkitClipPath", "polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)", 0],
     ];
     
     runAnimationTest(expectedValues);
@@ -68,6 +78,7 @@
 <div class="box" id="circle-box"></div>
 <div class="box" id="ellipse-box"></div>
 <div class="box" id="polygon-box"></div>
+<div class="box" id="none-box"></div>
 
 <div id="result">
 </div>

Modified: trunk/Source/WebCore/ChangeLog (155104 => 155105)


--- trunk/Source/WebCore/ChangeLog	2013-09-05 07:33:38 UTC (rev 155104)
+++ trunk/Source/WebCore/ChangeLog	2013-09-05 07:38:46 UTC (rev 155105)
@@ -1,3 +1,18 @@
+2013-09-05  Dirk Schulze  <[email protected]>
+
+        NULL ptr in WebCore::RefCountedPropertyWrapper<WebCore::ClipPathOperation>::blend
+        https://bugs.webkit.org/show_bug.cgi?id=105408
+
+        Reviewed by Dean Jackson.
+
+        Adding an early return if from or to clip-path values are 'none'. According to the
+        specification we shall just interpolate between two basic shapes.
+
+        http://dev.w3.org/csswg/css-shapes/#basic-shape-interpolation
+
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFunc):
+
 2013-09-05  Andre Moreira Magalhaes   <[email protected]>
 
         [Qt][WK1] REGRESSION(r154988): compositing/video/video-with-invalid-source.html

Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (155104 => 155105)


--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2013-09-05 07:33:38 UTC (rev 155104)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp	2013-09-05 07:38:46 UTC (rev 155105)
@@ -133,6 +133,9 @@
 
 static inline PassRefPtr<ClipPathOperation> blendFunc(const AnimationBase*, ClipPathOperation* from, ClipPathOperation* to, double progress)
 {
+    if (!from || !to)
+        return to;
+
     // Other clip-path operations than BasicShapes can not be animated.
     if (from->getOperationType() != ClipPathOperation::SHAPE || to->getOperationType() != ClipPathOperation::SHAPE)
         return to;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to