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

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

Issue 6685081: Merge 80487 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 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 | « Source/WebCore/dom/Node.h ('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 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights 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 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec) 1177 void Node::checkReplaceChild(Node* newChild, Node* oldChild, ExceptionCode& ec)
1178 { 1178 {
1179 checkAcceptChild(this, newChild, ec); 1179 checkAcceptChild(this, newChild, ec);
1180 if (ec) 1180 if (ec)
1181 return; 1181 return;
1182 1182
1183 if (!canReplaceChild(newChild, oldChild)) { 1183 if (!canReplaceChild(newChild, oldChild)) {
1184 ec = HIERARCHY_REQUEST_ERR; 1184 ec = HIERARCHY_REQUEST_ERR;
1185 return; 1185 return;
1186 } 1186 }
1187
1188 newChild->setDocumentRecursively(document());
1189 } 1187 }
1190 1188
1191 void Node::checkAddChild(Node *newChild, ExceptionCode& ec) 1189 void Node::checkAddChild(Node *newChild, ExceptionCode& ec)
1192 { 1190 {
1193 checkAcceptChild(this, newChild, ec); 1191 checkAcceptChild(this, newChild, ec);
1194 if (ec) 1192 if (ec)
1195 return; 1193 return;
1196 1194
1197 if (!isChildTypeAllowed(this, newChild)) { 1195 if (!isChildTypeAllowed(this, newChild)) {
1198 ec = HIERARCHY_REQUEST_ERR; 1196 ec = HIERARCHY_REQUEST_ERR;
1199 return; 1197 return;
1200 } 1198 }
1201
1202 newChild->setDocumentRecursively(document());
1203 } 1199 }
1204 1200
1205 bool Node::isDescendantOf(const Node *other) const 1201 bool Node::isDescendantOf(const Node *other) const
1206 { 1202 {
1207 // Return true if other is an ancestor of this, otherwise false 1203 // Return true if other is an ancestor of this, otherwise false
1208 if (!other) 1204 if (!other)
1209 return false; 1205 return false;
1210 for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) { 1206 for (const ContainerNode* n = parentNode(); n; n = n->parentNode()) {
1211 if (n == other) 1207 if (n == other)
1212 return true; 1208 return true;
(...skipping 1838 matching lines...) Expand 10 before | Expand all | Expand 10 after
3051 3047
3052 #ifndef NDEBUG 3048 #ifndef NDEBUG
3053 3049
3054 void showTree(const WebCore::Node* node) 3050 void showTree(const WebCore::Node* node)
3055 { 3051 {
3056 if (node) 3052 if (node)
3057 node->showTreeForThis(); 3053 node->showTreeForThis();
3058 } 3054 }
3059 3055
3060 #endif 3056 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/dom/Node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698