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

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

Closed
fred-wang opened this issue Feb 14, 2019 · 12 comments
Closed

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

fred-wang opened this issue Feb 14, 2019 · 12 comments
Labels
compatibility Issues affecting backward compatibility MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes

Comments

@fred-wang
Copy link

fred-wang commented Feb 14, 2019

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

@fred-wang fred-wang changed the title Specify interpretation of "thin", "thick", "medium" for mfrac@linethickness "thin", "thick", "medium" for mfrac@linethickness Feb 14, 2019
@fred-wang fred-wang changed the title "thin", "thick", "medium" for mfrac@linethickness "thin", "thick", "medium" values mfrac@linethickness Feb 14, 2019
@physikerwelt
Copy link
Member

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

@fred-wang fred-wang added MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification labels Feb 22, 2019
@fred-wang
Copy link
Author

fred-wang commented Mar 14, 2019

cc @rwlbuis, @emilio :

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

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

  • Remove WPT tests if any.
  • Send intent-to-remove to mozilla/webkit-dev mailing lists (maybe old Math WG too?).
  • Remove browser implementation.
  • Decide what to do for the full MathML spec (remove values? deprecate them? specify explicit numbers?).
  • Add polyfill to https://github.com/mathml-refresh/mathml-polyfills (e.g. convert to linethickness="50%", "100%", "200%" respectively).

@fred-wang fred-wang added the compatibility Issues affecting backward compatibility label Mar 20, 2019
@fred-wang
Copy link
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

caiolima pushed a commit to caiolima/webkit that referenced this issue May 3, 2019
…kness at runtime

https://bugs.webkit.org/show_bug.cgi?id=196142

This patch introduces some experimental runtime flag to let users
disable MathML features that are removed from MathML Core [1]. For now,
LayoutTests/imported/w3c:

these features are only disabled on GTK and WPE ports. This patch also
adds a condition to disable "thin", "thick", "medium" values of
mfrac@linethickness at runtime as agreed in [2].

[1] https://mathml-refresh.github.io/mathml-core/
[2] w3c/mathml#4

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-001.html:
Explicitly enable deprecated features in this test. It should be moved
back to WebKit's test suite if/when it is updated in the upstream WPT
repository so also add a reminder for the next synchronization.

Source/WebCore:

these features are only disabled on GTK and WPE ports. This patch also
adds a condition to disable "thin", "thick", "medium" values of
mfrac@linethickness at runtime as agreed in [2].

[1] https://mathml-refresh.github.io/mathml-core/
[2] w3c/mathml#4

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

No new tests, covered by frac-linethickness-0001.html

* mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::lineThickness): Just do standard
parsing for MathML lengths when non-core MathML features are disabled.
* page/Settings.yaml: Add WebCore setting.

Source/WebKit:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences coreMathMLEnabled]):
(-[WebPreferences setCoreMathMLEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::coreMathMLEnabled):
(WebPreferences::setCoreMathMLEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@244869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
@fred-wang
Copy link
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.

@fred-wang fred-wang added need implementation update need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes need tests Issues related to writing WPT tests labels May 16, 2019
@NSoiffer
Copy link
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).

@fred-wang
Copy link
Author

@davidcarlisle As said in #4 (comment) this was removed from core. Please do the update in mathml full, if any before removing the label.

@fred-wang fred-wang removed the need specification update Issues requiring specification changes label Jun 5, 2019
@NSoiffer
Copy link
Contributor

As per my action item, MathJax uses these values: 0.67, 1, 1.67. These seem to be multiples of the rule thickness.

@fred-wang
Copy link
Author

It seems MathJax, Firefox and WebKit values are relatively close so I'm happy to take any of them.

It looks like MathJax does not use the factor for medium/thin and thick/medium, but that's also the case for the CSS-based proposal #7

@fred-wang
Copy link
Author

https://lists.w3.org/Archives/Public/public-mathml4/2019Jun/0013.html

NO Objections - ADOPTED 067, 1.0, 1.67

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 17, 2019
…@linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323

--HG--
extra : moz-landing-system : lando
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Aug 17, 2019
…@linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323
@fred-wang
Copy link
Author

fred-wang commented Aug 18, 2019

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);
        });
});

@fred-wang
Copy link
Author

@fred-wang fred-wang added need specification update Issues requiring specification changes and removed need tests Issues related to writing WPT tests labels Sep 16, 2019
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323

UltraBlame original commit: 0692436a2b33c134bf50654ce466e4bd5ddb05cf
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323

UltraBlame original commit: 0692436a2b33c134bf50654ce466e4bd5ddb05cf
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…linethickness. r=emilio

See w3c/mathml#4
and https://groups.google.com/forum/#!topic/mozilla.dev.platform/G91-vBeC3Rw

This commit introduces a new preference option
mathml.mfrac_linethickness_names.disabled to disable linethickness names. For
now, these names are only disabled in Nightly builds. Announcements and actual
disabling of this and other MathML features will be considered later.

* test_bug553917.html is updated to check that these values now cause an error
  message to be logged into the console.
* mstyle-1.xhtml is updated to use a numeric linethickness since the point of
  the test is just to check that the attribute is not supported on mstyle, not
  about the actual attribute value.
* Other fractions tests relying on linethickness names are executed with the
  proper preference adjustment.
* mathml/presentation-markup/fractions/frac-linethickness-001.html is now
  closer to its expectation ; however the test still fails because nonzero
  unitless values are not removed yet. See
  w3c/mathml#24

Differential Revision: https://phabricator.services.mozilla.com/D42323

UltraBlame original commit: 0692436a2b33c134bf50654ce466e4bd5ddb05cf
ryanhaddad pushed a commit to WebKit/WebKit that referenced this issue Dec 22, 2020
…kness at runtime

https://bugs.webkit.org/show_bug.cgi?id=196142

This patch introduces some experimental runtime flag to let users
disable MathML features that are removed from MathML Core [1]. For now,
LayoutTests/imported/w3c:

these features are only disabled on GTK and WPE ports. This patch also
adds a condition to disable "thin", "thick", "medium" values of
mfrac@linethickness at runtime as agreed in [2].

[1] https://mathml-refresh.github.io/mathml-core/
[2] w3c/mathml#4

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* web-platform-tests/mathml/presentation-markup/fractions/frac-linethickness-001.html:
Explicitly enable deprecated features in this test. It should be moved
back to WebKit's test suite if/when it is updated in the upstream WPT
repository so also add a reminder for the next synchronization.

Source/WebCore:

these features are only disabled on GTK and WPE ports. This patch also
adds a condition to disable "thin", "thick", "medium" values of
mfrac@linethickness at runtime as agreed in [2].

[1] https://mathml-refresh.github.io/mathml-core/
[2] w3c/mathml#4

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

No new tests, covered by frac-linethickness-0001.html

* mathml/MathMLFractionElement.cpp:
(WebCore::MathMLFractionElement::lineThickness): Just do standard
parsing for MathML lengths when non-core MathML features are disabled.
* page/Settings.yaml: Add WebCore setting.

Source/WebKit:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences coreMathMLEnabled]):
(-[WebPreferences setCoreMathMLEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::coreMathMLEnabled):
(WebPreferences::setCoreMathMLEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

these features are only disabled on GTK and WPE ports.

[1] https://mathml-refresh.github.io/mathml-core/

Patch by Frederic Wang <fwang@igalia.com> on 2019-05-02
Reviewed by Rob Buis.

* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):

Canonical link: https://commits.webkit.org/211670@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Issues affecting backward compatibility MathML Core Issues affecting the MathML Core specification MathML 4 Issues affecting the MathML 4 specification need polyfill Issues requiring implementation changes need specification update Issues requiring specification changes
Projects
None yet
Development

No branches or pull requests

3 participants