[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

jschuh at chromium.org jschuh at chromium.org
Wed Dec 22 14:42:24 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ef00b948e34b7f91a26d04cc85115dd93111e382
Author: jschuh at chromium.org <jschuh at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 18 00:47:44 2010 +0000

    2010-10-17  Justin Schuh  <jschuh at chromium.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Duplicate use element children in shadow tree.
            https://bugs.webkit.org/show_bug.cgi?id=47561
    
            Test: svg/custom/use-nested-children.svg
    
            * svg/SVGUseElement.cpp:
            (WebCore::SVGUseElement::expandUseElementsInShadowTree):
    2010-10-17  Justin Schuh  <jschuh at chromium.org>
    
            Reviewed by Nikolas Zimmermann.
    
            Duplicate use element children in shadow tree.
            https://bugs.webkit.org/show_bug.cgi?id=47561
    
            * svg/custom/use-nested-children-expected.txt: Added.
            * svg/custom/use-nested-children.svg: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1d042d5..d4237ac 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-10-17  Justin Schuh  <jschuh at chromium.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Duplicate use element children in shadow tree.
+        https://bugs.webkit.org/show_bug.cgi?id=47561
+
+        * svg/custom/use-nested-children-expected.txt: Added.
+        * svg/custom/use-nested-children.svg: Added.
+
 2010-10-17  Martin Robinson  <mrobinson at igalia.com>
 
         Rebaseline MathML tests after r69926.
diff --git a/LayoutTests/svg/custom/use-nested-children-expected.txt b/LayoutTests/svg/custom/use-nested-children-expected.txt
new file mode 100644
index 0000000..63abe42
--- /dev/null
+++ b/LayoutTests/svg/custom/use-nested-children-expected.txt
@@ -0,0 +1,2 @@
+PASS: Should not trigger an ASSERT (bug 47561).
+
diff --git a/LayoutTests/svg/custom/use-nested-children.svg b/LayoutTests/svg/custom/use-nested-children.svg
new file mode 100644
index 0000000..9cacd4e
--- /dev/null
+++ b/LayoutTests/svg/custom/use-nested-children.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> 
+  <script>
+  if (window.layoutTestController)
+      layoutTestController.dumpAsText();
+  </script>
+  <defs>
+    <text x="10" y="30" id="t1">PASS: Should not trigger an ASSERT (bug 47561).</text>
+    <use id="u1" xlink:href="#t1">
+      <desc>This should be ignored.</desc>
+    </use>
+  </defs>
+  <use xlink:href="#u1"/>
+</svg>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 1eda1aa..532e547 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-10-17  Justin Schuh  <jschuh at chromium.org>
+
+        Reviewed by Nikolas Zimmermann.
+
+        Duplicate use element children in shadow tree.
+        https://bugs.webkit.org/show_bug.cgi?id=47561
+
+        Test: svg/custom/use-nested-children.svg
+
+        * svg/SVGUseElement.cpp:
+        (WebCore::SVGUseElement::expandUseElementsInShadowTree):
+
 2010-10-17  Hyung Song  <beergun at company100.net>
 
         Reviewed by David Levin.
diff --git a/WebCore/svg/SVGUseElement.cpp b/WebCore/svg/SVGUseElement.cpp
index 6edc216..474b0a4 100644
--- a/WebCore/svg/SVGUseElement.cpp
+++ b/WebCore/svg/SVGUseElement.cpp
@@ -798,6 +798,7 @@ void SVGUseElement::expandUseElementsInShadowTree(SVGShadowTreeRootElement* shad
         // Don't ASSERT(target) here, it may be "pending", too.
         // Setup sub-shadow tree root node
         RefPtr<SVGShadowTreeContainerElement> cloneParent = SVGShadowTreeContainerElement::create(document());
+        use->cloneChildNodes(cloneParent.get());
 
         // Spec: In the generated content, the 'use' will be replaced by 'g', where all attributes from the
         // 'use' element except for x, y, width, height and xlink:href are transferred to the generated 'g' element.
@@ -807,14 +808,6 @@ void SVGUseElement::expandUseElementsInShadowTree(SVGShadowTreeRootElement* shad
         if (target && !isDisallowedElement(target)) {
             RefPtr<Element> newChild = target->cloneElementWithChildren();
 
-            // We don't walk the target tree element-by-element, and clone each element,
-            // but instead use cloneElementWithChildren(). This is an optimization for the common
-            // case where <use> doesn't contain disallowed elements (ie. <foreignObject>).
-            // Though if there are disallowed elements in the subtree, we have to remove them.
-            // For instance: <use> on <g> containing <foreignObject> (indirect case).
-            if (subtreeContainsDisallowedElement(newChild.get()))
-                removeDisallowedElementsFromSubtree(newChild.get());
-
             SVGElement* newChildPtr = 0;
             if (newChild->isSVGElement())
                 newChildPtr = static_cast<SVGElement*>(newChild.get());
@@ -824,6 +817,14 @@ void SVGUseElement::expandUseElementsInShadowTree(SVGShadowTreeRootElement* shad
             ASSERT(!ec);
         }
 
+        // We don't walk the target tree element-by-element, and clone each element,
+        // but instead use cloneElementWithChildren(). This is an optimization for the common
+        // case where <use> doesn't contain disallowed elements (ie. <foreignObject>).
+        // Though if there are disallowed elements in the subtree, we have to remove them.
+        // For instance: <use> on <g> containing <foreignObject> (indirect case).
+        if (subtreeContainsDisallowedElement(cloneParent.get()))
+            removeDisallowedElementsFromSubtree(cloneParent.get());
+
         // Replace <use> with referenced content.
         ASSERT(use->parentNode()); 
         use->parentNode()->replaceChild(cloneParent.release(), use, ec);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list