Skip to content

CSS margin/border/padding compatibility #14

Closed

Description

@fred-wang

We need to clarify how CSS margin/border/padding is treated in MathML boxes.

AFAIK, Gecko supports margin/border/padding while WebKit just ignore these values.

Original report: https://gitlab.com/mathml/MathMLinHTML5/issues/9

Activity

  1. added
    MathML Core
    on Feb 20, 2019
  2. added
    css / html5
    need tests
    on Feb 22, 2019
  3. rwlbuis commented on Mar 8, 2019

    @rwlbuis

    From my investigation (Firefox on Linux), only margin is taken into account for MathML.

  4. added
    need resolution
    on May 16, 2019
  5. fred-wang commented on Jul 5, 2019

    @fred-wang
    Author
  6. fred-wang commented on Jul 5, 2019

    @fred-wang
    Author

    I think we are now ready to handle this, so I'll put this on the agenda of the nxt MathML CG meeting.

    Currently, the metrics of the margin/border/padding are defined the same as the content box:
    https://mathml-refresh.github.io/mathml-core/#layout-algorithms

    I personally think it makes sense to support margin/border/padding my proposal would be to just inflate the content box with the corresponding margin/border/padding in order to deduce the metrics for the margin/border/padding boxes. And define the child offsets within the border box to match the CSS layout API.

    For MathML-specific metrics:

    • ink-over/ink-under baselines would be set to the border box's line-over and lin-under edge if there is such a border.
    • top accent attachment would be increased by the line-left values of margin/border/padding.
    • similarly for italic correction, it would be increased by the line-left margin/border/padding. Maybe when there is a line-right border, italic correction should just be zero?
  7. added and removed
    need resolution
    on Jul 10, 2019
  8. fred-wang commented on Jul 10, 2019

    @fred-wang
    Author

    Consensus from July 8 meeting:

    • We should take into account the margin/border/padding values as that's something users will likely expect and can be handy.
    • They will affect the content box in the way defined by CSS but not the spacing/bars defined by MathML for the content (e.g. "radical extra ascender" or "space after script" ) as that's easier to implement and describe.

    I updated the MathML Core specification to explain how the metrics of the margin/border/padding boxes are deduced from the one of the content box.

  9. fred-wang commented on Jul 30, 2019

    @fred-wang
    Author

    We have tests for these:
    https://w3c-test.org/mathml/relations/css-styling/padding-border-margin/

    They probably need to be refined and extended later but I think we can close this issue.

  10. removed
    need tests
    on Jul 30, 2019
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

    MathML Corecss / html5

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions