Make DOMImplementation::hasFeature() behave according to specification
authorch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 17:31:04 +0000 (17:31 +0000)
committerch.dumez@sisa.samsung.com <ch.dumez@sisa.samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Aug 2013 17:31:04 +0000 (17:31 +0000)
commit4b75c5cc677ad4d0da0adcbd65c7f2181c408c00
treeb61705566869eacb6d5acd155de96705e1081c21
parent82e0303499e7e0a75e3ea0648cf03088888a83a9
Make DOMImplementation::hasFeature() behave according to specification
https://bugs.webkit.org/show_bug.cgi?id=119329

Reviewed by Ryosuke Niwa.

Source/WebCore:

Make DOMImplementation::hasFeature() behave according to the latest specification:
http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature

Specifically, the function should now return true unconditionally for any non-SVG feature.
This behavior is consistent with Firefox and since recently Blink.

hasFeature() originally would report whether the user agent claimed to support a
given DOM feature, but experience proved it was not nearly as reliable or granular
as simply checking whether the desired interfaces, attributes, or methods existed.
As such, it should no longer be used, but continues to exist (and simply returns
true) so that old pages don't stop working.

No new tests, covered by existing tests.

* dom/DOMImplementation.cpp:
(WebCore::isSupportedSVG10Feature):
(WebCore::isSupportedSVG11Feature):
(WebCore::DOMImplementation::hasFeature):

LayoutTests:

Rebaseline several test cases now that DOMImplementation::hasFeature() returns
true unconditionally for non-SVG features.

Also use a valid svg prefix for unknown features in SVG tests so that they are
properly recognized as SVG features and so that hasFeature() returns false as
expected.

* dom/xhtml/level3/core/hasFeature01-expected.txt:
* dom/xhtml/level3/core/hasFeature02-expected.txt:
* dom/xhtml/level3/core/hasFeature03-expected.txt:
* dom/xhtml/level3/core/hasFeature04-expected.txt:
* fast/dom/features-expected.txt:
* platform/efl/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/efl/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt:
* platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/mac/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt:
* platform/qt-mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt:
* svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt:
* svg/custom/outer-svg-unknown-feature.svg:
* svg/dynamic-updates/script-tests/SVGCircleElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGEllipseElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGForeignObjectElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGGElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGGElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGImageElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGImageElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGLineElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGLineElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPathElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPathElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPolygonElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPolygonElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPolylineElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGPolylineElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGRectElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGRectElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGSVGElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGSVGElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGTextElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGTextElement-svgdom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGUseElement-dom-requiredFeatures.js:
(repaintTest):
* svg/dynamic-updates/script-tests/SVGUseElement-svgdom-requiredFeatures.js:
(repaintTest):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
44 files changed:
LayoutTests/ChangeLog
LayoutTests/dom/xhtml/level3/core/hasFeature01-expected.txt
LayoutTests/dom/xhtml/level3/core/hasFeature02-expected.txt
LayoutTests/dom/xhtml/level3/core/hasFeature03-expected.txt
LayoutTests/dom/xhtml/level3/core/hasFeature04-expected.txt
LayoutTests/fast/dom/features-expected.txt
LayoutTests/platform/efl/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt
LayoutTests/platform/efl/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt
LayoutTests/platform/gtk/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt
LayoutTests/platform/gtk/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt
LayoutTests/platform/mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt
LayoutTests/platform/mac/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt
LayoutTests/platform/qt-mac/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt
LayoutTests/platform/qt/svg/W3C-SVG-1.1-SE/types-dom-06-f-expected.txt
LayoutTests/svg/W3C-SVG-1.1/struct-dom-03-b-expected.txt
LayoutTests/svg/custom/outer-svg-unknown-feature.svg
LayoutTests/svg/dynamic-updates/script-tests/SVGCircleElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGCircleElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGEllipseElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGEllipseElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGForeignObjectElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGForeignObjectElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGGElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGGElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGImageElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGImageElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGLineElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGLineElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPathElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPathElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPolygonElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPolygonElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPolylineElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGPolylineElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGRectElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGRectElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGSVGElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGSVGElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGTextElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGTextElement-svgdom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGUseElement-dom-requiredFeatures.js
LayoutTests/svg/dynamic-updates/script-tests/SVGUseElement-svgdom-requiredFeatures.js
Source/WebCore/ChangeLog
Source/WebCore/dom/DOMImplementation.cpp