Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[MathML] Poor spacing around delimiters in MathML Torture Test 14
https://bugs.webkit.org/show_bug.cgi?id=122837 Reviewed by Brent Fulgham. Instead of stretching the vertical bar with the stretchable version, just repeat the normal vertical bar. This follows what Gecko does when rendering tall vertical bars and also works around an issue with STIX fonts leading to poor spacing in formulas. Source/WebCore: * rendering/mathml/RenderMathMLOperator.cpp: Stretch the vertical bar with the normal variant. LayoutTests: * mathml/presentation/mo-stretch.html: Reworked this test to show stretching of all stretchable characters, which reveals a bug with the double vertical bar (covered by http://wkbug.com/123543). * platform/gtk/TestExpectations: * platform/gtk/mathml/presentation/mo-stretch-expected.png: * platform/gtk/mathml/presentation/mo-stretch-expected.txt: * platform/mac/mathml/presentation/mo-stretch-expected.png: * platform/mac/mathml/presentation/mo-stretch-expected.txt: Canonical link: https://commits.webkit.org/142005@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
807 additions
and
1,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,76 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body> | ||
<!-- This shows the unstretched operators. --> | ||
<math> | ||
<mrow> | ||
<mo>(</mo> <mo>)</mo> | ||
<mo>{</mo> <mo>}</mo> | ||
<mo>[</mo> <mo>]</mo> | ||
<mo>⌈</mo> <mo>⌉</mo> | ||
<mo>⌊</mo> <mo>⌋</mo> | ||
<mo stretchy="true">∫</mo> | ||
<mo>|</mo> <mo>‖</mo> | ||
</mrow> | ||
</math> | ||
|
||
<head> | ||
<title><mo> Stretching Tests</title> | ||
|
||
<style> | ||
td { border: solid } | ||
</style> | ||
</head> | ||
<br/> | ||
|
||
<body> | ||
<!-- Stretch the operators to different heights. --> | ||
<math> | ||
<mrow> | ||
<mo>(</mo> <mo>)</mo> | ||
<mo>{</mo> <mo>}</mo> | ||
<mo>[</mo> <mo>]</mo> | ||
<mo>⌈</mo> <mo>⌉</mo> | ||
<mo>⌊</mo> <mo>⌋</mo> | ||
<mo stretchy="true">∫</mo> | ||
<mo>|</mo> <mo>‖</mo> | ||
<mspace height="75px" depth="1px"/> | ||
</mrow> | ||
</math> | ||
|
||
<math display="block"> | ||
<mrow> | ||
<mrow> | ||
<mrow> | ||
<mi>f</mi> | ||
<math> | ||
<mrow> | ||
<mo>(</mo> | ||
<mfrac> | ||
<mrow><mfrac><mi>a</mi><mi>b</mi></mfrac><mo>+</mo><mi>c</mi></mrow> | ||
<mrow><mfrac><mi>c</mi><mi>d</mi></mfrac><mo>+</mo><mi>e</mi></mrow> | ||
</mfrac> | ||
<mo>)</mo> | ||
<mo>(</mo> <mo>)</mo> | ||
<mo>{</mo> <mo>}</mo> | ||
<mo>[</mo> <mo>]</mo> | ||
<mo>⌈</mo> <mo>⌉</mo> | ||
<mo>⌊</mo> <mo>⌋</mo> | ||
<mo stretchy="true">∫</mo> | ||
<mo>|</mo> <mo>‖</mo> | ||
<mspace height="50px" depth="1px"/> | ||
</mrow> | ||
</mrow> | ||
<mo>+</mo> | ||
<mrow> | ||
<mi>g</mi> | ||
</math> | ||
|
||
<math> | ||
<mrow> | ||
<mo>[</mo> | ||
<msubsup> | ||
<mi>x</mi> | ||
<mrow><mfrac><mi>c</mi><mi>d</mi></mfrac><mo>+</mo><mi>e</mi></mrow> | ||
<mrow><mfrac><mi>a</mi><mi>b</mi></mfrac><mo>+</mo><mi>c</mi></mrow> | ||
</msubsup> | ||
<mo>]</mo> | ||
<mo>(</mo> <mo>)</mo> | ||
<mo>{</mo> <mo>}</mo> | ||
<mo>[</mo> <mo>]</mo> | ||
<mo>⌈</mo> <mo>⌉</mo> | ||
<mo>⌊</mo> <mo>⌋</mo> | ||
<mo stretchy="true">∫</mo> | ||
<mo>|</mo> <mo>‖</mo> | ||
<mspace height="20px" depth="1px"/> | ||
</mrow> | ||
</mrow> | ||
</mrow> | ||
<mo>+</mo> | ||
<mrow> | ||
<msubsup> | ||
<mo>∫</mo> | ||
<mi>a</mi> | ||
<mi>b</mi> | ||
</msubsup> | ||
<mrow> | ||
<munderover><mo>∑</mo><mrow><mi>i</mi><mo>=</mo><mn>0</mn></mrow><mi>n</mi></munderover> | ||
<mi>i</mi> | ||
</mrow> | ||
</mrow> | ||
</mrow> | ||
</math> | ||
</math> | ||
|
||
<p>Implied <code>mrow</code> with operator stretching:</p> | ||
<math display="block"> | ||
<msqrt> | ||
<mi>f</mi> | ||
<mo>(</mo> | ||
<mfrac> <mn>1</mn> <mi>y</mi> </mfrac> | ||
<mo>)</mo> | ||
</msqrt> | ||
</math> | ||
<br/> | ||
|
||
<p>Preferred logical widths and heights, with operator stretching:</p> | ||
<table><td>a</table> | ||
<table><td id="grow-td">x</table> | ||
<script> | ||
window.addEventListener("load", function() { | ||
document.body.offsetTop; | ||
|
||
var e = document.createElement("div"); | ||
e.innerHTML = "<math display='block' style='margin-bottom: 0'> <mrow>"+ | ||
"<mrow> <mo>{</mo> <mi>x</mi> <mo>}</mo> </mrow> <mo>+</mo>" + | ||
"<mfenced> <mfrac> <mn>1</mn> <mi>y</mi> </mfrac> </mfenced> <mo>+</mo>" + | ||
"<mrow> <mo>[</mo> <mtable> <mtr><mtd><mn>1</mn></mtd></mtr> <mtr><mtd><mn>2</mn></mtd></mtr>" + | ||
"<mtr><mtd><mn>3</mn></mtd></mtr> </mtable> <mo>]</mo> </mrow> </mrow> </math>"; | ||
var td = document.getElementById("grow-td"), t = td.firstChild; | ||
td.insertBefore(e.firstChild, t); | ||
td.removeChild(t); | ||
}, false); | ||
</script> | ||
<!-- Show that stretching also works in msqrt as well as mrow. --> | ||
<math> | ||
<msqrt> | ||
<mo>(</mo> <mo>)</mo> | ||
<mo>{</mo> <mo>}</mo> | ||
<mo>[</mo> <mo>]</mo> | ||
<mo>⌈</mo> <mo>⌉</mo> | ||
<mo>⌊</mo> <mo>⌋</mo> | ||
<mo stretchy="true">∫</mo> | ||
<mo>|</mo> <mo>‖</mo> | ||
<mspace height="40px" depth="1px"/> | ||
</msqrt> | ||
</math> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-9.55 KB
(53%)
LayoutTests/platform/gtk/mathml/presentation/mo-stretch-expected.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.