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

Unified Diff: Source/core/dom/DOMImplementation.cpp

Issue 1108293002: Make DOMImplementation.hasFeature() always return true. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: windows compilefix attempt Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DOMImplementation.h ('k') | Source/core/dom/DOMImplementation.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DOMImplementation.cpp
diff --git a/Source/core/dom/DOMImplementation.cpp b/Source/core/dom/DOMImplementation.cpp
index e47b6bce7d252ddbadb6f552d5b8ff1f3ec62c22..fccfbfd853bec9d1c1ac22a05c7219efed012498 100644
--- a/Source/core/dom/DOMImplementation.cpp
+++ b/Source/core/dom/DOMImplementation.cpp
@@ -61,123 +61,11 @@
namespace blink {
-typedef HashSet<String, CaseFoldingHash> FeatureSet;
-
-static void addString(FeatureSet& set, const char* string)
-{
- set.add(string);
-}
-
-static bool isSupportedSVG10Feature(const String& feature, const String& version)
-{
- if (!version.isEmpty() && version != "1.0")
- return false;
-
- static bool initialized = false;
- DEFINE_STATIC_LOCAL(FeatureSet, svgFeatures, ());
- if (!initialized) {
- addString(svgFeatures, "svg");
- addString(svgFeatures, "svg.static");
-// addString(svgFeatures, "svg.animation");
-// addString(svgFeatures, "svg.dynamic");
-// addString(svgFeatures, "svg.dom.animation");
-// addString(svgFeatures, "svg.dom.dynamic");
- addString(svgFeatures, "dom");
- addString(svgFeatures, "dom.svg");
- addString(svgFeatures, "dom.svg.static");
-// addString(svgFeatures, "svg.all");
-// addString(svgFeatures, "dom.svg.all");
- initialized = true;
- }
- return feature.startsWith("org.w3c.", TextCaseInsensitive)
- && svgFeatures.contains(feature.right(feature.length() - 8));
-}
-
-static bool isSupportedSVG11Feature(const String& feature, const String& version)
-{
- if (!version.isEmpty() && version != "1.1")
- return false;
-
- static bool initialized = false;
- DEFINE_STATIC_LOCAL(FeatureSet, svgFeatures, ());
- if (!initialized) {
- // Sadly, we cannot claim to implement any of the SVG 1.1 generic feature sets
- // lack of Font and Filter support.
- // http://bugs.webkit.org/show_bug.cgi?id=15480
- addString(svgFeatures, "SVG");
- addString(svgFeatures, "SVGDOM");
- addString(svgFeatures, "SVG-static");
- addString(svgFeatures, "SVGDOM-static");
- addString(svgFeatures, "SVG-animation");
- addString(svgFeatures, "SVGDOM-animation");
-// addString(svgFeatures, "SVG-dynamic);
-// addString(svgFeatures, "SVGDOM-dynamic);
- addString(svgFeatures, "CoreAttribute");
- addString(svgFeatures, "Structure");
- addString(svgFeatures, "BasicStructure");
- addString(svgFeatures, "ContainerAttribute");
- addString(svgFeatures, "ConditionalProcessing");
- addString(svgFeatures, "Image");
- addString(svgFeatures, "Style");
- addString(svgFeatures, "ViewportAttribute");
- addString(svgFeatures, "Shape");
- addString(svgFeatures, "Text");
- addString(svgFeatures, "BasicText");
- addString(svgFeatures, "PaintAttribute");
- addString(svgFeatures, "BasicPaintAttribute");
- addString(svgFeatures, "OpacityAttribute");
- addString(svgFeatures, "GraphicsAttribute");
- addString(svgFeatures, "BaseGraphicsAttribute");
- addString(svgFeatures, "Marker");
-// addString(svgFeatures, "ColorProfile");
- addString(svgFeatures, "Gradient");
- addString(svgFeatures, "Pattern");
- addString(svgFeatures, "Clip");
- addString(svgFeatures, "BasicClip");
- addString(svgFeatures, "Mask");
- addString(svgFeatures, "Filter");
- addString(svgFeatures, "BasicFilter");
- addString(svgFeatures, "DocumentEventsAttribute");
- addString(svgFeatures, "GraphicalEventsAttribute");
-// addString(svgFeatures, "AnimationEventsAttribute");
- addString(svgFeatures, "Cursor");
- addString(svgFeatures, "Hyperlinking");
- addString(svgFeatures, "XlinkAttribute");
- addString(svgFeatures, "View");
- addString(svgFeatures, "Script");
- addString(svgFeatures, "Animation");
- addString(svgFeatures, "Extensibility");
- initialized = true;
- }
- return feature.startsWith("http://www.w3.org/tr/svg11/feature#", TextCaseInsensitive)
- && svgFeatures.contains(feature.right(feature.length() - 35));
-}
-
DOMImplementation::DOMImplementation(Document& document)
: m_document(document)
{
}
-bool DOMImplementation::hasFeature(const String& feature, const String& version)
-{
- if (feature.startsWith("http://www.w3.org/TR/SVG", TextCaseInsensitive)
- || feature.startsWith("org.w3c.dom.svg", TextCaseInsensitive)
- || feature.startsWith("org.w3c.svg", TextCaseInsensitive)) {
- // FIXME: SVG 2.0 support?
- return isSupportedSVG10Feature(feature, version) || isSupportedSVG11Feature(feature, version);
- }
- return true;
-}
-
-bool DOMImplementation::hasFeatureForBindings(const String& feature, const String& version)
-{
- if (!hasFeature(feature, version)) {
- UseCounter::countDeprecation(m_document, UseCounter::DOMImplementationHasFeatureReturnFalse);
- return false;
- }
- return true;
-}
-
PassRefPtrWillBeRawPtr<DocumentType> DOMImplementation::createDocumentType(const AtomicString& qualifiedName,
const String& publicId, const String& systemId, ExceptionState& exceptionState)
{
« 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