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

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

Issue 391483002: Revert 177812 "Migrate touch events to EventHandlerRegistry" (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 5 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 InvalidateOnClassAttrChange, 169 InvalidateOnClassAttrChange,
170 InvalidateOnIdNameAttrChange, 170 InvalidateOnIdNameAttrChange,
171 InvalidateOnNameAttrChange, 171 InvalidateOnNameAttrChange,
172 InvalidateOnForAttrChange, 172 InvalidateOnForAttrChange,
173 InvalidateForFormControls, 173 InvalidateForFormControls,
174 InvalidateOnHRefAttrChange, 174 InvalidateOnHRefAttrChange,
175 InvalidateOnAnyAttrChange, 175 InvalidateOnAnyAttrChange,
176 }; 176 };
177 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1; 177 const int numNodeListInvalidationTypes = InvalidateOnAnyAttrChange + 1;
178 178
179 typedef HashCountedSet<Node*> TouchEventTargetSet;
180
179 enum DocumentClass { 181 enum DocumentClass {
180 DefaultDocumentClass = 0, 182 DefaultDocumentClass = 0,
181 HTMLDocumentClass = 1, 183 HTMLDocumentClass = 1,
182 XHTMLDocumentClass = 1 << 1, 184 XHTMLDocumentClass = 1 << 1,
183 ImageDocumentClass = 1 << 2, 185 ImageDocumentClass = 1 << 2,
184 PluginDocumentClass = 1 << 3, 186 PluginDocumentClass = 1 << 3,
185 MediaDocumentClass = 1 << 4, 187 MediaDocumentClass = 1 << 4,
186 SVGDocumentClass = 1 << 5, 188 SVGDocumentClass = 1 << 5,
187 XMLDocumentClass = 1 << 6, 189 XMLDocumentClass = 1 << 6,
188 }; 190 };
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after
931 933
932 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>); 934 int requestAnimationFrame(PassOwnPtr<RequestAnimationFrameCallback>);
933 void cancelAnimationFrame(int id); 935 void cancelAnimationFrame(int id);
934 void serviceScriptedAnimations(double monotonicAnimationStartTime); 936 void serviceScriptedAnimations(double monotonicAnimationStartTime);
935 937
936 virtual EventTarget* errorEventTarget() OVERRIDE FINAL; 938 virtual EventTarget* errorEventTarget() OVERRIDE FINAL;
937 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL; 939 virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtrWillBeRawPtr<ScriptCallS tack>) OVERRIDE FINAL;
938 940
939 void initDNSPrefetch(); 941 void initDNSPrefetch();
940 942
943 bool hasTouchEventHandlers() const { return (m_touchEventTargets.get()) ? m_ touchEventTargets->size() : false; }
944
945 // Called when a single touch event handler has been added or removed for a node.
946 // The Node should always be in this Document, except for child Documents wh ich report
947 // themselves to their parent exactly once if they have any touch handlers.
948 // Handlers added/removed from the LocalDOMWindow are reported as the Docume nt.
949 void didAddTouchEventHandler(Node*);
950 void didRemoveTouchEventHandler(Node* handler) { didRemoveTouchEventHandler( handler, false); }
951
952 // Called whenever all touch event handlers have been removed for a node (su ch as when the
953 // node itself is being removed from the document).
954 void didClearTouchEventHandlers(Node* handler) { didRemoveTouchEventHandler( handler, true); }
955
956 const TouchEventTargetSet* touchEventTargets() const { return m_touchEventTa rgets.get(); }
957
941 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; } 958 bool isInDocumentWrite() { return m_writeRecursionDepth > 0; }
942 959
943 IntSize initialViewportSize() const; 960 IntSize initialViewportSize() const;
944 961
945 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer. 962 // There are currently two parallel autosizing implementations: TextAutosize r and FastTextAutosizer.
946 // See http://tinyurl.com/chromium-fast-autosizer for more details. 963 // See http://tinyurl.com/chromium-fast-autosizer for more details.
947 TextAutosizer* textAutosizer(); 964 TextAutosizer* textAutosizer();
948 FastTextAutosizer* fastTextAutosizer(); 965 FastTextAutosizer* fastTextAutosizer();
949 966
950 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&); 967 PassRefPtrWillBeRawPtr<Element> createElement(const AtomicString& localName, const AtomicString& typeExtension, ExceptionState&);
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 1145
1129 void clearFocusedElementSoon(); 1146 void clearFocusedElementSoon();
1130 void clearFocusedElementTimerFired(Timer<Document>*); 1147 void clearFocusedElementTimerFired(Timer<Document>*);
1131 1148
1132 void processHttpEquivDefaultStyle(const AtomicString& content); 1149 void processHttpEquivDefaultStyle(const AtomicString& content);
1133 void processHttpEquivRefresh(const AtomicString& content); 1150 void processHttpEquivRefresh(const AtomicString& content);
1134 void processHttpEquivSetCookie(const AtomicString& content); 1151 void processHttpEquivSetCookie(const AtomicString& content);
1135 void processHttpEquivXFrameOptions(const AtomicString& content); 1152 void processHttpEquivXFrameOptions(const AtomicString& content);
1136 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content); 1153 void processHttpEquivContentSecurityPolicy(const AtomicString& equiv, const AtomicString& content);
1137 1154
1155 void didRemoveTouchEventHandler(Node*, bool clearAll);
1156
1138 bool haveStylesheetsLoaded() const; 1157 bool haveStylesheetsLoaded() const;
1139 1158
1140 void setHoverNode(PassRefPtrWillBeRawPtr<Node>); 1159 void setHoverNode(PassRefPtrWillBeRawPtr<Node>);
1141 Node* hoverNode() const { return m_hoverNode.get(); } 1160 Node* hoverNode() const { return m_hoverNode.get(); }
1142 1161
1143 typedef HashSet<OwnPtr<EventFactoryBase> > EventFactorySet; 1162 typedef HashSet<OwnPtr<EventFactoryBase> > EventFactorySet;
1144 static EventFactorySet& eventFactories(); 1163 static EventFactorySet& eventFactories();
1145 1164
1146 DocumentLifecycle m_lifecycle; 1165 DocumentLifecycle m_lifecycle;
1147 1166
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
1321 bool m_didSetReferrerPolicy; 1340 bool m_didSetReferrerPolicy;
1322 ReferrerPolicy m_referrerPolicy; 1341 ReferrerPolicy m_referrerPolicy;
1323 1342
1324 bool m_directionSetOnDocumentElement; 1343 bool m_directionSetOnDocumentElement;
1325 bool m_writingModeSetOnDocumentElement; 1344 bool m_writingModeSetOnDocumentElement;
1326 DocumentTiming m_documentTiming; 1345 DocumentTiming m_documentTiming;
1327 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher; 1346 RefPtrWillBeMember<MediaQueryMatcher> m_mediaQueryMatcher;
1328 bool m_writeRecursionIsTooDeep; 1347 bool m_writeRecursionIsTooDeep;
1329 unsigned m_writeRecursionDepth; 1348 unsigned m_writeRecursionDepth;
1330 1349
1350 OwnPtr<TouchEventTargetSet> m_touchEventTargets;
1351
1331 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r; 1352 RefPtrWillBeMember<ScriptedAnimationController> m_scriptedAnimationControlle r;
1332 OwnPtr<MainThreadTaskRunner> m_taskRunner; 1353 OwnPtr<MainThreadTaskRunner> m_taskRunner;
1333 OwnPtr<TextAutosizer> m_textAutosizer; 1354 OwnPtr<TextAutosizer> m_textAutosizer;
1334 OwnPtr<FastTextAutosizer> m_fastTextAutosizer; 1355 OwnPtr<FastTextAutosizer> m_fastTextAutosizer;
1335 1356
1336 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext; 1357 RefPtrWillBeMember<CustomElementRegistrationContext> m_registrationContext;
1337 RefPtrWillBeMember<CustomElementMicrotaskRunQueue> m_customElementMicrotaskR unQueue; 1358 RefPtrWillBeMember<CustomElementMicrotaskRunQueue> m_customElementMicrotaskR unQueue;
1338 1359
1339 void elementDataCacheClearTimerFired(Timer<Document>*); 1360 void elementDataCacheClearTimerFired(Timer<Document>*);
1340 Timer<Document> m_elementDataCacheClearTimer; 1361 Timer<Document> m_elementDataCacheClearTimer;
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1409 Node* eventTargetNodeForDocument(Document*); 1430 Node* eventTargetNodeForDocument(Document*);
1410 1431
1411 } // namespace WebCore 1432 } // namespace WebCore
1412 1433
1413 #ifndef NDEBUG 1434 #ifndef NDEBUG
1414 // Outside the WebCore namespace for ease of invocation from gdb. 1435 // Outside the WebCore namespace for ease of invocation from gdb.
1415 void showLiveDocumentInstances(); 1436 void showLiveDocumentInstances();
1416 #endif 1437 #endif
1417 1438
1418 #endif // Document_h 1439 #endif // Document_h
OLDNEW
« no previous file with comments | « trunk/LayoutTests/fast/events/touch/touch-handler-count-expected.txt ('k') | trunk/Source/core/dom/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698