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 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011 Apple Inc. All rights
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 Google Inc. All rights reserved. | 8 * Copyright (C) 2008, 2009, 2011 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 * | 10 * |
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 case CDATA_SECTION_NODE: | 828 case CDATA_SECTION_NODE: |
829 return createCDATASection(importedNode->nodeValue(), ec); | 829 return createCDATASection(importedNode->nodeValue(), ec); |
830 case ENTITY_REFERENCE_NODE: | 830 case ENTITY_REFERENCE_NODE: |
831 return createEntityReference(importedNode->nodeName(), ec); | 831 return createEntityReference(importedNode->nodeName(), ec); |
832 case PROCESSING_INSTRUCTION_NODE: | 832 case PROCESSING_INSTRUCTION_NODE: |
833 return createProcessingInstruction(importedNode->nodeName(), importedNod
e->nodeValue(), ec); | 833 return createProcessingInstruction(importedNode->nodeName(), importedNod
e->nodeValue(), ec); |
834 case COMMENT_NODE: | 834 case COMMENT_NODE: |
835 return createComment(importedNode->nodeValue()); | 835 return createComment(importedNode->nodeValue()); |
836 case ELEMENT_NODE: { | 836 case ELEMENT_NODE: { |
837 Element* oldElement = static_cast<Element*>(importedNode); | 837 Element* oldElement = static_cast<Element*>(importedNode); |
838 RefPtr<Element> newElement = createElementNS(oldElement->namespaceURI(),
oldElement->tagQName().toString(), ec); | 838 // FIXME: The following check might be unnecessary. Is it possible that |
839 | 839 // oldElement has mismatched prefix/namespace? |
| 840 if (hasPrefixNamespaceMismatch(oldElement->tagQName())) { |
| 841 ec = NAMESPACE_ERR; |
| 842 return 0; |
| 843 } |
| 844 RefPtr<Element> newElement = createElement(oldElement->tagQName(), ec); |
840 if (ec) | 845 if (ec) |
841 return 0; | 846 return 0; |
842 | 847 |
843 NamedNodeMap* attrs = oldElement->attributes(true); | 848 NamedNodeMap* attrs = oldElement->attributes(true); |
844 if (attrs) { | 849 if (attrs) { |
845 unsigned length = attrs->length(); | 850 unsigned length = attrs->length(); |
846 for (unsigned i = 0; i < length; i++) { | 851 for (unsigned i = 0; i < length; i++) { |
847 Attribute* attr = attrs->attributeItem(i); | 852 Attribute* attr = attrs->attributeItem(i); |
848 newElement->setAttribute(attr->name(), attr->value().impl(), ec)
; | 853 newElement->setAttribute(attr->name(), attr->value().impl(), ec)
; |
849 if (ec) | 854 if (ec) |
(...skipping 4367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5217 | 5222 |
5218 NodeListsNodeData* data = rareData()->nodeLists(); | 5223 NodeListsNodeData* data = rareData()->nodeLists(); |
5219 | 5224 |
5220 String localTypeNames = typeNames.isNull() ? String("http://webkit.org/micro
data/undefinedItemType") : typeNames; | 5225 String localTypeNames = typeNames.isNull() ? String("http://webkit.org/micro
data/undefinedItemType") : typeNames; |
5221 ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeName
s)); | 5226 ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeName
s)); |
5222 data->m_microDataItemListCache.remove(localTypeNames); | 5227 data->m_microDataItemListCache.remove(localTypeNames); |
5223 } | 5228 } |
5224 #endif | 5229 #endif |
5225 | 5230 |
5226 } // namespace WebCore | 5231 } // namespace WebCore |
OLD | NEW |