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

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

Issue 2835223003: Use kCamelCase in Document::ListenerType enum (Closed)
Patch Set: renamed Created 3 years, 8 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 * (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 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All
7 * rights reserved. 7 * rights reserved.
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
9 * (http://www.torchmobile.com/) 9 * (http://www.torchmobile.com/)
10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 10 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
(...skipping 4538 matching lines...) Expand 10 before | Expand all | Expand 10 after
4549 void Document::AddMutationEventListenerTypeIfEnabled( 4549 void Document::AddMutationEventListenerTypeIfEnabled(
4550 ListenerType listener_type) { 4550 ListenerType listener_type) {
4551 if (ContextFeatures::MutationEventsEnabled(this)) 4551 if (ContextFeatures::MutationEventsEnabled(this))
4552 AddListenerType(listener_type); 4552 AddListenerType(listener_type);
4553 } 4553 }
4554 4554
4555 void Document::AddListenerTypeIfNeeded(const AtomicString& event_type, 4555 void Document::AddListenerTypeIfNeeded(const AtomicString& event_type,
4556 EventTarget& event_target) { 4556 EventTarget& event_target) {
4557 if (event_type == EventTypeNames::DOMSubtreeModified) { 4557 if (event_type == EventTypeNames::DOMSubtreeModified) {
4558 UseCounter::Count(*this, UseCounter::kDOMSubtreeModifiedEvent); 4558 UseCounter::Count(*this, UseCounter::kDOMSubtreeModifiedEvent);
4559 AddMutationEventListenerTypeIfEnabled(DOMSUBTREEMODIFIED_LISTENER); 4559 AddMutationEventListenerTypeIfEnabled(kDOMSubtreeModifiedListener);
4560 } else if (event_type == EventTypeNames::DOMNodeInserted) { 4560 } else if (event_type == EventTypeNames::DOMNodeInserted) {
4561 UseCounter::Count(*this, UseCounter::kDOMNodeInsertedEvent); 4561 UseCounter::Count(*this, UseCounter::kDOMNodeInsertedEvent);
4562 AddMutationEventListenerTypeIfEnabled(DOMNODEINSERTED_LISTENER); 4562 AddMutationEventListenerTypeIfEnabled(kDOMNodeInsertedListener);
4563 } else if (event_type == EventTypeNames::DOMNodeRemoved) { 4563 } else if (event_type == EventTypeNames::DOMNodeRemoved) {
4564 UseCounter::Count(*this, UseCounter::kDOMNodeRemovedEvent); 4564 UseCounter::Count(*this, UseCounter::kDOMNodeRemovedEvent);
4565 AddMutationEventListenerTypeIfEnabled(DOMNODEREMOVED_LISTENER); 4565 AddMutationEventListenerTypeIfEnabled(kDOMNodeRemovedListener);
4566 } else if (event_type == EventTypeNames::DOMNodeRemovedFromDocument) { 4566 } else if (event_type == EventTypeNames::DOMNodeRemovedFromDocument) {
4567 UseCounter::Count(*this, UseCounter::kDOMNodeRemovedFromDocumentEvent); 4567 UseCounter::Count(*this, UseCounter::kDOMNodeRemovedFromDocumentEvent);
4568 AddMutationEventListenerTypeIfEnabled(DOMNODEREMOVEDFROMDOCUMENT_LISTENER); 4568 AddMutationEventListenerTypeIfEnabled(kDOMNodeRemovedFromDocumentListener);
4569 } else if (event_type == EventTypeNames::DOMNodeInsertedIntoDocument) { 4569 } else if (event_type == EventTypeNames::DOMNodeInsertedIntoDocument) {
4570 UseCounter::Count(*this, UseCounter::kDOMNodeInsertedIntoDocumentEvent); 4570 UseCounter::Count(*this, UseCounter::kDOMNodeInsertedIntoDocumentEvent);
4571 AddMutationEventListenerTypeIfEnabled(DOMNODEINSERTEDINTODOCUMENT_LISTENER); 4571 AddMutationEventListenerTypeIfEnabled(kDOMNodeInsertedIntoDocumentListener);
4572 } else if (event_type == EventTypeNames::DOMCharacterDataModified) { 4572 } else if (event_type == EventTypeNames::DOMCharacterDataModified) {
4573 UseCounter::Count(*this, UseCounter::kDOMCharacterDataModifiedEvent); 4573 UseCounter::Count(*this, UseCounter::kDOMCharacterDataModifiedEvent);
4574 AddMutationEventListenerTypeIfEnabled(DOMCHARACTERDATAMODIFIED_LISTENER); 4574 AddMutationEventListenerTypeIfEnabled(kDOMCharacterDataModifiedListener);
4575 } else if (event_type == EventTypeNames::webkitAnimationStart || 4575 } else if (event_type == EventTypeNames::webkitAnimationStart ||
4576 event_type == EventTypeNames::animationstart) { 4576 event_type == EventTypeNames::animationstart) {
4577 AddListenerType(ANIMATIONSTART_LISTENER); 4577 AddListenerType(kAnimationStartListener);
4578 } else if (event_type == EventTypeNames::webkitAnimationEnd || 4578 } else if (event_type == EventTypeNames::webkitAnimationEnd ||
4579 event_type == EventTypeNames::animationend) { 4579 event_type == EventTypeNames::animationend) {
4580 AddListenerType(ANIMATIONEND_LISTENER); 4580 AddListenerType(kAnimationEndListener);
4581 } else if (event_type == EventTypeNames::webkitAnimationIteration || 4581 } else if (event_type == EventTypeNames::webkitAnimationIteration ||
4582 event_type == EventTypeNames::animationiteration) { 4582 event_type == EventTypeNames::animationiteration) {
4583 AddListenerType(ANIMATIONITERATION_LISTENER); 4583 AddListenerType(kAnimationIterationListener);
4584 if (View()) { 4584 if (View()) {
4585 // Need to re-evaluate time-to-effect-change for any running animations. 4585 // Need to re-evaluate time-to-effect-change for any running animations.
4586 View()->ScheduleAnimation(); 4586 View()->ScheduleAnimation();
4587 } 4587 }
4588 } else if (event_type == EventTypeNames::webkitTransitionEnd || 4588 } else if (event_type == EventTypeNames::webkitTransitionEnd ||
4589 event_type == EventTypeNames::transitionend) { 4589 event_type == EventTypeNames::transitionend) {
4590 AddListenerType(TRANSITIONEND_LISTENER); 4590 AddListenerType(kTransitionEndListener);
4591 } else if (event_type == EventTypeNames::scroll) { 4591 } else if (event_type == EventTypeNames::scroll) {
4592 AddListenerType(SCROLL_LISTENER); 4592 AddListenerType(kScrollListener);
4593 } else if (event_type == EventTypeNames::load) { 4593 } else if (event_type == EventTypeNames::load) {
4594 if (Node* node = event_target.ToNode()) { 4594 if (Node* node = event_target.ToNode()) {
4595 if (isHTMLStyleElement(*node)) { 4595 if (isHTMLStyleElement(*node)) {
4596 AddListenerType(LOAD_LISTENER_AT_CAPTURE_PHASE_OR_AT_STYLE_ELEMENT); 4596 AddListenerType(kLoadListenerAtCapturePhaseOrAtStyleElement);
4597 return; 4597 return;
4598 } 4598 }
4599 } 4599 }
4600 if (event_target.HasCapturingEventListeners(event_type)) 4600 if (event_target.HasCapturingEventListeners(event_type))
4601 AddListenerType(LOAD_LISTENER_AT_CAPTURE_PHASE_OR_AT_STYLE_ELEMENT); 4601 AddListenerType(kLoadListenerAtCapturePhaseOrAtStyleElement);
4602 } 4602 }
4603 } 4603 }
4604 4604
4605 HTMLFrameOwnerElement* Document::LocalOwner() const { 4605 HTMLFrameOwnerElement* Document::LocalOwner() const {
4606 if (!GetFrame()) 4606 if (!GetFrame())
4607 return 0; 4607 return 0;
4608 // FIXME: This probably breaks the attempts to layout after a load is finished 4608 // FIXME: This probably breaks the attempts to layout after a load is finished
4609 // in implicitClose(), and probably tons of other things... 4609 // in implicitClose(), and probably tons of other things...
4610 return GetFrame()->DeprecatedLocalOwner(); 4610 return GetFrame()->DeprecatedLocalOwner();
4611 } 4611 }
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
6691 } 6691 }
6692 6692
6693 void showLiveDocumentInstances() { 6693 void showLiveDocumentInstances() {
6694 WeakDocumentSet& set = liveDocumentSet(); 6694 WeakDocumentSet& set = liveDocumentSet();
6695 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6695 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6696 for (blink::Document* document : set) 6696 for (blink::Document* document : set)
6697 fprintf(stderr, "- Document %p URL: %s\n", document, 6697 fprintf(stderr, "- Document %p URL: %s\n", document,
6698 document->Url().GetString().Utf8().data()); 6698 document->Url().GetString().Utf8().data());
6699 } 6699 }
6700 #endif 6700 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698