-
Notifications
You must be signed in to change notification settings - Fork 21
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
display: math Define what would happen if author sets mathml { display: block; }
#171
Comments
mathml { display: block; }
if we introduce display: math
mathml { display: block; }
I suspect that what was meant was Someone can set a 'display' attribute with value "block"|"inline" on a |
OK I think that makes more sense for @rwlbuis uploaded a patch to prepare that: https://chromium-review.googlesource.com/c/chromium/src/+/1917207 |
Which takes precedence, the attr value
I think a similar issue exists for I thought we had discussed this (perhaps in general), but I can't find any discussion. I suspect something similar is lurking in HTML docs due to legacy issues, but HTML5 seems to have cleaned up the ones I checked. If true, we should follow that precedent. |
I'd imagine specificity and Cascade would determine which was used. Any author set attribute maps in the UA sheet to a rule. Any author set style should override that origin. |
If I have
and
which wins? They are both exactly the same specificity. Similarly (without the external style specification):
Going back to the case with an external style specification on math and markup
I would think 'ltr' is used on "Hello".However, in starting in on the polyfill, I don't see a way to find out if there is a CSS rule
or not. I can find out if there is a inline CSS rule and I can get the computed style, but the computed style could be coming from something set on an mtext, an mrow, or the math element. If there isn't a way to distinguish these cases, maybe that tells informs the discussion as to how we need to resolve this? |
I'm pretty sure they are different origins in the cascade, so for example.. the hidden attribute in html maps to display: none in the UA rules. If an author sets this to display block, that is in the author origin and so it 'wins' ... https://codepen.io/bkardell/pen/ExVOjoN Is this different? |
This block is in your proposed user-agent stylesheet math[display="block" i] {
display: math;
text-align: center;
math-style: display;
}
math[display="inline" i] {
display: inline-math;
math-style: inline;
} So Re. directionality, the HTML5 user-agent stylesheet has this: @namespace url(http://www.w3.org/1999/xhtml);
[dir]:dir(ltr), bdi:dir(ltr), input[type=tel i]:dir(ltr) { direction: ltr; }
[dir]:dir(rtl), bdi:dir(rtl) { direction: rtl; } Which only applies to the HTML namespace, so you'd probably want something similar for MathML. I believe it's done that way because the HTML dir attribute has an allowable value of "auto", which has functionality which can't be mapped directly to CSS. I don't know if this applies to MathML, if not you could just have [dir=rtl] { direction: rtl }
[dir=ltr] { direction: ltr } If there's no stylesheet rule for an attribute then (according to https://mathml-refresh.github.io/mathml/#order-of-processing-attributes-versus-style-sheets) any attribute not explicitly handled in the user-agent stylesheet would be classed as a "non-CSS presentational hint', which references this from CSS2.1:
That's how it's done in SVG too - |
Just copying this from the hackfest notes by @bkardell @fantasai
display: math
, in case authors are already settingdisplay: block
etc. and expecting no change to internal contents."mathml" is not an element, so I'm not sure what it is about. Also, I don't think MathML authors currently change the CSS display values of MathML elements.
The text was updated successfully, but these errors were encountered: