Closed Bug 1788523 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 35646 - [mathml] Fix MathML layout algorithms for empty children with negative margins

Categories

(Core :: MathML, task, P4)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream error])

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

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

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

[mathml] Fix MathML layout algorithms for empty children with negative margins

This CL adds two WPT crashtests for the edge cases of MathML elements
having empty children with negative margins, testing separately the
inline and block cases:

mathml/crashtests/children-with-negative-inline-sizes.html
mathml/crashtests/children-with-negative-block-sizes.html

The former almost works without problem, but it's currently failing the
assertion that min size is at most the max size for the \<mroot> element.
This is due to a mistake in the min/max calculation and is fixed by
aligning with the MathML Core spec [1]. This also makes existing
mathml/presentation-markup/mrow/no-spacing.html test pass.

The latter is failing the assertion that block intrinsic size includes
at least the border/padding, for the algorithms related to fraction and
scripted elements. This is because the calculated ascent/descent of the
content boxes can be negative for the empty children with negative
margins. This is fixed by clamping the calculated ascent/descent to 0
before adding the element's own border/padding. For that purpose, a bit
of code refactoring is also done here.

[1] https://w3c.github.io/mathml-core/#root-with-index

Bug: 1342307
Change-Id: I00db8d423f163c14cc2ef34dcccde8a3a086e036
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3858293
Commit-Queue: Frédéric Wang \<fwang@igalia.com>
Reviewed-by: Ian Kilpatrick \<ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041390}

Component: web-platform-tests → MathML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]

CI Results

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

Total 2 tests

Status Summary

Firefox

PASS: 2

Chrome

PASS: 2

Safari

PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f7a92034729e [wpt PR 35646] - [mathml] Fix MathML layout algorithms for empty children with negative margins, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.