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

mstyle mathvariant inheritance and mi #53

Open
faceless2 opened this issue Mar 30, 2020 · 5 comments
Open

mstyle mathvariant inheritance and mi #53

faceless2 opened this issue Mar 30, 2020 · 5 comments

Comments

@faceless2
Copy link

We've run into this in an example we're testing with:

<mstyle mathvariant="bold-italic">
 <mi>B</mi>
</mstyle>

The user-agent rule mi { text-transform: math-auto } is overriding the rule text-transform: math-bold-italic which it's inheriting from the mstyle.

I'm aware that there will be some changes from MathML3, and from reading w3c/mathml#1 and https://lists.w3.org/Archives/Public/public-mathml4/2019Mar/0007.html it seems you're aware of this situation already. But I couldn't find a resolution for this specific situation.

If overriding the mathvariant attribute on the mstyle is intentional, that's fine. But if not, it's quite easy to continue to support this syntax by adding

mstyle[mathvariant] mi {
    text-transform: inherit;
}

to the user-agent stylesheet.

@fred-wang
Copy link
Contributor

I think we decided to ignore this case because people should really (1) use mathvariant on on token elements only (2) use transformed unicode character directly instead of mathvariant="bold-italic".

I think we would need to think about the impact and details of this. For example, that it should probably be

*[mathvariant] mi {
    text-transform: inherit;
}

since mathvariant is not restricted to mstyle in MathML Core.

Or maybe the computed value of of text-transform: math-auto should depend on the inherited value instead.

@NSoiffer
Copy link
Contributor

Since the case that @faceless2 mentions is legal although maybe not a good idea in practice, it needs to be tested (doesn't seem to be at this point in time).

At the meeting today, @bkardell was doubtful that the

*[mathvariant] mi {
    text-transform: inherit;
}

suggested fix above is appropriate.

@faceless2
Copy link
Author

The suggested behaviour of text-transform: math-auto in w3c/csswg-drafts#5386 was that it would italiciize the mi if it was a single character and if the inherited value of text-transform was none - as @fred-wang proposed in that issue:

"If the specified value of text-transform is math-auto and the inherited is not none then computed value is the inherited value"

So provided <mstyle mathvariant="bold-italic"> sets the text-transform property, this issue is resolved.

Specifically, and assuming the proposed math text-transform values in w3c/csswg-drafts#5386 were approved: if the mathvariant acted as a presentational hint on the mstyle that set text-transform: math-boldi-italic (or equivalent), then the inherited value of text-transform on the mi element would not be none, and so the computed value of the stylesheet rule mi { text-transform: math-auto } would be the inherited vaue: math-bold-italic.

I'm aware the propose additional math text-transform values are not yet approved, but this might make the case for them a bit stronger.

@NSoiffer NSoiffer transferred this issue from w3c/mathml Jun 29, 2021
@fred-wang
Copy link
Contributor

I don't remember if there was any progress on this. @faceless2 do you know the status?

@NSoiffer
Copy link
Contributor

mathvariant is (now) only defined as valid on mi, so I think this issue is no longer present.

@faceless2: if you agree, can you close this issue?

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

No branches or pull requests

3 participants