Skip to content

Commit

Permalink
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
mrobinson committed Nov 5, 2013
1 parent 4fc9d68 commit 1a3ce7c
Show file tree
Hide file tree
Showing 10 changed files with 807 additions and 1,123 deletions.
21 changes: 21 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,24 @@
2013-11-05 Martin Robinson <mrobinson@igalia.com>

[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.

* 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:

2013-11-05 Daniel Bates <dabates@apple.com>

XSSAuditor should catch reflected srcdoc properties even without a <frame> tag injection
Expand Down
1 change: 0 additions & 1 deletion LayoutTests/TestExpectations
Expand Up @@ -18,7 +18,6 @@ webkit.org/b/76280 media/W3C/video/networkState/networkState_during_progress.htm

# MathML pixel tests
webkit.org/b/99618 mathml/presentation/roots.xhtml [ Failure ]
webkit.org/b/99618 mathml/presentation/mo-stretch.html [ Failure ]
webkit.org/b/57700 mathml/presentation/row.xhtml [ Failure ]
webkit.org/b/57700 mathml/presentation/mo.xhtml [ Failure ]

Expand Down
136 changes: 62 additions & 74 deletions LayoutTests/mathml/presentation/mo-stretch.html
@@ -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>&LeftCeiling;</mo> <mo>&RightCeiling;</mo>
<mo>&LeftFloor;</mo> <mo>&RightFloor;</mo>
<mo stretchy="true">&Integral;</mo>
<mo>|</mo> <mo>&Verbar;</mo>
</mrow>
</math>

<head>
<title>&lt;mo&gt; 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>&LeftCeiling;</mo> <mo>&RightCeiling;</mo>
<mo>&LeftFloor;</mo> <mo>&RightFloor;</mo>
<mo stretchy="true">&Integral;</mo>
<mo>|</mo> <mo>&Verbar;</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>&LeftCeiling;</mo> <mo>&RightCeiling;</mo>
<mo>&LeftFloor;</mo> <mo>&RightFloor;</mo>
<mo stretchy="true">&Integral;</mo>
<mo>|</mo> <mo>&Verbar;</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>&LeftCeiling;</mo> <mo>&RightCeiling;</mo>
<mo>&LeftFloor;</mo> <mo>&RightFloor;</mo>
<mo stretchy="true">&Integral;</mo>
<mo>|</mo> <mo>&Verbar;</mo>
<mspace height="20px" depth="1px"/>
</mrow>
</mrow>
</mrow>
<mo>+</mo>
<mrow>
<msubsup>
<mo>&int;</mo>
<mi>a</mi>
<mi>b</mi>
</msubsup>
<mrow>
<munderover><mo>&sum;</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>&LeftCeiling;</mo> <mo>&RightCeiling;</mo>
<mo>&LeftFloor;</mo> <mo>&RightFloor;</mo>
<mo stretchy="true">&Integral;</mo>
<mo>|</mo> <mo>&Verbar;</mo>
<mspace height="40px" depth="1px"/>
</msqrt>
</math>

</body>

</html>
3 changes: 0 additions & 3 deletions LayoutTests/platform/gtk/TestExpectations
Expand Up @@ -1388,9 +1388,6 @@ webkit.org/b/118420 [ Release ] fast/dom/gc-dom-tree-lifetime.html [ Failure ]

webkit.org/b/118595 fast/regions/auto-size/autoheight-correct-region-for-lines-2.html [ ImageOnlyFailure ]

# May take too long on the bots.
Bug(GTK) mathml/very-large-stretchy-operators.html [ Pass Timeout ]

# MathML tests failing after MathML pixel tests were replaced with ref tests
webkit.org/b/118904 mathml/presentation/bug95404.html [ ImageOnlyFailure ]

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1a3ce7c

Please sign in to comment.