webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
749 stars 68 forks source link

www.coursera.org - Missing square brackets for the equations #57772

Open GeneYangNDHU opened 4 years ago

GeneYangNDHU commented 4 years ago

URL: https://www.coursera.org/learn/machine-learning/resources/QQx8l

Browser / Version: Firefox 80.0 Operating System: Windows 10 Tested Another Browser: Yes Internet Explorer

Problem type: Something else Description: square brackets in matrix are not properly displayed Steps to Reproduce: You have to log into Coursera website to access this webpage. I've tested on IE, Edge and Chrome on Windows 10, Safari on iOS/iPadOS, Firefox is the only web browser that can not properly display this page. It seems to be a commonly-used latex-like syntax, just like the ones in Wikipedia, however, not able to display the square brackets around a matrix.

View the screenshot Screenshot
Browser Configuration
  • None

From webcompat.com with ❤️

cipriansv commented 4 years ago

Thank you for the report. @GeneYangNDHU. Unfortunately, a paid subscription for this course is needed to access the link.

Having no sign-in credentials for a paid subscription will close the issue as incomplete.

If the reporter (or anyone else) can provide more information (valid credentials for a test account with a link to this page), please feel free to reopen or comment on the issue, and we'll have a thorough look at it.

GeneYangNDHU commented 4 years ago

Hi @cipriansv , thanks for your help. I created a test account for this issue, please re-visit the webpage through the following information: Test Information.txt

cipriansv commented 4 years ago

@softvision-oana-arbuzov, could you please take a look at this on your Windows machine?

softvision-oana-arbuzov commented 4 years ago

Thanks for the report, I was able to reproduce the issue on mobile layout. image

Note: For me on desktop layout the equations are not loaded correctly on Chrome and Edge. Screenshot_4

Tested with: Browser / Version: Firefox Nightly 200913 (🦎 82.0a1-20200908095243) Operating System: Samsung Galaxy S6 Edge (Android 7.0) - 1440 x 2560 pixels (~577 ppi pixel density)

Moving to Needsdiagnosis for further investigation.

karlcow commented 4 years ago

So interesting in Safari and chrome, the renderer for the mathml code is by default HTML-CSS and it renders well the bracket

Capture d’écran 2020-09-15 à 14 04 22

In Firefox the default renderer is MathML

Capture d’écran 2020-09-15 à 14 04 34

if I switch Firefox to html-css, I get the right rendering for the bracket if I switch Safari to mathml, it still displays correctly the bracket but after a warning that all mathml features are not implemented yet.

if I switch Chrome to mathml the rendering is even more disastrous

Capture d’écran 2020-09-15 à 14 22 08

The multiple rows square bracket is

        <mfenced open="[" close="]">
          <mtable rowspacing="4pt" columnspacing="1em">
            <mtr>
              <mtd>
                <msub>
                  <mi>x</mi>
                  <mn>0</mn>
                </msub>
              </mtd>
            </mtr>
            <mtr>
              <mtd>
                <msub>
                  <mi>x</mi>
                  <mn>1</mn>
                </msub>
              </mtd>
            </mtr>
            <mtr>
              <mtd>
                <mo>&#x22EE;<!-- ⋮ --></mo>
              </mtd>
            </mtr>
            <mtr>
              <mtd>
                <msub>
                  <mi>x</mi>
                  <mi>n</mi>
                </msub>
              </mtd>
            </mtr>
          </mtable>
        </mfenced>

I filed for the support of mfenced https://bugzilla.mozilla.org/show_bug.cgi?id=1664975

but that doesn't explain why firefox gets mathml renderer while chrome/safari gets html/css (even when safari does the right thing for rendering the mathml code with the mathml renderer)

karlcow commented 4 years ago

Probably in https://d2265nx4vomwra.cloudfront.net/2.1/extensions/MathEvents.js the JS code detects that Firefox displays MathML and decides to use the mathml renderer. It's probably an issue to report on mathjax property. https://www.mathjax.org/

@GeneYangNDHU Would you be able to report the issue at https://github.com/mathjax/MathJax/issues

Pointing to this issue here? Thanks.

karlcow commented 4 years ago

Ah @GeneYangNDHU according to https://bugzilla.mozilla.org/show_bug.cgi?id=1603773 mfenced has been removed from mathml spec.

So there are two issues here.

  1. The fact that firefox doesn't receive html/css processing
  2. The fact that coursera is using mfenced (which will be obsolete in MathML3)
GeneYangNDHU commented 4 years ago

@karlcow , thanks for your analysis to clarify the problem. It seems these two issues have nothing to do with firefox so far, I will report issue 1 and 2 to MathJax and Coursera community, respectively.