Skip to content

Commit

Permalink
[mathml] Make math display values on non-MathML elements compute to flow
Browse files Browse the repository at this point in the history
This CL aligns with a recent resolution from the CSSWG:
w3c/csswg-drafts#5385 (comment)

This also ensures that LayoutObjectFactory::CreateMath always receives
a MathML element.

The new test fails when MathML Core (in particular LayoutNG) is
disabled because math display values are not supported. Subtests fail
when MathML Core is enabled because multiple display values are not
supported.

Bug: 1127222, 6606
Change-Id: Ica5558f221960d0f80609dfe0e56c029de7e9c3a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404789
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/master@{#806578}
  • Loading branch information
fred-wang authored and chromium-wpt-export-bot committed Sep 14, 2020
1 parent d807cdc commit 4c0af38
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions css/css-display/display-math-on-non-mathml-elements.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>display: math and inline-math on non-MathML compute to flow</title>
<link rel="help" href="https://drafts.csswg.org/css-display/#the-display-properties">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<div id="container">

<div data-expected="block" style="display: math;"></div>
<div data-expected="inline" style="display: inline-math;"></div>
<div data-expected="inline" style="display: inline math;"></div>
<div data-expected="block" style="display: block math;"></div>

<svg data-expected="block" style="display: math;"></svg>
<svg data-expected="inline" style="display: inline-math;"></svg>
<svg data-expected="inline" style="display: inline math;"></svg>
<svg data-expected="block" style="display: block math;"></svg>

</div>

<script>
Array.from(container.children).forEach(element => {
test(function() {
assert_equals(window.getComputedStyle(element).display,
element.getAttribute('data-expected'));
}, `computed display on <${element.tagName} style="${element.getAttribute('style')}">`);
});
</script>

0 comments on commit 4c0af38

Please sign in to comment.