Changeset 122389 in webkit


Ignore:
Timestamp:
Jul 11, 2012 5:05:12 PM (12 years ago)
Author:
shinyak@chromium.org
Message:

SVGUseElement should not use Element::ensureShadowRoot().
https://bugs.webkit.org/show_bug.cgi?id=90938

Reviewed by Hajime Morita.

We would like to remove Element::ensureShadowRoot() because we would like to stabilize the lifecycle of Shadow DOM.
This patch rewrites SVGUseElement::create() not to use Element::ensureShadowRoot(). Since our convention to create
a shadow subtree is to create a method createShadowSubtree(), I obeyed it.

No new tests. Simple refactoring.

  • svg/SVGUseElement.cpp:

(WebCore::SVGUseElement::create):
(WebCore::SVGUseElement::createShadowSubtree):
(WebCore):

  • svg/SVGUseElement.h:

(SVGUseElement):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122383 r122389  
     12012-07-11  Shinya Kawanaka  <shinyak@chromium.org>
     2
     3        SVGUseElement should not use Element::ensureShadowRoot().
     4        https://bugs.webkit.org/show_bug.cgi?id=90938
     5
     6        Reviewed by Hajime Morita.
     7
     8        We would like to remove Element::ensureShadowRoot() because we would like to stabilize the lifecycle of Shadow DOM.
     9        This patch rewrites SVGUseElement::create() not to use Element::ensureShadowRoot(). Since our convention to create
     10        a shadow subtree is to create a method createShadowSubtree(), I obeyed it.
     11
     12        No new tests. Simple refactoring.
     13
     14        * svg/SVGUseElement.cpp:
     15        (WebCore::SVGUseElement::create):
     16        (WebCore::SVGUseElement::createShadowSubtree):
     17        (WebCore):
     18        * svg/SVGUseElement.h:
     19        (SVGUseElement):
     20
    1212012-07-11  Alexandre Elias  <aelias@google.com>
    222
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r120951 r122389  
    100100    // Always build a #shadow-root for SVGUseElement.
    101101    RefPtr<SVGUseElement> use = adoptRef(new SVGUseElement(tagName, document, wasInsertedByParser));
    102     use->ensureShadowRoot();
     102    use->createShadowSubtree();
    103103    return use.release();
    104104}
     
    108108    if (m_cachedDocument)
    109109        m_cachedDocument->removeClient(this);
     110}
     111
     112void SVGUseElement::createShadowSubtree()
     113{
     114    ASSERT(!shadow());
     115    ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot);
    110116}
    111117
  • trunk/Source/WebCore/svg/SVGUseElement.h

    r118192 r122389  
    5656private:
    5757    SVGUseElement(const QualifiedName&, Document*, bool wasInsertedByParser);
     58
     59    void createShadowSubtree();
    5860
    5961    virtual bool isValid() const { return SVGTests::isValid(); }
Note: See TracChangeset for help on using the changeset viewer.