Skip to content

Definition of MathML Length #63

Closed
Closed

Description

@fred-wang

I think it's not nice that we have a definition of MathML Length different from CSS, but I guess we cannot really solve this.

The RelaxNG pattern is pattern = '\s*((-?[0-9]([0-9].?|.[0-9])[0-9](e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*'

The definition is https://mathml-refresh.github.io/mathml/chapter2.html#fund.units

Note that "Since some applications are inconsistent about normalization of whitespace, for maximum interoperability it is advisable to use only a single whitespace character for separating parts of a value. Moreover, leading and trailing whitespace in attribute values should be avoided. ". I think we should be more explicit about white spaces...

My proposal is to:

Then this definition should go into MathML Core.

Update: Some people proposed to actually removed namedspace values too #75 which would make things even closer to HTML/CSS lengths.

Activity

  1. added
    MathML Core
    MathML 4
    css / html5
    need tests
    on Feb 28, 2019
  2. davidcarlisle commented on Mar 5, 2019

    @davidcarlisle
    Collaborator

    @fred-wang I added a placeholder section to the core draft, feel free to edit, I sketched out dropping all support for mathml-specific length syntax from core, including named lengths. that may be too aggressive or controversial, I also added markup to allow links back to this issue tracker.

  3. fred-wang commented on Mar 14, 2019

    @fred-wang
    Author

    If a match between MathML and HTML5 has to be done, a level from the above list has also to be chosen.

    Yes, I guess we should use whatever is used in browsers... Using definitions in WHATWG's HTML5 could probably avoid the version number issues.

  4. fred-wang commented on Mar 19, 2019

    @fred-wang
    Author

    @fred-wang I added a placeholder section to the core draft, feel free to edit, I sketched out dropping all support for mathml-specific length syntax from core, including named lengths. that may be too aggressive or controversial, I also added markup to allow links back to this issue tracker.

    I opened #75 for the namedspace discussion.

  5. added
    compatibility
    on Mar 20, 2019
  6. physikerwelt commented on Mar 31, 2019

    @physikerwelt
    Member

    can we also get rid of the string constants

    (negative)?((very){0,2}thi(n|ck)|medium)mathspace)

  7. fred-wang commented on Mar 31, 2019

    @fred-wang
    Author

    can we also get rid of the string constants

    (negative)?((very){0,2}thi(n|ck)|medium)mathspace)

    That's #75

  8. NSoiffer commented on Apr 30, 2019

    @NSoiffer
    Contributor

    On 29/4/19 call, agreed to drop unitless values except 0 from core.
    The call agreed that the handling of whitespace in attribute values should follow whatever CSS does.

    The full spec will continue to allow namedspaces.

  9. 5 remaining items

  10. rwlbuis commented on May 7, 2019

    @rwlbuis

    @rwlbuis What about CSS variables? ( https://drafts.csswg.org/css-variables/ )

    That is a great find, I forgot about them. I verified that in chromium CSS variables works in the SVG-in-HTML case, so it seems the way to go, but we may want to check with the SVG WG.

  11. NSoiffer commented on May 13, 2019

    @NSoiffer
    Contributor

    Interesting!

    First off, caniuse says that this is implemented in all the major modern browsers. So it seems safe to use.

    Does this really allow us to keep named quantity such as mediumspace and thick in the spec, or just provide an easy target for polyfills? It seems they would need to have the -- prefix, but maybe that is something that is easy for a browser implementation to do?

  12. bkardell commented on May 13, 2019

    @bkardell
    Collaborator

    Not sure I'm following so feel free to ignore if I've misunderstood but

    -- is supposed to be reserved for author space afaik there's no precedent for browsers setting variables in this particular way (note: should look up recentish discussions about environment properties as the discussion is probably relevant and I could be wrong).. but.. CSS has always had this mechanism for non standard extension of all of it's 'parts' ( properties, pseudoclasses, fns, etc) so that the parser can stay forward compatible. The pattern has always been dash, vendor prefix, dash - like -moz-blah. Custom anything in CSS will follow this same pattern, it's just that there is no vendor prefix, so you get -- meaning author defined rather than vendor defined.

    That said, variables in CSS are actually custom properties - and that's a thing vendors have been doing, as I say, forever.

    otherwise they are just vendor prefixed things without a vendor (ie -moz-blah becomes -- because there is no vendor).

  13. added
    need resolution
    on May 16, 2019
  14. added
    need polyfill
    need specification update
    and removed
    need resolution
    on May 16, 2019
  15. fred-wang commented on Jun 5, 2019

    @fred-wang
    Author

    The core spec now refers to from CSS.

  16. removed
    need specification update
    on Jun 5, 2019
  17. removed
    need tests
    on Sep 16, 2019
  18. fred-wang commented on Sep 16, 2019

    @fred-wang
    Author

    There are tests for that, so closing.

  19. added
    need specification update
    on Sep 16, 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 4MathML Corecompatibilitycss / html5need polyfillneed specification update

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions