Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: Source/WebCore/dom/TreeScopeAdopter.cpp

Issue 9617035: Merge 107519 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/dom/resources/node-move-to-new-document-crash.svg ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 ASSERT_UNUSED(oldDocument, oldDocument == oldDocumentDidMoveToNewDocumentWas CalledWith); 89 ASSERT_UNUSED(oldDocument, oldDocument == oldDocumentDidMoveToNewDocumentWas CalledWith);
90 didMoveToNewDocumentWasCalled = true; 90 didMoveToNewDocumentWasCalled = true;
91 } 91 }
92 #endif 92 #endif
93 93
94 inline void TreeScopeAdopter::moveNodeToNewDocument(Node* node, Document* oldDoc ument, Document* newDocument) const 94 inline void TreeScopeAdopter::moveNodeToNewDocument(Node* node, Document* oldDoc ument, Document* newDocument) const
95 { 95 {
96 ASSERT(!node->inDocument() || oldDocument != newDocument); 96 ASSERT(!node->inDocument() || oldDocument != newDocument);
97 97
98 newDocument->guardRef(); 98 newDocument->guardRef();
99 if (oldDocument) { 99 if (oldDocument)
100 oldDocument->moveNodeIteratorsToNewDocument(node, newDocument); 100 oldDocument->moveNodeIteratorsToNewDocument(node, newDocument);
101 oldDocument->guardDeref();
102 }
103 101
104 node->setDocument(newDocument); 102 node->setDocument(newDocument);
105 103
106 #ifndef NDEBUG 104 #ifndef NDEBUG
107 didMoveToNewDocumentWasCalled = false; 105 didMoveToNewDocumentWasCalled = false;
108 oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument; 106 oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;
109 #endif 107 #endif
110 108
111 node->didMoveToNewDocument(oldDocument); 109 node->didMoveToNewDocument(oldDocument);
112 ASSERT(didMoveToNewDocumentWasCalled); 110 ASSERT(didMoveToNewDocumentWasCalled);
111
112 if (oldDocument)
113 oldDocument->guardDeref();
113 } 114 }
114 115
115 } 116 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/resources/node-move-to-new-document-crash.svg ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698