Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WebIDL definition(s) to use new mixin syntax #353

Closed
7 tasks
tobie opened this issue Nov 3, 2017 · 6 comments
Closed
7 tasks

Update WebIDL definition(s) to use new mixin syntax #353

tobie opened this issue Nov 3, 2017 · 6 comments

Comments

@tobie
Copy link
Member

tobie commented Nov 3, 2017

Hi all!

WebIDL recently introduced dedicated syntax for mixins.

This syntax replaces the [NoInterfaceObject] extended attribute and implements statement which have been deprecated (except for a few legacy uses cases explicitely mentioned in the spec).

You can read more about it here.

In most cases, the changes should be relatively straightforward. The now deprecated:

interface Foo { };

[NoInterfaceObject]  // (Mostly) DEPRECATED
interface Bar { };
Foo implementes Bar; // DEPRECATED

should just be rewritten as:

interface Foo { };

interface mixin Bar { };
Foo includes Bar;

Additonaly, a section on when to use partials and mixins has been added to the spec. It's short and might be worth a read.

It seems the following interfaces in the Scalable Vector Graphics (SVG) 2 spec are impacted by this change:

  • SVGTests
  • SVGFitToViewBox
  • SVGZoomAndPan
  • SVGURIReference
  • SVGElementInstance
  • GetSVGDocument
  • SVGAnimatedPoints

We're sorry for the inconvenience this causes, but our hope is that this ultimately makes things simpler and clearer for everybody.

As always, please feel free to reach out if you have any questions.

Thanks!


Tracked in: whatwg/webidl#472 | Original pull-request: whatwg/webidl#433

@dirkschulze
Copy link
Contributor

@tobie What about GlobalEventHandlers? We implement it for SVGElement. Has it been updated yet?

@dirkschulze
Copy link
Contributor

I also couldn't find an implement for GetSVGDocument. It is mentioned that it might be used in HTML by HTMLObjectElement with getSVGDocument. Was that updated already or is it going to be updated right after we change it in the spec?

@dirkschulze
Copy link
Contributor

@tobie Other interfaces that we implement from HTML are:

  • HTMLHyperlinkElementUtils
  • WindowEventHandlers
  • LinkStyle
  • GlobalEventHandlers

We can only update those once HTML updated them.

@tobie
Copy link
Member Author

tobie commented Dec 29, 2017

Other interfaces that we implement from HTML are HTMLHyperlinkElementUtils, WindowEventHandlers, LinkStyle, and GlobalEventHandlers. We can only update those once HTML updated them.

HTML has been updated in whatwg/html#3207, so HTMLHyperlinkElementUtils, WindowEventHandlers, and GlobalEventHandlers have been converted to the new syntax.

LinkStyle, however, is defined in the CSSOM spec, which has not been converted yet. It's tracked here: w3c/csswg-drafts#1931.

@tobie
Copy link
Member Author

tobie commented Dec 29, 2017

I also couldn't find an implement for GetSVGDocument. It is mentioned that it might be used in HTML by HTMLObjectElement with getSVGDocument. Was that updated already or is it going to be updated right after we change it in the spec?

So the HTML spec defines the getSVGDocument operation rather than include the GetSVGDocument mixin. Looking at both definitions, it seems the HTML one is more specific.

There might be an opportunity here to simplify things, but that's a separate issue. GetSVGDocument really is a mixin regardless of whether other interfaces include it.

@dirkschulze
Copy link
Contributor

@tobie Ok, replaced implements with includes for the HTML defined interfaces and made GetSVGDocument a mixin for now. We can discuss which spec should define the interface in a separate issue.

All that is left is the SVGPathSegment NoInterfaceObject of the SVG Path editors draft. This specs is not up for a WD as far as I know. Not sure if it even is on the charter of the SVG WG for this year. So there might be other changes to that spec anyway.

dirkschulze added a commit that referenced this issue Apr 12, 2018
Update SVG interfaces to use mixins where possible in all SVG specs. Issue #353
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants