Changeset 62484 in webkit


Ignore:
Timestamp:
Jul 5, 2010 5:48:28 AM (14 years ago)
Author:
Nikolas Zimmermann
Message:

2010-07-05 Nikolas Zimmermann <nzimmermann@rim.com>

Reviewed by Dirk Schulze / Darin Adler.

Node.cloneNode does not work on SVG nodes
https://bugs.webkit.org/show_bug.cgi?id=41421

Be sure to synchronize animated SVG properties before checking whether NamedNodeMap exists.
When creating a SVG element from JS, and setting all attributes via SVG DOM, and not using setAttribute
the NamedNodeMap does not exist. When cloning such an element, be sure to synchronize SVG <-> XML DOM
attributes before attempting to clone, otherwhise the SVG animated properties are lost while cloning.

Test: svg/custom/clone-element-with-animated-svg-properties.html

  • dom/Element.cpp: (WebCore::Element::cloneElementWithoutChildren):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r62482 r62484  
     12010-07-05  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze / Darin Adler.
     4
     5        Node.cloneNode does not work on SVG nodes
     6        https://bugs.webkit.org/show_bug.cgi?id=41421
     7
     8        * platform/mac/svg/custom/clone-element-with-animated-svg-properties-expected.checksum: Added.
     9        * platform/mac/svg/custom/clone-element-with-animated-svg-properties-expected.png: Added.
     10        * platform/mac/svg/custom/clone-element-with-animated-svg-properties-expected.txt: Added.
     11        * svg/custom/clone-element-with-animated-svg-properties.html: Added.
     12
    1132010-07-05  Nikolas Zimmermann  <nzimmermann@rim.com>
    214
  • trunk/WebCore/ChangeLog

    r62483 r62484  
     12010-07-05  Nikolas Zimmermann  <nzimmermann@rim.com>
     2
     3        Reviewed by Dirk Schulze / Darin Adler.
     4
     5        Node.cloneNode does not work on SVG nodes
     6        https://bugs.webkit.org/show_bug.cgi?id=41421
     7
     8        Be sure to synchronize animated SVG properties before checking whether NamedNodeMap exists.
     9        When creating a SVG element from JS, and setting all attributes via SVG DOM, and not using setAttribute
     10        the NamedNodeMap does not exist. When cloning such an element, be sure to synchronize SVG <-> XML DOM
     11        attributes before attempting to clone, otherwhise the SVG animated properties are lost while cloning.
     12
     13        Test: svg/custom/clone-element-with-animated-svg-properties.html
     14
     15        * dom/Element.cpp:
     16        (WebCore::Element::cloneElementWithoutChildren):
     17
    1182010-07-05  Antti Koivisto  <koivisto@iki.fi>
    219
  • trunk/WebCore/dom/Element.cpp

    r62215 r62484  
    155155    ASSERT(isHTMLElement() == clone->isHTMLElement());
    156156
    157     // Clone attributes.
    158     if (namedAttrMap)
    159         clone->attributes()->setAttributes(*attributes(true)); // Call attributes(true) to force attribute synchronization to occur (for svg and style) before cloning happens.
    160    
     157    // Call attributes(true) to force attribute synchronization to occur for SVG and style attributes.
     158    if (NamedNodeMap* attributeMap = attributes(true))
     159        clone->attributes()->setAttributes(*attributeMap);
     160
    161161    clone->copyNonAttributeProperties(this);
    162162
Note: See TracChangeset for help on using the changeset viewer.