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

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

Issue 108483002: Have Document::parseQualifiedName() deal with AtomicStrings (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/Document.h » ('j') | 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 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org) 6 * Copyright (C) 2006 Samuel Weinig (sam@webkit.org)
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 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 { 171 {
172 if (feature.startsWith("http://www.w3.org/TR/SVG", false) 172 if (feature.startsWith("http://www.w3.org/TR/SVG", false)
173 || feature.startsWith("org.w3c.dom.svg", false) 173 || feature.startsWith("org.w3c.dom.svg", false)
174 || feature.startsWith("org.w3c.svg", false)) { 174 || feature.startsWith("org.w3c.svg", false)) {
175 // FIXME: SVG 2.0 support? 175 // FIXME: SVG 2.0 support?
176 return isSupportedSVG10Feature(feature, version) || isSupportedSVG11Feat ure(feature, version); 176 return isSupportedSVG10Feature(feature, version) || isSupportedSVG11Feat ure(feature, version);
177 } 177 }
178 return true; 178 return true;
179 } 179 }
180 180
181 PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const String& qua lifiedName, 181 PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const AtomicStrin g& qualifiedName,
182 const String& publicId, const String& systemId, ExceptionState& exceptionSta te) 182 const String& publicId, const String& systemId, ExceptionState& exceptionSta te)
183 { 183 {
184 String prefix, localName; 184 AtomicString prefix, localName;
185 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptio nState)) 185 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptio nState))
186 return 0; 186 return 0;
187 187
188 return DocumentType::create(&m_document, qualifiedName, publicId, systemId); 188 return DocumentType::create(&m_document, qualifiedName, publicId, systemId);
189 } 189 }
190 190
191 DOMImplementation* DOMImplementation::getInterface(const String& /*feature*/) 191 DOMImplementation* DOMImplementation::getInterface(const String& /*feature*/)
192 { 192 {
193 return 0; 193 return 0;
194 } 194 }
195 195
196 PassRefPtr<Document> DOMImplementation::createDocument(const String& namespaceUR I, 196 PassRefPtr<Document> DOMImplementation::createDocument(const AtomicString& names paceURI,
197 const String& qualifiedName, DocumentType* doctype, ExceptionState& exceptio nState) 197 const AtomicString& qualifiedName, DocumentType* doctype, ExceptionState& ex ceptionState)
198 { 198 {
199 RefPtr<Document> doc; 199 RefPtr<Document> doc;
200 DocumentInit init = DocumentInit::fromContext(m_document.contextDocument()); 200 DocumentInit init = DocumentInit::fromContext(m_document.contextDocument());
201 if (namespaceURI == SVGNames::svgNamespaceURI) { 201 if (namespaceURI == SVGNames::svgNamespaceURI) {
202 doc = SVGDocument::create(init); 202 doc = SVGDocument::create(init);
203 } else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) { 203 } else if (namespaceURI == HTMLNames::xhtmlNamespaceURI) {
204 doc = Document::createXHTML(init.withRegistrationContext(m_document.regi strationContext())); 204 doc = Document::createXHTML(init.withRegistrationContext(m_document.regi strationContext()));
205 } else { 205 } else {
206 doc = Document::create(init); 206 doc = Document::create(init);
207 } 207 }
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return TextDocument::create(init); 359 return TextDocument::create(init);
360 if (type == "image/svg+xml") 360 if (type == "image/svg+xml")
361 return SVGDocument::create(init); 361 return SVGDocument::create(init);
362 if (isXMLMIMEType(type)) 362 if (isXMLMIMEType(type))
363 return Document::create(init); 363 return Document::create(init);
364 364
365 return HTMLDocument::create(init); 365 return HTMLDocument::create(init);
366 } 366 }
367 367
368 } 368 }
OLDNEW
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698