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

Changeset 245469 in webkit


Ignore:
Timestamp:
May 17, 2019, 10:26:05 AM (7 years ago)
Author:
Said Abou-Hallawa
Message:

SVGElement should detach itself from all its properties before it is deleted
https://bugs.webkit.org/show_bug.cgi?id=197954

Reviewed by Simon Fraser.

Source/WebCore:

Before deleting the SVGElement node, SVGElement::detachAllProperties()
needs to be called. This will make the properties be detached objects
which means no change will be committed unless these properties are
attached to another owner.

Test: svg/dom/svg-properties-detach-change.html

  • dom/Node.cpp:

(WebCore::Node::removedLastRef):

  • svg/SVGElement.h:

(WebCore::SVGElement::detachAllProperties):

LayoutTests:

  • svg/dom/svg-properties-detach-change-expected.txt: Added.
  • svg/dom/svg-properties-detach-change.html : Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r245467 r245469  
     12019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVGElement should detach itself from all its properties before it is deleted
     4        https://bugs.webkit.org/show_bug.cgi?id=197954
     5
     6        Reviewed by Simon Fraser.
     7
     8        * svg/dom/svg-properties-detach-change-expected.txt: Added.
     9        * svg/dom/svg-properties-detach-change.html : Added.
     10
    1112019-05-17  Eric Carlson  <eric.carlson@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r245467 r245469  
     12019-05-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        SVGElement should detach itself from all its properties before it is deleted
     4        https://bugs.webkit.org/show_bug.cgi?id=197954
     5
     6        Reviewed by Simon Fraser.
     7
     8        Before deleting the SVGElement node, SVGElement::detachAllProperties()
     9        needs to be called. This will make the properties be detached objects
     10        which means no change will be committed unless these properties are
     11        attached to another owner.
     12
     13        Test: svg/dom/svg-properties-detach-change.html
     14
     15        * dom/Node.cpp:
     16        (WebCore::Node::removedLastRef):
     17        * svg/SVGElement.h:
     18        (WebCore::SVGElement::detachAllProperties):
     19
    1202019-05-17  Eric Carlson  <eric.carlson@apple.com>
    221
  • trunk/Source/WebCore/dom/Node.cpp

    r245086 r245469  
    6363#include "RenderTextControl.h"
    6464#include "RenderView.h"
     65#include "SVGElement.h"
    6566#include "ScopedEventQueue.h"
    6667#include "ScriptDisallowedScope.h"
     
    25102511    }
    25112512
     2513    // Now it is time to detach the SVGElement from all its properties. These properties
     2514    // may outlive the SVGElement. The only difference after the detach is no commit will
     2515    // be carried out unless these properties are attached to another owner.
     2516    if (is<SVGElement>(*this))
     2517        downcast<SVGElement>(*this).detachAllProperties();
     2518
    25122519#ifndef NDEBUG
    25132520    m_deletionHasBegun = true;
  • trunk/Source/WebCore/svg/SVGElement.h

    r243954 r245469  
    129129    using PropertyRegistry = SVGPropertyOwnerRegistry<SVGElement>;
    130130    virtual const SVGPropertyRegistry& propertyRegistry() const { return m_propertyRegistry; }
     131    void detachAllProperties() { propertyRegistry().detachAllProperties(); }
    131132
    132133    bool isAnimatedPropertyAttribute(const QualifiedName&) const;
Note: See TracChangeset for help on using the changeset viewer.