Skip to content

mpadded and resolution of percentage values #227

Closed

Description

@fred-wang

cc @bfgeek @rwlbuis

This came up during chrome review.

Currently the spec follows MathML3 i.e. relative width/height/depth refer to the default size i.e. the size of its content.
In CSS, percentage refers to the size of the block container.
If we map MathML attributes to CSS this does not work.

So it looks like core level 1 should restrict more mpadded or things rewritten.

See also #103 #50 #45 #185

Activity

  1. added
    MathML Core
    css / html5
    need tests
    need specification update
    on Aug 5, 2020
  2. NSoiffer commented on Aug 10, 2020

    @NSoiffer
    Contributor

    Discussed at the Core CG meeting today. Looking at usage stats, no one is reporting usage of %'s.

    @rwlbuis reported Google only has an issue with 'width', but it seems weird to support depth/height and not width.

    We didn't discuss lspace and voffset, but they would fall into "weird to support" group if width is not supported.

    The meeting resolved that '%' should be removed completely from mpadded in core. They should remain in full and the polyfill should handle them (it already handles cross width - height/depth values)..

  3. fred-wang commented on Aug 21, 2020

    @fred-wang
    Author

    @rwlbuis We can't "remove %" since they are defined for CSS lengths. Instead, we need a way to interpret these values. I assume the suggestion is to handle them the same as what is done for "absent or invalid" in the spec so I'll do this. How did you implement this in chromium? Do you have WPT tests?

  4. fred-wang commented on Aug 21, 2020

    @fred-wang
    Author

    I updated the spec to treat % as invalid/unspecified. This seems to match rob's tests.

    @rwlbuis voffset/lspace attributes are not tested by web-platform-tests/wpt#24664 ; what's the decision here?

  5. rwlbuis commented on Aug 21, 2020

    @rwlbuis

    I updated the spec to treat % as invalid/unspecified. This seems to match rob's tests.

    @rwlbuis voffset/lspace attributes are not tested by web-platform-tests/wpt#24664 ; what's the decision here?

    I think it is best to treat voffset/lspace attributes same as the width attribute regarding percentages. I updated the test for that:
    web-platform-tests/wpt#25175

  6. NSoiffer commented on Aug 21, 2020

    @NSoiffer
    Contributor

    Removing all references to % in mpadded attrs for core is what the group decided. It is weird to allow them in only some cases.

    The polyfill was updated to convert all %s to pixels.

  7. ronkok commented on Aug 29, 2020

    @ronkok

    Given the current plans for mpadded, how would an author recreate the effect of TeX \vcenter? We'll want to be able to change the first fraction below into the second one. How would an author do that?

    vcenter

  8. NSoiffer commented on Aug 31, 2020

    @NSoiffer
    Contributor

    I think you will have to use some Javascript to do this, which potentially is done by including the mpadded polyfill.

    Your other alternative, which I don't recommend, is to use the polyfill, convert the position it comes up for your specific cases to a font relative unit such as 'ex's, and then use those in your code. I think it will get it close to right, but I doubt it will be exactly right in all situations. If you have lots of expression, that probably doesn't work for you.

  9. ronkok commented on Sep 1, 2020

    @ronkok

    @NSoiffer Thank you for the link to the polyfill. It contains some interesting techniques.

    After a polyfill-mpadded has set the vertical alignment of the fraction, I believe a reflow would then be necessary to properly set the height and depth of the parentheses around the fraction shown above. (Correct me if that is wrong.) Of course, we all want to avoid a reflow.

    It is very late to introduce a new attribute for the ongoing effort, but I hope that some kind \vcenter equivalent can be added to a future version of the MathML <mpadded> element. The syntax could be voffset='center' or symmetric='true'. Would it be appropriate to open a new issue for this request?

  10. NSoiffer commented on Sep 3, 2020

    @NSoiffer
    Contributor

    Unfortunately, without support for percentages, reflow is required.

    I'm a little dubious that a voffset='center' attr will ever be added to core because all three browser vendors would need to support it, but at least it avoids (I think) google's objection to percentages. @fred-wang or @rwlbuis might know whether this would fly on technical grounds with google.

    From a usage point of view, it seems hard to imagine it crosses the bar to get into core. Getting it into MathML 4 (and hence having a polyfill pre-built) is possibly more doable. I suggest you file a separate issue for that and provide use cases (from a TeX macro?) and maybe usage statistics if you can find them. Those could make a compelling case if there is significant usage.

  11. removed
    MathML Core
    css / html5
    need specification update
    need tests
    on Oct 5, 2020
  12. NSoiffer commented on Oct 5, 2020

    @NSoiffer
    Contributor

    Since support of % in mpadded attrs is no longer part of core, I removed the needs tests, etc labels. The spec seems up to date. The polyfill implments %s, so I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions