Source/WebCore: Fix a crash relating to anonymous block merging in
[WebKit-https.git] / Source / WebCore / rendering / RenderFullScreen.cpp
index d6164e6..fe0f23d 100644 (file)
@@ -125,14 +125,11 @@ RenderObject* RenderFullScreen::wrapRenderer(RenderObject* object, Document* doc
 void RenderFullScreen::unwrapRenderer()
 {
     RenderObject* holder = placeholder() ? placeholder() : this;
-    RenderObject* parent = holder->parent();
-    if (parent) {
-        RenderObject* child = firstChild();
-        while (child) {
-            RenderObject* nextChild = child->nextSibling();
+    if (holder->parent()) {
+        RenderObject* child;
+        while ((child = firstChild())) {
             child->remove();
-            parent->addChild(child, holder);
-            child = nextChild;
+            holder->parent()->addChild(child, holder);
         }
     }
     remove();