⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 236991 in webkit


Ignore:
Timestamp:
Oct 9, 2018, 4:59:52 PM (8 years ago)
Author:
Said Abou-Hallawa
Message:

REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
https://bugs.webkit.org/show_bug.cgi?id=190411

Reviewed by Simon Fraser.

Source/WebCore:

Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html

When changing the attributes of the SVGLangSpace, we should invalidate
the renderer of the SVGGeometryElement descendant only. Renderer of other
elements, like SVGStopElement, should not be invalidated because they do
not have geometry and they can be used as resources for drawing another
SVGGeometryElement.

  • svg/SVGElement.h:

(WebCore::SVGElement::isSVGGeometryElement const):

  • svg/SVGGeometryElement.h:

(isType):

  • svg/SVGLangSpace.cpp:

(WebCore::SVGLangSpace::svgAttributeChanged):

LayoutTests:

  • svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr-expected.txt: Added.
  • svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r236987 r236991  
     12018-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
     4        https://bugs.webkit.org/show_bug.cgi?id=190411
     5
     6        Reviewed by Simon Fraser.
     7
     8        * svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr-expected.txt: Added.
     9        * svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html: Added.
     10
    1112018-10-09  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r236987 r236991  
     12018-10-09  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
     4        https://bugs.webkit.org/show_bug.cgi?id=190411
     5
     6        Reviewed by Simon Fraser.
     7
     8        Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html
     9
     10        When changing the attributes of the SVGLangSpace, we should invalidate
     11        the renderer of the SVGGeometryElement descendant only. Renderer of other
     12        elements, like SVGStopElement, should not be invalidated because they do
     13        not have geometry and they can be used as resources for drawing another
     14        SVGGeometryElement.
     15
     16        * svg/SVGElement.h:
     17        (WebCore::SVGElement::isSVGGeometryElement const):
     18        * svg/SVGGeometryElement.h:
     19        (isType):
     20        * svg/SVGLangSpace.cpp:
     21        (WebCore::SVGLangSpace::svgAttributeChanged):
     22
    1232018-10-09  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/Source/WebCore/svg/SVGElement.h

    r234620 r236991  
    6666
    6767    virtual bool isSVGGraphicsElement() const { return false; }
     68    virtual bool isSVGGeometryElement() const { return false; }
    6869    virtual bool isFilterEffect() const { return false; }
    6970    virtual bool isGradientStop() const { return false; }
  • trunk/Source/WebCore/svg/SVGGeometryElement.h

    r234620 r236991  
    5555
    5656private:
     57    bool isSVGGeometryElement() const override { return true; }
    5758    const SVGAttributeOwnerProxy& attributeOwnerProxy() const override { return m_attributeOwnerProxy; }
    5859
     
    6566
    6667} // namespace WebCore
     68
     69SPECIALIZE_TYPE_TRAITS_BEGIN(WebCore::SVGGeometryElement)
     70    static bool isType(const WebCore::SVGElement& element) { return element.isSVGGeometryElement(); }
     71    static bool isType(const WebCore::Node& node) { return is<WebCore::SVGElement>(node) && isType(downcast<WebCore::SVGElement>(node)); }
     72SPECIALIZE_TYPE_TRAITS_END()
  • trunk/Source/WebCore/svg/SVGLangSpace.cpp

    r234620 r236991  
    2525#include "RenderSVGResource.h"
    2626#include "RenderSVGShape.h"
    27 #include "SVGElement.h"
     27#include "SVGGeometryElement.h"
    2828#include "XMLNames.h"
    2929#include <wtf/NeverDestroyed.h>
     
    6868        return;
    6969
    70     if (auto* renderer = downcast<RenderSVGShape>(m_contextElement.renderer())) {
    71         SVGElement::InstanceInvalidationGuard guard(m_contextElement);
    72         RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
    73     }
     70    auto* renderer = m_contextElement.renderer();
     71    if (!is<RenderSVGShape>(renderer))
     72        return;
     73
     74    ASSERT(is<SVGGeometryElement>(m_contextElement));
     75    SVGElement::InstanceInvalidationGuard guard(m_contextElement);
     76    RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
    7477}
    7578
Note: See TracChangeset for help on using the changeset viewer.