W3C home > Mailing lists > Public > www-math@w3.org > November 2014

Re: data-* attributes

From: Peter Krautzberger <peter.krautzberger@mathjax.org>
Date: Mon, 3 Nov 2014 14:47:38 +0100
Message-ID: <CABqxo81+7WJkyr_tkpsK7_EZSWxpXYJANJzcLR-vzK3pw26p3Q@mail.gmail.com>
To: David Carlisle <davidc@nag.co.uk>
Cc: "www-math@w3.org" <www-math@w3.org>
Thanks for your comments, David.

> One reason [...]
> is that HTML moved away from grammar based syntax
> (data-* being a good example of something that can't even be approximated
in any of
> dtd/RelaxNG or XSD schema).

Right. Still, I'd argue that it is a significant use case. Perhaps there
could be note suggesting a best practice for providing information in XML
that would be represented as data-* in HTML.

> MathJax could easily ignore  [...]

FWIW, MathJax wasn't the motivation for my question; this came out of questions
regarding JATS. In practice, data-* works just fine; it's just not formally
valid.

Peter.


On Mon, Nov 3, 2014 at 9:19 AM, David Carlisle <davidc@nag.co.uk> wrote:

> On 31/10/2014 10:13, Peter Krautzberger wrote:
>
>> Hi www-math,
>>
>> I've recently noticed that the W3C validator
>> <http://validator.w3.org/check> considers  HTML5 documents with
>> data-* attributes on MathML elements invalid.
>>
>> I'm wondering if this is a bug.
>>
>
> Not in that one (as it's using the xhtml1/mathml2 xml dtd but
>
> the html5/validator.nu based validator
>
> http://validator.w3.org/nu/
>
> also says it's invalid which I think is unfortunate. It's not really a
> bug in the validator though as (mostly) it just says what we tell it to
> say (in the relax NG schema for mathml3 in that case).
>
>>
>> It also made me wonder in how far the MathML spec could adopt data-*
>> in general. The spec suggests
>> <http://www.w3.org/Math/draft-spec/mathml.html#chapter2_
>> interf.unspecified>
>> namespacing for unspecified data. When working in both XML and HTML5
>> contexts this seems less than ideal.
>>
>>
> My personal view is that we don't need to add data- in a "pure
> xml/mathml" context) but that for mathml-in-html we should
> push for as close integration of html/svg/mathml as possible.
> At the DOM level a series of bug reports (and fixes:-) on html have
> largely achieved that with many features such as .innerHTML etc being
> pushed from HTMLElement to Element interface in the DOM so apply to
> MathML and SVG.
>
> At the markup level I think there is more we could do. One reason why we
> never updated the old HTML+MathML+SVG dtd from MathMl2 to MathML3 is
> that HTML moved away from grammar based syntax (data-* being a good
> example of something that can't even be approximated in any of
> dtd/RelaxNG or XSD schema).
>
> But I think we should have a mathml-in-html note that explicitly
> authorises data- and event based attributes such as onclick
> onmouseover etc when used in an HTML context.
>
> MathJax could easily ignore data- not sure how easy it would be to
> make the mouse events work for rendering back ends other than native
> mathml...
>
> Which brings us back to Browser support, as Frédéric just reminded us in
> another thread we perhaps need to push for better native support in more
> browsers before further standardising that support....
>
> David
> (personal response only, none of the above is a working group position)
>
>
>
>
>
Received on Monday, 3 November 2014 13:48:05 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:47 UTC