Skip to content

Move target size adjusments to the mo section #202

Closed

Description

@fred-wang

Adjustments for symmetric/minsize/maxsize are here: https://mathml-refresh.github.io/mathml-core/#dfn-algorithm-for-stretching-operators-along-the-block-axis

(https://mathml-refresh.github.io/mathml-core/#dfn-algorithm-for-stretching-operators-along-the-inline-axis has nothing because of w3c/mathml-core#64)

They should probably be moved to the layout of the operator:
https://mathml-refresh.github.io/mathml-core/#layout-of-operators

Although that does not make a difference, it's probably more natural.

Also if we do w3c/mathml-core#138 users would be able to pass target ascent/descent, so it seems better if the mo elements make the adjustments themselves.

Doing them during mrow would only be needed if we want the target size to take into account embellishment sizes, but that's not the case.

Activity

  1. fred-wang commented on Apr 15, 2020

    @fred-wang
    Author

    No comments on this issue since the last month but it seems the misunderstanding of how minsize/maxsize/symmetric are handled is being raised again and again, moving adjustments from [vertical] to [mo] would make things less misleading. This is how it is implemented in Chromium actually and the minsize/maxsize/symmetric are then only needed locally during the mo algo (see also #208).


    First note that:

    1. Uascent/Udescent in [vertical] only depends on the non-embellished operators. In particular, they don't include embellished sizes, so something like

      <math>
        <munder>
          <mo symmetric="false">(</mo>
          <mspace depth="200px" width="10px" style="background: blue"/>
        </munder>
        <mspace height="50px" width="10px" style="background: green"/>
      </math>
      

      will make the parenthesis match the height of the green mspace, the height of the blue one does not matter. If that's really important, we can still change the algorithm to first layout embellished op without stretch constraint, but I'd prefer to avoid extra layout steps.

    2. Sascent/Sdescent in [vertical] depends on Uascent/Udescent and the AxisHeight.

    3. Tascent, Tdescent in [vertical] depends on Sascent/Sdescent and the minsize/maxsize. Again, if we want to include the "unstretched size" of embellished operators then we can do an extra layout step, but I'd prefer to avoid it.

    4. The size of vertical stretchy operators in [mo] depends on Tascent + Tdescent.

    5. The vertical position of vertical stretchy operators in [mo] depends on its ascent/descent and Tascent - Tdescent. Note that if symmetric=true, Tascent/Tdescent have been made symmetric with respect to the axis height in step 2., so we only need to do centering with respect to these targets, AxisHeight is not (directly) involved. And if symmetric=false, we don't care about axis alignment anyway.

    6. The baseline of an embellished op matches the baseline of its core mo, except when mfrac and mpadded are involved e.g. in

      <math>
        <mrow>
          <mfrac>
            <mo>(</mo>
            <mn>denominator</mn>
          </mfrac>
          <mpadded voffset="-200px">
            <mo>(</mo>
          </mpadded>
          <mn>not-space-like</mn>
          <mspace height="100px" depth="50px" width="10px" style="background: blue"/>
        </mrow>
      </math>
      

      the mfrac will have its fraction bar align with the math axis so will shift its numerator mo up ; and the mpadded will shift its child mo down by -200px. But in all other cases, the baselines are the same.

    7. The AxisHeight, minsize, maxsize, lspace, rspace depend on the font-size. The embellished operators and its core mo have the same font-size, except if mfrac is part of the embellished operator (font-size reduced in numerator) or if the user explicitly modifies the font-size.


    If we pass Uascent/Udescent as stretch constrainsts instead of Tascent/Tdescent the result will change per 2., 3., 4., 5., 7.

    If we pass Sascent/Sdescent as stretch constrainsts instead of Tascent/Tdescent the result in 3., 4., 5. will change per 2., 3., 4., 5., 7

    If we use U_above_axis and U_below_axis instead of Uascent/Udescent ; and similarly the for S and T then the dependency on AxisHeight goes away in 2. and 3. ; no new dependency appears in 4. BUT the AxisHeight appears in 5. Moving calculation from [vertical] to [mo] will still change because of 3., 4., 5. and 7.

    The baseline mismatch in 6. won't change anything since Uascent/Udescent will still be calculated in [vertical] while the baseline is not involved in the calculation mentioned in 2., 3., 4., 5.

    So to summarize:

    • The only potential change is whether we really care about embellished operators changing the font-size (and so AxisHeight and minsize/maxsize) when arriving to its core mo. I believe we don't.

    • If lspace/rspace/minsize/maxsize should be more explicit about the reference style #208 is resolved so that minsize/maxsize use the font-size of the embellished operator, then we cannot move the minsize/maxsize adjustments to [mo].

    [vertical] https://mathml-refresh.github.io/mathml-core/#algorithm-for-stretching-operators-along-the-block-axis
    [mo] https://mathml-refresh.github.io/mathml-core/#layout-of-operators

  2. added
    MathML Core
    need specification update
    need tests
    on May 22, 2020
  3. removed
    need specification update
    need tests
    on Jun 1, 2020
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 Core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions