| 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 909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 if (exceptionState.hadException()) | 920 if (exceptionState.hadException()) |
| 921 return false; | 921 return false; |
| 922 newContainerNode->appendChild(newChild.release(), exceptionState); | 922 newContainerNode->appendChild(newChild.release(), exceptionState); |
| 923 if (exceptionState.hadException()) | 923 if (exceptionState.hadException()) |
| 924 return false; | 924 return false; |
| 925 } | 925 } |
| 926 | 926 |
| 927 return true; | 927 return true; |
| 928 } | 928 } |
| 929 | 929 |
| 930 PassRefPtr<Node> Document::importNode(Node* importedNode, ExceptionState& ec) | 930 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, ExceptionS
tate& ec) |
| 931 { | 931 { |
| 932 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg
ument); | 932 UseCounter::countDeprecation(this, UseCounter::DocumentImportNodeOptionalArg
ument); |
| 933 return importNode(importedNode, true, ec); | 933 return importNode(importedNode, true, ec); |
| 934 } | 934 } |
| 935 | 935 |
| 936 PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionSt
ate& exceptionState) | 936 PassRefPtrWillBeRawPtr<Node> Document::importNode(Node* importedNode, bool deep,
ExceptionState& exceptionState) |
| 937 { | 937 { |
| 938 if (!importedNode) { | 938 if (!importedNode) { |
| 939 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Node")); | 939 exceptionState.throwDOMException(NotSupportedError, ExceptionMessages::a
rgumentNullOrIncorrectType(1, "Node")); |
| 940 return nullptr; | 940 return nullptr; |
| 941 } | 941 } |
| 942 | 942 |
| 943 switch (importedNode->nodeType()) { | 943 switch (importedNode->nodeType()) { |
| 944 case TEXT_NODE: | 944 case TEXT_NODE: |
| 945 return createTextNode(importedNode->nodeValue()); | 945 return createTextNode(importedNode->nodeValue()); |
| 946 case CDATA_SECTION_NODE: | 946 case CDATA_SECTION_NODE: |
| 947 return createCDATASection(importedNode->nodeValue(), exceptionState); | 947 return createCDATASection(importedNode->nodeValue(), exceptionState); |
| 948 case PROCESSING_INSTRUCTION_NODE: | 948 case PROCESSING_INSTRUCTION_NODE: |
| 949 return createProcessingInstruction(importedNode->nodeName(), importedNod
e->nodeValue(), exceptionState); | 949 return createProcessingInstruction(importedNode->nodeName(), importedNod
e->nodeValue(), exceptionState); |
| 950 case COMMENT_NODE: | 950 case COMMENT_NODE: |
| 951 return createComment(importedNode->nodeValue()); | 951 return createComment(importedNode->nodeValue()); |
| 952 case DOCUMENT_TYPE_NODE: { | 952 case DOCUMENT_TYPE_NODE: { |
| 953 DocumentType* doctype = toDocumentType(importedNode); | 953 DocumentType* doctype = toDocumentType(importedNode); |
| 954 return DocumentType::create(this, doctype->name(), doctype->publicId(),
doctype->systemId()); | 954 return DocumentType::create(this, doctype->name(), doctype->publicId(),
doctype->systemId()); |
| 955 } | 955 } |
| 956 case ELEMENT_NODE: { | 956 case ELEMENT_NODE: { |
| 957 Element* oldElement = toElement(importedNode); | 957 Element* oldElement = toElement(importedNode); |
| 958 // FIXME: The following check might be unnecessary. Is it possible that | 958 // FIXME: The following check might be unnecessary. Is it possible that |
| 959 // oldElement has mismatched prefix/namespace? | 959 // oldElement has mismatched prefix/namespace? |
| 960 if (!hasValidNamespaceForElements(oldElement->tagQName())) { | 960 if (!hasValidNamespaceForElements(oldElement->tagQName())) { |
| 961 exceptionState.throwDOMException(NamespaceError, "The imported node
has an invalid namespace."); | 961 exceptionState.throwDOMException(NamespaceError, "The imported node
has an invalid namespace."); |
| 962 return nullptr; | 962 return nullptr; |
| 963 } | 963 } |
| 964 RefPtr<Element> newElement = createElement(oldElement->tagQName(), false
); | 964 RefPtrWillBeRawPtr<Element> newElement = createElement(oldElement->tagQN
ame(), false); |
| 965 | 965 |
| 966 newElement->cloneDataFromElement(*oldElement); | 966 newElement->cloneDataFromElement(*oldElement); |
| 967 | 967 |
| 968 if (deep) { | 968 if (deep) { |
| 969 if (!importContainerNodeChildren(oldElement, newElement, exceptionSt
ate)) | 969 if (!importContainerNodeChildren(oldElement, newElement, exceptionSt
ate)) |
| 970 return nullptr; | 970 return nullptr; |
| 971 if (isHTMLTemplateElement(*oldElement) | 971 if (isHTMLTemplateElement(*oldElement) |
| 972 && !importContainerNodeChildren(toHTMLTemplateElement(oldElement
)->content(), toHTMLTemplateElement(newElement)->content(), exceptionState)) | 972 && !importContainerNodeChildren(toHTMLTemplateElement(oldElement
)->content(), toHTMLTemplateElement(newElement)->content(), exceptionState)) |
| 973 return nullptr; | 973 return nullptr; |
| 974 } | 974 } |
| (...skipping 4764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5739 // FIXME: Oilpan: Use a weak counted set instead. | 5739 // FIXME: Oilpan: Use a weak counted set instead. |
| 5740 if (m_touchEventTargets) { | 5740 if (m_touchEventTargets) { |
| 5741 Vector<Node*> deadNodes; | 5741 Vector<Node*> deadNodes; |
| 5742 for (TouchEventTargetSet::iterator it = m_touchEventTargets->begin(); it
!= m_touchEventTargets->end(); ++it) { | 5742 for (TouchEventTargetSet::iterator it = m_touchEventTargets->begin(); it
!= m_touchEventTargets->end(); ++it) { |
| 5743 if (!visitor->isAlive(it->key)) | 5743 if (!visitor->isAlive(it->key)) |
| 5744 deadNodes.append(it->key); | 5744 deadNodes.append(it->key); |
| 5745 } | 5745 } |
| 5746 for (unsigned i = 0; i < deadNodes.size(); ++i) | 5746 for (unsigned i = 0; i < deadNodes.size(); ++i) |
| 5747 didClearTouchEventHandlers(deadNodes[i]); | 5747 didClearTouchEventHandlers(deadNodes[i]); |
| 5748 } | 5748 } |
| 5749 if (m_domWindow && !visitor->isAlive(m_domWindow)) { |
| 5750 ASSERT(isDisposed()); |
| 5751 // Oilpan: this mirrors the clearing of the document object's touch |
| 5752 // handlers that happen when the DOMWindow is destructed in a non-Oilpan |
| 5753 // setting (done via DOMWindow::removeAllEventListeners().) |
| 5754 didClearTouchEventHandlers(this); |
| 5755 m_domWindow.clear(); |
| 5756 } |
| 5749 } | 5757 } |
| 5750 | 5758 |
| 5751 void Document::trace(Visitor* visitor) | 5759 void Document::trace(Visitor* visitor) |
| 5752 { | 5760 { |
| 5753 visitor->trace(m_docType); | 5761 visitor->trace(m_docType); |
| 5754 visitor->trace(m_implementation); | 5762 visitor->trace(m_implementation); |
| 5755 visitor->trace(m_autofocusElement); | 5763 visitor->trace(m_autofocusElement); |
| 5756 visitor->trace(m_focusedElement); | 5764 visitor->trace(m_focusedElement); |
| 5757 visitor->trace(m_hoverNode); | 5765 visitor->trace(m_hoverNode); |
| 5758 visitor->trace(m_activeHoverElement); | 5766 visitor->trace(m_activeHoverElement); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 5786 visitor->trace(m_timeline); | 5794 visitor->trace(m_timeline); |
| 5787 visitor->trace(m_compositorPendingAnimations); | 5795 visitor->trace(m_compositorPendingAnimations); |
| 5788 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); | 5796 visitor->registerWeakMembers<Document, &Document::clearWeakMembers>(this); |
| 5789 DocumentSupplementable::trace(visitor); | 5797 DocumentSupplementable::trace(visitor); |
| 5790 TreeScope::trace(visitor); | 5798 TreeScope::trace(visitor); |
| 5791 ContainerNode::trace(visitor); | 5799 ContainerNode::trace(visitor); |
| 5792 ExecutionContext::trace(visitor); | 5800 ExecutionContext::trace(visitor); |
| 5793 } | 5801 } |
| 5794 | 5802 |
| 5795 } // namespace WebCore | 5803 } // namespace WebCore |
| OLD | NEW |