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

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: More comments. 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; } 954 double lastHandledUserGestureTimestamp() const { return m_lastHandledUserGes tureTimestamp; }
Rick Byers 2014/04/04 20:12:27 Looks like you added this back (after it was remov
Sami 2014/04/07 14:56:49 Oh, thanks for pointing this out. I was working re
957 955 void resetLastHandledUserGestureTimestamp();
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 956
971 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 957 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
972 958
973 IntSize initialViewportSize() const; 959 IntSize initialViewportSize() const;
974 960
975 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer. 961 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer.
976 // See http://tinyurl.com/chromium-fast-autosizer for more details. 962 // See http://tinyurl.com/chromium-fast-autosizer for more details.
977 TextAutosizer* textAutosizer(); 963 TextAutosizer* textAutosizer();
978 FastTextAutosizer* fastTextAutosizer(); 964 FastTextAutosizer* fastTextAutosizer();
979 965
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 1133
1148 void clearFocusedElementSoon(); 1134 void clearFocusedElementSoon();
1149 void clearFocusedElementTimerFired(Timer<Document>*); 1135 void clearFocusedElementTimerFired(Timer<Document>*);
1150 1136
1151 void processHttpEquivDefaultStyle(const AtomicString& content); 1137 void processHttpEquivDefaultStyle(const AtomicString& content);
1152 void processHttpEquivRefresh(const AtomicString& content); 1138 void processHttpEquivRefresh(const AtomicString& content);
1153 void processHttpEquivSetCookie(const AtomicString& content); 1139 void processHttpEquivSetCookie(const AtomicString& content);
1154 void processHttpEquivXFrameOptions(const AtomicString& content); 1140 void processHttpEquivXFrameOptions(const AtomicString& content);
1155 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content); 1141 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
1156 1142
1157 void didRemoveTouchEventHandler(Node*, bool clearAll);
1158
1159 bool needsRenderTreeUpdate() const; 1143 bool needsRenderTreeUpdate() const;
1160 bool shouldScheduleRenderTreeUpdate() const; 1144 bool shouldScheduleRenderTreeUpdate() const;
1161 1145
1162 DocumentLifecycle m_lifecycle; 1146 DocumentLifecycle m_lifecycle;
1163 1147
1164 bool m_hasNodesWithPlaceholderStyle; 1148 bool m_hasNodesWithPlaceholderStyle;
1165 bool m_needsNotifyRemoveAllPendingStylesheet; 1149 bool m_needsNotifyRemoveAllPendingStylesheet;
1166 bool m_evaluateMediaQueriesOnStyleRecalc; 1150 bool m_evaluateMediaQueriesOnStyleRecalc;
1167 1151
1168 // If we do ignore the pending stylesheet count, then we need to add a boole an 1152 // If we do ignore the pending stylesheet count, then we need to add a boole an
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 bool m_didSetReferrerPolicy; 1306 bool m_didSetReferrerPolicy;
1323 ReferrerPolicy m_referrerPolicy; 1307 ReferrerPolicy m_referrerPolicy;
1324 1308
1325 bool m_directionSetOnDocumentElement; 1309 bool m_directionSetOnDocumentElement;
1326 bool m_writingModeSetOnDocumentElement; 1310 bool m_writingModeSetOnDocumentElement;
1327 DocumentTiming m_documentTiming; 1311 DocumentTiming m_documentTiming;
1328 RefPtrWillBePersistent<MediaQueryMatcher> m_mediaQueryMatcher; 1312 RefPtrWillBePersistent<MediaQueryMatcher> m_mediaQueryMatcher;
1329 bool m_writeRecursionIsTooDeep; 1313 bool m_writeRecursionIsTooDeep;
1330 unsigned m_writeRecursionDepth; 1314 unsigned m_writeRecursionDepth;
1331 1315
1332 OwnPtr<TouchEventTargetSet> m_touchEventTargets; 1316 double m_lastHandledUserGestureTimestamp;
Rick Byers 2014/04/04 20:12:27 ditto
Sami 2014/04/07 14:56:49 Done.
1333 1317
1334 RefPtr<ScriptedAnimationController> m_scriptedAnimationController; 1318 RefPtr<ScriptedAnimationController> m_scriptedAnimationController;
1335 OwnPtr<MainThreadTaskRunner> m_taskRunner; 1319 OwnPtr<MainThreadTaskRunner> m_taskRunner;
1336 OwnPtr<TextAutosizer> m_textAutosizer; 1320 OwnPtr<TextAutosizer> m_textAutosizer;
1337 OwnPtr<FastTextAutosizer> m_fastTextAutosizer; 1321 OwnPtr<FastTextAutosizer> m_fastTextAutosizer;
1338 1322
1339 RefPtr<CustomElementRegistrationContext> m_registrationContext; 1323 RefPtr<CustomElementRegistrationContext> m_registrationContext;
1340 1324
1341 void elementDataCacheClearTimerFired(Timer<Document>*); 1325 void elementDataCacheClearTimerFired(Timer<Document>*);
1342 Timer<Document> m_elementDataCacheClearTimer; 1326 Timer<Document> m_elementDataCacheClearTimer;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 inline bool Node::isDocumentNode() const 1407 inline bool Node::isDocumentNode() const
1424 { 1408 {
1425 return this == document(); 1409 return this == document();
1426 } 1410 }
1427 1411
1428 Node* eventTargetNodeForDocument(Document*); 1412 Node* eventTargetNodeForDocument(Document*);
1429 1413
1430 } // namespace WebCore 1414 } // namespace WebCore
1431 1415
1432 #endif // Document_h 1416 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698