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

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

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 5 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
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Document.h » ('j') | 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, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights reserved.
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 #include "core/rendering/RenderView.h" 53 #include "core/rendering/RenderView.h"
54 #include "platform/ScriptForbiddenScope.h" 54 #include "platform/ScriptForbiddenScope.h"
55 55
56 namespace WebCore { 56 namespace WebCore {
57 57
58 using namespace HTMLNames; 58 using namespace HTMLNames;
59 59
60 static void dispatchChildInsertionEvents(Node&); 60 static void dispatchChildInsertionEvents(Node&);
61 static void dispatchChildRemovalEvents(Node&); 61 static void dispatchChildRemovalEvents(Node&);
62 62
63 #ifndef NDEBUG 63 #if ENABLE(ASSERT)
64 unsigned NoEventDispatchAssertion::s_count = 0; 64 unsigned NoEventDispatchAssertion::s_count = 0;
65 #endif 65 #endif
66 66
67 static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState) 67 static void collectChildrenAndRemoveFromOldParent(Node& node, NodeVector& nodes, ExceptionState& exceptionState)
68 { 68 {
69 if (!node.isDocumentFragment()) { 69 if (!node.isDocumentFragment()) {
70 nodes.append(&node); 70 nodes.append(&node);
71 if (ContainerNode* oldParent = node.parentNode()) 71 if (ContainerNode* oldParent = node.parentNode())
72 oldParent->removeChild(&node, exceptionState); 72 oldParent->removeChild(&node, exceptionState);
73 return; 73 return;
(...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after
1370 } 1370 }
1371 1371
1372 // Fall back to traversing our subtree. In case of duplicate ids, the first element found will be returned. 1372 // Fall back to traversing our subtree. In case of duplicate ids, the first element found will be returned.
1373 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) { 1373 for (Element* element = ElementTraversal::firstWithin(*this); element; eleme nt = ElementTraversal::next(*element, this)) {
1374 if (element->getIdAttribute() == id) 1374 if (element->getIdAttribute() == id)
1375 return element; 1375 return element;
1376 } 1376 }
1377 return 0; 1377 return 0;
1378 } 1378 }
1379 1379
1380 #ifndef NDEBUG 1380 #if ENABLE(ASSERT)
1381 bool childAttachedAllowedWhenAttachingChildren(ContainerNode* node) 1381 bool childAttachedAllowedWhenAttachingChildren(ContainerNode* node)
1382 { 1382 {
1383 if (node->isShadowRoot()) 1383 if (node->isShadowRoot())
1384 return true; 1384 return true;
1385 1385
1386 if (node->isInsertionPoint()) 1386 if (node->isInsertionPoint())
1387 return true; 1387 return true;
1388 1388
1389 if (node->isElementNode() && toElement(node)->shadow()) 1389 if (node->isElementNode() && toElement(node)->shadow())
1390 return true; 1390 return true;
1391 1391
1392 return false; 1392 return false;
1393 } 1393 }
1394 #endif 1394 #endif
1395 1395
1396 } // namespace WebCore 1396 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/ContainerNode.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698