CHECK failure with MathML + ::first-letter
Ensure that display: math elements handle ::first-letter the same as
flexbox/grid in order to fix a CHECK failure. display: math elements do
not support linebreaking, so an equivalent testcase for ::first-line
is not possible. The WG is agreeing about whether these pseudo-elements
should indeed be ignored for math layout [1].
[1] https://github.com/w3c/mathml-core/issues/211
Bug: 1495811
Change-Id: Id4eda5573f64e79ece3a94b6f09f991f3251434b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5054276
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Frédéric Wang <fwang@igalia.com>
Cr-Commit-Position: refs/heads/main@{#1229096}
diff --git a/mathml/crashtests/first-letter-contributed-to-ancestor.html b/mathml/crashtests/first-letter-contributed-to-ancestor.html
new file mode 100644
index 0000000..f50841d
--- /dev/null
+++ b/mathml/crashtests/first-letter-contributed-to-ancestor.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1495811">
+<style>
+ math {
+ display: inline-block;
+ }
+ math::first-letter {
+ background-color: blue;
+ }
+</style>
+<math>
+ <mo id="mo">%</mo>
+</math>
+<script>
+ mo.appendChild(document.createTextNode("A"));
+ document.body.innerText += "";
+</script>