Open Bug 2018403 Opened 2 months ago Updated 5 days ago

Consider wrapping children of math/mtd in an anonymous mrow

Categories

(Core :: MathML, task)

task

Tracking

()

ASSIGNED

People

(Reporter: fwang, Assigned: fwang, NeedInfo)

References

(Blocks 2 open bugs)

Details

Attachments

(13 files, 3 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
2.86 KB, text/html
Details
585 bytes, text/html
Details
894 bytes, text/html
Details
507 bytes, text/html
Details
255 bytes, text/html
Details
349 bytes, text/html
Details
497 bytes, text/html
Details
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
2.57 KB, text/html
Details
48 bytes, text/x-phabricator-request
Details | Review
326 bytes, text/html
Details

That should help fix bug 236963 (stretching) and probably bug 2018114 (spacing).

This is what Chromium does, I believe.

On the other hand, this will remove our basic (and probably broken) linebreaking support within math/mtd.

Attached file Testcase

This is showing some inconsistencies in Firefox when an explicit mrow is used as a direct child of the math or when it is not.

Always creating an anonymous mrow would help solve inconsistencies, but we would lose our rudimentary linebreaking support.

Assignee: nobody → fwang
Status: NEW → ASSIGNED
Attachment #9547512 - Attachment description: WIP: Bug 2018403 - Consider wrapping children of math/mtd in an anonymous mrow. → WIP: Bug 2018403 - Part 1: wrap children of <math> into an anonymous <mrow>.
Attachment #9547512 - Attachment description: WIP: Bug 2018403 - Part 1: wrap children of <math> into an anonymous <mrow>. → WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>.
Attached file anonymous-mrow-assert-001.html (obsolete) —
Attached file anonymous-mrow-assert-002.html (obsolete) —
Attached file anonymous-mrow-assert-003.html (obsolete) —
Attachment #9551878 - Attachment is obsolete: true
Attachment #9551879 - Attachment is obsolete: true
Attachment #9551880 - Attachment is obsolete: true
Depends on: 2023048
Depends on: 2023057
Attachment #9547512 - Attachment description: WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. → WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri
Attachment #9547512 - Attachment description: WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri → Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri
Attachment #9547512 - Attachment description: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri → WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri
Attachment #9547512 - Attachment description: WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri → Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri
See Also: → 1846930
Attachment #9547512 - Attachment description: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri → WIP: Bug 2018403 - Wrap children of <math>/<mtd> into an anonymous <mrow>. r=emilio,eri
Depends on: 2026637
See Also: → 433064
Flags: needinfo?(emilio)

So something like comment 15 gives me mostly a progression:

Error Summary
-------------
/mathml/presentation-markup/operators/mo-lspace-rspace-3.html
  UNEXPECTED-PASS /mathml/presentation-markup/operators/mo-lspace-rspace-3.html - Testing http://web-platform.test:8000/mathml/presentation-markup/operators/mo-lspace-rspace-3.html == http://web-platform.test:8000/mathml/presentation-markup/operators/mo-lspace-rspace-3-ref.html
/mathml/presentation-markup/operators/painting-stretchy-operator-001.html
  UNEXPECTED-PASS /mathml/presentation-markup/operators/painting-stretchy-operator-001.html - Testing http://web-platform.test:8000/mathml/presentation-markup/operators/painting-stretchy-operator-001.html == http://web-platform.test:8000/mathml/presentation-markup/operators/painting-stretchy-operator-001-ref.html
/mathml/presentation-markup/operators/embellished-operator-001.html
  UNEXPECTED-PASS mrow (embellished operator)
  UNEXPECTED-PASS mstyle (embellished operator)
  UNEXPECTED-PASS mphantom (embellished operator)
  UNEXPECTED-PASS merror (embellished operator)
  UNEXPECTED-PASS mprescripts (embellished operator)
  UNEXPECTED-PASS none (embellished operator)
  UNEXPECTED-PASS unknown (embellished operator)
  UNEXPECTED-PASS mfenced (embellished operator)
  UNEXPECTED-PASS a (embellished operator)
/mathml/presentation-markup/operators/embellished-operator-002.html
  UNEXPECTED-PASS msub (embellished operator)
  UNEXPECTED-PASS msup (embellished operator)
  UNEXPECTED-PASS msubsup (embellished operator)
  UNEXPECTED-PASS munder (embellished operator)
  UNEXPECTED-PASS mover (embellished operator)
  UNEXPECTED-PASS munderover (embellished operator)
  UNEXPECTED-PASS mmultiscripts (embellished operator)
  FAIL mfrac (embellished operator, from in-flow children) - assert_approx_equals: expected 50 +/- 1 but got 54.16667175292969
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:68:36
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:65:16
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:58:34
  FAIL mfrac (not embellished operator) - assert_approx_equals: expected 0 +/- 1 but got 4.1666717529296875
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:74:36
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:71:16
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-002.html:58:34
/mathml/presentation-markup/operators/embellished-operator-003.html
  UNEXPECTED-PASS maction (embellished operator)
  FAIL maction (embellished operator, from in-flow children) - assert_approx_equals: expected 50 +/- 1 but got 100
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:70:36
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:67:16
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:60:32
  UNEXPECTED-PASS maction (embellished operator, one child)
  UNEXPECTED-PASS semantics (embellished operator)
  FAIL semantics (embellished operator, from in-flow children) - assert_approx_equals: expected 50 +/- 1 but got 100
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:70:36
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:67:16
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-003.html:60:32
  UNEXPECTED-PASS semantics (embellished operator, one child)
/mathml/presentation-markup/operators/embellished-operator-004.html
  UNEXPECTED-PASS Vertical stretching performed for math > mo.
  UNEXPECTED-PASS Vertical stretching performed for Stretching for math[display=block] > mo.
  FAIL Vertical stretching performed for math > mrow > mo. - assert_greater_than_equal: expected a number greater than or equal to 100 but got 10
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:35:40
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:33:15
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:32:61
  FAIL Vertical stretching performed for Stretching for math[display=block] > mrow > mo. - assert_greater_than_equal: expected a number greater than or equal to 100 but got 10
runTests/</<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:35:40
Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:2869:25
test@http://web-platform.test:8000/resources/testharness.js:633:30
runTests/<@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:33:15
runTests@http://web-platform.test:8000/mathml/presentation-markup/operators/embellished-operator-004.html:32:61
  UNEXPECTED-PASS Vertical stretching performed for math > mrow > mrow > mo.
  UNEXPECTED-PASS Vertical stretching performed for Stretching for math[display=block] > mrow > mrow > mo.
/mathml/presentation-markup/operators/mo-lspace-rspace-5.html
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, LTR, normal text).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, LTR, largeop variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, LTR, stretchy variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, LTR, glyph assembly).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, LTR, normal text).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, LTR, largeop variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, LTR, stretchy variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, LTR, glyph assembly).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, RTL, normal text).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, RTL, largeop variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, RTL, stretchy variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, not embellished, RTL, glyph assembly).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, RTL, normal text).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, RTL, largeop variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, RTL, stretchy variant).
  UNEXPECTED-PASS lspace/rspace spacing correctly set around operator (child of math, embellished, RTL, glyph assembly).

I haven't investigated the regression but that seems mostly straight-forward?

Flags: needinfo?(emilio) → needinfo?(fwang)

Thank you Emilio for trying this. I think we are getting similar issues as my two previous patches, but this is some progress:

Flags: needinfo?(fwang)
Attachment #9560593 - Attachment description: WIP: Bug 2018403 - attempt to make math/mtd an mrow. → WIP: Bug 2018403 - Make math/mtd elements generate an nsMathMLmrowFrame.

(In reply to Frédéric Wang Nélar from comment #18)

Thank you Emilio for trying this. I think we are getting similar issues as my two previous patches, but this is some progress:

So these two bugs should be fixed in the latest version of https://phabricator.services.mozilla.com/D290881

Now I'm trying to fix the regression with /mathml/presentation-markup/tables/table-002.html and /mathml/presentation-markup/tables/table-003.html / attachment 9567602 [details] for tables.

I tried https://phabricator.services.mozilla.com/D292767 but the MathML code does some fancy thing to save reflow output and I don't see a straightforward way to determine the baseline of the inner frame for mtd.

Flags: needinfo?(emilio)

Sorry for the lag getting to this... It seems nsMathMLmtdInnerFrame::Reflow or so could save the BlockStartAscent rather than trying to recompute it after the fact, can't it?

Flags: needinfo?(emilio)
Flags: needinfo?(fwang)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: