[whatwg] supporting HTMLElement.dataset on SVG elements

Garrett Smith dhtmlkitchen at gmail.com
Wed Feb 6 11:18:00 PST 2013


On 2/5/13, Cameron McCormack <cam at mcc.id.au> wrote:
> As part of aligning SVG with some not-so-HTML-specific features of HTML,
> the SVG WG would like to support data-* attributes on SVG elements.  In
> mixed HTML/SVG documents, it seems like you would want to be able to use
> these attributes regardless of whether the elements are HTML or SVG, or
> indeed MathML.
>
> Does it make sense to move HTMLElement.dataset up to Element, so that
> all elements can benefit from it?  If not, could this attribute be split
> out on to a separate interface that we could have SVGElement implement?
>
What is the cost of extracting a common interface?

Are there any cases, existing or potential, where global attributes
might create conflict or make no sense?
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#global-attributes

HTMLUnknownElement looks like it wants to fill the role of common
interface, but due to class hierarchy, it can't.
http://www.whatwg.org/specs/web-apps/current-work/multipage/elements.html#htmlunknownelement

| interface must be used for HTML elements that are not
| defined by this specification (or other applicable specifications).

a new interface, such as UnknownElement or GenericElement could
accommodate shared features and avoid potential situations where those
features wouldn't make sense on a common Element superclass.
GenericElement could be implemented by HTMLElement and SVGElement and
all subclasses thereof including HTMLUnknownElement, plus whatever
they use in Math ML and whoever else wants to inherit from
GenericElement.
-- 
Garrett
Twitter: @xkit
personx.tumblr.com



More information about the whatwg mailing list