Closed Bug 1241898 Opened 9 years ago Closed 8 years ago

Why is SVGUnitTypes not [NoInterfaceObject]?

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla52
Tracking Status
firefox46 --- affected
firefox52 --- fixed

People

(Reporter: bzbarsky, Assigned: longsonr)

References

Details

Attachments

(1 file, 3 obsolete files)

It is in the spec. Can we make it so?
Flags: needinfo?(longsonr)
Assignee: nobody → longsonr
Flags: needinfo?(longsonr)
Attached patch patch (obsolete) — Splinter Review
Attachment #8780842 - Flags: review?(peterv)
Attachment #8780842 - Flags: review?(peterv) → review+
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/666bd7d68521 Make SVGUnitTypes [NoInterfaceObject]. r=peterv
Flags: in-testsuite-
Cameron, is it intended that SVG 2 no longer support clip1.clipPathUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE; or anything from https://dxr.mozilla.org/mozilla-central/source/dom/svg/test/test_SVGUnitTypes.html?q=test_SVGUnitTypes.html&redirect_type=direct Obviously I can remove the mochitest and rewrite the reftest to avoid such usage if that's the way forward.
Flags: needinfo?(longsonr) → needinfo?(cam)
Hmm, so that was a change I made in the spec when fixing the IDL to remove multiple inheritance during the conversion to Web IDL. For "mixin" interfaces like this, I made them [NoInterfaceObject]. But you are right that previously (if you interpreted the old IDL in a sensible way) this exposed the constants on SVGUnitTypes. clip1.clippathUnits.baseVal = SVGClipPathElement.SVG_UNIT_TYPE_USERSPACEONUSE still works of course. I see that all other browsers still expose SVGUnitTypes, so I'm wondering now if it's a mistake to remove this, at least without confirming first that nobody uses them. (I don't see an entry for SVGUnitTypes in chromestatus.com so perhaps we should add a use counter ourselves.) WDYT?
Flags: needinfo?(cam) → needinfo?(longsonr)
I think we should wontfix this and ensure that all IDL that has constants defined in is not [NoInterfaceObject].
Flags: needinfo?(longsonr)
If we want to keep the constants on SVGUnitTypes, I think the IDL here should look like this: 1) An SVGUnitTypes interface that is empty but not [NoInterfaceObject]. 2) Some mixin, name not relevant, which is therefore [NoInterfaceObject] and is mixed into SVGUnitTypes and the other interfaces that SVGUnitTypes is currently mixed into. The only observable difference from our current behavior, I believe, would be that "element instanceof SVGUnitTypes" no longer tests true for any elements. But does it test true in any other browser? http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4409 reports false in Chrome and Safari, and throws a "Function does not have a valid prototype object" exception in Edge. For posterity, that testcase is: var el = document.createElementNS("http://www.w3.org/2000/svg", "linearGradient"); w(el instanceof SVGUnitTypes); This would remove one of the very few cases where we still have confusion between interfaces and mixins and pave the way towards having them be distinct concepts in IDL...
Flags: needinfo?(longsonr)
Attached patch both changes in one patch (obsolete) — Splinter Review
That seems much more sensible. Can we get the SVG specification updated along these lines Cam?
Flags: needinfo?(longsonr) → needinfo?(cam)
Attachment #8783707 - Flags: feedback?(cam)
Note that this leaves the open question of what SVGUnitTypes.prototype should be, but note that this is already not interoperable between Edge and Chrome/Safari. I think my suggestion above would basically align us with the Chrome/Safari behavior.
Attached patch unittypes.txt (obsolete) — Splinter Review
Attachment #8780842 - Attachment is obsolete: true
Attachment #8783707 - Attachment is obsolete: true
Attachment #8783707 - Flags: feedback?(cam)
Attachment #8790046 - Flags: review?(cam)
I'm not actively involved in SVG spec work lately, but you can raise an issue here: https://github.com/w3c/svgwg/issues/new
Flags: needinfo?(cam)
Comment on attachment 8790046 [details] [diff] [review] unittypes.txt Review of attachment 8790046 [details] [diff] [review]: ----------------------------------------------------------------- r=me with that, and of course a DOM peer's review is required for the .webidl changes. Proposing those specific IDL changes in the GitHub issue you raise would be good, thanks. ::: dom/svg/test/mochitest.ini @@ -83,5 @@ > [test_SVGStringList.xhtml] > [test_SVGStyleElement.xhtml] > [test_SVGTransformListAddition.xhtml] > [test_SVGTransformList.xhtml] > -[test_SVGUnitTypes.html] Rather than delete this test, can you just adjust it so that it checks that one of the unit type constants is visible on these elements?
Attachment #8790046 - Flags: review?(cam) → review+
Attached patch unittypes.txtSplinter Review
only the webidl changes need yuor review Peter
Attachment #8790046 - Attachment is obsolete: true
Attachment #8799227 - Flags: review?(peterv)
Comment on attachment 8799227 [details] [diff] [review] unittypes.txt Review of attachment 8799227 [details] [diff] [review]: ----------------------------------------------------------------- Please don't forget to open an issue with the WG. ::: dom/webidl/moz.build @@ +550,5 @@ > 'SVGURIReference.webidl', > 'SVGUseElement.webidl', > 'SVGViewElement.webidl', > 'SVGZoomAndPan.webidl', > + 'SVGZoomAndPanValues.webidl', This doesn't belong here, right? But you'll deal with that when merging I guess :-).
Attachment #8799227 - Flags: review?(peterv) → review+
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a8cc44c79c30 Make SVGUnitTypes [NoInterfaceObject]. r=cam r=peterv
Backed out for build bustage: WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::SVGUnitTypesValues'., /builds/slave/m-in-lx-0000000000000000000000/build/src/dom/webidl/SVGUnitTypes.webidl line 16:24 Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=a8cc44c79c30946426314285c6f63c0f4d2b0295 Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=38093736&repo=mozilla-inbound WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::SVGUnitTypesValues'., /builds/slave/m-in-lx-0000000000000000000000/build/src/dom/webidl/SVGUnitTypes.webidl line 16:24
Flags: needinfo?(longsonr)
Backout by archaeopteryx@coole-files.de: https://hg.mozilla.org/integration/mozilla-inbound/rev/4616f76f25ec Backed out changeset a8cc44c79c30 for build bustage. r=backout DONTBUILD
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/c73e584c4071 Make SVGUnitTypes [NoInterfaceObject]. r=cam r=peterv
Pushed by ryanvm@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/9adfea13296e Fix SVGFilteElement typo in test_SVGUnitTypes.html.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Flags: needinfo?(longsonr)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: