2011-01-17 MORITA Hajime <morrita@google.com>
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 06:52:41 +0000 (06:52 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 06:52:41 +0000 (06:52 +0000)
        Unreviewed crash fix, which introduced at r75995

        * dom/Element.cpp:
        (WebCore::Element::removeShadowRoot):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75999 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/dom/Element.cpp

index 2dd01b8..2f314a7 100644 (file)
@@ -1,3 +1,10 @@
+2011-01-17 MORITA Hajime  <morrita@google.com>
+
+        Unreviewed crash fix, which introduced at r75995
+
+        * dom/Element.cpp:
+        (WebCore::Element::removeShadowRoot):
+
 2011-01-17  MORITA Hajime  <morrita@google.com>
 
         Reviewed by Dimitri Glazkov.
index 34caa22..1b9e3dc 100644 (file)
@@ -1103,9 +1103,11 @@ void Element::setShadowRoot(PassRefPtr<Node> node)
 
 void Element::removeShadowRoot()
 {
-    if (ElementRareData* data = rareData()) {
-        if (!data->m_shadowRoot)
-            return;
+    if (!hasRareData())
+        return;
+
+    ElementRareData* data = rareData();
+    if (data->m_shadowRoot) {
         RefPtr<Node> oldRoot = data->m_shadowRoot;
         data->m_shadowRoot = 0;
         document()->removeFocusedNodeOfSubtree(oldRoot.get());