| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 Loading... |
| 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 3380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5410 m_scriptedAnimationController->cancelCallback(id); | 5403 m_scriptedAnimationController->cancelCallback(id); |
| 5411 } | 5404 } |
| 5412 | 5405 |
| 5413 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) | 5406 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) |
| 5414 { | 5407 { |
| 5415 if (!m_scriptedAnimationController) | 5408 if (!m_scriptedAnimationController) |
| 5416 return; | 5409 return; |
| 5417 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); | 5410 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); |
| 5418 } | 5411 } |
| 5419 | 5412 |
| 5420 #if ENABLE(TOUCH_EVENTS) | |
| 5421 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 | 5413 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 |
| 5422 { | 5414 { |
| 5423 // FIXME: It's not clear from the documentation at | 5415 // FIXME: It's not clear from the documentation at |
| 5424 // http://developer.apple.com/library/safari/#documentation/UserExperience/R
eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html | 5416 // http://developer.apple.com/library/safari/#documentation/UserExperience/R
eference/DocumentAdditionsReference/DocumentAdditions/DocumentAdditions.html |
| 5425 // 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 | 5417 // 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 |
| 5426 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781
9 | 5418 // and implement them here. See https://bugs.webkit.org/show_bug.cgi?id=4781
9 |
| 5427 Frame* frame = window ? window->frame() : this->frame(); | 5419 Frame* frame = window ? window->frame() : this->frame(); |
| 5428 return Touch::create(frame, target, identifier, screenX, screenY, pageX, pag
eY, radiusX, radiusY, rotationAngle, force); | 5420 return Touch::create(frame, target, identifier, screenX, screenY, pageX, pag
eY, radiusX, radiusY, rotationAngle, force); |
| 5429 } | 5421 } |
| 5430 #endif | |
| 5431 | 5422 |
| 5432 static void wheelEventHandlerCountChanged(Document* document) | 5423 static void wheelEventHandlerCountChanged(Document* document) |
| 5433 { | 5424 { |
| 5434 Page* page = document->page(); | 5425 Page* page = document->page(); |
| 5435 if (!page) | 5426 if (!page) |
| 5436 return; | 5427 return; |
| 5437 | 5428 |
| 5438 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(); | 5429 ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(); |
| 5439 if (!scrollingCoordinator) | 5430 if (!scrollingCoordinator) |
| 5440 return; | 5431 return; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 5462 --m_wheelEventHandlerCount; | 5453 --m_wheelEventHandlerCount; |
| 5463 Frame* mainFrame = page() ? page()->mainFrame() : 0; | 5454 Frame* mainFrame = page() ? page()->mainFrame() : 0; |
| 5464 if (mainFrame) | 5455 if (mainFrame) |
| 5465 mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); | 5456 mainFrame->notifyChromeClientWheelEventHandlerCountChanged(); |
| 5466 | 5457 |
| 5467 wheelEventHandlerCountChanged(this); | 5458 wheelEventHandlerCountChanged(this); |
| 5468 } | 5459 } |
| 5469 | 5460 |
| 5470 void Document::didAddTouchEventHandler(Node* handler) | 5461 void Document::didAddTouchEventHandler(Node* handler) |
| 5471 { | 5462 { |
| 5472 #if ENABLE(TOUCH_EVENTS) | |
| 5473 if (!m_touchEventTargets.get()) | 5463 if (!m_touchEventTargets.get()) |
| 5474 m_touchEventTargets = adoptPtr(new TouchEventTargetSet); | 5464 m_touchEventTargets = adoptPtr(new TouchEventTargetSet); |
| 5475 m_touchEventTargets->add(handler); | 5465 m_touchEventTargets->add(handler); |
| 5476 if (Document* parent = parentDocument()) { | 5466 if (Document* parent = parentDocument()) { |
| 5477 parent->didAddTouchEventHandler(this); | 5467 parent->didAddTouchEventHandler(this); |
| 5478 return; | 5468 return; |
| 5479 } | 5469 } |
| 5480 if (Page* page = this->page()) { | 5470 if (Page* page = this->page()) { |
| 5481 #if ENABLE(TOUCH_EVENT_TRACKING) | |
| 5482 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) | 5471 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordina
tor()) |
| 5483 scrollingCoordinator->touchEventTargetRectsDidChange(this); | 5472 scrollingCoordinator->touchEventTargetRectsDidChange(this); |
| 5484 #endif | |
| 5485 if (m_touchEventTargets->size() == 1) | 5473 if (m_touchEventTargets->size() == 1) |
| 5486 page->chrome()->client()->needTouchEvents(true); | 5474 page->chrome()->client()->needTouchEvents(true); |
| 5487 } | 5475 } |
| 5488 #else | |
| 5489 UNUSED_PARAM(handler); | |
| 5490 #endif | |
| 5491 } | 5476 } |
| 5492 | 5477 |
| 5493 void Document::didRemoveTouchEventHandler(Node* handler) | 5478 void Document::didRemoveTouchEventHandler(Node* handler) |
| 5494 { | 5479 { |
| 5495 #if ENABLE(TOUCH_EVENTS) | |
| 5496 if (!m_touchEventTargets.get()) | 5480 if (!m_touchEventTargets.get()) |
| 5497 return; | 5481 return; |
| 5498 ASSERT(m_touchEventTargets->contains(handler)); | 5482 ASSERT(m_touchEventTargets->contains(handler)); |
| 5499 m_touchEventTargets->remove(handler); | 5483 m_touchEventTargets->remove(handler); |
| 5500 if (Document* parent = parentDocument()) { | 5484 if (Document* parent = parentDocument()) { |
| 5501 parent->didRemoveTouchEventHandler(this); | 5485 parent->didRemoveTouchEventHandler(this); |
| 5502 return; | 5486 return; |
| 5503 } | 5487 } |
| 5504 | 5488 |
| 5505 Page* page = this->page(); | 5489 Page* page = this->page(); |
| 5506 if (!page) | 5490 if (!page) |
| 5507 return; | 5491 return; |
| 5508 #if ENABLE(TOUCH_EVENT_TRACKING) | |
| 5509 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(
)) | 5492 if (ScrollingCoordinator* scrollingCoordinator = page->scrollingCoordinator(
)) |
| 5510 scrollingCoordinator->touchEventTargetRectsDidChange(this); | 5493 scrollingCoordinator->touchEventTargetRectsDidChange(this); |
| 5511 #endif | |
| 5512 if (m_touchEventTargets->size()) | 5494 if (m_touchEventTargets->size()) |
| 5513 return; | 5495 return; |
| 5514 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t
raverseNext()) { | 5496 for (const Frame* frame = page->mainFrame(); frame; frame = frame->tree()->t
raverseNext()) { |
| 5515 if (frame->document() && frame->document()->hasTouchEventHandlers()) | 5497 if (frame->document() && frame->document()->hasTouchEventHandlers()) |
| 5516 return; | 5498 return; |
| 5517 } | 5499 } |
| 5518 page->chrome()->client()->needTouchEvents(false); | 5500 page->chrome()->client()->needTouchEvents(false); |
| 5519 #else | |
| 5520 UNUSED_PARAM(handler); | |
| 5521 #endif | |
| 5522 } | 5501 } |
| 5523 | 5502 |
| 5524 #if ENABLE(TOUCH_EVENTS) | |
| 5525 void Document::didRemoveEventTargetNode(Node* handler) | 5503 void Document::didRemoveEventTargetNode(Node* handler) |
| 5526 { | 5504 { |
| 5527 if (m_touchEventTargets) { | 5505 if (m_touchEventTargets) { |
| 5528 m_touchEventTargets->removeAll(handler); | 5506 m_touchEventTargets->removeAll(handler); |
| 5529 if ((handler == this || m_touchEventTargets->isEmpty()) && parentDocumen
t()) | 5507 if ((handler == this || m_touchEventTargets->isEmpty()) && parentDocumen
t()) |
| 5530 parentDocument()->didRemoveEventTargetNode(this); | 5508 parentDocument()->didRemoveEventTargetNode(this); |
| 5531 } | 5509 } |
| 5532 } | 5510 } |
| 5533 #endif | |
| 5534 | 5511 |
| 5535 void Document::resetLastHandledUserGestureTimestamp() | 5512 void Document::resetLastHandledUserGestureTimestamp() |
| 5536 { | 5513 { |
| 5537 m_lastHandledUserGestureTimestamp = currentTime(); | 5514 m_lastHandledUserGestureTimestamp = currentTime(); |
| 5538 } | 5515 } |
| 5539 | 5516 |
| 5540 HTMLIFrameElement* Document::seamlessParentIFrame() const | 5517 HTMLIFrameElement* Document::seamlessParentIFrame() const |
| 5541 { | 5518 { |
| 5542 if (!shouldDisplaySeamlesslyWithParent()) | 5519 if (!shouldDisplaySeamlesslyWithParent()) |
| 5543 return 0; | 5520 return 0; |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5839 info.addMember(m_fullScreenChangeEventTargetQueue, "fullScreenChangeEventTar
getQueue"); | 5816 info.addMember(m_fullScreenChangeEventTargetQueue, "fullScreenChangeEventTar
getQueue"); |
| 5840 info.addMember(m_fullScreenErrorEventTargetQueue, "fullScreenErrorEventTarge
tQueue"); | 5817 info.addMember(m_fullScreenErrorEventTargetQueue, "fullScreenErrorEventTarge
tQueue"); |
| 5841 info.addMember(m_savedPlaceholderRenderStyle, "savedPlaceholderRenderStyle")
; | 5818 info.addMember(m_savedPlaceholderRenderStyle, "savedPlaceholderRenderStyle")
; |
| 5842 #if ENABLE(DIALOG_ELEMENT) | 5819 #if ENABLE(DIALOG_ELEMENT) |
| 5843 info.addMember(m_topLayerElements, "topLayerElements"); | 5820 info.addMember(m_topLayerElements, "topLayerElements"); |
| 5844 #endif | 5821 #endif |
| 5845 info.addMember(m_loadEventDelayTimer, "loadEventDelayTimer"); | 5822 info.addMember(m_loadEventDelayTimer, "loadEventDelayTimer"); |
| 5846 info.addMember(m_viewportArguments, "viewportArguments"); | 5823 info.addMember(m_viewportArguments, "viewportArguments"); |
| 5847 info.addMember(m_documentTiming, "documentTiming"); | 5824 info.addMember(m_documentTiming, "documentTiming"); |
| 5848 info.addMember(m_mediaQueryMatcher, "mediaQueryMatcher"); | 5825 info.addMember(m_mediaQueryMatcher, "mediaQueryMatcher"); |
| 5849 #if ENABLE(TOUCH_EVENTS) | |
| 5850 info.addMember(m_touchEventTargets, "touchEventTargets"); | 5826 info.addMember(m_touchEventTargets, "touchEventTargets"); |
| 5851 #endif | |
| 5852 info.addMember(m_scriptedAnimationController, "scriptedAnimationController")
; | 5827 info.addMember(m_scriptedAnimationController, "scriptedAnimationController")
; |
| 5853 info.addMember(m_pendingTasksTimer, "pendingTasksTimer"); | 5828 info.addMember(m_pendingTasksTimer, "pendingTasksTimer"); |
| 5854 info.addMember(m_textAutosizer, "textAutosizer"); | 5829 info.addMember(m_textAutosizer, "textAutosizer"); |
| 5855 info.addMember(m_namedFlows, "namedFlows"); | 5830 info.addMember(m_namedFlows, "namedFlows"); |
| 5856 info.addMember(m_domSecurityPolicy, "domSecurityPolicy"); | 5831 info.addMember(m_domSecurityPolicy, "domSecurityPolicy"); |
| 5857 info.addMember(m_sharedObjectPoolClearTimer, "sharedObjectPoolClearTimer"); | 5832 info.addMember(m_sharedObjectPoolClearTimer, "sharedObjectPoolClearTimer"); |
| 5858 info.addMember(m_sharedObjectPool, "sharedObjectPool"); | 5833 info.addMember(m_sharedObjectPool, "sharedObjectPool"); |
| 5859 info.addMember(m_localeCache, "localeCache"); | 5834 info.addMember(m_localeCache, "localeCache"); |
| 5860 info.addMember(m_templateDocument, "templateDocument"); | 5835 info.addMember(m_templateDocument, "templateDocument"); |
| 5861 info.addMember(m_templateDocumentHost, "templateDocumentHost"); | 5836 info.addMember(m_templateDocumentHost, "templateDocumentHost"); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5918 return; | 5893 return; |
| 5919 | 5894 |
| 5920 Vector<RefPtr<Element> > associatedFormControls; | 5895 Vector<RefPtr<Element> > associatedFormControls; |
| 5921 copyToVector(m_associatedFormControls, associatedFormControls); | 5896 copyToVector(m_associatedFormControls, associatedFormControls); |
| 5922 | 5897 |
| 5923 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm
Controls); | 5898 frame()->page()->chrome()->client()->didAssociateFormControls(associatedForm
Controls); |
| 5924 m_associatedFormControls.clear(); | 5899 m_associatedFormControls.clear(); |
| 5925 } | 5900 } |
| 5926 | 5901 |
| 5927 } // namespace WebCore | 5902 } // namespace WebCore |
| OLD | NEW |