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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 #include "core/dom/NodeFilter.h" | 84 #include "core/dom/NodeFilter.h" |
85 #include "core/dom/NodeIterator.h" | 85 #include "core/dom/NodeIterator.h" |
86 #include "core/dom/NodeComputedStyle.h" | 86 #include "core/dom/NodeComputedStyle.h" |
87 #include "core/dom/NodeRareData.h" | 87 #include "core/dom/NodeRareData.h" |
88 #include "core/dom/NodeTraversal.h" | 88 #include "core/dom/NodeTraversal.h" |
89 #include "core/dom/NodeWithIndex.h" | 89 #include "core/dom/NodeWithIndex.h" |
90 #include "core/dom/NthIndexCache.h" | 90 #include "core/dom/NthIndexCache.h" |
91 #include "core/dom/ProcessingInstruction.h" | 91 #include "core/dom/ProcessingInstruction.h" |
92 #include "core/dom/ScriptRunner.h" | 92 #include "core/dom/ScriptRunner.h" |
93 #include "core/dom/ScriptedAnimationController.h" | 93 #include "core/dom/ScriptedAnimationController.h" |
| 94 #include "core/dom/ScriptedIdleTaskController.h" |
94 #include "core/dom/SelectorQuery.h" | 95 #include "core/dom/SelectorQuery.h" |
95 #include "core/dom/StaticNodeList.h" | 96 #include "core/dom/StaticNodeList.h" |
96 #include "core/dom/StyleEngine.h" | 97 #include "core/dom/StyleEngine.h" |
97 #include "core/dom/TouchList.h" | 98 #include "core/dom/TouchList.h" |
98 #include "core/dom/TransformSource.h" | 99 #include "core/dom/TransformSource.h" |
99 #include "core/dom/TreeWalker.h" | 100 #include "core/dom/TreeWalker.h" |
100 #include "core/dom/VisitedLinkState.h" | 101 #include "core/dom/VisitedLinkState.h" |
101 #include "core/dom/XMLDocument.h" | 102 #include "core/dom/XMLDocument.h" |
102 #include "core/dom/custom/CustomElementMicrotaskRunQueue.h" | 103 #include "core/dom/custom/CustomElementMicrotaskRunQueue.h" |
103 #include "core/dom/custom/CustomElementRegistrationContext.h" | 104 #include "core/dom/custom/CustomElementRegistrationContext.h" |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 | 638 |
638 m_markers->clear(); | 639 m_markers->clear(); |
639 | 640 |
640 m_cssCanvasElements.clear(); | 641 m_cssCanvasElements.clear(); |
641 | 642 |
642 // FIXME: consider using ActiveDOMObject. | 643 // FIXME: consider using ActiveDOMObject. |
643 if (m_scriptedAnimationController) | 644 if (m_scriptedAnimationController) |
644 m_scriptedAnimationController->clearDocumentPointer(); | 645 m_scriptedAnimationController->clearDocumentPointer(); |
645 m_scriptedAnimationController.clear(); | 646 m_scriptedAnimationController.clear(); |
646 | 647 |
| 648 // FIXME: consider using ActiveDOMObject. |
| 649 if (m_scriptedIdleTaskController) |
| 650 m_scriptedIdleTaskController->clearDocumentPointer(); |
| 651 m_scriptedIdleTaskController.clear(); |
| 652 |
647 if (svgExtensions()) | 653 if (svgExtensions()) |
648 accessSVGExtensions().pauseAnimations(); | 654 accessSVGExtensions().pauseAnimations(); |
649 | 655 |
650 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); | 656 m_lifecycle.advanceTo(DocumentLifecycle::Disposed); |
651 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); | 657 DocumentLifecycleNotifier::notifyDocumentWasDisposed(); |
652 } | 658 } |
653 #endif | 659 #endif |
654 | 660 |
655 SelectorQueryCache& Document::selectorQueryCache() | 661 SelectorQueryCache& Document::selectorQueryCache() |
656 { | 662 { |
(...skipping 1466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2123 if (this == &axObjectCacheOwner()) | 2129 if (this == &axObjectCacheOwner()) |
2124 clearAXObjectCache(); | 2130 clearAXObjectCache(); |
2125 | 2131 |
2126 stopActiveDOMObjects(); | 2132 stopActiveDOMObjects(); |
2127 | 2133 |
2128 // FIXME: consider using ActiveDOMObject. | 2134 // FIXME: consider using ActiveDOMObject. |
2129 if (m_scriptedAnimationController) | 2135 if (m_scriptedAnimationController) |
2130 m_scriptedAnimationController->clearDocumentPointer(); | 2136 m_scriptedAnimationController->clearDocumentPointer(); |
2131 m_scriptedAnimationController.clear(); | 2137 m_scriptedAnimationController.clear(); |
2132 | 2138 |
| 2139 // FIXME: consider using ActiveDOMObject. |
| 2140 if (m_scriptedIdleTaskController) |
| 2141 m_scriptedIdleTaskController->clearDocumentPointer(); |
| 2142 m_scriptedIdleTaskController.clear(); |
| 2143 |
2133 if (svgExtensions()) | 2144 if (svgExtensions()) |
2134 accessSVGExtensions().pauseAnimations(); | 2145 accessSVGExtensions().pauseAnimations(); |
2135 | 2146 |
2136 // FIXME: This shouldn't be needed once LocalDOMWindow becomes ExecutionCont
ext. | 2147 // FIXME: This shouldn't be needed once LocalDOMWindow becomes ExecutionCont
ext. |
2137 if (m_domWindow) | 2148 if (m_domWindow) |
2138 m_domWindow->clearEventQueue(); | 2149 m_domWindow->clearEventQueue(); |
2139 | 2150 |
2140 if (m_layoutView) | 2151 if (m_layoutView) |
2141 m_layoutView->setIsInWindow(false); | 2152 m_layoutView->setIsInWindow(false); |
2142 | 2153 |
(...skipping 2980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5123 m_scriptedAnimationController->cancelCallback(id); | 5134 m_scriptedAnimationController->cancelCallback(id); |
5124 } | 5135 } |
5125 | 5136 |
5126 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) | 5137 void Document::serviceScriptedAnimations(double monotonicAnimationStartTime) |
5127 { | 5138 { |
5128 if (!m_scriptedAnimationController) | 5139 if (!m_scriptedAnimationController) |
5129 return; | 5140 return; |
5130 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); | 5141 m_scriptedAnimationController->serviceScriptedAnimations(monotonicAnimationS
tartTime); |
5131 } | 5142 } |
5132 | 5143 |
| 5144 ScriptedIdleTaskController& Document::ensureScriptedIdleTaskController() |
| 5145 { |
| 5146 if (!m_scriptedIdleTaskController) { |
| 5147 m_scriptedIdleTaskController = ScriptedIdleTaskController::create(this); |
| 5148 } |
| 5149 return *m_scriptedIdleTaskController; |
| 5150 } |
| 5151 |
| 5152 int Document::requestIdleFrame(IdleRequestCallback* callback) |
| 5153 { |
| 5154 return ensureScriptedIdleTaskController().registerCallback(callback); |
| 5155 } |
| 5156 |
| 5157 void Document::cancelIdleFrame(int id) |
| 5158 { |
| 5159 if (!m_scriptedIdleTaskController) |
| 5160 return; |
| 5161 m_scriptedIdleTaskController->cancelCallback(id); |
| 5162 } |
| 5163 |
5133 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 | 5164 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 |
5134 { | 5165 { |
5135 // Match behavior from when these types were integers, and avoid surprises f
rom someone explicitly | 5166 // Match behavior from when these types were integers, and avoid surprises f
rom someone explicitly |
5136 // passing Infinity/NaN. | 5167 // passing Infinity/NaN. |
5137 if (!std::isfinite(pageX)) | 5168 if (!std::isfinite(pageX)) |
5138 pageX = 0; | 5169 pageX = 0; |
5139 if (!std::isfinite(pageY)) | 5170 if (!std::isfinite(pageY)) |
5140 pageY = 0; | 5171 pageY = 0; |
5141 if (!std::isfinite(screenX)) | 5172 if (!std::isfinite(screenX)) |
5142 screenX = 0; | 5173 screenX = 0; |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5727 visitor->trace(m_formController); | 5758 visitor->trace(m_formController); |
5728 visitor->trace(m_visitedLinkState); | 5759 visitor->trace(m_visitedLinkState); |
5729 visitor->trace(m_frame); | 5760 visitor->trace(m_frame); |
5730 visitor->trace(m_domWindow); | 5761 visitor->trace(m_domWindow); |
5731 visitor->trace(m_fetcher); | 5762 visitor->trace(m_fetcher); |
5732 visitor->trace(m_parser); | 5763 visitor->trace(m_parser); |
5733 visitor->trace(m_contextFeatures); | 5764 visitor->trace(m_contextFeatures); |
5734 visitor->trace(m_styleSheetList); | 5765 visitor->trace(m_styleSheetList); |
5735 visitor->trace(m_mediaQueryMatcher); | 5766 visitor->trace(m_mediaQueryMatcher); |
5736 visitor->trace(m_scriptedAnimationController); | 5767 visitor->trace(m_scriptedAnimationController); |
| 5768 visitor->trace(m_scriptedIdleTaskController); |
5737 visitor->trace(m_textAutosizer); | 5769 visitor->trace(m_textAutosizer); |
5738 visitor->trace(m_registrationContext); | 5770 visitor->trace(m_registrationContext); |
5739 visitor->trace(m_customElementMicrotaskRunQueue); | 5771 visitor->trace(m_customElementMicrotaskRunQueue); |
5740 visitor->trace(m_elementDataCache); | 5772 visitor->trace(m_elementDataCache); |
5741 visitor->trace(m_associatedFormControls); | 5773 visitor->trace(m_associatedFormControls); |
5742 visitor->trace(m_useElementsNeedingUpdate); | 5774 visitor->trace(m_useElementsNeedingUpdate); |
5743 visitor->trace(m_layerUpdateSVGFilterElements); | 5775 visitor->trace(m_layerUpdateSVGFilterElements); |
5744 visitor->trace(m_timers); | 5776 visitor->trace(m_timers); |
5745 visitor->trace(m_templateDocument); | 5777 visitor->trace(m_templateDocument); |
5746 visitor->trace(m_templateDocumentHost); | 5778 visitor->trace(m_templateDocumentHost); |
(...skipping 17 matching lines...) Expand all Loading... |
5764 #ifndef NDEBUG | 5796 #ifndef NDEBUG |
5765 using namespace blink; | 5797 using namespace blink; |
5766 void showLiveDocumentInstances() | 5798 void showLiveDocumentInstances() |
5767 { | 5799 { |
5768 WeakDocumentSet& set = liveDocumentSet(); | 5800 WeakDocumentSet& set = liveDocumentSet(); |
5769 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); | 5801 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); |
5770 for (Document* document : set) | 5802 for (Document* document : set) |
5771 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); | 5803 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().str
ing().utf8().data()); |
5772 } | 5804 } |
5773 #endif | 5805 #endif |
OLD | NEW |