Changeset 258464 in webkit


Ignore:
Timestamp:
Mar 14, 2020 12:15:14 AM (4 years ago)
Author:
rniwa@webkit.org
Message:

Call SVGTRefElement::buildPendingResource in SVGElement::didFinishInsertingNode
https://bugs.webkit.org/show_bug.cgi?id=208981

Reviewed by Antti Koivisto.

This patch moves the call to SVGTRefElement::buildPendingResource from SVGElement::insertedIntoAncestor
to SVGElement::didFinishInsertingNode.

  • svg/SVGElement.cpp:

(WebCore::SVGElement::insertedIntoAncestor): Return true when the element has a pending resource ID.
(WebCore::SVGElement::didFinishInsertingNode): Added. Calls buildPendingResourcesIfNeeded.

  • svg/SVGElement.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r258459 r258464  
     12020-03-14  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Call SVGTRefElement::buildPendingResource in SVGElement::didFinishInsertingNode
     4        https://bugs.webkit.org/show_bug.cgi?id=208981
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This patch moves the call to SVGTRefElement::buildPendingResource from SVGElement::insertedIntoAncestor
     9        to SVGElement::didFinishInsertingNode.
     10
     11        * svg/SVGElement.cpp:
     12        (WebCore::SVGElement::insertedIntoAncestor): Return true when the element has a pending resource ID.
     13        (WebCore::SVGElement::didFinishInsertingNode): Added. Calls buildPendingResourcesIfNeeded.
     14        * svg/SVGElement.h:
     15
    1162020-03-13  Said Abou-Hallawa  <said@apple.com>
    217
  • trunk/Source/WebCore/svg/SVGElement.cpp

    r257196 r258464  
    834834    StyledElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);
    835835    updateRelativeLengthsInformation();
     836
     837    if (needsPendingResourceHandling() && insertionType.connectedToDocument && !isInShadowTree()) {
     838        SVGDocumentExtensions& extensions = document().accessSVGExtensions();
     839        String resourceId = getIdAttribute();
     840        if (extensions.isIdOfPendingResource(resourceId))
     841            return InsertedIntoAncestorResult::NeedsPostInsertionCallback;
     842    }
     843
     844    return InsertedIntoAncestorResult::Done;
     845}
     846
     847void SVGElement::didFinishInsertingNode()
     848{
    836849    buildPendingResourcesIfNeeded();
    837     return InsertedIntoAncestorResult::Done;
    838850}
    839851
  • trunk/Source/WebCore/svg/SVGElement.h

    r257188 r258464  
    167167    void collectStyleForPresentationAttribute(const QualifiedName&, const AtomString&, MutableStyleProperties&) override;
    168168    InsertedIntoAncestorResult insertedIntoAncestor(InsertionType, ContainerNode&) override;
     169    void didFinishInsertingNode() override;
    169170    void removedFromAncestor(RemovalType, ContainerNode&) override;
    170171    void childrenChanged(const ChildChange&) override;
Note: See TracChangeset for help on using the changeset viewer.