Update SVG interfaces to use mixins where possible in all SVG specs. Issue #353 by dirkschulze · Pull Request #376 · w3c/svgwg
In general, I'm supportive of the change. My main concern for reviewing is to make sure that you've caught all the relevant references. Below I summarize the changes made & the checks I made against them:
The following have been converted from NoInterfaceObject interfaces to Mixins:
-
SVGTests(included inSVGGraphicsElement, and inSVGAnimationElementin the animation module) -
SVGFitToViewBox(included inSVGSVGElement,SVGSymbolElement,SVGMarkerElement,SVGPatternElement,SVGViewElement) -
SVGZoomAndPan(included inSVGSVGElement,SVGViewElement) -
SVGURIReference(included inSVGUseElement,SVGMeshElement,SVGTextPathElement,SVGImageElement,SVGGradientElement,SVGPatternElement,SVGCursorElement,SVGScriptElement,SVGAElement, andSVGMPathElementin the animation module) -
SVGElementInstance(included inSVGElement) -
GetSVGDocument(designed to be compatible withHTMLIframeElementandHTMLObjectElement, but those interfaces currently define the method directly instead of implementing the interface, so we're not breaking anything there, although a follow-up PR could suggest they switch to the mixin structure) -
SVGAnimatedPoints(included inSVGPolylineElementandSVGPolygonElement) -
SVGPathDatain the Paths Level 3 module
Those are all the eligible NoInterfaceObject interfaces in SVG 2, and all the interfaces that currently implement. I haven't checked the other modules myself, but I'm less worried about those since we're not asking anyone to implement them yet.
In addition, the following mixins defined in the HTML standard are now references as includes not implements:
GlobalEventHandlers(included inSVGElement)WindowEventHandlers(included inSVGSVGElement)HTMLHyperlinkElementUtils(included inSVGAElement)
However, those interfaces are still being linked to W3C HTML 5.1 definitions, which used the NoInterfaceObject syntax (as does HTML 5.3 ED). The link URLs are defined in definitions.xml, but there should be a WG resolution before switching from W3C to WHATWG as the definitive reference for HTML (we're not consistent throughout the spec prose, linking to either/both, but IDL is more formal).
Also note that there is an open issue about conflicts implementing HTMLHyperlinkElementUtils in SVG elements (although nothing in this PR makes that a bigger or smaller conflict).
The only other potentially-mixin interface implemented in SVG is LinkStyle (but that would need edits to CSSOM first, and then an update to SVG's reference definition URL to point to CSSOM instead of CSS 2).
Final comment: There should be an edit made to the changes appendix describing these changes (one line in the "changes to the entire spec" section should be fine).
That & a WG decision on cross-linking to the HTML specs, and I'd be able to sign off on this PR.