Changeset 155105 in webkit


Ignore:
Timestamp:
Sep 5, 2013 12:38:46 AM (11 years ago)
Author:
krit@webkit.org
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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155100 r155105  
     12013-09-05  Dirk Schulze  <krit@webkit.org>
     2
     3        NULL ptr in WebCore::RefCountedPropertyWrapper<WebCore::ClipPathOperation>::blend
     4        https://bugs.webkit.org/show_bug.cgi?id=105408
     5
     6        Reviewed by Dean Jackson.
     7
     8        Test that animation from none to a basic shape on -webkit-clip-path doesn't crash.
     9
     10        * css3/masking/clip-path-animation-expected.txt:
     11        * css3/masking/clip-path-animation.html:
     12
    1132013-09-04  Dirk Schulze  <krit@webkit.org>
    214
  • trunk/LayoutTests/css3/masking/clip-path-animation-expected.txt

    r151517 r155105  
    1    
     1    
    22PASS - "webkitClipPath" property for "rectangle-box" element at 1s saw something close to: rectangle(10%, 10%, 80%, 80%, 0px, 0px)
    33PASS - "webkitClipPath" property for "circle-box" element at 1s saw something close to: circle(35%, 35%, 35%)
    44PASS - "webkitClipPath" property for "ellipse-box" element at 1s saw something close to: ellipse(35%, 35%, 35%, 30%)
    55PASS - "webkitClipPath" property for "polygon-box" element at 1s saw something close to: polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)
     6PASS - "webkitClipPath" property for "none-box" element at 1s saw something close to: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)
    67
  • trunk/LayoutTests/css3/masking/clip-path-animation.html

    r151517 r155105  
    2828    }
    2929
     30    #none-box {
     31      -webkit-animation: none-anim 2s linear
     32    }
    3033
    3134    @-webkit-keyframes rectangle-anim {
     
    4952    }
    5053
     54    @-webkit-keyframes none-anim {
     55        /* We do not support animations from or to 'none' as specified. */
     56        from { -webkit-clip-path: none; }
     57        to   { -webkit-clip-path: polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%); }
     58    }
     59
    5160  </style>
    5261  <script src="../../animations/resources/animation-test-helpers.js"></script>
     
    5867      ["ellipse-anim",  1, "ellipse-box", "webkitClipPath", "ellipse(35%, 35%, 35%, 30%)", 0.05],
    5968      ["polygon-anim",  1, "polygon-box", "webkitClipPath", "polygon(nonzero, 10% 10%, 90% 10%, 90% 90%, 10% 90%)", 0.05],
     69      ["none-anim",  1, "none-box", "webkitClipPath", "polygon(nonzero, 20% 20%, 80% 20%, 80% 80%, 20% 80%)", 0],
    6070    ];
    6171   
     
    6979<div class="box" id="ellipse-box"></div>
    7080<div class="box" id="polygon-box"></div>
     81<div class="box" id="none-box"></div>
    7182
    7283<div id="result">
  • trunk/Source/WebCore/ChangeLog

    r155104 r155105  
     12013-09-05  Dirk Schulze  <krit@webkit.org>
     2
     3        NULL ptr in WebCore::RefCountedPropertyWrapper<WebCore::ClipPathOperation>::blend
     4        https://bugs.webkit.org/show_bug.cgi?id=105408
     5
     6        Reviewed by Dean Jackson.
     7
     8        Adding an early return if from or to clip-path values are 'none'. According to the
     9        specification we shall just interpolate between two basic shapes.
     10
     11        http://dev.w3.org/csswg/css-shapes/#basic-shape-interpolation
     12
     13        * page/animation/CSSPropertyAnimation.cpp:
     14        (WebCore::blendFunc):
     15
    1162013-09-05  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
    217
  • trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp

    r155100 r155105  
    134134static inline PassRefPtr<ClipPathOperation> blendFunc(const AnimationBase*, ClipPathOperation* from, ClipPathOperation* to, double progress)
    135135{
     136    if (!from || !to)
     137        return to;
     138
    136139    // Other clip-path operations than BasicShapes can not be animated.
    137140    if (from->getOperationType() != ClipPathOperation::SHAPE || to->getOperationType() != ClipPathOperation::SHAPE)
Note: See TracChangeset for help on using the changeset viewer.