Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: Source/WebCore/dom/Document.cpp

Issue 9249042: Merge 104275 - Fix a crash by importing an element of which local name ends with ":input". (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/dom/importNode-confusing-localName-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
825 case CDATA_SECTION_NODE: 825 case CDATA_SECTION_NODE:
826 return createCDATASection(importedNode->nodeValue(), ec); 826 return createCDATASection(importedNode->nodeValue(), ec);
827 case ENTITY_REFERENCE_NODE: 827 case ENTITY_REFERENCE_NODE:
828 return createEntityReference(importedNode->nodeName(), ec); 828 return createEntityReference(importedNode->nodeName(), ec);
829 case PROCESSING_INSTRUCTION_NODE: 829 case PROCESSING_INSTRUCTION_NODE:
830 return createProcessingInstruction(importedNode->nodeName(), importedNod e->nodeValue(), ec); 830 return createProcessingInstruction(importedNode->nodeName(), importedNod e->nodeValue(), ec);
831 case COMMENT_NODE: 831 case COMMENT_NODE:
832 return createComment(importedNode->nodeValue()); 832 return createComment(importedNode->nodeValue());
833 case ELEMENT_NODE: { 833 case ELEMENT_NODE: {
834 Element* oldElement = static_cast<Element*>(importedNode); 834 Element* oldElement = static_cast<Element*>(importedNode);
835 RefPtr<Element> newElement = createElementNS(oldElement->namespaceURI(), oldElement->tagQName().toString(), ec); 835 // FIXME: The following check might be unnecessary. Is it possible that
836 836 // oldElement has mismatched prefix/namespace?
837 if (hasPrefixNamespaceMismatch(oldElement->tagQName())) {
838 ec = NAMESPACE_ERR;
839 return 0;
840 }
841 RefPtr<Element> newElement = createElement(oldElement->tagQName(), ec);
837 if (ec) 842 if (ec)
838 return 0; 843 return 0;
839 844
840 NamedNodeMap* attrs = oldElement->attributes(true); 845 NamedNodeMap* attrs = oldElement->attributes(true);
841 if (attrs) { 846 if (attrs) {
842 unsigned length = attrs->length(); 847 unsigned length = attrs->length();
843 for (unsigned i = 0; i < length; i++) { 848 for (unsigned i = 0; i < length; i++) {
844 Attribute* attr = attrs->attributeItem(i); 849 Attribute* attr = attrs->attributeItem(i);
845 newElement->setAttribute(attr->name(), attr->value().impl(), ec) ; 850 newElement->setAttribute(attr->name(), attr->value().impl(), ec) ;
846 if (ec) 851 if (ec)
(...skipping 4340 matching lines...) Expand 10 before | Expand all | Expand 10 after
5187 5192
5188 NodeListsNodeData* data = rareData()->nodeLists(); 5193 NodeListsNodeData* data = rareData()->nodeLists();
5189 5194
5190 String localTypeNames = typeNames.isNull() ? String("http://webkit.org/micro data/undefinedItemType") : typeNames; 5195 String localTypeNames = typeNames.isNull() ? String("http://webkit.org/micro data/undefinedItemType") : typeNames;
5191 ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeName s)); 5196 ASSERT_UNUSED(list, list == data->m_microDataItemListCache.get(localTypeName s));
5192 data->m_microDataItemListCache.remove(localTypeNames); 5197 data->m_microDataItemListCache.remove(localTypeNames);
5193 } 5198 }
5194 #endif 5199 #endif
5195 5200
5196 } // namespace WebCore 5201 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/dom/importNode-confusing-localName-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698