Changeset 107523 in webkit


Ignore:
Timestamp:
Feb 12, 2012 7:35:19 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

SVGTRefElement shouldn't create a shadow root dynamically.
https://bugs.webkit.org/show_bug.cgi?id=77938

Patch by Shinya Kawanaka <shinyak@google.com> on 2012-02-12
Reviewed by Hajime Morita.

Source/WebCore:

SVGTRefElement creates a shadow root dynamically. This will cause a problem to support
multiple shadow subtrees. So it should be created in a constructor phase.

Test: svg/custom/tref-shadowdom.html

  • svg/SVGTRefElement.cpp:

(WebCore::SVGTRefElement::create):
(WebCore::SVGTRefElement::createShadowSubtree):
(WebCore):
(WebCore::SVGTRefElement::updateReferencedText):

  • svg/SVGTRefElement.h:

(SVGTRefElement):

LayoutTests:

Checks a shadow root exists of tref element in cases xlink:href is set and is not set.

  • svg/custom/tref-shadowdom-expected.txt: Added.
  • svg/custom/tref-shadowdom.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107519 r107523  
     12012-02-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        SVGTRefElement shouldn't create a shadow root dynamically.
     4        https://bugs.webkit.org/show_bug.cgi?id=77938
     5
     6        Reviewed by Hajime Morita.
     7
     8        Checks a shadow root exists of tref element in cases xlink:href is set and is not set.
     9
     10        * svg/custom/tref-shadowdom-expected.txt: Added.
     11        * svg/custom/tref-shadowdom.html: Added.
     12
    1132012-02-12  Abhishek Arya  <inferno@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r107520 r107523  
     12012-02-12  Shinya Kawanaka  <shinyak@google.com>
     2
     3        SVGTRefElement shouldn't create a shadow root dynamically.
     4        https://bugs.webkit.org/show_bug.cgi?id=77938
     5
     6        Reviewed by Hajime Morita.
     7
     8        SVGTRefElement creates a shadow root dynamically. This will cause a problem to support
     9        multiple shadow subtrees. So it should be created in a constructor phase.
     10
     11        Test: svg/custom/tref-shadowdom.html
     12
     13        * svg/SVGTRefElement.cpp:
     14        (WebCore::SVGTRefElement::create):
     15        (WebCore::SVGTRefElement::createShadowSubtree):
     16        (WebCore):
     17        (WebCore::SVGTRefElement::updateReferencedText):
     18        * svg/SVGTRefElement.h:
     19        (SVGTRefElement):
     20
    1212012-02-12  Kentaro Hara  <haraken@chromium.org>
    222
  • trunk/Source/WebCore/svg/SVGTRefElement.cpp

    r106769 r107523  
    5757PassRefPtr<SVGTRefElement> SVGTRefElement::create(const QualifiedName& tagName, Document* document)
    5858{
    59     return adoptRef(new SVGTRefElement(tagName, document));
     59    RefPtr<SVGTRefElement> element = adoptRef(new SVGTRefElement(tagName, document));
     60    element->createShadowSubtree();
     61    return element.release();
    6062}
    6163
     
    145147}
    146148
     149void SVGTRefElement::createShadowSubtree()
     150{
     151    ShadowRoot::create(this, ShadowRoot::CreatingUserAgentShadowRoot, ASSERT_NO_EXCEPTION);
     152}
     153
    147154void SVGTRefElement::updateReferencedText()
    148155{
     
    152159    if (target->parentNode())
    153160        textContent = target->textContent();
    154     ExceptionCode ignore = 0;
    155     if (!ensureShadowRoot()->firstChild())
    156         shadowRoot()->appendChild(SVGShadowText::create(document(), textContent), ignore);
     161
     162    if (!shadowRoot()->firstChild())
     163        shadowRoot()->appendChild(SVGShadowText::create(document(), textContent), ASSERT_NO_EXCEPTION);
    157164    else
    158         shadowRoot()->firstChild()->setTextContent(textContent, ignore);
     165        shadowRoot()->firstChild()->setTextContent(textContent, ASSERT_NO_EXCEPTION);
    159166}
    160167
  • trunk/Source/WebCore/svg/SVGTRefElement.h

    r106769 r107523  
    4141    virtual ~SVGTRefElement();
    4242
     43    void createShadowSubtree();
     44
    4345    bool isSupportedAttribute(const QualifiedName&);
    4446    virtual void parseAttribute(Attribute*) OVERRIDE;
Note: See TracChangeset for help on using the changeset viewer.