mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Layout all math elements using InternalDummy context
Always create a new formatting context for <math> elements. Previously that didn't happen if they only had inline children, e.g. mtable. This fixes a crash in the WPT MathML test mathml/crashtests/children-with-negative-block-sizes.html
This commit is contained in:
parent
4408ea7c9b
commit
e7c209820d
Notes:
github-actions[bot]
2024-10-16 17:52:28 +00:00
Author: https://github.com/stendavid Commit: https://github.com/LadybirdBrowser/ladybird/commit/e7c209820d2 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1831
3 changed files with 16 additions and 0 deletions
1
Tests/LibWeb/Text/expected/math-with-inline-child.txt
Normal file
1
Tests/LibWeb/Text/expected/math-with-inline-child.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
PASS (didn't crash)
|
11
Tests/LibWeb/Text/input/math-with-inline-child.html
Normal file
11
Tests/LibWeb/Text/input/math-with-inline-child.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<math>
|
||||||
|
<mtable></mtable>
|
||||||
|
</math>
|
||||||
|
<script src="include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
println("PASS (didn't crash)");
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -136,6 +136,10 @@ Optional<FormattingContext::Type> FormattingContext::formatting_context_type_cre
|
||||||
if (display.is_grid_inside())
|
if (display.is_grid_inside())
|
||||||
return Type::Grid;
|
return Type::Grid;
|
||||||
|
|
||||||
|
if (display.is_math_inside())
|
||||||
|
// HACK: Instead of crashing, create a dummy formatting context that does nothing.
|
||||||
|
return Type::InternalDummy;
|
||||||
|
|
||||||
if (creates_block_formatting_context(box))
|
if (creates_block_formatting_context(box))
|
||||||
return Type::Block;
|
return Type::Block;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue