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

Side by Side Diff: Source/core/dom/ContainerNode.cpp

Issue 22880019: [DOM4] Doctypes now always have a node document and can be moved across document boundaries (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add missing test Created 7 years, 4 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 | Annotate | Revision Log
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 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return true; 166 return true;
167 } 167 }
168 168
169 // This should never happen, but also protect release builds from tree corru ption. 169 // This should never happen, but also protect release builds from tree corru ption.
170 ASSERT(!newChild->isPseudoElement()); 170 ASSERT(!newChild->isPseudoElement());
171 if (newChild->isPseudoElement()) { 171 if (newChild->isPseudoElement()) {
172 es.throwDOMException(HierarchyRequestError); 172 es.throwDOMException(HierarchyRequestError);
173 return false; 173 return false;
174 } 174 }
175 175
176 if (newChild->inDocument() && newChild->isDocumentTypeNode()) {
177 es.throwDOMException(HierarchyRequestError);
178 return false;
179 }
180 if (containsConsideringHostElements(newChild, newParent)) { 176 if (containsConsideringHostElements(newChild, newParent)) {
181 es.throwDOMException(HierarchyRequestError); 177 es.throwDOMException(HierarchyRequestError);
182 return false; 178 return false;
183 } 179 }
184 180
185 if (oldChild && newParent->isDocumentNode()) { 181 if (oldChild && newParent->isDocumentNode()) {
186 if (!toDocument(newParent)->canReplaceChild(newChild, oldChild)) { 182 if (!toDocument(newParent)->canReplaceChild(newChild, oldChild)) {
187 es.throwDOMException(HierarchyRequestError); 183 es.throwDOMException(HierarchyRequestError);
188 return false; 184 return false;
189 } 185 }
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 return true; 1047 return true;
1052 1048
1053 if (node->isElementNode() && toElement(node)->shadow()) 1049 if (node->isElementNode() && toElement(node)->shadow())
1054 return true; 1050 return true;
1055 1051
1056 return false; 1052 return false;
1057 } 1053 }
1058 #endif 1054 #endif
1059 1055
1060 } // namespace WebCore 1056 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698