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

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

Issue 167653002: Make importNode work when the XML document contains a CDATA section (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Create CDATASection directly in importNode Created 6 years, 10 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
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, 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 876 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 { 887 {
888 if (!importedNode) { 888 if (!importedNode) {
889 exceptionState.throwDOMException(NotSupportedError, "The node provided i s invalid."); 889 exceptionState.throwDOMException(NotSupportedError, "The node provided i s invalid.");
890 return 0; 890 return 0;
891 } 891 }
892 892
893 switch (importedNode->nodeType()) { 893 switch (importedNode->nodeType()) {
894 case TEXT_NODE: 894 case TEXT_NODE:
895 return createTextNode(importedNode->nodeValue()); 895 return createTextNode(importedNode->nodeValue());
896 case CDATA_SECTION_NODE: 896 case CDATA_SECTION_NODE:
897 return createCDATASection(importedNode->nodeValue(), exceptionState); 897 return CDATASection::create(*this, importedNode->nodeValue());
898 case PROCESSING_INSTRUCTION_NODE: 898 case PROCESSING_INSTRUCTION_NODE:
899 return createProcessingInstruction(importedNode->nodeName(), importedNod e->nodeValue(), exceptionState); 899 return createProcessingInstruction(importedNode->nodeName(), importedNod e->nodeValue(), exceptionState);
900 case COMMENT_NODE: 900 case COMMENT_NODE:
901 return createComment(importedNode->nodeValue()); 901 return createComment(importedNode->nodeValue());
902 case DOCUMENT_TYPE_NODE: { 902 case DOCUMENT_TYPE_NODE: {
903 DocumentType* doctype = toDocumentType(importedNode); 903 DocumentType* doctype = toDocumentType(importedNode);
904 return DocumentType::create(this, doctype->name(), doctype->publicId(), doctype->systemId()); 904 return DocumentType::create(this, doctype->name(), doctype->publicId(), doctype->systemId());
905 } 905 }
906 case ELEMENT_NODE: { 906 case ELEMENT_NODE: {
907 Element* oldElement = toElement(importedNode); 907 Element* oldElement = toElement(importedNode);
(...skipping 4533 matching lines...) Expand 10 before | Expand all | Expand 10 after
5441 void Document::defaultEventHandler(Event* event) 5441 void Document::defaultEventHandler(Event* event)
5442 { 5442 {
5443 if (frame() && frame()->remotePlatformLayer()) { 5443 if (frame() && frame()->remotePlatformLayer()) {
5444 frame()->chromeClient().forwardInputEvent(this, event); 5444 frame()->chromeClient().forwardInputEvent(this, event);
5445 return; 5445 return;
5446 } 5446 }
5447 Node::defaultEventHandler(event); 5447 Node::defaultEventHandler(event);
5448 } 5448 }
5449 5449
5450 } // namespace WebCore 5450 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698