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

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

Issue 2833733002: Avoid firing load events on style elements if there is no listeners for that (Closed)
Patch Set: fix style 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('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 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 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) 2010 Nokia Corporation and/or its subsidiary(-ies) 10 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
784 DOMSUBTREEMODIFIED_LISTENER = 1, 784 DOMSUBTREEMODIFIED_LISTENER = 1,
785 DOMNODEINSERTED_LISTENER = 1 << 1, 785 DOMNODEINSERTED_LISTENER = 1 << 1,
786 DOMNODEREMOVED_LISTENER = 1 << 2, 786 DOMNODEREMOVED_LISTENER = 1 << 2,
787 DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 1 << 3, 787 DOMNODEREMOVEDFROMDOCUMENT_LISTENER = 1 << 3,
788 DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4, 788 DOMNODEINSERTEDINTODOCUMENT_LISTENER = 1 << 4,
789 DOMCHARACTERDATAMODIFIED_LISTENER = 1 << 5, 789 DOMCHARACTERDATAMODIFIED_LISTENER = 1 << 5,
790 ANIMATIONEND_LISTENER = 1 << 6, 790 ANIMATIONEND_LISTENER = 1 << 6,
791 ANIMATIONSTART_LISTENER = 1 << 7, 791 ANIMATIONSTART_LISTENER = 1 << 7,
792 ANIMATIONITERATION_LISTENER = 1 << 8, 792 ANIMATIONITERATION_LISTENER = 1 << 8,
793 TRANSITIONEND_LISTENER = 1 << 9, 793 TRANSITIONEND_LISTENER = 1 << 9,
794 SCROLL_LISTENER = 1 << 10 794 SCROLL_LISTENER = 1 << 10,
795 // 5 bits remaining 795 LOAD_LISTENER_AT_CAPTURE_PHASE_OR_AT_STYLE_ELEMENT = 1 << 11
796 // 4 bits remaining
tkent 2017/04/25 01:36:32 Oh, this enum wasn't renamed to kCamelCase.
hayato 2017/04/25 01:40:13 Ah, I didn't notice it. :) I can rename these in a
796 }; 797 };
797 798
798 bool HasListenerType(ListenerType listener_type) const { 799 bool HasListenerType(ListenerType listener_type) const {
799 return (listener_types_ & listener_type); 800 return (listener_types_ & listener_type);
800 } 801 }
801 void AddListenerTypeIfNeeded(const AtomicString& event_type); 802 void AddListenerTypeIfNeeded(const AtomicString& event_type, EventTarget&);
802 803
803 bool HasMutationObserversOfType(MutationObserver::MutationType type) const { 804 bool HasMutationObserversOfType(MutationObserver::MutationType type) const {
804 return mutation_observer_types_ & type; 805 return mutation_observer_types_ & type;
805 } 806 }
806 bool HasMutationObservers() const { return mutation_observer_types_; } 807 bool HasMutationObservers() const { return mutation_observer_types_; }
807 void AddMutationObserverTypes(MutationObserverOptions types) { 808 void AddMutationObserverTypes(MutationObserverOptions types) {
808 mutation_observer_types_ |= types; 809 mutation_observer_types_ |= types;
809 } 810 }
810 811
811 IntersectionObserverController* GetIntersectionObserverController(); 812 IntersectionObserverController* GetIntersectionObserverController();
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true); 1732 DEFINE_TYPE_CASTS(TreeScope, Document, document, true, true);
1732 1733
1733 } // namespace blink 1734 } // namespace blink
1734 1735
1735 #ifndef NDEBUG 1736 #ifndef NDEBUG
1736 // Outside the WebCore namespace for ease of invocation from gdb. 1737 // Outside the WebCore namespace for ease of invocation from gdb.
1737 CORE_EXPORT void showLiveDocumentInstances(); 1738 CORE_EXPORT void showLiveDocumentInstances();
1738 #endif 1739 #endif
1739 1740
1740 #endif // Document_h 1741 #endif // Document_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698