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

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

Issue 2835223003: Use kCamelCase in Document::ListenerType enum (Closed)
Patch Set: renamed Created 3 years, 7 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
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 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All rights
6 * reserved. 6 * reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 return; 1230 return;
1231 1231
1232 #if DCHECK_IS_ON() 1232 #if DCHECK_IS_ON()
1233 DCHECK(!EventDispatchForbiddenScope::IsEventDispatchForbidden()); 1233 DCHECK(!EventDispatchForbiddenScope::IsEventDispatchForbidden());
1234 #endif 1234 #endif
1235 1235
1236 Node* c = &child; 1236 Node* c = &child;
1237 Document* document = &child.GetDocument(); 1237 Document* document = &child.GetDocument();
1238 1238
1239 if (c->parentNode() && 1239 if (c->parentNode() &&
1240 document->HasListenerType(Document::DOMNODEINSERTED_LISTENER)) 1240 document->HasListenerType(Document::kDOMNodeInsertedListener))
1241 c->DispatchScopedEvent(MutationEvent::Create( 1241 c->DispatchScopedEvent(MutationEvent::Create(
1242 EventTypeNames::DOMNodeInserted, true, c->parentNode())); 1242 EventTypeNames::DOMNodeInserted, true, c->parentNode()));
1243 1243
1244 // dispatch the DOMNodeInsertedIntoDocument event to all descendants 1244 // dispatch the DOMNodeInsertedIntoDocument event to all descendants
1245 if (c->isConnected() && document->HasListenerType( 1245 if (c->isConnected() && document->HasListenerType(
1246 Document::DOMNODEINSERTEDINTODOCUMENT_LISTENER)) { 1246 Document::kDOMNodeInsertedIntoDocumentListener)) {
1247 for (; c; c = NodeTraversal::Next(*c, &child)) 1247 for (; c; c = NodeTraversal::Next(*c, &child))
1248 c->DispatchScopedEvent(MutationEvent::Create( 1248 c->DispatchScopedEvent(MutationEvent::Create(
1249 EventTypeNames::DOMNodeInsertedIntoDocument, false)); 1249 EventTypeNames::DOMNodeInsertedIntoDocument, false));
1250 } 1250 }
1251 } 1251 }
1252 1252
1253 static void DispatchChildRemovalEvents(Node& child) { 1253 static void DispatchChildRemovalEvents(Node& child) {
1254 if (child.IsInShadowTree()) { 1254 if (child.IsInShadowTree()) {
1255 probe::willRemoveDOMNode(&child); 1255 probe::willRemoveDOMNode(&child);
1256 return; 1256 return;
1257 } 1257 }
1258 1258
1259 #if DCHECK_IS_ON() 1259 #if DCHECK_IS_ON()
1260 DCHECK(!EventDispatchForbiddenScope::IsEventDispatchForbidden()); 1260 DCHECK(!EventDispatchForbiddenScope::IsEventDispatchForbidden());
1261 #endif 1261 #endif
1262 1262
1263 probe::willRemoveDOMNode(&child); 1263 probe::willRemoveDOMNode(&child);
1264 1264
1265 Node* c = &child; 1265 Node* c = &child;
1266 Document* document = &child.GetDocument(); 1266 Document* document = &child.GetDocument();
1267 1267
1268 // Dispatch pre-removal mutation events. 1268 // Dispatch pre-removal mutation events.
1269 if (c->parentNode() && 1269 if (c->parentNode() &&
1270 document->HasListenerType(Document::DOMNODEREMOVED_LISTENER)) { 1270 document->HasListenerType(Document::kDOMNodeRemovedListener)) {
1271 NodeChildRemovalTracker scope(child); 1271 NodeChildRemovalTracker scope(child);
1272 c->DispatchScopedEvent(MutationEvent::Create(EventTypeNames::DOMNodeRemoved, 1272 c->DispatchScopedEvent(MutationEvent::Create(EventTypeNames::DOMNodeRemoved,
1273 true, c->parentNode())); 1273 true, c->parentNode()));
1274 } 1274 }
1275 1275
1276 // Dispatch the DOMNodeRemovedFromDocument event to all descendants. 1276 // Dispatch the DOMNodeRemovedFromDocument event to all descendants.
1277 if (c->isConnected() && document->HasListenerType( 1277 if (c->isConnected() && document->HasListenerType(
1278 Document::DOMNODEREMOVEDFROMDOCUMENT_LISTENER)) { 1278 Document::kDOMNodeRemovedFromDocumentListener)) {
1279 NodeChildRemovalTracker scope(child); 1279 NodeChildRemovalTracker scope(child);
1280 for (; c; c = NodeTraversal::Next(*c, &child)) 1280 for (; c; c = NodeTraversal::Next(*c, &child))
1281 c->DispatchScopedEvent(MutationEvent::Create( 1281 c->DispatchScopedEvent(MutationEvent::Create(
1282 EventTypeNames::DOMNodeRemovedFromDocument, false)); 1282 EventTypeNames::DOMNodeRemovedFromDocument, false));
1283 } 1283 }
1284 } 1284 }
1285 1285
1286 bool ContainerNode::HasRestyleFlagInternal(DynamicRestyleFlags mask) const { 1286 bool ContainerNode::HasRestyleFlagInternal(DynamicRestyleFlags mask) const {
1287 return RareData()->HasRestyleFlag(mask); 1287 return RareData()->HasRestyleFlag(mask);
1288 } 1288 }
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1519 return true; 1519 return true;
1520 1520
1521 if (node->IsElementNode() && ToElement(node)->Shadow()) 1521 if (node->IsElementNode() && ToElement(node)->Shadow())
1522 return true; 1522 return true;
1523 1523
1524 return false; 1524 return false;
1525 } 1525 }
1526 #endif 1526 #endif
1527 1527
1528 } // namespace blink 1528 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/CharacterData.cpp ('k') | third_party/WebKit/Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698