Title: [122389] trunk/Source/WebCore
Revision
122389
Author
[email protected]
Date
2012-07-11 17:05:12 -0700 (Wed, 11 Jul 2012)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (122388 => 122389)


--- trunk/Source/WebCore/ChangeLog	2012-07-11 23:33:20 UTC (rev 122388)
+++ trunk/Source/WebCore/ChangeLog	2012-07-12 00:05:12 UTC (rev 122389)
@@ -1,3 +1,23 @@
+2012-07-11  Shinya Kawanaka  <[email protected]> 
+
+        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):
+
 2012-07-11  Alexandre Elias  <[email protected]>
 
         [chromium] Move compositor quads to Platform/chromium/public

Modified: trunk/Source/WebCore/svg/SVGUseElement.cpp (122388 => 122389)


--- trunk/Source/WebCore/svg/SVGUseElement.cpp	2012-07-11 23:33:20 UTC (rev 122388)
+++ trunk/Source/WebCore/svg/SVGUseElement.cpp	2012-07-12 00:05:12 UTC (rev 122389)
@@ -99,7 +99,7 @@
 {
     // Always build a #shadow-root for SVGUseElement.
     RefPtr<SVGUseElement> use = adoptRef(new SVGUseElement(tagName, document, wasInsertedByParser));
-    use->ensureShadowRoot();
+    use->createShadowSubtree();
     return use.release();
 }
 
@@ -109,6 +109,12 @@
         m_cachedDocument->removeClient(this);
 }
 
+void SVGUseElement::createShadowSubtree()
+{
+    ASSERT(!shadow());
+    ShadowRoot::create(this, ShadowRoot::UserAgentShadowRoot);
+}
+
 SVGElementInstance* SVGUseElement::instanceRoot()
 {
     // If there is no element instance tree, force immediate SVGElementInstance tree

Modified: trunk/Source/WebCore/svg/SVGUseElement.h (122388 => 122389)


--- trunk/Source/WebCore/svg/SVGUseElement.h	2012-07-11 23:33:20 UTC (rev 122388)
+++ trunk/Source/WebCore/svg/SVGUseElement.h	2012-07-12 00:05:12 UTC (rev 122389)
@@ -56,6 +56,8 @@
 private:
     SVGUseElement(const QualifiedName&, Document*, bool wasInsertedByParser);
 
+    void createShadowSubtree();
+
     virtual bool isValid() const { return SVGTests::isValid(); }
     virtual bool supportsFocus() const { return true; }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to