Commit 73f41409 authored by krit@webkit.org's avatar krit@webkit.org

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:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@155105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e547636f
2013-09-05 Dirk Schulze <krit@webkit.org>
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 <krit@webkit.org>
Support interpolation between cross-fade() images
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%)
......@@ -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="../../animations/resources/animation-test-helpers.js"></script>
<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>
......
2013-09-05 Dirk Schulze <krit@webkit.org>
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 <andre.magalhaes@collabora.co.uk>
[Qt][WK1] REGRESSION(r154988): compositing/video/video-with-invalid-source.html
......@@ -133,6 +133,9 @@ static inline TransformOperations blendFunc(const AnimationBase* anim, const Tra
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment