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 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 if (exceptionState.hadException()) | 918 if (exceptionState.hadException()) |
919 return false; | 919 return false; |
920 newContainerNode->appendChild(newChild.release(), exceptionState); | 920 newContainerNode->appendChild(newChild.release(), exceptionState); |
921 if (exceptionState.hadException()) | 921 if (exceptionState.hadException()) |
922 return false; | 922 return false; |
923 } | 923 } |
924 | 924 |
925 return true; | 925 return true; |
926 } | 926 } |
927 | 927 |
928 PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec) | 928 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionS
tate& ec) |
929 { | 929 { |
930 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg
ument); | 930 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg
ument); |
931 return importNode(importedNode, true, ec); | 931 return importNode(importedNode, true, ec); |
932 } | 932 } |
933 | 933 |
934 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt
ate& exceptionState) | 934 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep,
ExceptionState& exceptionState) |
935 { | 935 { |
936 if (!importedNode) { | 936 if (!importedNode) { |
937 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Node")); | 937 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Node")); |
938 return nullptr; | 938 return nullptr; |
939 } | 939 } |
940 | 940 |
941 switch (importedNode->nodeType()) { | 941 switch (importedNode->nodeType()) { |
942 case TEXT_NODE: | 942 case TEXT_NODE: |
943 return createTextNode(importedNode->nodeValue()); | 943 return createTextNode(importedNode->nodeValue()); |
944 case CDATA_SECTION_NODE: | 944 case CDATA_SECTION_NODE: |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2244 lifecycleNotifier().notifyDocumentWasDetached(); | 2244 lifecycleNotifier().notifyDocumentWasDetached(); |
2245 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); | 2245 m_lifecycle.advanceTo(DocumentLifecycle::Stopped); |
2246 #if ENABLE(OILPAN) | 2246 #if ENABLE(OILPAN) |
2247 // FIXME: Oilpan: With Oilpan dispose should not be needed. At | 2247 // FIXME: Oilpan: With Oilpan dispose should not be needed. At |
2248 // this point we still have dispose in order to clear out some | 2248 // this point we still have dispose in order to clear out some |
2249 // RefPtrs that would otherwise cause leaks. However, when the | 2249 // RefPtrs that would otherwise cause leaks. However, when the |
2250 // Document is detached the document can still be alive, so we | 2250 // Document is detached the document can still be alive, so we |
2251 // really shouldn't clear anything at this point. It should just | 2251 // really shouldn't clear anything at this point. It should just |
2252 // die with the document when the document is no longer reachable. | 2252 // die with the document when the document is no longer reachable. |
2253 dispose(); | 2253 dispose(); |
| 2254 |
| 2255 // This mirrors the clearing of the document object's touch |
| 2256 // handlers that happens when the DOMWindow is destructed in a |
| 2257 // non-Oilpan setting (DOMWindow::removeAllEventListeners()), |
| 2258 // except that it is now done during detach instead. |
| 2259 didClearTouchEventHandlers(this); |
| 2260 |
| 2261 // Done with the window, explicitly clear to hasten its |
| 2262 // destruction. |
| 2263 clearDOMWindow(); |
2254 #endif | 2264 #endif |
2255 } | 2265 } |
2256 | 2266 |
2257 void Document::prepareForDestruction() | 2267 void Document::prepareForDestruction() |
2258 { | 2268 { |
2259 m_markers->prepareForDestruction(); | 2269 m_markers->prepareForDestruction(); |
2260 disconnectDescendantFrames(); | 2270 disconnectDescendantFrames(); |
2261 | 2271 |
2262 // The process of disconnecting descendant frames could have already detache
d us. | 2272 // The process of disconnecting descendant frames could have already detache
d us. |
2263 if (!isActive()) | 2273 if (!isActive()) |
(...skipping 3500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5764 #if ENABLE(OILPAN) | 5774 #if ENABLE(OILPAN) |
5765 for (int i = 0; i < numNodeListInvalidationTypes; ++i) | 5775 for (int i = 0; i < numNodeListInvalidationTypes; ++i) |
5766 visitor->trace(m_nodeLists[i]); | 5776 visitor->trace(m_nodeLists[i]); |
5767 #endif | 5777 #endif |
5768 visitor->trace(m_cssCanvasElements); | 5778 visitor->trace(m_cssCanvasElements); |
5769 visitor->trace(m_topLayerElements); | 5779 visitor->trace(m_topLayerElements); |
5770 visitor->trace(m_elemSheet); | 5780 visitor->trace(m_elemSheet); |
5771 visitor->trace(m_nodeIterators); | 5781 visitor->trace(m_nodeIterators); |
5772 visitor->trace(m_styleEngine); | 5782 visitor->trace(m_styleEngine); |
5773 visitor->trace(m_formController); | 5783 visitor->trace(m_formController); |
| 5784 visitor->trace(m_domWindow); |
5774 visitor->trace(m_fetcher); | 5785 visitor->trace(m_fetcher); |
5775 visitor->trace(m_parser); | 5786 visitor->trace(m_parser); |
5776 visitor->trace(m_contextFeatures); | 5787 visitor->trace(m_contextFeatures); |
5777 visitor->trace(m_styleSheetList); | 5788 visitor->trace(m_styleSheetList); |
5778 visitor->trace(m_mediaQueryMatcher); | 5789 visitor->trace(m_mediaQueryMatcher); |
5779 visitor->trace(m_associatedFormControls); | 5790 visitor->trace(m_associatedFormControls); |
5780 visitor->trace(m_templateDocument); | 5791 visitor->trace(m_templateDocument); |
5781 visitor->trace(m_templateDocumentHost); | 5792 visitor->trace(m_templateDocumentHost); |
5782 visitor->trace(m_visibilityObservers); | 5793 visitor->trace(m_visibilityObservers); |
5783 visitor->trace(m_userActionElements); | 5794 visitor->trace(m_userActionElements); |
5784 visitor->trace(m_svgExtensions); | 5795 visitor->trace(m_svgExtensions); |
5785 visitor->trace(m_timeline); | 5796 visitor->trace(m_timeline); |
5786 visitor->trace(m_compositorPendingAnimations); | 5797 visitor->trace(m_compositorPendingAnimations); |
5787 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); | 5798 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); |
5788 DocumentSupplementable::trace(visitor); | 5799 DocumentSupplementable::trace(visitor); |
5789 TreeScope::trace(visitor); | 5800 TreeScope::trace(visitor); |
5790 ContainerNode::trace(visitor); | 5801 ContainerNode::trace(visitor); |
5791 ExecutionContext::trace(visitor); | 5802 ExecutionContext::trace(visitor); |
5792 } | 5803 } |
5793 | 5804 |
5794 } // namespace WebCore | 5805 } // namespace WebCore |
OLD | NEW |