Index: Source/web/WebFrame.cpp |
diff --git a/Source/web/WebFrame.cpp b/Source/web/WebFrame.cpp |
index b6832d30b735811ea7c4940a581f6364b0182073..ec68cbbddb21025e059e7f4cc9ef50e38fd06c05 100644 |
--- a/Source/web/WebFrame.cpp |
+++ b/Source/web/WebFrame.cpp |
@@ -29,8 +29,11 @@ void WebFrame::swap(WebFrame* frame) |
{ |
using std::swap; |
- // All child frames must have been detached first. |
- ASSERT(!m_firstChild && !m_lastChild); |
+ Frame* oldFrame = toCoreFrame(this); |
+ |
+ // All child frames must be detached first. |
+ oldFrame->detachChildren(); |
kenrb
2014/09/04 19:04:50
I haven't spent time thinking about the right sequ
dcheng
2014/09/04 19:18:11
Ken makes some good points. This reminds me of why
nasko
2014/09/04 23:46:28
I've implemented an idea based on our discussion.
|
+ |
// The frame being swapped in should not have a Frame associated |
// with it yet. |
ASSERT(!toCoreFrame(frame)); |
@@ -66,7 +69,6 @@ void WebFrame::swap(WebFrame* frame) |
// the type of the passed in WebFrame. |
// FIXME: This is a bit clunky; this results in pointless decrements and |
// increments of connected subframes. |
- Frame* oldFrame = toCoreFrame(this); |
FrameOwner* owner = oldFrame->owner(); |
oldFrame->disconnectOwnerElement(); |
if (frame->isWebLocalFrame()) { |