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

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

Issue 14296003: Remove TOUCH_EVENTS and TOUCH_EVENT_TRACKING compile-time flags. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('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, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 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) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 #include "Settings.h" 162 #include "Settings.h"
163 #include "ShadowRoot.h" 163 #include "ShadowRoot.h"
164 #include "StaticHashSetNodeList.h" 164 #include "StaticHashSetNodeList.h"
165 #include "StylePropertySet.h" 165 #include "StylePropertySet.h"
166 #include "StyleResolver.h" 166 #include "StyleResolver.h"
167 #include "StyleSheetContents.h" 167 #include "StyleSheetContents.h"
168 #include "StyleSheetList.h" 168 #include "StyleSheetList.h"
169 #include "TextAutosizer.h" 169 #include "TextAutosizer.h"
170 #include "TextResourceDecoder.h" 170 #include "TextResourceDecoder.h"
171 #include "Timer.h" 171 #include "Timer.h"
172 #include "TouchList.h"
172 #include "TraceEvent.h" 173 #include "TraceEvent.h"
173 #include "TransformSource.h" 174 #include "TransformSource.h"
174 #include "TreeWalker.h" 175 #include "TreeWalker.h"
175 #include "UserActionElementSet.h" 176 #include "UserActionElementSet.h"
176 #include "UserContentURLPattern.h" 177 #include "UserContentURLPattern.h"
177 #include "VisitedLinkState.h" 178 #include "VisitedLinkState.h"
178 #include "WebCoreMemoryInstrumentation.h" 179 #include "WebCoreMemoryInstrumentation.h"
179 #include "XMLDocumentParser.h" 180 #include "XMLDocumentParser.h"
180 #include "XMLHttpRequest.h" 181 #include "XMLHttpRequest.h"
181 #include "XMLNSNames.h" 182 #include "XMLNSNames.h"
(...skipping 20 matching lines...) Expand all
202 #endif 203 #endif
203 204
204 #if ENABLE(SVG) 205 #if ENABLE(SVG)
205 #include "SVGDocumentExtensions.h" 206 #include "SVGDocumentExtensions.h"
206 #include "SVGElementFactory.h" 207 #include "SVGElementFactory.h"
207 #include "SVGNames.h" 208 #include "SVGNames.h"
208 #include "SVGSVGElement.h" 209 #include "SVGSVGElement.h"
209 #include "SVGStyleElement.h" 210 #include "SVGStyleElement.h"
210 #endif 211 #endif
211 212
212 #if ENABLE(TOUCH_EVENTS)
213 #include "TouchList.h"
214 #endif
215
216 #if ENABLE(MATHML) 213 #if ENABLE(MATHML)
217 #include "MathMLElement.h" 214 #include "MathMLElement.h"
218 #include "MathMLElementFactory.h" 215 #include "MathMLElementFactory.h"
219 #include "MathMLNames.h" 216 #include "MathMLNames.h"
220 #endif 217 #endif
221 218
222 #include "CaptionUserPreferences.h" 219 #include "CaptionUserPreferences.h"
223 220
224 using namespace std; 221 using namespace std;
225 using namespace WTF; 222 using namespace WTF;
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 ASSERT(!m_inPageCache); 547 ASSERT(!m_inPageCache);
551 ASSERT(!m_savedRenderer); 548 ASSERT(!m_savedRenderer);
552 ASSERT(m_ranges.isEmpty()); 549 ASSERT(m_ranges.isEmpty());
553 ASSERT(!m_styleRecalcTimer.isActive()); 550 ASSERT(!m_styleRecalcTimer.isActive());
554 ASSERT(!m_parentTreeScope); 551 ASSERT(!m_parentTreeScope);
555 ASSERT(!hasGuardRefCount()); 552 ASSERT(!hasGuardRefCount());
556 553
557 if (m_templateDocument) 554 if (m_templateDocument)
558 m_templateDocument->setTemplateDocumentHost(0); // balanced in templateD ocument(). 555 m_templateDocument->setTemplateDocumentHost(0); // balanced in templateD ocument().
559 556
560 #if ENABLE(TOUCH_EVENT_TRACKING)
561 if (Document* ownerDocument = this->ownerDocument()) 557 if (Document* ownerDocument = this->ownerDocument())
562 ownerDocument->didRemoveEventTargetNode(this); 558 ownerDocument->didRemoveEventTargetNode(this);
563 #endif
564 // FIXME: Should we reset m_domWindow when we detach from the Frame? 559 // FIXME: Should we reset m_domWindow when we detach from the Frame?
565 if (m_domWindow) 560 if (m_domWindow)
566 m_domWindow->resetUnlessSuspendedForPageCache(); 561 m_domWindow->resetUnlessSuspendedForPageCache();
567 562
568 m_scriptRunner.clear(); 563 m_scriptRunner.clear();
569 564
570 histogramMutationEventUsage(m_listenerTypes); 565 histogramMutationEventUsage(m_listenerTypes);
571 566
572 removeAllEventListeners(); 567 removeAllEventListeners();
573 568
(...skipping 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 m_focusedNode = 0; 2001 m_focusedNode = 0;
2007 m_activeElement = 0; 2002 m_activeElement = 0;
2008 2003
2009 ContainerNode::detach(); 2004 ContainerNode::detach();
2010 2005
2011 unscheduleStyleRecalc(); 2006 unscheduleStyleRecalc();
2012 2007
2013 if (render) 2008 if (render)
2014 render->destroy(); 2009 render->destroy();
2015 2010
2016 #if ENABLE(TOUCH_EVENTS)
2017 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument()) 2011 if (m_touchEventTargets && m_touchEventTargets->size() && parentDocument())
2018 parentDocument()->didRemoveEventTargetNode(this); 2012 parentDocument()->didRemoveEventTargetNode(this);
2019 #endif
2020 2013
2021 // This is required, as our Frame might delete itself as soon as it detaches 2014 // This is required, as our Frame might delete itself as soon as it detaches
2022 // us. However, this violates Node::detach() semantics, as it's never 2015 // us. However, this violates Node::detach() semantics, as it's never
2023 // possible to re-attach. Eventually Document::detach() should be renamed, 2016 // possible to re-attach. Eventually Document::detach() should be renamed,
2024 // or this setting of the frame to 0 could be made explicit in each of the 2017 // or this setting of the frame to 0 could be made explicit in each of the
2025 // callers of Document::detach(). 2018 // callers of Document::detach().
2026 m_frame = 0; 2019 m_frame = 0;
2027 m_renderArena.clear(); 2020 m_renderArena.clear();
2028 2021
2029 if (m_mediaQueryMatcher) 2022 if (m_mediaQueryMatcher)
(...skipping 3383 matching lines...) Expand 10 before | Expand all | Expand 10 after
5413 m_scriptedAnimationController->cancelCallback(id); 5406 m_scriptedAnimationController->cancelCallback(id);
5414 } 5407 }
5415 5408
5416 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) 5409 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime)
5417 { 5410 {
5418 if (!m_scriptedAnimationController) 5411 if (!m_scriptedAnimationController)
5419 return; 5412 return;
5420 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime); 5413 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS tartTime);
5421 } 5414 }
5422 5415
5423 #if ENABLE(TOUCH_EVENTS)
5424 PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const 5416 PassRefPtr<Touch> Document::createTouch(DOMWindow* window, EventTarget* target, int identifier, int pageX, int pageY, int screenX, int screenY, int radiusX, int radiusY, float rotationAngle, float force, ExceptionCode&) const
5425 { 5417 {
5426 // FIXME: It's not clear from the documentation at 5418 // FIXME: It's not clear from the documentation at
5427 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html 5419 // http://developer.apple.com/library/safari/#documentation/UserExperience/R eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html
5428 // when this method should throw and nor is it by inspection of iOS behavior . It would be nice to verify any cases where it throws under iOS 5420 // when this method should throw and nor is it by inspection of iOS behavior . It would be nice to verify any cases where it throws under iOS
5429 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9 5421 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781 9
5430 Frame* frame = window ? window->frame() : this->frame(); 5422 Frame* frame = window ? window->frame() : this->frame();
5431 return Touch::create(frame, target, identifier, screenX, screenY, pageX, pag eY, radiusX, radiusY, rotationAngle, force); 5423 return Touch::create(frame, target, identifier, screenX, screenY, pageX, pag eY, radiusX, radiusY, rotationAngle, force);
5432 } 5424 }
5433 #endif
5434 5425
5435 static void wheelEventHandlerCountChanged(Document* document) 5426 static void wheelEventHandlerCountChanged(Document* document)
5436 { 5427 {
5437 Page* page = document->page(); 5428 Page* page = document->page();
5438 if (!page) 5429 if (!page)
5439 return; 5430 return;
5440 5431
5441 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(); 5432 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator();
5442 if (!scrollingCoordinator) 5433 if (!scrollingCoordinator)
5443 return; 5434 return;
(...skipping 21 matching lines...) Expand all
5465 --m_wheelEventHandlerCount; 5456 --m_wheelEventHandlerCount;
5466 Frame* mainFrame = page() ? page()->mainFrame() : 0; 5457 Frame* mainFrame = page() ? page()->mainFrame() : 0;
5467 if (mainFrame) 5458 if (mainFrame)
5468 mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); 5459 mainFrame->notifyChromeClientWheelEventHandlerCountChanged();
5469 5460
5470 wheelEventHandlerCountChanged(this); 5461 wheelEventHandlerCountChanged(this);
5471 } 5462 }
5472 5463
5473 void Document::didAddTouchEventHandler(Node* handler) 5464 void Document::didAddTouchEventHandler(Node* handler)
5474 { 5465 {
5475 #if ENABLE(TOUCH_EVENTS)
5476 if (!m_touchEventTargets.get()) 5466 if (!m_touchEventTargets.get())
5477 m_touchEventTargets = adoptPtr(new TouchEventTargetSet); 5467 m_touchEventTargets = adoptPtr(new TouchEventTargetSet);
5478 m_touchEventTargets->add(handler); 5468 m_touchEventTargets->add(handler);
5479 if (Document* parent = parentDocument()) { 5469 if (Document* parent = parentDocument()) {
5480 parent->didAddTouchEventHandler(this); 5470 parent->didAddTouchEventHandler(this);
5481 return; 5471 return;
5482 } 5472 }
5483 if (Page* page = this->page()) { 5473 if (Page* page = this->page()) {
5484 #if ENABLE(TOUCH_EVENT_TRACKING)
5485 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor()) 5474 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina tor())
5486 scrollingCoordinator->touchEventTargetRectsDidChange(this); 5475 scrollingCoordinator->touchEventTargetRectsDidChange(this);
5487 #endif
5488 if (m_touchEventTargets->size() == 1) 5476 if (m_touchEventTargets->size() == 1)
5489 page->chrome()->client()->needTouchEvents(true); 5477 page->chrome()->client()->needTouchEvents(true);
5490 } 5478 }
5491 #else
5492 UNUSED_PARAM(handler);
5493 #endif
5494 } 5479 }
5495 5480
5496 void Document::didRemoveTouchEventHandler(Node* handler) 5481 void Document::didRemoveTouchEventHandler(Node* handler)
5497 { 5482 {
5498 #if ENABLE(TOUCH_EVENTS)
5499 if (!m_touchEventTargets.get()) 5483 if (!m_touchEventTargets.get())
5500 return; 5484 return;
5501 ASSERT(m_touchEventTargets->contains(handler)); 5485 ASSERT(m_touchEventTargets->contains(handler));
5502 m_touchEventTargets->remove(handler); 5486 m_touchEventTargets->remove(handler);
5503 if (Document* parent = parentDocument()) { 5487 if (Document* parent = parentDocument()) {
5504 parent->didRemoveTouchEventHandler(this); 5488 parent->didRemoveTouchEventHandler(this);
5505 return; 5489 return;
5506 } 5490 }
5507 5491
5508 Page* page = this->page(); 5492 Page* page = this->page();
5509 if (!page) 5493 if (!page)
5510 return; 5494 return;
5511 #if ENABLE(TOUCH_EVENT_TRACKING)
5512 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator( )) 5495 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator( ))
5513 scrollingCoordinator->touchEventTargetRectsDidChange(this); 5496 scrollingCoordinator->touchEventTargetRectsDidChange(this);
5514 #endif
5515 if (m_touchEventTargets->size()) 5497 if (m_touchEventTargets->size())
5516 return; 5498 return;
5517 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t raverseNext()) { 5499 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t raverseNext()) {
5518 if (frame->document() && frame->document()->hasTouchEventHandlers()) 5500 if (frame->document() && frame->document()->hasTouchEventHandlers())
5519 return; 5501 return;
5520 } 5502 }
5521 page->chrome()->client()->needTouchEvents(false); 5503 page->chrome()->client()->needTouchEvents(false);
5522 #else
5523 UNUSED_PARAM(handler);
5524 #endif
5525 } 5504 }
5526 5505
5527 #if ENABLE(TOUCH_EVENTS)
5528 void Document::didRemoveEventTargetNode(Node* handler) 5506 void Document::didRemoveEventTargetNode(Node* handler)
5529 { 5507 {
5530 if (m_touchEventTargets) { 5508 if (m_touchEventTargets) {
5531 m_touchEventTargets->removeAll(handler); 5509 m_touchEventTargets->removeAll(handler);
5532 if ((handler == this || m_touchEventTargets->isEmpty()) && parentDocumen t()) 5510 if ((handler == this || m_touchEventTargets->isEmpty()) && parentDocumen t())
5533 parentDocument()->didRemoveEventTargetNode(this); 5511 parentDocument()->didRemoveEventTargetNode(this);
5534 } 5512 }
5535 } 5513 }
5536 #endif
5537 5514
5538 void Document::resetLastHandledUserGestureTimestamp() 5515 void Document::resetLastHandledUserGestureTimestamp()
5539 { 5516 {
5540 m_lastHandledUserGestureTimestamp = currentTime(); 5517 m_lastHandledUserGestureTimestamp = currentTime();
5541 } 5518 }
5542 5519
5543 HTMLIFrameElement* Document::seamlessParentIFrame() const 5520 HTMLIFrameElement* Document::seamlessParentIFrame() const
5544 { 5521 {
5545 if (!shouldDisplaySeamlesslyWithParent()) 5522 if (!shouldDisplaySeamlesslyWithParent())
5546 return 0; 5523 return 0;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
5842 info.addMember(m_fullScreenChangeEventTargetQueue, "fullScreenChangeEventTar getQueue"); 5819 info.addMember(m_fullScreenChangeEventTargetQueue, "fullScreenChangeEventTar getQueue");
5843 info.addMember(m_fullScreenErrorEventTargetQueue, "fullScreenErrorEventTarge tQueue"); 5820 info.addMember(m_fullScreenErrorEventTargetQueue, "fullScreenErrorEventTarge tQueue");
5844 info.addMember(m_savedPlaceholderRenderStyle, "savedPlaceholderRenderStyle") ; 5821 info.addMember(m_savedPlaceholderRenderStyle, "savedPlaceholderRenderStyle") ;
5845 #if ENABLE(DIALOG_ELEMENT) 5822 #if ENABLE(DIALOG_ELEMENT)
5846 info.addMember(m_topLayerElements, "topLayerElements"); 5823 info.addMember(m_topLayerElements, "topLayerElements");
5847 #endif 5824 #endif
5848 info.addMember(m_loadEventDelayTimer, "loadEventDelayTimer"); 5825 info.addMember(m_loadEventDelayTimer, "loadEventDelayTimer");
5849 info.addMember(m_viewportArguments, "viewportArguments"); 5826 info.addMember(m_viewportArguments, "viewportArguments");
5850 info.addMember(m_documentTiming, "documentTiming"); 5827 info.addMember(m_documentTiming, "documentTiming");
5851 info.addMember(m_mediaQueryMatcher, "mediaQueryMatcher"); 5828 info.addMember(m_mediaQueryMatcher, "mediaQueryMatcher");
5852 #if ENABLE(TOUCH_EVENTS)
5853 info.addMember(m_touchEventTargets, "touchEventTargets"); 5829 info.addMember(m_touchEventTargets, "touchEventTargets");
5854 #endif
5855 info.addMember(m_scriptedAnimationController, "scriptedAnimationController") ; 5830 info.addMember(m_scriptedAnimationController, "scriptedAnimationController") ;
5856 info.addMember(m_pendingTasksTimer, "pendingTasksTimer"); 5831 info.addMember(m_pendingTasksTimer, "pendingTasksTimer");
5857 info.addMember(m_textAutosizer, "textAutosizer"); 5832 info.addMember(m_textAutosizer, "textAutosizer");
5858 info.addMember(m_namedFlows, "namedFlows"); 5833 info.addMember(m_namedFlows, "namedFlows");
5859 info.addMember(m_domSecurityPolicy, "domSecurityPolicy"); 5834 info.addMember(m_domSecurityPolicy, "domSecurityPolicy");
5860 info.addMember(m_sharedObjectPoolClearTimer, "sharedObjectPoolClearTimer"); 5835 info.addMember(m_sharedObjectPoolClearTimer, "sharedObjectPoolClearTimer");
5861 info.addMember(m_sharedObjectPool, "sharedObjectPool"); 5836 info.addMember(m_sharedObjectPool, "sharedObjectPool");
5862 info.addMember(m_localeCache, "localeCache"); 5837 info.addMember(m_localeCache, "localeCache");
5863 info.addMember(m_templateDocument, "templateDocument"); 5838 info.addMember(m_templateDocument, "templateDocument");
5864 info.addMember(m_templateDocumentHost, "templateDocumentHost"); 5839 info.addMember(m_templateDocumentHost, "templateDocumentHost");
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
5921 return; 5896 return;
5922 5897
5923 Vector<RefPtr<Element> > associatedFormControls; 5898 Vector<RefPtr<Element> > associatedFormControls;
5924 copyToVector(m_associatedFormControls, associatedFormControls); 5899 copyToVector(m_associatedFormControls, associatedFormControls);
5925 5900
5926 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm Controls); 5901 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm Controls);
5927 m_associatedFormControls.clear(); 5902 m_associatedFormControls.clear();
5928 } 5903 }
5929 5904
5930 } // namespace WebCore 5905 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/dom/Document.h ('k') | Source/core/dom/Document.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698