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

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

Issue 10987026: Merge 129469 - adoptNode() shouldn't reset ownerDocument if the source node failed to remove itself (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 2 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/adopt-node-prevented-expected.txt ('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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 } 1058 }
1059 1059
1060 // FIXME: What about <frame> and <object>? 1060 // FIXME: What about <frame> and <object>?
1061 if (source->hasTagName(iframeTag)) { 1061 if (source->hasTagName(iframeTag)) {
1062 HTMLIFrameElement* iframe = static_cast<HTMLIFrameElement*>(source.g et()); 1062 HTMLIFrameElement* iframe = static_cast<HTMLIFrameElement*>(source.g et());
1063 if (frame() && frame()->tree()->isDescendantOf(iframe->contentFrame( ))) { 1063 if (frame() && frame()->tree()->isDescendantOf(iframe->contentFrame( ))) {
1064 ec = HIERARCHY_REQUEST_ERR; 1064 ec = HIERARCHY_REQUEST_ERR;
1065 return 0; 1065 return 0;
1066 } 1066 }
1067 } 1067 }
1068 if (source->parentNode()) 1068 if (source->parentNode()) {
1069 source->parentNode()->removeChild(source.get(), ec); 1069 source->parentNode()->removeChild(source.get(), ec);
1070 if (ec)
1071 return 0;
1072 }
1070 } 1073 }
1071 1074
1072 this->adoptIfNeeded(source.get()); 1075 this->adoptIfNeeded(source.get());
1073 1076
1074 return source; 1077 return source;
1075 } 1078 }
1076 1079
1077 bool Document::hasValidNamespaceForElements(const QualifiedName& qName) 1080 bool Document::hasValidNamespaceForElements(const QualifiedName& qName)
1078 { 1081 {
1079 // These checks are from DOM Core Level 2, createElementNS 1082 // These checks are from DOM Core Level 2, createElementNS
(...skipping 5082 matching lines...) Expand 10 before | Expand all | Expand 10 after
6162 #if ENABLE(UNDO_MANAGER) 6165 #if ENABLE(UNDO_MANAGER)
6163 PassRefPtr<UndoManager> Document::undoManager() 6166 PassRefPtr<UndoManager> Document::undoManager()
6164 { 6167 {
6165 if (!m_undoManager) 6168 if (!m_undoManager)
6166 m_undoManager = UndoManager::create(this); 6169 m_undoManager = UndoManager::create(this);
6167 return m_undoManager; 6170 return m_undoManager;
6168 } 6171 }
6169 #endif 6172 #endif
6170 6173
6171 } // namespace WebCore 6174 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/adopt-node-prevented-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698