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

Define dataset as a mixin for HTMLElement and SVGElement #280

Closed
nikosandronikos opened this issue Jul 12, 2016 · 14 comments
Closed

Define dataset as a mixin for HTMLElement and SVGElement #280

nikosandronikos opened this issue Jul 12, 2016 · 14 comments

Comments

@nikosandronikos
Copy link

nikosandronikos commented Jul 12, 2016

The SVGElement and HTMLElement interfaces both define a dataset IDL attribute.

The SVGWG are wondering about the possibility of moving the definition into DOM as a mixin interface that can then be applied to both HTMLElement and SVGElement.

Issue in SVGWG tracker: w3c/svgwg#60

@annevk
Copy link
Member

annevk commented Jul 18, 2016

Maybe HTML would be a better place to provide this abstraction, since everything has to depend on HTML anyway?

@nikosandronikos
Copy link
Author

If you think that's the appropriate place then that's ok with us. Where it ends up isn't as important as having only a single definition.

@annevk
Copy link
Member

annevk commented Jul 19, 2016

I think I would prefer that. We put class and id in DOM because they are "superglobal attributes". Features that are "global attributes" for a limited set of namespaces probably don't really belong in DOM directly, insofar we have any meaningful modularization here...

@domenic agreed?

@domenic
Copy link
Member

domenic commented Jul 19, 2016

Yeah I guess the reasoning in your last comment makes sense.

So in terms of HTML changes, I'm thinking, create a new ElementDataset mixin in the section #embedding-custom-non-visible-data-with-the-data-*-attributes, move [SameObject] readonly attribute DOMStringMap dataset; there, and then in the HTMLElement definition, add implements ElementDataset like we already have for implements ElementContentEditable.

@annevk
Copy link
Member

annevk commented Jul 19, 2016

Yeah, and we need to verify all attribute manipulation is generic enough. And maybe the data-* conformance should be made reusable or directly defined for SVG too.

@annevk
Copy link
Member

annevk commented Aug 11, 2016

See also https://bugzilla.mozilla.org/show_bug.cgi?id=921834. Apparently WebKit/Blink expose it directly on Element. Gecko plans to add it to SVGElement. Edge only has it on HTMLElement.

@domenic
Copy link
Member

domenic commented Aug 11, 2016

Apparently WebKit/Blink expose it directly on Element.

If you read a bit further down this is not true. Confirmation, at least in Blink (not near my WebKit computer): http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=4371

@annevk
Copy link
Member

annevk commented Aug 11, 2016

Oops, my bad. Okay, maybe given that @cdumez can patch WebKit.

@cdumez
Copy link

cdumez commented Aug 11, 2016

@annevk: so moving dataset from Element to HTMLElement / SVGElement ?

@annevk
Copy link
Member

annevk commented Aug 11, 2016

@cdumez yes.

@cdumez
Copy link

cdumez commented Aug 11, 2016

@annevk Not a problem then: http://trac.webkit.org/changeset/204377

@cvrebert
Copy link
Member

cvrebert commented Mar 5, 2017

@dstorey
Copy link
Member

dstorey commented Feb 14, 2018

Edge now supports this on SVGElement, along with a number of other things like tabIndex, focus(), blur().

They all seem like something that could be in a mixin.

@annevk
Copy link
Member

annevk commented Feb 16, 2018

I'm moving this to whatwg/html#3471 as this is really an issue with the HTML Standard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants