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

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

Issue 225903009: Migrate touch events to EventHandlerRegistry (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 6 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 | Annotate | Revision Log
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 InvalidateOnClassAttrChange, 189 InvalidateOnClassAttrChange,
190 InvalidateOnIdNameAttrChange, 190 InvalidateOnIdNameAttrChange,
191 InvalidateOnNameAttrChange, 191 InvalidateOnNameAttrChange,
192 InvalidateOnForAttrChange, 192 InvalidateOnForAttrChange,
193 InvalidateForFormControls, 193 InvalidateForFormControls,
194 InvalidateOnHRefAttrChange, 194 InvalidateOnHRefAttrChange,
195 InvalidateOnAnyAttrChange, 195 InvalidateOnAnyAttrChange,
196 }; 196 };
197 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1; 197 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1;
198 198
199 typedef HashCountedSet<Node*> TouchEventTargetSet;
200
201 enum DocumentClass { 199 enum DocumentClass {
202 DefaultDocumentClass = 0, 200 DefaultDocumentClass = 0,
203 HTMLDocumentClass = 1, 201 HTMLDocumentClass = 1,
204 XHTMLDocumentClass = 1 << 1, 202 XHTMLDocumentClass = 1 << 1,
205 ImageDocumentClass = 1 << 2, 203 ImageDocumentClass = 1 << 2,
206 PluginDocumentClass = 1 << 3, 204 PluginDocumentClass = 1 << 3,
207 MediaDocumentClass = 1 << 4, 205 MediaDocumentClass = 1 << 4,
208 SVGDocumentClass = 1 << 5, 206 SVGDocumentClass = 1 << 5,
209 XMLDocumentClass = 1 << 6, 207 XMLDocumentClass = 1 << 6,
210 }; 208 };
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 965
968 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); 966 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
969 void cancelAnimationFrame(int id); 967 void cancelAnimationFrame(int id);
970 void serviceScriptedAnimations(double monotonicAnimationStartTime); 968 void serviceScriptedAnimations(double monotonicAnimationStartTime);
971 969
972 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; 970 virtual EventTarget* errorEventTarget() OVERRIDE FINAL;
973 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL; 971 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL;
974 972
975 void initDNSPrefetch(); 973 void initDNSPrefetch();
976 974
977 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_ touchEventTargets->size() : false; }
978
979 // Called when a single touch event handler has been added or removed for a node.
980 // The Node should always be in this Document, except for child Documents wh ich report
981 // themselves to their parent exactly once if they have any touch handlers.
982 // Handlers added/removed from the DOMWindow are reported as the Document.
983 void didAddTouchEventHandler(Node*);
984 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler( handler, false); }
985
986 // Called whenever all touch event handlers have been removed for a node (su ch as when the
987 // node itself is being removed from the document).
988 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler( handler, true); }
989
990 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa rgets.get(); }
991
992 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 975 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
993 976
994 IntSize initialViewportSize() const; 977 IntSize initialViewportSize() const;
995 978
996 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer. 979 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer.
997 // See http://tinyurl.com/chromium-fast-autosizer for more details. 980 // See http://tinyurl.com/chromium-fast-autosizer for more details.
998 TextAutosizer* textAutosizer(); 981 TextAutosizer* textAutosizer();
999 FastTextAutosizer* fastTextAutosizer(); 982 FastTextAutosizer* fastTextAutosizer();
1000 983
1001 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&); 984 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&);
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
1181 1164
1182 void clearFocusedElementSoon(); 1165 void clearFocusedElementSoon();
1183 void clearFocusedElementTimerFired(Timer<Document>*); 1166 void clearFocusedElementTimerFired(Timer<Document>*);
1184 1167
1185 void processHttpEquivDefaultStyle(const AtomicString& content); 1168 void processHttpEquivDefaultStyle(const AtomicString& content);
1186 void processHttpEquivRefresh(const AtomicString& content); 1169 void processHttpEquivRefresh(const AtomicString& content);
1187 void processHttpEquivSetCookie(const AtomicString& content); 1170 void processHttpEquivSetCookie(const AtomicString& content);
1188 void processHttpEquivXFrameOptions(const AtomicString& content); 1171 void processHttpEquivXFrameOptions(const AtomicString& content);
1189 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content); 1172 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
1190 1173
1191 void didRemoveTouchEventHandler(Node*, bool clearAll);
1192
1193 bool haveStylesheetsLoaded() const; 1174 bool haveStylesheetsLoaded() const;
1194 1175
1195 void setHoverNode(PassRefPtrWillBeRawPtr<Node>); 1176 void setHoverNode(PassRefPtrWillBeRawPtr<Node>);
1196 Node* hoverNode() const { return m_hoverNode.get(); } 1177 Node* hoverNode() const { return m_hoverNode.get(); }
1197 1178
1198 typedef HashSet<OwnPtr<EventFactoryBase> > EventFactorySet; 1179 typedef HashSet<OwnPtr<EventFactoryBase> > EventFactorySet;
1199 static EventFactorySet& eventFactories(); 1180 static EventFactorySet& eventFactories();
1200 1181
1201 DocumentLifecycle m_lifecycle; 1182 DocumentLifecycle m_lifecycle;
1202 1183
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 bool m_didSetReferrerPolicy; 1357 bool m_didSetReferrerPolicy;
1377 ReferrerPolicy m_referrerPolicy; 1358 ReferrerPolicy m_referrerPolicy;
1378 1359
1379 bool m_directionSetOnDocumentElement; 1360 bool m_directionSetOnDocumentElement;
1380 bool m_writingModeSetOnDocumentElement; 1361 bool m_writingModeSetOnDocumentElement;
1381 DocumentTiming m_documentTiming; 1362 DocumentTiming m_documentTiming;
1382 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher; 1363 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher;
1383 bool m_writeRecursionIsTooDeep; 1364 bool m_writeRecursionIsTooDeep;
1384 unsigned m_writeRecursionDepth; 1365 unsigned m_writeRecursionDepth;
1385 1366
1386 OwnPtr<TouchEventTargetSet> m_touchEventTargets;
1387
1388 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r; 1367 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r;
1389 OwnPtr<MainThreadTaskRunner> m_taskRunner; 1368 OwnPtr<MainThreadTaskRunner> m_taskRunner;
1390 OwnPtr<TextAutosizer> m_textAutosizer; 1369 OwnPtr<TextAutosizer> m_textAutosizer;
1391 OwnPtr<FastTextAutosizer> m_fastTextAutosizer; 1370 OwnPtr<FastTextAutosizer> m_fastTextAutosizer;
1392 1371
1393 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext; 1372 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext;
1394 1373
1395 void elementDataCacheClearTimerFired(Timer<Document>*); 1374 void elementDataCacheClearTimerFired(Timer<Document>*);
1396 Timer<Document> m_elementDataCacheClearTimer; 1375 Timer<Document> m_elementDataCacheClearTimer;
1397 1376
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
1465 inline bool Node::isDocumentNode() const 1444 inline bool Node::isDocumentNode() const
1466 { 1445 {
1467 return this == document(); 1446 return this == document();
1468 } 1447 }
1469 1448
1470 Node* eventTargetNodeForDocument(Document*); 1449 Node* eventTargetNodeForDocument(Document*);
1471 1450
1472 } // namespace WebCore 1451 } // namespace WebCore
1473 1452
1474 #endif // Document_h 1453 #endif // Document_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698