<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[203103] trunk/LayoutTests</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/203103">203103</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2016-07-11 21:03:43 -0700 (Mon, 11 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Replace reftest mathml/presentation/fractions-positions.html with script tests
https://bugs.webkit.org/show_bug.cgi?id=159558
Patch by Frederic Wang <fwang@igalia.com> on 2016-07-11
Reviewed by Martin Robinson.
* TestExpectations: Remove fractions-positions.html
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html: Added.
* mathml/presentation/fractions-positions-expected.html: Removed.
* mathml/presentation/fractions-positions.html: Removed.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupfractionsfrac1expectedtxt">trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupfractionsfrac1html">trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsmathmlpresentationfractionspositionsexpectedhtml">trunk/LayoutTests/mathml/presentation/fractions-positions-expected.html</a></li>
<li><a href="#trunkLayoutTestsmathmlpresentationfractionspositionshtml">trunk/LayoutTests/mathml/presentation/fractions-positions.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203102 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-12 03:30:05 UTC (rev 203102)
+++ trunk/LayoutTests/ChangeLog        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-07-11 Frederic Wang <fwang@igalia.com>
+
+ Replace reftest mathml/presentation/fractions-positions.html with script tests
+ https://bugs.webkit.org/show_bug.cgi?id=159558
+
+ Reviewed by Martin Robinson.
+
+ * TestExpectations: Remove fractions-positions.html
+ * imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt: Added.
+ * imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html: Added.
+ * mathml/presentation/fractions-positions-expected.html: Removed.
+ * mathml/presentation/fractions-positions.html: Removed.
+
</ins><span class="cx"> 2016-07-11 Benjamin Poulain <benjamin@webkit.org>
</span><span class="cx">
</span><span class="cx"> [JSC] Array.from() and Array.of() try to build objects even if "this" is not a constructor
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (203102 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2016-07-12 03:30:05 UTC (rev 203102)
+++ trunk/LayoutTests/TestExpectations        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -121,9 +121,6 @@
</span><span class="cx">
</span><span class="cx"> webkit.org/b/129057 media/controls-styling-strict.html [ Pass Failure ]
</span><span class="cx">
</span><del>-# Skip this MathML test for now until it is rewritten to be more reliable.
-webkit.org/b/159558 mathml/presentation/fractions-positions.html [ Skip ]
-
</del><span class="cx"> # These tests will be rewritten, just skip them until that time.
</span><span class="cx"> webkit.org/b/148036 http/tests/inspector/css/ [ Skip ]
</span><span class="cx"> webkit.org/b/148036 http/tests/inspector/page/ [ Skip ]
</span></span></pre></div>
<a id="trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupfractionsfrac1expectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt (0 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt         (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+−
+
+
+PASS Fraction axis is aligned on the math axis
+PASS Vertical positions of numerator and denominator
+PASS Horizontal alignments of numerator and denominator
+PASS Dimension of mfrac elements
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsimportedmathmlinhtml5mathmlpresentationmarkupfractionsfrac1html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html (0 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html         (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -0,0 +1,126 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Fraction</title>
+<link rel="help" href="http://www.mathml-association.org/MathMLinHTML5/S3.html#SS3.SSS2">
+<meta name="assert" content="Verify fraction metrics for different sizes of numerator and denominator.">
+<script src="../../../../../resources/testharness.js"></script>
+<script src="../../../../../resources/testharnessreport.js"></script>
+<style>
+ math, mspace {
+ font-size: 10px;
+ }
+</style>
+<script>
+ /* This test does not use any specific fonts and so the exact rules are not
+ specified precisely. We assume reasonable values for numerator/denominator
+ shifts and spacing. */
+
+ function getBox(aId) {
+ var box = document.getElementById(aId).getBoundingClientRect();
+ box.middle = (box.bottom + box.top) / 2;
+ box.center = (box.left + box.right) / 2;
+ return box;
+ }
+
+ function getFractionAxis(aId) {
+ return (getBox(aId).top * den.height + getBox(aId).bottom * num.height) / (num.height + den.height);
+ }
+
+ setup({ explicit_done: true });
+ window.addEventListener("load", runTests);
+
+ function runTests() {
+ test(function() {
+ var e = 3;
+ var mathAxis = getBox("axis").middle;
+ for (var i = 0; i < 10; i++) {
+ var frac = getBox("frac" + i);
+ var num = getBox("frac" + i + "num");
+ var den = getBox("frac" + i + "den");
+ // To estimate the fraction axis, we calculate barycenter between the
+ // top and bottom of the fraction, using the heights of numerator and
+ // denominator as weights.
+ var fracAxis = (frac.top * den.height + frac.bottom * num.height) / (num.height + den.height);
+ assert_approx_equals(fracAxis, mathAxis, e, "frac" + i + " fraction bar");
+ }
+ }, "Fraction axis is aligned on the math axis");
+
+ test(function() {
+ for (var i = 0; i < 10; i++) {
+ assert_less_than(getBox("frac" + i + "num").bottom, getBox("frac" + i + "den").top, "numerator is above denominator");
+ assert_less_than(getBox("frac" + i + "den").top - getBox("frac" + i + "num").bottom, 5, "The gap between numerator and denominator is not too large");
+ }
+ }, "Vertical positions of numerator and denominator");
+
+ test(function() {
+ var e = 3;
+ for (var i = 0; i < 10; i++)
+ assert_approx_equals(getBox("frac" + i + "num").center, getBox("frac" + i + "den").center, e, "numerator and denominator are horizontally centered");
+ }, "Horizontal alignments of numerator and denominator");
+
+ test(function() {
+ var e = 5;
+ for (var i = 0; i < 10; i++) {
+ var frac = getBox("frac" + i);
+ var num = getBox("frac" + i + "num");
+ var den = getBox("frac" + i + "den");
+ assert_approx_equals(frac.height, den.bottom - num.top, e, "height of frac " + i + " is determined by the bottom/top sides of the denominator/numerator");
+ assert_approx_equals(frac.width, Math.max(num.right, den.right) - Math.min(num.left, den.left), e, "width of frac " + i + " is determined by the left/right sides of the denominator/numerator (plus some spacing)");
+ }
+ }, "Dimension of mfrac elements");
+
+ done();
+ }
+</script>
+</head>
+<body>
+ <p>
+ <math>
+ <mo id="axis">−</mo>
+ <mfrac id="frac0">
+ <mspace id="frac0num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac0den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac1">
+ <mspace id="frac1num" width="30px" height="15px" mathbackground="blue"/>
+ <mspace id="frac1den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac2">
+ <mspace id="frac2num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac2den" width="30px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac3">
+ <mspace id="frac3num" width="15px" height="30px" mathbackground="blue"/>
+ <mspace id="frac3den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac4">
+ <mspace id="frac4num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac4den" width="15px" height="30px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac5" linethickness="0px">
+ <mspace id="frac5num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac5den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac6" linethickness="0px">
+ <mspace id="frac6num" width="30px" height="15px" mathbackground="blue"/>
+ <mspace id="frac6den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac7" linethickness="0px">
+ <mspace id="frac7num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac7den" width="30px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac8" linethickness="0px">
+ <mspace id="frac8num" width="15px" height="30px" mathbackground="blue"/>
+ <mspace id="frac8den" width="15px" height="15px" mathbackground="green"/>
+ </mfrac>
+ <mfrac id="frac9" linethickness="0px">
+ <mspace id="frac9num" width="15px" height="15px" mathbackground="blue"/>
+ <mspace id="frac9den" width="15px" height="30px" mathbackground="green"/>
+ </mfrac>
+ </math>
+ </p>
+ <hr/>
+</body>
+</html>
</ins><span class="cx">Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/fractions/frac-1.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<ins>+LF
</ins><span class="cx">\ No newline at end of property
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<ins>+text/html
</ins><span class="cx">\ No newline at end of property
</span><a id="trunkLayoutTestsmathmlpresentationfractionspositionsexpectedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/fractions-positions-expected.html (203102 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/fractions-positions-expected.html        2016-07-12 03:30:05 UTC (rev 203102)
+++ trunk/LayoutTests/mathml/presentation/fractions-positions-expected.html        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -1,59 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>fractions positions</title>
- <meta charset="utf-8"/>
- <style>
- math {
- padding: 0;
- border: 0;
- }
- td {
- border: 1px solid black;
- text-align: center; width: 8em; height: 8em;
- vertical-align: middle;
- }
- span {
- display: inline-block;
- background: black;
- border: 0;
- margin: 0;
- }
- </style>
- </head>
- <body>
-
- <table style="position: absolute; top: 10px; left: 10px;">
- <tr>
- <td>
- <math>
- <mfrac>
- <mtext><span style="width: 2em; height: 1em;"></span></mtext>
- <mtext><span style="width: 2em; height: 1em; background:blue;"></span></mtext>
- </mfrac>
- </math>
- </td>
- <td>
- <math>
- <mfrac>
- <mtext><span style="width: 2em; height: 1em; background:red;"></span></mtext>
- <mtext><span style="width: 2em; height: 1em;"></span></mtext>
- </mfrac>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute; top: 10px; left: 10px;">
- <tr>
- <td>
- <span style="width: 2em; height: 2em; margin-bottom: 2em;"></span>
- </td>
- <td>
- <span style="width: 2em; height: 2em; margin-top: 2em;"></span>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestsmathmlpresentationfractionspositionshtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/mathml/presentation/fractions-positions.html (203102 => 203103)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/mathml/presentation/fractions-positions.html        2016-07-12 03:30:05 UTC (rev 203102)
+++ trunk/LayoutTests/mathml/presentation/fractions-positions.html        2016-07-12 04:03:43 UTC (rev 203103)
</span><span class="lines">@@ -1,62 +0,0 @@
</span><del>-<!doctype html>
-<html>
- <head>
- <title>fractions positions</title>
- <meta charset="utf-8"/>
- <style>
- math {
- padding: 0;
- border: 0;
- }
- td {
- border: 1px solid black;
- text-align: center; width: 8em; height: 8em;
- vertical-align: middle;
- }
- span {
- display: inline-block;
- background: black;
- border: 0;
- margin: 0;
- }
- </style>
- </head>
- <body>
-
- <!-- This verifies the position of the numerator and denominator -->
- <table style="position: absolute; top: 10px; left: 10px;">
- <tr>
- <td>
- <math>
- <mfrac>
- <mtext><span style="width: 2em; height: 1em; background:red;"></span></mtext>
- <mtext><span style="width: 2em; height: 1em; background:blue;"></span></mtext>
- </mfrac>
- </math>
- </td>
- <td>
- <math>
- <mfrac>
- <mtext><span style="width: 2em; height: 1em; background:red;"></span></mtext>
- <mtext><span style="width: 2em; height: 1em; background:blue;"></span></mtext>
- </mfrac>
- </math>
- </td>
- </tr>
- </table>
-
- <table style="position: absolute; top: 10px; left: 10px;">
- <tr>
- <td>
- <!-- This should hide the numerator -->
- <span style="width: 2em; height: 2em; margin-bottom: 2em;"></span>
- </td>
- <td>
- <!-- This should hide the denumerator -->
- <span style="width: 2em; height: 2em; margin-top: 2em;"></span>
- </td>
- </tr>
- </table>
-
- </body>
-</html>
</del></span></pre>
</div>
</div>
</body>
</html>