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

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

Issue 141363002: Count DOMImplementation.hasFeature usage and cases where it returns false (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/DOMImplementation.idl » ('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 28 matching lines...) Expand all
39 #include "core/dom/custom/CustomElementRegistrationContext.h" 39 #include "core/dom/custom/CustomElementRegistrationContext.h"
40 #include "core/html/HTMLDocument.h" 40 #include "core/html/HTMLDocument.h"
41 #include "core/html/HTMLMediaElement.h" 41 #include "core/html/HTMLMediaElement.h"
42 #include "core/html/HTMLViewSourceDocument.h" 42 #include "core/html/HTMLViewSourceDocument.h"
43 #include "core/html/ImageDocument.h" 43 #include "core/html/ImageDocument.h"
44 #include "core/html/MediaDocument.h" 44 #include "core/html/MediaDocument.h"
45 #include "core/html/PluginDocument.h" 45 #include "core/html/PluginDocument.h"
46 #include "core/html/TextDocument.h" 46 #include "core/html/TextDocument.h"
47 #include "core/loader/FrameLoader.h" 47 #include "core/loader/FrameLoader.h"
48 #include "core/frame/Frame.h" 48 #include "core/frame/Frame.h"
49 #include "core/frame/UseCounter.h"
49 #include "core/page/Page.h" 50 #include "core/page/Page.h"
50 #include "core/svg/SVGDocument.h" 51 #include "core/svg/SVGDocument.h"
51 #include "platform/ContentType.h" 52 #include "platform/ContentType.h"
52 #include "platform/MIMETypeRegistry.h" 53 #include "platform/MIMETypeRegistry.h"
53 #include "platform/graphics/Image.h" 54 #include "platform/graphics/Image.h"
54 #include "platform/graphics/media/MediaPlayer.h" 55 #include "platform/graphics/media/MediaPlayer.h"
55 #include "platform/plugins/PluginData.h" 56 #include "platform/plugins/PluginData.h"
56 #include "platform/weborigin/SecurityOrigin.h" 57 #include "platform/weborigin/SecurityOrigin.h"
57 #include "wtf/StdLibExtras.h" 58 #include "wtf/StdLibExtras.h"
58 59
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 { 171 {
171 if (feature.startsWith("http://www.w3.org/TR/SVG", false) 172 if (feature.startsWith("http://www.w3.org/TR/SVG", false)
172 || feature.startsWith("org.w3c.dom.svg", false) 173 || feature.startsWith("org.w3c.dom.svg", false)
173 || feature.startsWith("org.w3c.svg", false)) { 174 || feature.startsWith("org.w3c.svg", false)) {
174 // FIXME: SVG 2.0 support? 175 // FIXME: SVG 2.0 support?
175 return isSupportedSVG10Feature(feature, version) || isSupportedSVG11Feat ure(feature, version); 176 return isSupportedSVG10Feature(feature, version) || isSupportedSVG11Feat ure(feature, version);
176 } 177 }
177 return true; 178 return true;
178 } 179 }
179 180
181 bool DOMImplementation::hasFeatureForBindings(const String& feature, const Strin g& version)
182 {
183 if (!hasFeature(feature, version)) {
184 UseCounter::count(m_document, UseCounter::DOMImplementationHasFeatureRet urnFalse);
185 return false;
186 }
187 return true;
188 }
189
180 PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const AtomicStrin g& qualifiedName, 190 PassRefPtr<DocumentType> DOMImplementation::createDocumentType(const AtomicStrin g& qualifiedName,
181 const String& publicId, const String& systemId, ExceptionState& exceptionSta te) 191 const String& publicId, const String& systemId, ExceptionState& exceptionSta te)
182 { 192 {
183 AtomicString prefix, localName; 193 AtomicString prefix, localName;
184 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptio nState)) 194 if (!Document::parseQualifiedName(qualifiedName, prefix, localName, exceptio nState))
185 return 0; 195 return 0;
186 196
187 return DocumentType::create(&m_document, qualifiedName, publicId, systemId); 197 return DocumentType::create(&m_document, qualifiedName, publicId, systemId);
188 } 198 }
189 199
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 return TextDocument::create(init); 386 return TextDocument::create(init);
377 if (type == "image/svg+xml") 387 if (type == "image/svg+xml")
378 return SVGDocument::create(init); 388 return SVGDocument::create(init);
379 if (isXMLMIMEType(type)) 389 if (isXMLMIMEType(type))
380 return Document::create(init); 390 return Document::create(init);
381 391
382 return HTMLDocument::create(init); 392 return HTMLDocument::create(init);
383 } 393 }
384 394
385 } 395 }
OLDNEW
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/DOMImplementation.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698