Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorganize documentation for MathML global attributes #17812

Merged
merged 16 commits into from
Jul 8, 2022

Conversation

fred-wang
Copy link
Contributor

  • Add a new article for the
    math-depth
    property, which is used to implement the global attribute scriptlevel
    in MathML Core.
  • Remove all per-element references to
    global attributes
    from MathML element pages as well as the Gecko-specific notes for
    mathvariant. Instead, they are moved to dedicated pages about global
    attributes.
  • Introduce a new mathml/global_attributes/ directory, based on
    HTML's one. For now, most of the links for these attributes point to
    equivalent pages for HTML. New articles are created for MathML-specific
    global attributes.

Note that the specifications and browser compatibility data for these new
articles are currently missing.

Summary

Reorganize documentation for MathML global attributes, moving them to dedicated pages instead of duplicating on each MathML element article. This also introduces CSS math-depth article for the sake of documenting scriptlevel.

Motivation

In the past, some attributes could be applied to a large class of MathML elements but not necessarily to all of them. This has changed with MathML Core where these generic attributes are now clearly defined as global attributes. Additionally, many attributes have now been taken from HTML (such as nonce or on* or data-*) and need to be documented.

Supporting details

https://w3c.github.io/mathml-core/#global-attributes

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@fred-wang fred-wang requested review from a team as code owners June 30, 2022 09:23
@fred-wang fred-wang requested review from estelle and dipikabh and removed request for a team June 30, 2022 09:23
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:MathML MathML docs labels Jun 30, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 30, 2022

Preview URLs

Flaws

Note! 31 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/CSS/math-depth
Title: math-depth
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: css.properties.math-depth

URL: /en-US/docs/Web/MathML/Element/mmultiscripts
Title: <mmultiscripts>
on GitHub
Flaw count: 1

  • broken_links:
    • Can't resolve /en-US/docs/Error_Console

URL: /en-US/docs/Web/MathML/Global_attributes
Title: Global attributes
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes

URL: /en-US/docs/Web/MathML/Global_attributes/mathcolor
Title: mathcolor
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.mathcolor

URL: /en-US/docs/Web/MathML/Global_attributes/scriptlevel
Title: scriptlevel
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.scriptlevel

URL: /en-US/docs/Web/MathML/Global_attributes/displaystyle
Title: displaystyle
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.displaystyle

URL: /en-US/docs/Web/MathML/Global_attributes/mathvariant
Title: mathvariant
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.mathvariant

URL: /en-US/docs/Web/MathML/Global_attributes/href
Title: href
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.href

URL: /en-US/docs/Web/MathML/Global_attributes/mathsize
Title: mathsize
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.mathsize

URL: /en-US/docs/Web/MathML/Global_attributes/mathbackground
Title: mathbackground
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: mathml.global_attributes.mathbackground

External URLs

URL: /en-US/docs/Web/CSS/math-depth
Title: math-depth
on GitHub

No new external URLs


URL: /en-US/docs/Web/CSS/math-style
Title: math-style
on GitHub

No new external URLs


URL: /en-US/docs/Web/CSS/font-size
Title: font-size
on GitHub


URL: /en-US/docs/Web/MathML/Element/mpadded
Title: <mpadded>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/merror
Title: <merror>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/msup
Title: <msup>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mtr
Title: <mtr>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mtable
Title: <mtable>
on GitHub


URL: /en-US/docs/Web/MathML/Element/math
Title: <math>
on GitHub


URL: /en-US/docs/Web/MathML/Element/mphantom
Title: <mphantom>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/msub
Title: <msub>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mspace
Title: <mspace>
on GitHub


URL: /en-US/docs/Web/MathML/Element/mtext
Title: <mtext>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/maction
Title: <maction>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/ms
Title: <ms>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/msubsup
Title: <msubsup>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mtd
Title: <mtd>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mover
Title: <mover>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mrow
Title: <mrow>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mmultiscripts
Title: <mmultiscripts>
on GitHub


URL: /en-US/docs/Web/MathML/Element/munderover
Title: <munderover>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mfenced
Title: <mfenced>
on GitHub


URL: /en-US/docs/Web/MathML/Element/mfrac
Title: <mfrac>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mn
Title: <mn>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/msqrt
Title: <msqrt>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/menclose
Title: <menclose>
on GitHub


URL: /en-US/docs/Web/MathML/Element/mroot
Title: <mroot>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/mo
Title: <mo>
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Element/mstyle
Title: <mstyle>
on GitHub


URL: /en-US/docs/Web/MathML/Element/mi
Title: <mi>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/semantics
Title: <semantics>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Element/munder
Title: <munder>
on GitHub

No external URLs


URL: /en-US/docs/Web/MathML/Global_attributes
Title: Global attributes
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Global_attributes/mathcolor
Title: mathcolor
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Global_attributes/scriptlevel
Title: scriptlevel
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Global_attributes/displaystyle
Title: displaystyle
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Global_attributes/mathvariant
Title: mathvariant
on GitHub


URL: /en-US/docs/Web/MathML/Global_attributes/href
Title: href
on GitHub


URL: /en-US/docs/Web/MathML/Global_attributes/mathsize
Title: mathsize
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Global_attributes/mathbackground
Title: mathbackground
on GitHub

No new external URLs


URL: /en-US/docs/Web/MathML/Attribute
Title: MathML attribute reference
on GitHub

No new external URLs

(this comment was updated 2022-07-08 13:26:04.106985)

@teoli2003
Copy link
Contributor

Hi!

I have a generic question: what is the implementation status of MathML-Core?

@fred-wang
Copy link
Contributor Author

short answer: implemented in Chromium under a flag, and some alignment has been done on the Gecko/WebKit side.

@estelle
Copy link
Member

estelle commented Jul 1, 2022

Do we have MathML page types? cc: @wbamberg?

@wbamberg
Copy link
Collaborator

wbamberg commented Jul 1, 2022

Do we have MathML page types? cc: @wbamberg?

According to #15539, although MathML does have specialised page types, it's not P1, so isn't slated to get page types defined yet. But I'd be happy for someone to define them of course.

@fred-wang
Copy link
Contributor Author

@estelle Thanks for the review. I believe I've addressed all the feedback.

I'm not sure I know what page types are, but ideally I'd like to have a sidebar similar to https://developer.mozilla.org/en-US/docs/Web/HTML where elements and global attributes are accessible from the sidebar. Probably out of the scope for this commit. For now, I added a link to global attributes from the MathML attributes page.

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few more spots could use values and examples. I have a few questions too which I had reading this, so think addressing those may help the newbie (like me.)

Thanks!

files/en-us/web/css/math-depth/index.md Show resolved Hide resolved
files/en-us/web/mathml/attribute/index.md Outdated Show resolved Hide resolved
{{MathMLRef("Global_attributes")}}

The **`mathcolor`** [global attribute](/en-US/docs/Web/MathML/Global_attributes) sets the [color](/en-US/docs/Web/CSS/color) of a MathML element.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> **Note:** Use CSS for styling MathML whenever possible. The `mathcolor` attribute should only be included for applications that are not CSS-aware and will be overridden by the CSS `color` property , if set.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does mathcolor impact border-color like CSS color does?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes mathcolor sets the color property via a presentational hint so all the feature of color apply too. Do you mean we should be more explicit about it? I only explicitly mentioned "fraction bars or radical symbols" below as they are specific to math.

@wbamberg
Copy link
Collaborator

wbamberg commented Jul 1, 2022

@estelle Thanks for the review. I believe I've addressed all the feedback.

I'm not sure I know what page types are, but ideally I'd like to have a sidebar similar to https://developer.mozilla.org/en-US/docs/Web/HTML where elements and global attributes are accessible from the sidebar. Probably out of the scope for this commit. For now, I added a link to global attributes from the MathML attributes page.

Page types are just a piece of metadata, represented as a "page-type" front matter key, which says what kind of page something is: for example if it documents a WebAPI instance method, or an HTML element, or a CSS property. We will use them to build sidebars and also to define the kind of content a given page ought to include. I guess MathML would at least have mathml-element and mathml-attribute.

@teoli2003
Copy link
Contributor

@estelle Thanks for the review. I believe I've addressed all the feedback.
I'm not sure I know what page types are, but ideally I'd like to have a sidebar similar to https://developer.mozilla.org/en-US/docs/Web/HTML where elements and global attributes are accessible from the sidebar. Probably out of the scope for this commit. For now, I added a link to global attributes from the MathML attributes page.

Page types are just a piece of metadata, represented as a "page-type" front matter key, which says what kind of page something is: for example if it documents a WebAPI instance method, or an HTML element, or a CSS property. We will use them to build sidebars and also to define the kind of content a given page ought to include. I guess MathML would at least have mathml-element and mathml-attribute.

Yes, I would have:

  • mathml-element
  • mathml-global-attribute
  • mathml-attribute

And the two common to every area:

  • guide
  • landing

@fred-wang
Copy link
Contributor Author

@estelle Thanks. I believe this is ready for another round of review!

@fred-wang fred-wang force-pushed the mathml-global-attributes branch from d581728 to 41a5810 Compare July 6, 2022 07:51
@fred-wang fred-wang requested a review from estelle July 7, 2022 07:53
@fred-wang fred-wang force-pushed the mathml-global-attributes branch from 41a5810 to 83e64f0 Compare July 7, 2022 12:06
- Add a new article for the
  [math-depth](https://w3c.github.io/mathml-core/#the-math-script-level-property)
  property, which is used to implement the global attribute `scriptlevel`
  in MathML Core. Also mention font-size: math.
- Remove all per-element references to
  [global attributes](https://w3c.github.io/mathml-core/#global-attributes)
  from MathML element pages as well as the  Gecko-specific notes for
  `mathvariant`. Instead, they are moved to dedicated pages about global
  attributes.
- Introduce a new `mathml/global_attributes/` directory, based on
  HTML's one. For now, most of the links for these attributes point to
  equivalent pages for HTML. New articles are created for MathML-specific
  global attributes.

Note that the specifications and browser compatibility data for these new
articles are currently missing.
@fred-wang fred-wang force-pushed the mathml-global-attributes branch from 83e64f0 to b4b762d Compare July 8, 2022 08:25
Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, @fred-wang . I had a few comments/changes, but this is very close to being ready to merge.

files/en-us/web/css/math-depth/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/math-depth/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/math-depth/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/math-depth/index.md Outdated Show resolved Hide resolved
files/en-us/web/css/math-depth/index.md Outdated Show resolved Hide resolved
@teoli2003
Copy link
Contributor

Let's merge this!

@teoli2003 teoli2003 merged commit 11fbbb9 into mdn:main Jul 8, 2022
fred-wang added a commit to fred-wang/browser-compat-data that referenced this pull request Jul 14, 2022
This is adding data for new pages added in
mdn/content#17812
@fred-wang fred-wang deleted the mathml-global-attributes branch July 14, 2022 14:38
queengooborg pushed a commit to mdn/browser-compat-data that referenced this pull request Jul 17, 2022
* Add data for MathML global attributes

This is adding data for new pages added in
mdn/content#17812

* improve version_added for firefox & webkit

* update safari version_added ; add dir attribute
fred-wang added a commit to fred-wang/content that referenced this pull request Jul 21, 2022
This is a follow-up of [1]:

- Comments that displaystyle/scriptlevel/mathvariant
  are implemented via CSS are moved to
  browser-compat-data [2].

- mathsize: empty section is removed.

- mathvariant: recommendation to use Unicode characters is
  removed, since it's repeating a note above on the page.
  The vague statement about partial implementation in
  Firefox 28 as well as the comment to have appropriate
  fonts are removed, as they are not really important.

[1] mdn#17812
[2] mdn/browser-compat-data#17067
teoli2003 pushed a commit that referenced this pull request Jul 21, 2022
This is a follow-up of [1]:

- Comments that displaystyle/scriptlevel/mathvariant
  are implemented via CSS are moved to
  browser-compat-data [2].

- mathsize: empty section is removed.

- mathvariant: recommendation to use Unicode characters is
  removed, since it's repeating a note above on the page.
  The vague statement about partial implementation in
  Firefox 28 as well as the comment to have appropriate
  fonts are removed, as they are not really important.

[1] #17812
[2] mdn/browser-compat-data#17067
fred-wang added a commit to fred-wang/content that referenced this pull request Jul 22, 2022
teoli2003 pushed a commit that referenced this pull request Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:MathML MathML docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants