Title: [141162] trunk/Source/WebCore
Revision
141162
Author
espr...@chromium.org
Date
2013-01-29 13:51:25 -0800 (Tue, 29 Jan 2013)

Log Message

Remove all ShadowRoots during ElementShadow destruction
https://bugs.webkit.org/show_bug.cgi?id=108207

Reviewed by Dimitri Glazkov.

There's no reason to expose removeAllShadowRoots since the only legitimate
place to call it is right as we're destroying the ElementShadow.

No new tests, just refactoring.

* dom/Element.cpp:
(WebCore::Element::~Element): Remove call to removeAllShadowRoots()
* dom/ElementShadow.h:
(WebCore::ElementShadow::~ElementShadow): Call removeAllShadowRoots().
(ElementShadow): Make removeAllShadowRoots() private.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (141161 => 141162)


--- trunk/Source/WebCore/ChangeLog	2013-01-29 21:49:12 UTC (rev 141161)
+++ trunk/Source/WebCore/ChangeLog	2013-01-29 21:51:25 UTC (rev 141162)
@@ -1,3 +1,21 @@
+2013-01-29  Elliott Sprehn  <espr...@chromium.org>
+
+        Remove all ShadowRoots during ElementShadow destruction
+        https://bugs.webkit.org/show_bug.cgi?id=108207
+
+        Reviewed by Dimitri Glazkov.
+
+        There's no reason to expose removeAllShadowRoots since the only legitimate
+        place to call it is right as we're destroying the ElementShadow.
+
+        No new tests, just refactoring.
+
+        * dom/Element.cpp:
+        (WebCore::Element::~Element): Remove call to removeAllShadowRoots()
+        * dom/ElementShadow.h:
+        (WebCore::ElementShadow::~ElementShadow): Call removeAllShadowRoots().
+        (ElementShadow): Make removeAllShadowRoots() private.
+
 2013-01-29  Justin Novosad  <ju...@google.com>
 
         REGRESSION (r135628-135632): Double box shadow failure to render

Modified: trunk/Source/WebCore/dom/Element.cpp (141161 => 141162)


--- trunk/Source/WebCore/dom/Element.cpp	2013-01-29 21:49:12 UTC (rev 141161)
+++ trunk/Source/WebCore/dom/Element.cpp	2013-01-29 21:51:25 UTC (rev 141162)
@@ -194,13 +194,9 @@
         ElementRareData* data = ""
         data->setPseudoElement(BEFORE, 0);
         data->setPseudoElement(AFTER, 0);
+        data->clearShadow();
     }
 
-    if (ElementShadow* elementShadow = shadow()) {
-        elementShadow->removeAllShadowRoots();
-        elementRareData()->clearShadow();
-    }
-
     if (hasSyntheticAttrChildNodes())
         detachAllAttrNodesFromElement();
 

Modified: trunk/Source/WebCore/dom/ElementShadow.h (141161 => 141162)


--- trunk/Source/WebCore/dom/ElementShadow.h	2013-01-29 21:49:12 UTC (rev 141161)
+++ trunk/Source/WebCore/dom/ElementShadow.h	2013-01-29 21:51:25 UTC (rev 141162)
@@ -48,7 +48,7 @@
 
     ~ElementShadow()
     {
-        ASSERT(m_shadowRoots.isEmpty());
+        removeAllShadowRoots();
     }
 
     Element* host() const;
@@ -56,7 +56,6 @@
     ShadowRoot* oldestShadowRoot() const { return m_shadowRoots.tail(); }
     ElementShadow* containingShadow() const;
 
-    void removeAllShadowRoots();
     void addShadowRoot(Element* shadowHost, PassRefPtr<ShadowRoot>, ShadowRoot::ShadowRootType, ExceptionCode&);
 
     void attach();
@@ -78,6 +77,8 @@
 private:
     ElementShadow() { }
 
+    void removeAllShadowRoots();
+
     DoublyLinkedList<ShadowRoot> m_shadowRoots;
     ContentDistributor m_distributor;
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to