-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add more global attributes from HTML #118
Comments
Hmm, somehow until now I didn't catch that math elements can have an Which annotation attributes from https://html.spec.whatwg.org/#linkTypes does it support (I assume the same as a/area?) and that then all of the things about building requests/CORs etc are exactly the same too? This seems kind of considerably underspecified, do you know how those that support linking (Safari definitely does) handles those questions? |
ahh, I assume all of the 'location' things in CSS would treat this like links too? Basically all of these: |
Yes, I think so. The spec actually has such a selector in the UA stylesheet https://mathml-refresh.github.io/mathml-core/#dfn-href |
That seems sensible to me. IIRC, the MathML href implementations in Gecko/WebKit/Chromium basically rely on or copy what is done for the a element, so I expect they would behave the same. (BTW, as a side comment MathML 2 used to rely on xlink for hyperlinks. I think SVG does it too) |
The UA Style sheet in the spec uses
While I understand what is desired, isn't that too broad as it affects all links, not just those in MathML? FYI: |
The complete stylesheet is https://mathml-refresh.github.io/mathml-core/#user-agent-stylesheet And this rule forces all rules to apply only to element in the MathML namespace:
|
Well, MathML doesn’t currently support event handler attributes at all, and I’d like it to stay that way, as event handler attributes are mothballed in favour of TL;DR: I object to adding |
@ExE-Boss it seems very strange for mathml to be special in this regard. The default position should be, in my mind, that working like everything else should be the default goal and that being special should be only if we can give a really good justification for why it has to be, no? Is there some very strong argument as to why it should continue to be different really? |
Because event handler attributes are deprecated, and a legacy mistake, IMO. |
They aren't deprecated. They have even expanded in the not distant past whatwg/html@940a2d4 |
I think @davidcarlisle raised the issue during one meeting. The conclusion was that as long as HTML supports them, it is not a big extra code to support this for MathML and as Brian said it makes things more consistent with SVG/HTML. Also, it's sometimes more convenient (e.g. for quick testing) to use on[event] attribute than to register events via addEventListener. I believe people still use onload a lot for example. |
Remaining work was done by and we have several tests for that. So I think we can close this. |
The global attributes are defined here:
https://mathml-refresh.github.io/mathml-core/#global-attributes
Some of them are taken from HTML:
https://mathml-refresh.github.io/mathml-core/#attributes-common-to-html-and-mathml-elements
After discussions in w3c/mathml-core#129, we agreed that we want to add some IDL for all MathML elements:
https://mathml-refresh.github.io/mathml-core/#dom-and-javascript
(1) GlobalEventHandlers, DocumentAndElementEventHandlers would mean adding all the
onsomething
event attributes:https://html.spec.whatwg.org/multipage/webappapis.html#globaleventhandlers
https://html.spec.whatwg.org/multipage/webappapis.html#documentandelementeventhandlers
Rob mentioned that SVG has something to avoid to explicitly mention them:
https://svgwg.org/svg2-draft/interact.html#EventAttributes
(Side comment: do we really want to keep the non-normative https://mathml-refresh.github.io/mathml-core/#relaxng ? Now that we are relying a lot on HTML and CSS definitions (in particular for attribute values) instead of having a standalone document, it seems a bit tedious to keep things in sync. Maybe the RelaxNG schema should be moved in a different repository?)
(2) HTMLOrSVGElement would add this:
https://html.spec.whatwg.org/multipage/dom.html#htmlorsvgelement
'data-' attributes:
https://html.spec.whatwg.org/multipage/dom.html#attr-data-
nonce attribute:
https://html.spec.whatwg.org/multipage/urls-and-fetching.html#nonce-attributes
tabIndex attribute:
https://html.spec.whatwg.org/multipage/interaction.html#attr-tabindex
(3) ElementCSSInlineStyle has a style attribute
https://www.w3.org/TR/cssom-1/#elementcssinlinestyle
which is already here:
https://mathml-refresh.github.io/mathml-core/#style
so nothing to add.
In several places, the HTML spec mentions that IDL attributes reflect content attributes:
https://html.spec.whatwg.org/multipage/common-dom-interfaces.html#reflect
Maybe we need to mention that too.
The text was updated successfully, but these errors were encountered: