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

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

Issue 206603002: Add EventHandlerRegistry (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added comments. Replaced nullptr with 0 to fix build. Created 6 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, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 InvalidateOnClassAttrChange, 187 InvalidateOnClassAttrChange,
188 InvalidateOnIdNameAttrChange, 188 InvalidateOnIdNameAttrChange,
189 InvalidateOnNameAttrChange, 189 InvalidateOnNameAttrChange,
190 InvalidateOnForAttrChange, 190 InvalidateOnForAttrChange,
191 InvalidateForFormControls, 191 InvalidateForFormControls,
192 InvalidateOnHRefAttrChange, 192 InvalidateOnHRefAttrChange,
193 InvalidateOnAnyAttrChange, 193 InvalidateOnAnyAttrChange,
194 }; 194 };
195 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1; 195 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1;
196 196
197 typedef HashCountedSet<Node*> TouchEventTargetSet;
198
199 enum DocumentClass { 197 enum DocumentClass {
200 DefaultDocumentClass = 0, 198 DefaultDocumentClass = 0,
201 HTMLDocumentClass = 1, 199 HTMLDocumentClass = 1,
202 XHTMLDocumentClass = 1 << 1, 200 XHTMLDocumentClass = 1 << 1,
203 ImageDocumentClass = 1 << 2, 201 ImageDocumentClass = 1 << 2,
204 PluginDocumentClass = 1 << 3, 202 PluginDocumentClass = 1 << 3,
205 MediaDocumentClass = 1 << 4, 203 MediaDocumentClass = 1 << 4,
206 SVGDocumentClass = 1 << 5, 204 SVGDocumentClass = 1 << 5,
207 XMLDocumentClass = 1 << 6, 205 XMLDocumentClass = 1 << 6,
208 }; 206 };
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 944
947 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); 945 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
948 void cancelAnimationFrame(int id); 946 void cancelAnimationFrame(int id);
949 void serviceScriptedAnimations(double monotonicAnimationStartTime); 947 void serviceScriptedAnimations(double monotonicAnimationStartTime);
950 948
951 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; 949 virtual EventTarget* errorEventTarget() OVERRIDE FINAL;
952 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) OVERR IDE FINAL; 950 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) OVERR IDE FINAL;
953 951
954 void initDNSPrefetch(); 952 void initDNSPrefetch();
955 953
956 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_ touchEventTargets->size() : false; }
957
958 // Called when a single touch event handler has been added or removed for a node.
959 // The Node should always be in this Document, except for child Documents wh ich report
960 // themselves to their parent exactly once if they have any touch handlers.
961 // Handlers added/removed from the DOMWindow are reported as the Document.
962 void didAddTouchEventHandler(Node*);
963 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler( handler, false); }
964
965 // Called whenever all touch event handlers have been removed for a node (su ch as when the
966 // node itself is being removed from the document).
967 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler( handler, true); }
968
969 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa rgets.get(); }
970
971 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 954 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
972 955
973 IntSize initialViewportSize() const; 956 IntSize initialViewportSize() const;
974 957
975 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer. 958 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer.
976 // See http://tinyurl.com/chromium-fast-autosizer for more details. 959 // See http://tinyurl.com/chromium-fast-autosizer for more details.
977 TextAutosizer* textAutosizer(); 960 TextAutosizer* textAutosizer();
978 FastTextAutosizer* fastTextAutosizer(); 961 FastTextAutosizer* fastTextAutosizer();
979 962
980 PassRefPtr<Element> createElement(const AtomicString& localName, const Atomi cString& typeExtension, ExceptionState&); 963 PassRefPtr<Element> createElement(const AtomicString& localName, const Atomi cString& typeExtension, ExceptionState&);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 1130
1148 void clearFocusedElementSoon(); 1131 void clearFocusedElementSoon();
1149 void clearFocusedElementTimerFired(Timer<Document>*); 1132 void clearFocusedElementTimerFired(Timer<Document>*);
1150 1133
1151 void processHttpEquivDefaultStyle(const AtomicString& content); 1134 void processHttpEquivDefaultStyle(const AtomicString& content);
1152 void processHttpEquivRefresh(const AtomicString& content); 1135 void processHttpEquivRefresh(const AtomicString& content);
1153 void processHttpEquivSetCookie(const AtomicString& content); 1136 void processHttpEquivSetCookie(const AtomicString& content);
1154 void processHttpEquivXFrameOptions(const AtomicString& content); 1137 void processHttpEquivXFrameOptions(const AtomicString& content);
1155 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content); 1138 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
1156 1139
1157 void didRemoveTouchEventHandler(Node*, bool clearAll);
1158
1159 bool needsRenderTreeUpdate() const; 1140 bool needsRenderTreeUpdate() const;
1160 bool shouldScheduleRenderTreeUpdate() const; 1141 bool shouldScheduleRenderTreeUpdate() const;
1161 bool haveStylesheetsLoaded() const; 1142 bool haveStylesheetsLoaded() const;
1162 1143
1163 DocumentLifecycle m_lifecycle; 1144 DocumentLifecycle m_lifecycle;
1164 1145
1165 bool m_hasNodesWithPlaceholderStyle; 1146 bool m_hasNodesWithPlaceholderStyle;
1166 bool m_needsNotifyRemoveAllPendingStylesheet; 1147 bool m_needsNotifyRemoveAllPendingStylesheet;
1167 bool m_evaluateMediaQueriesOnStyleRecalc; 1148 bool m_evaluateMediaQueriesOnStyleRecalc;
1168 1149
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 bool m_didSetReferrerPolicy; 1304 bool m_didSetReferrerPolicy;
1324 ReferrerPolicy m_referrerPolicy; 1305 ReferrerPolicy m_referrerPolicy;
1325 1306
1326 bool m_directionSetOnDocumentElement; 1307 bool m_directionSetOnDocumentElement;
1327 bool m_writingModeSetOnDocumentElement; 1308 bool m_writingModeSetOnDocumentElement;
1328 DocumentTiming m_documentTiming; 1309 DocumentTiming m_documentTiming;
1329 RefPtrWillBePersistent<MediaQueryMatcher> m_mediaQueryMatcher; 1310 RefPtrWillBePersistent<MediaQueryMatcher> m_mediaQueryMatcher;
1330 bool m_writeRecursionIsTooDeep; 1311 bool m_writeRecursionIsTooDeep;
1331 unsigned m_writeRecursionDepth; 1312 unsigned m_writeRecursionDepth;
1332 1313
1333 OwnPtr<TouchEventTargetSet> m_touchEventTargets;
1334
1335 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; 1314 RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
1336 OwnPtr<MainThreadTaskRunner> m_taskRunner; 1315 OwnPtr<MainThreadTaskRunner> m_taskRunner;
1337 OwnPtr<TextAutosizer> m_textAutosizer; 1316 OwnPtr<TextAutosizer> m_textAutosizer;
1338 OwnPtr<FastTextAutosizer> m_fastTextAutosizer; 1317 OwnPtr<FastTextAutosizer> m_fastTextAutosizer;
1339 1318
1340 RefPtr<CustomElementRegistrationContext> m_registrationContext; 1319 RefPtr<CustomElementRegistrationContext> m_registrationContext;
1341 1320
1342 void elementDataCacheClearTimerFired(Timer<Document>*); 1321 void elementDataCacheClearTimerFired(Timer<Document>*);
1343 Timer<Document> m_elementDataCacheClearTimer; 1322 Timer<Document> m_elementDataCacheClearTimer;
1344 1323
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
1424 inline bool Node::isDocumentNode() const 1403 inline bool Node::isDocumentNode() const
1425 { 1404 {
1426 return this == document(); 1405 return this == document();
1427 } 1406 }
1428 1407
1429 Node* eventTargetNodeForDocument(Document*); 1408 Node* eventTargetNodeForDocument(Document*);
1430 1409
1431 } // namespace WebCore 1410 } // namespace WebCore
1432 1411
1433 #endif // Document_h 1412 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698