All users were logged out of Bugzilla on October 13th, 2018

SVGElement::isSupported is not supported

RESOLVED FIXED

Status

()

RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: taken.spc, Assigned: taken.spc)

Tracking

Trunk
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(4 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
Created attachment 403108 [details] [diff] [review]
Patch

svgElement.isSupported(feature, version) is not yet implemented. We should implement it.
Attachment #403108 - Flags: review?(longsonr)
(Assignee)

Comment 1

9 years ago
Created attachment 403109 [details]
Testcase
Assignee: nobody → taken.spc
Status: NEW → ASSIGNED
http://www.w3.org/TR/DOM-Level-3-Core/core.html#Level-2-Core-Node-supports says This is the same name which can be passed to the method hasFeature on DOMImplementation.

http://www.w3.org/TR/SVG/svgdom.html#FeatureStrings eventually leads to this set of feature strings... http://www.w3.org/TR/SVG/feature.html one of which you have in your testcase.

nsGenericElement::InternalIsSupported certainly includes this via nsSVGFeatures::HaveFeature but it also includes much more. I must admit I'm not sure whether it is right to include things not listed in nsSVGFeatures::HaveFeature or not.
What do other browsers do?

Can you get clarification from www-svg?

Can we have a mochitest here? I guess somewhere we have tests for hasFeature with a list of test strings, can we just run all those tests on different kinds of elements as well?
(Assignee)

Comment 4

9 years ago
Created attachment 403462 [details]
More testcase

(In reply to comment #3)
> What do other browsers do?

Opera 10, Safari 4 and Chrome 3 support checking SVG feature strings and 'HTML', 'HTMLEvents', etc... for SVG elements

# BTW, They (and Gecko) return |true| for SVG feature strings for HTML elements
# http://taken.s101.xrea.com/tmp/isSupported.html
Can you produce a mochitest please?
Attachment #403108 - Flags: review?(longsonr) → review+
(Assignee)

Comment 6

9 years ago
Created attachment 403500 [details] [diff] [review]
mochitest

Simple test determinants whether isSupported is available for SVGSVGElement.
# Should I add a comment to nsSVGFeaturesList.h?
Attachment #403500 - Flags: review?(longsonr)
Comment on attachment 403500 [details] [diff] [review]
mochitest

>+
>+function testIsSupported(elem) {
>+  for each (var [feature, version, excepted_result] in featurs) {

I think the right semantics would be to call the variable accepted_result and the array should be called features

>+    if (excepted_result) {
>+      ok(elem.isSupported(feature, version), "isSupported(" + feature + ", " + version + ") returned wrong value, Was it chnaged to unsupported feature?");

"changed to an unupported feature" rather than "chnaged to..."

>+    } else {
>+      todo(elem.isSupported(feature, version), "isSupported(" + feature + ", " + version + ") is unsupported feature string");
>+    }

Should probably include some non-SVG specific tests too i.e. HTML, HTML events etc.
(Assignee)

Comment 8

9 years ago
Created attachment 403690 [details] [diff] [review]
mochitest (comment addressed)
Attachment #403500 - Attachment is obsolete: true
Attachment #403690 - Flags: review?(longsonr)
Attachment #403500 - Flags: review?(longsonr)
Attachment #403690 - Flags: review?(longsonr) → review+
pushed http://hg.mozilla.org/mozilla-central/rev/cc3c732f56cd
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
pushed http://hg.mozilla.org/mozilla-central/rev/1b3409557b31
Flags: in-testsuite? → in-testsuite+
You need to log in before you can comment on or make changes to this bug.