Changeset 243845 in webkit


Ignore:
Timestamp:
Apr 3, 2019 7:09:50 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
https://bugs.webkit.org/show_bug.cgi?id=196518

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-03
Reviewed by Simon Fraser.

Source/WebCore:

r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().

RenderSVGRect tries to optimize its layout and drawing if the rectangle
is not rounded. So it uses the flag m_usePathFallback to know whether to
use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
is rounded but its boundingSize is empty, m_path will be cleared,
m_innerStrokeRect and m_outerStrokeRect will be recalculated but
m_usePathFallback will not be reset to false. Therefore when calling
RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
will assert since m_path is null.

Test: svg/animations/animate-rounded-corner-rect-zero-height.svg

  • rendering/svg/RenderSVGRect.cpp:

(WebCore::RenderSVGRect::updateShapeFromElement):
Reset m_usePathFallback to false once clearPath() is called.

LayoutTests:

  • svg/animations/animate-rounded-corner-rect-zero-height-expected.txt: Added.
  • svg/animations/animate-rounded-corner-rect-zero-height.svg: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r243841 r243845  
     12019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
     4        https://bugs.webkit.org/show_bug.cgi?id=196518
     5
     6        Reviewed by Simon Fraser.
     7
     8        * svg/animations/animate-rounded-corner-rect-zero-height-expected.txt: Added.
     9        * svg/animations/animate-rounded-corner-rect-zero-height.svg: Added.
     10
    1112019-04-03  Myles C. Maxfield  <mmaxfield@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r243844 r243845  
     12019-04-03  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
     4        https://bugs.webkit.org/show_bug.cgi?id=196518
     5
     6        Reviewed by Simon Fraser.
     7
     8        r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
     9
     10        RenderSVGRect tries to optimize its layout and drawing if the rectangle
     11        is not rounded. So it uses the flag m_usePathFallback to know whether to
     12        use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
     13        is rounded but its boundingSize is empty, m_path will be cleared,
     14        m_innerStrokeRect and m_outerStrokeRect will be recalculated but
     15        m_usePathFallback will not be reset to false. Therefore when calling
     16        RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
     17        will assert since m_path is null.
     18
     19        Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
     20
     21        * rendering/svg/RenderSVGRect.cpp:
     22        (WebCore::RenderSVGRect::updateShapeFromElement):
     23        Reset m_usePathFallback to false once clearPath() is called.
     24
    1252019-04-03  Ryosuke Niwa  <rniwa@webkit.org>
    226
  • trunk/Source/WebCore/rendering/svg/RenderSVGRect.cpp

    r232246 r243845  
    5656    m_outerStrokeRect = FloatRect();
    5757    clearPath();
     58    m_usePathFallback = false;
    5859
    5960    SVGLengthContext lengthContext(&rectElement());
     
    7273            return;
    7374        }
    74         m_usePathFallback = false;
    7575    }
    7676
Note: See TracChangeset for help on using the changeset viewer.