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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #include "core/dom/NodeComputedStyle.h" | 85 #include "core/dom/NodeComputedStyle.h" |
86 #include "core/dom/NodeFilter.h" | 86 #include "core/dom/NodeFilter.h" |
87 #include "core/dom/NodeIterator.h" | 87 #include "core/dom/NodeIterator.h" |
88 #include "core/dom/NodeRareData.h" | 88 #include "core/dom/NodeRareData.h" |
89 #include "core/dom/NodeTraversal.h" | 89 #include "core/dom/NodeTraversal.h" |
90 #include "core/dom/NodeWithIndex.h" | 90 #include "core/dom/NodeWithIndex.h" |
91 #include "core/dom/NthIndexCache.h" | 91 #include "core/dom/NthIndexCache.h" |
92 #include "core/dom/ProcessingInstruction.h" | 92 #include "core/dom/ProcessingInstruction.h" |
93 #include "core/dom/ScriptRunner.h" | 93 #include "core/dom/ScriptRunner.h" |
94 #include "core/dom/ScriptedAnimationController.h" | 94 #include "core/dom/ScriptedAnimationController.h" |
| 95 #include "core/dom/ScriptedIdleTaskController.h" |
95 #include "core/dom/SelectorQuery.h" | 96 #include "core/dom/SelectorQuery.h" |
96 #include "core/dom/StaticNodeList.h" | 97 #include "core/dom/StaticNodeList.h" |
97 #include "core/dom/StyleEngine.h" | 98 #include "core/dom/StyleEngine.h" |
98 #include "core/dom/TouchList.h" | 99 #include "core/dom/TouchList.h" |
99 #include "core/dom/TransformSource.h" | 100 #include "core/dom/TransformSource.h" |
100 #include "core/dom/TreeWalker.h" | 101 #include "core/dom/TreeWalker.h" |
101 #include "core/dom/VisitedLinkState.h" | 102 #include "core/dom/VisitedLinkState.h" |
102 #include "core/dom/XMLDocument.h" | 103 #include "core/dom/XMLDocument.h" |
103 #include "core/dom/custom/CustomElementMicrotaskRunQueue.h" | 104 #include "core/dom/custom/CustomElementMicrotaskRunQueue.h" |
104 #include "core/dom/custom/CustomElementRegistrationContext.h" | 105 #include "core/dom/custom/CustomElementRegistrationContext.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 | 584 |
584 m_markers->clear(); | 585 m_markers->clear(); |
585 | 586 |
586 m_cssCanvasElements.clear(); | 587 m_cssCanvasElements.clear(); |
587 | 588 |
588 // FIXME: consider using ActiveDOMObject. | 589 // FIXME: consider using ActiveDOMObject. |
589 if (m_scriptedAnimationController) | 590 if (m_scriptedAnimationController) |
590 m_scriptedAnimationController->clearDocumentPointer(); | 591 m_scriptedAnimationController->clearDocumentPointer(); |
591 m_scriptedAnimationController.clear(); | 592 m_scriptedAnimationController.clear(); |
592 | 593 |
| 594 m_scriptedIdleTaskController.clear(); |
| 595 |
593 if (svgExtensions()) | 596 if (svgExtensions()) |
594 accessSVGExtensions().pauseAnimations(); | 597 accessSVGExtensions().pauseAnimations(); |
595 | 598 |
596 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); | 599 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); |
597 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); | 600 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); |
598 | 601 |
599 m_canvasFontCache.clear(); | 602 m_canvasFontCache.clear(); |
600 } | 603 } |
601 #endif | 604 #endif |
602 | 605 |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) | 2139 if (m_frame->loader().client()->sharedWorkerRepositoryClient()) |
2137 m_frame->loader().client()->sharedWorkerRepositoryClient()->documentDeta
ched(this); | 2140 m_frame->loader().client()->sharedWorkerRepositoryClient()->documentDeta
ched(this); |
2138 | 2141 |
2139 stopActiveDOMObjects(); | 2142 stopActiveDOMObjects(); |
2140 | 2143 |
2141 // FIXME: consider using ActiveDOMObject. | 2144 // FIXME: consider using ActiveDOMObject. |
2142 if (m_scriptedAnimationController) | 2145 if (m_scriptedAnimationController) |
2143 m_scriptedAnimationController->clearDocumentPointer(); | 2146 m_scriptedAnimationController->clearDocumentPointer(); |
2144 m_scriptedAnimationController.clear(); | 2147 m_scriptedAnimationController.clear(); |
2145 | 2148 |
| 2149 m_scriptedIdleTaskController.clear(); |
| 2150 |
2146 if (svgExtensions()) | 2151 if (svgExtensions()) |
2147 accessSVGExtensions().pauseAnimations(); | 2152 accessSVGExtensions().pauseAnimations(); |
2148 | 2153 |
2149 // FIXME: This shouldn't be needed once LocalDOMWindow becomes ExecutionCont
ext. | 2154 // FIXME: This shouldn't be needed once LocalDOMWindow becomes ExecutionCont
ext. |
2150 if (m_domWindow) | 2155 if (m_domWindow) |
2151 m_domWindow->clearEventQueue(); | 2156 m_domWindow->clearEventQueue(); |
2152 | 2157 |
2153 if (m_layoutView) | 2158 if (m_layoutView) |
2154 m_layoutView->setIsInWindow(false); | 2159 m_layoutView->setIsInWindow(false); |
2155 | 2160 |
(...skipping 3056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5212 m_scriptedAnimationController->cancelCallback(id); | 5217 m_scriptedAnimationController->cancelCallback(id); |
5213 } | 5218 } |
5214 | 5219 |
5215 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) | 5220 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) |
5216 { | 5221 { |
5217 if (!m_scriptedAnimationController) | 5222 if (!m_scriptedAnimationController) |
5218 return; | 5223 return; |
5219 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); | 5224 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); |
5220 } | 5225 } |
5221 | 5226 |
| 5227 ScriptedIdleTaskController& Document::ensureScriptedIdleTaskController() |
| 5228 { |
| 5229 if (!m_scriptedIdleTaskController) |
| 5230 m_scriptedIdleTaskController = ScriptedIdleTaskController::create(this,
loader()->timing()); |
| 5231 return *m_scriptedIdleTaskController; |
| 5232 } |
| 5233 |
| 5234 int Document::requestIdleCallback(IdleRequestCallback* callback, double timeoutM
illis) |
| 5235 { |
| 5236 return ensureScriptedIdleTaskController().registerCallback(callback, timeout
Millis); |
| 5237 } |
| 5238 |
| 5239 void Document::cancelIdleCallback(int id) |
| 5240 { |
| 5241 if (!m_scriptedIdleTaskController) |
| 5242 return; |
| 5243 m_scriptedIdleTaskController->cancelCallback(id); |
| 5244 } |
| 5245 |
5222 PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarg
et* target, int identifier, double pageX, double pageY, double screenX, double s
creenY, double radiusX, double radiusY, float rotationAngle, float force) const | 5246 PassRefPtrWillBeRawPtr<Touch> Document::createTouch(DOMWindow* window, EventTarg
et* target, int identifier, double pageX, double pageY, double screenX, double s
creenY, double radiusX, double radiusY, float rotationAngle, float force) const |
5223 { | 5247 { |
5224 // Match behavior from when these types were integers, and avoid surprises f
rom someone explicitly | 5248 // Match behavior from when these types were integers, and avoid surprises f
rom someone explicitly |
5225 // passing Infinity/NaN. | 5249 // passing Infinity/NaN. |
5226 if (!std::isfinite(pageX)) | 5250 if (!std::isfinite(pageX)) |
5227 pageX = 0; | 5251 pageX = 0; |
5228 if (!std::isfinite(pageY)) | 5252 if (!std::isfinite(pageY)) |
5229 pageY = 0; | 5253 pageY = 0; |
5230 if (!std::isfinite(screenX)) | 5254 if (!std::isfinite(screenX)) |
5231 screenX = 0; | 5255 screenX = 0; |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5740 visitor->trace(m_formController); | 5764 visitor->trace(m_formController); |
5741 visitor->trace(m_visitedLinkState); | 5765 visitor->trace(m_visitedLinkState); |
5742 visitor->trace(m_frame); | 5766 visitor->trace(m_frame); |
5743 visitor->trace(m_domWindow); | 5767 visitor->trace(m_domWindow); |
5744 visitor->trace(m_fetcher); | 5768 visitor->trace(m_fetcher); |
5745 visitor->trace(m_parser); | 5769 visitor->trace(m_parser); |
5746 visitor->trace(m_contextFeatures); | 5770 visitor->trace(m_contextFeatures); |
5747 visitor->trace(m_styleSheetList); | 5771 visitor->trace(m_styleSheetList); |
5748 visitor->trace(m_mediaQueryMatcher); | 5772 visitor->trace(m_mediaQueryMatcher); |
5749 visitor->trace(m_scriptedAnimationController); | 5773 visitor->trace(m_scriptedAnimationController); |
| 5774 visitor->trace(m_scriptedIdleTaskController); |
5750 visitor->trace(m_textAutosizer); | 5775 visitor->trace(m_textAutosizer); |
5751 visitor->trace(m_registrationContext); | 5776 visitor->trace(m_registrationContext); |
5752 visitor->trace(m_customElementMicrotaskRunQueue); | 5777 visitor->trace(m_customElementMicrotaskRunQueue); |
5753 visitor->trace(m_elementDataCache); | 5778 visitor->trace(m_elementDataCache); |
5754 visitor->trace(m_associatedFormControls); | 5779 visitor->trace(m_associatedFormControls); |
5755 visitor->trace(m_useElementsNeedingUpdate); | 5780 visitor->trace(m_useElementsNeedingUpdate); |
5756 visitor->trace(m_layerUpdateSVGFilterElements); | 5781 visitor->trace(m_layerUpdateSVGFilterElements); |
5757 visitor->trace(m_timers); | 5782 visitor->trace(m_timers); |
5758 visitor->trace(m_templateDocument); | 5783 visitor->trace(m_templateDocument); |
5759 visitor->trace(m_templateDocumentHost); | 5784 visitor->trace(m_templateDocumentHost); |
(...skipping 20 matching lines...) Expand all Loading... |
5780 #ifndef NDEBUG | 5805 #ifndef NDEBUG |
5781 using namespace blink; | 5806 using namespace blink; |
5782 void showLiveDocumentInstances() | 5807 void showLiveDocumentInstances() |
5783 { | 5808 { |
5784 WeakDocumentSet& set = liveDocumentSet(); | 5809 WeakDocumentSet& set = liveDocumentSet(); |
5785 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5810 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5786 for (Document* document : set) | 5811 for (Document* document : set) |
5787 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5812 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5788 } | 5813 } |
5789 #endif | 5814 #endif |
OLD | NEW |