Skip to content

"thin", "thick", "medium" values mfrac@linethickness #4

Closed

Description

@fred-wang

From https://mathml-refresh.github.io/mathml/chapter3.html#presm.mfrac :

Specifies the thickness of the horizontal "fraction bar", or "rule" The default value is "medium", "thin" is thinner, but visible, "thick" is thicker; the exact thickness of these is left up to the rendering agent.

The MathML Core spec suggests 50%, 100%, 200%.

It's possible that we also want to remove/deprecate these values if they are not used in practice.

Math WG discussion: https://lists.w3.org/Archives/Public/www-math/2016Aug/0001.html

Activity

  1. changed the title [-]Specify interpretation of "thin", "thick", "medium" for mfrac@linethickness[/-] [+]"thin", "thick", "medium" for mfrac@linethickness[/+] on Feb 14, 2019
  2. changed the title [-]"thin", "thick", "medium" for mfrac@linethickness[/-] [+]"thin", "thick", "medium" values mfrac@linethickness[/+] on Feb 14, 2019
  3. physikerwelt commented on Feb 19, 2019

    @physikerwelt
    Member

    I think we should remove the string constants "thin" (50%), "thick" (200%), "medium" (100%)

  4. added
    MathML Core
    MathML 4
    on Feb 22, 2019
  5. fred-wang commented on Mar 14, 2019

    @fred-wang
    Author

    cc @rwlbuis, @emilio :

    This was removed from MathML core in w3c/mathml-core@ce02fd1

    I'm leaving this open because it still remains to:

  6. added
    compatibility
    on Mar 20, 2019
  7. fred-wang commented on Mar 22, 2019

    @fred-wang
    Author

    Decision is to keep in MathML full but note in main spec that non core features will require polyfills so you may not want to use them. https://lists.w3.org/Archives/Public/public-mathml4/2019Mar/0026.html

  8. fred-wang commented on May 16, 2019

    @fred-wang
    Author

    Resolution:
    #4 (comment)

    Specification:
    Add deprecation warning in Full?

    Implementation:
    WebKit: https://bugs.webkit.org/show_bug.cgi?id=196142
    Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1548529
    Not implemented in Chromium.

    Polyfill:
    Convert to length values
    Maybe using CSS variables to make values configurable?

    Tests:

    • Remove WPT tests or check that these values are not supported.
  9. added
    need polyfill
    need specification update
    need tests
    on May 16, 2019
  10. NSoiffer commented on May 20, 2019

    @NSoiffer
    Contributor

    MathPlayer uses the values 4.0, 7.5, 12.0. I'm not certain, but it appears these values are a percent of the font size. The default value is 5.0.

    Here's an example from MathPlayer:

    <math display='block' xmlns='http://www.w3.org/1998/Math/MathML' mathsize="24pt">
     <mrow>
      <mfrac linethickness="thin">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac>
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac linethickness="medium">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac linethickness="thick">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      </mrow>
    </math>
    

    img

    I'm not particular fond of the MathPlayer values. Here's a modification that uses the values @fred-wang proposed:

    <math display='block' xmlns='http://www.w3.org/1998/Math/MathML' mathsize="24pt">
     <mrow>
      <mfrac linethickness="0.5">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac>
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac linethickness="1">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      <mfrac linethickness="2">
       <mn>5</mn>
       <mn>888</mn>
      </mfrac>
      </mrow>
    </math>
    

    img

    More realistically, here it is at 12pt:
    img

    Which seems fine to me. 10pt renders similarly (i.e, the line thickness is distinguishable).

  11. 7 remaining items

  12. fred-wang commented on Aug 18, 2019

    @fred-wang
    Author

    Polyfill:

    window.addEventListener("load", function() {
        const namespaceURI = "http://www.w3.org/1998/Math/MathML";
        Array.from(document.body.
                   getElementsByTagNameNS(namespaceURI, "mfrac")).
            forEach(mfrac => {
                if (!mfrac.hasAttribute("linethickness"))
                    return;
                var value = mfrac.getAttribute("linethickness").
                    replace(/thin|medium|thick/, match => {
                        switch (match) {
                        case "thin": return "67%";
                        case "medium": return "100%";
                        case "thick": return "167%";
                        }
                    });
                mfrac.setAttribute("linethickness", value);
            });
    });
    
  13. added
    need specification update
    and removed
    need tests
    on Sep 16, 2019
  14. NSoiffer commented on Jun 6, 2025

    @NSoiffer
    Contributor

    In "full", 3.3.2 (mfrac) for linethickness mentions "thin", etc. The attr is marked as "core", but the named values are "not-core" and should probably have that tag. Currently it says (with poor English):

    Note: MathML Core does only allow values.

    So "does only allow" ->"only allows" and somehow "not-core" should get added.

  15. davidcarlisle commented on Jun 6, 2025

    @davidcarlisle
    Collaborator

    @NSoiffer

    So "does only allow" ->"only allows" and somehow "not-core" should get added.

    agree with english change, for marking, we could either mark the attribute as something like restricted-core or we could try to mark the individual named lengths as not-core (that's probaby more disruptive)

  16. added a commit that references this issue on Jun 6, 2025
  17. added a commit that references this issue on Jun 6, 2025
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 4MathML Corecompatibilityneed polyfillneed specification update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions