Closed Bug 1812975 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 38215 - [mathml] Fix offset of vertical glyph assembly

Categories

(Core :: MathML, task, P4)

task

Tracking

()

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 38215 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/38215
Details from upstream follow.

Frédéric Wang <fwang@igalia.com> wrote:

[mathml] Fix offset of vertical glyph assembly

When ShapeResult::CreateForStretchyMathOperator shapes vertical glyph
assemblies, the offset of each part is adjusted by the advance specified
in the corresponding MathGlyphVariantRecord table [1]. Note that this may be slightly different from the calculated height of the glyph, but
is faster to get. In any case the baselines of glyphs are used as a
reference when setting an offset in ShapeResults, so this CL changes the
adjustment to use the glyph ascent instead of the glyph height.

This CL fixes rendering issues for vertical stretchy MathML Operators
for fonts like Cambria Math that use non-zero descent for parts in a
glyph assembly.

StretchyOperatorShaperTest.GlyphVariants is tweaked to use an equivalent
stretchy.woff font (glyphs have zero descent) and a new test
StretchyOperatorShaperTest.GlyphVariantsCenteredOnBaseline is introduced
for a similar stretchy-centered-on-baseline.woff (glyphs have non-zero
and equal ascent/descent).

Finally, a WPT test is added to check that the painting of a vertical
glyph assembly with the two fonts above matches the location of their
bounding boxes.

[1] https://learn.microsoft.com/en-us/typography/opentype/spec/math

Bug: 1409380
Change-Id: I173c1cf461cebe3523e1a10aaf8d7b479bca03ad

Reviewed-on: https://chromium-review.googlesource.com/4197134
WPT-Export-Revision: 73792eb3878b4fc4efaf69643393cfbb214c2b99

Component: web-platform-tests → MathML
Product: Testing → Core

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 6 tests

Status Summary

Firefox

OK : 1
FAIL: 10

Chrome

OK : 1
PASS: 9
FAIL: 1

Safari

OK : 1
PASS: 1
FAIL: 9

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7bc0821e8053
[wpt PR 38215] - [mathml] Fix offset of vertical glyph assembly, a=testonly
https://hg.mozilla.org/integration/autoland/rev/e2713abc0206
[wpt PR 38215] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.