ampproject / ampproject/amphtml
inline amp-mathml truncates math expressions intermittently
- Dominant language
- JavaScript
- Stars
- 14.9k
- Forks
- 4.1k
- PR merge metrics
- No merged PRs in 30d
Description
## What's the issue?
<amp-mathml inline/> intermittently renders inline iframes with too narrow a width. Most of the time there is no issue, but occasionally it is too small.
As we are composing educational content, this is a showstopper for us, because some formulas will be rendered missing part of the expression, resulting in the appearance of mathematically invalid content.
While we have encountered this repeatedly in all sorts of content (paragraphs, accordions, styled divs, etc), we encounter it the most inside our test cases for <table/>s. I want to stress, that **<amp-mathml/> isn't only buggy inside tables; this is just the place we are most able to see the issue arise**.
## How do we reproduce the issue?
The following is a test case page. You may discover this intermittent issue by reloading the page over and over again.
https://content-solutions.s3.ca-central-1.amazonaws.com/amp-mathml-sizing-bug/mathml-sizing-bug.html
- Sometimes everything renders perfectly
- Sometimes the iframes above the fold render perfectly, then as you scroll down some render too small.
- Sometimes if you reload the page viewing the middle table, the middle table will be fine, and one of the other tables above or below it will render mathml to small.
The following is a screenshot of the page loaded in Chrome OSX. Note that in the first table everything is fine, but in the second table (same content/code, just duplicated to add more instances of mathml) the first row and last row have math formulas that have been truncated.
In the last table (again, just duplicated, same content code), note that the first row -1.2 looks ok, but the last row has the same problem as in the second table.
https://content-solutions.s3.ca-central-1.amazonaws.com/amp-mathml-sizing-bug/mathml-sizing-bug.png
## What browsers are affected?
All browsers/devices. This is intermittent.
## Which AMP version is affected?
We have noticed this issue intermittently since **October 2019**, but the current version number we see it in is **2011070101001**
Contributor guide
Research direction
Start with the amp-mathml component entry point and reproduce the intermittent sizing failure using the linked test case page, including repeated reloads and scrolling through the tables. Compare affected and unaffected iframe widths across the documented scenarios; done means inline math expressions are no longer truncated in any browser or layout described.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100