Title: [202907] trunk/LayoutTests
- Revision
- 202907
- Author
- [email protected]
- Date
- 2016-07-07 07:29:25 -0700 (Thu, 07 Jul 2016)
Log Message
Replace reftest scripts-height.html with script tests
https://bugs.webkit.org/show_bug.cgi?id=159423
We import a test from the MathML in HTML5 test suite to replace the test scripts-height.html
and make results more reliable, explicit and accurate. This avoids the failure on iOS.
Patch by Frederic Wang <[email protected]> on 2016-07-07
Reviewed by Martin Robinson.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt: Added.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html: Added.
* mathml/presentation/scripts-height.html: Removed.
* platform/ios-simulator/TestExpectations: Remove failure expectation.
Modified Paths
Added Paths
Removed Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (202906 => 202907)
--- trunk/LayoutTests/ChangeLog 2016-07-07 14:26:08 UTC (rev 202906)
+++ trunk/LayoutTests/ChangeLog 2016-07-07 14:29:25 UTC (rev 202907)
@@ -1,5 +1,20 @@
2016-07-07 Frederic Wang <[email protected]>
+ Replace reftest scripts-height.html with script tests
+ https://bugs.webkit.org/show_bug.cgi?id=159423
+
+ We import a test from the MathML in HTML5 test suite to replace the test scripts-height.html
+ and make results more reliable, explicit and accurate. This avoids the failure on iOS.
+
+ Reviewed by Martin Robinson.
+
+ * imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt: Added.
+ * imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html: Added.
+ * mathml/presentation/scripts-height.html: Removed.
+ * platform/ios-simulator/TestExpectations: Remove failure expectation.
+
+2016-07-07 Frederic Wang <[email protected]>
+
Replace multiscripts-positions.html reftest with script tests
https://bugs.webkit.org/show_bug.cgi?id=159418
Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt (0 => 202907)
--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt 2016-07-07 14:29:25 UTC (rev 202907)
@@ -0,0 +1,4 @@
+
+PASS Alignment on the baseline for bases of different heights
+PASS Vertical position of the scripts for bases of different heights
+
Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4-expected.txt
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html (0 => 202907)
--- trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html (rev 0)
+++ trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html 2016-07-07 14:29:25 UTC (rev 202907)
@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Subscripts and Superscripts metrics</title>
+<link rel="help" href=""
+<meta name="assert" content="Verify metrics of scripted elements for bases of different heights.">
+<script src=""
+<script src=""
+<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 script shifts and
+ spacing. */
+
+ function getBox(aId) {
+ var box = document.getElementById(aId).getBoundingClientRect();
+ box.middle = (box.bottom + box.top) / 2;
+ return box;
+ }
+
+ setup({ explicit_done: true });
+ window.addEventListener("load", runTests);
+
+ var sizeArray = [50, 75, 100];
+
+ function runTests() {
+ test(function() {
+ var e = 1;
+ sizeArray.forEach(function(size) {
+ assert_approx_equals(getBox("msub" + size + "base").middle, getBox("baseline").bottom, e, "msub base " + size + "is placed on the baseline");
+ assert_approx_equals(getBox("msup" + size + "base").middle, getBox("baseline").bottom, e, "msup base " + size + "is placed on the baseline");
+ assert_approx_equals(getBox("msubsup" + size + "base").middle, getBox("baseline").bottom, e, "msubsup base " + size + "is placed on the baseline");
+ assert_approx_equals(getBox("multi" + size + "base").middle, getBox("baseline").bottom, e, "mmultiscripts base " + size + "is placed on the baseline");
+ });
+ }, "Alignment on the baseline for bases of different heights");
+
+ test(function() {
+ var e = 5;
+ sizeArray.forEach(function(size) {
+ assert_approx_equals(getBox("msub" + size + "sub").middle, getBox("msub" + size + "base").bottom, e, "msub script " + size + "is placed at the top of of the base");
+ });
+ }, "Vertical position of the scripts for bases of different heights");
+
+ done();
+ }
+</script>
+</head>
+<body>
+ <p>
+ <math>
+ <mspace id="baseline" width="30px" height="2px" depth="0px" mathbackground="blue"/>
+ <msub id="msub50">
+ <mspace id="msub50base" width="30px" height="50px" depth="50px" mathbackground="black"/>
+ <mspace id="msub50sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msub>
+ <msup id="msup50">
+ <mspace id="msup50base" width="30px" height="50px" depth="50px" mathbackground="black"/>
+ <mspace id="msup50sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msup>
+ <msubsup id="msubsup50">
+ <mspace id="msubsup50base" width="30px" height="50px" depth="50px" mathbackground="black"/>
+ <mspace id="msubsup50sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="msubsup50sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msubsup>
+ <mmultiscripts id="multi50">
+ <mspace id="multi50base" width="30px" height="50px" depth="50px" mathbackground="black"/>
+ <mspace id="multi50postsub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi50postsup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mprescripts/>
+ <mspace id="multi50presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi50presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </mmultiscripts>
+ <msub id="msub75">
+ <mspace id="msub75base" width="30px" height="75px" depth="75px" mathbackground="black"/>
+ <mspace id="msub75sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msub>
+ <msup id="msup75">
+ <mspace id="msup75base" width="30px" height="75px" depth="75px" mathbackground="black"/>
+ <mspace id="msup75sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msup>
+ <msubsup id="msubsup75">
+ <mspace id="msubsup75base" width="30px" height="75px" depth="75px" mathbackground="black"/>
+ <mspace id="msubsup75sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="msubsup75sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msubsup>
+ <mmultiscripts id="multi75">
+ <mspace id="multi75base" width="30px" height="75px" depth="75px" mathbackground="black"/>
+ <mspace id="multi75postsub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi75postsup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mprescripts/>
+ <mspace id="multi75presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi75presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </mmultiscripts>
+ <msub id="msub100">
+ <mspace id="msub100base" width="30px" height="100px" depth="100px" mathbackground="black"/>
+ <mspace id="msub100sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msub>
+ <msup id="msup100">
+ <mspace id="msup100base" width="30px" height="100px" depth="100px" mathbackground="black"/>
+ <mspace id="msup100sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msup>
+ <msubsup id="msubsup100">
+ <mspace id="msubsup100base" width="30px" height="100px" depth="100px" mathbackground="black"/>
+ <mspace id="msubsup100sub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="msubsup100sup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </msubsup>
+ <mmultiscripts id="multi100">
+ <mspace id="multi100base" width="30px" height="100px" depth="100px" mathbackground="black"/>
+ <mspace id="multi100postsub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi100postsup" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mprescripts/>
+ <mspace id="multi100presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ <mspace id="multi100presub" width="10px" height="5px" depth="5px" mathbackground="black"/>
+ </mmultiscripts>
+ </math>
+ </p>
+ <hr/>
+</body>
+</html>
Property changes on: trunk/LayoutTests/imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-4.html
___________________________________________________________________
Added: svn:eol-style
+LF
\ No newline at end of property
Added: svn:mime-type
+text/html
\ No newline at end of property
Deleted: trunk/LayoutTests/mathml/presentation/scripts-height.html (202906 => 202907)
--- trunk/LayoutTests/mathml/presentation/scripts-height.html 2016-07-07 14:26:08 UTC (rev 202906)
+++ trunk/LayoutTests/mathml/presentation/scripts-height.html 2016-07-07 14:29:25 UTC (rev 202907)
@@ -1,96 +0,0 @@
-<!doctype html>
-<html>
- <head>
- <title>scripts-height</title>
- <meta charset="utf-8"/>
- <style>
- math {
- padding: 0;
- border: 0;
- }
- td {
- border: 1px solid black;
- text-align: center; width: 100px; height: 100px;
- vertical-align: middle;
- }
- span {
- display: inline-block;
- background: black;
- border: 0;
- margin: 0;
- padding: 0;
- }
- </style>
- </head>
- <body>
-
- <!-- base with large height: the script are shifted to the top/bottom
- of the cell and should be hidden by the black rectangles -->
- <div style="position: absolute; top: 10px; left: 10px;">
- <table>
- <tr>
- <td>
- <math>
- <msubsup>
- <mspace height="40px" depth="40px"/>
- <mspace width="10px" height="5px" depth="5px"
- mathbackground="red"/>
- <mspace width="10px" height="5px" depth="5px"
- mathbackground="blue"/>
- </msubsup>
- </math>
- </td>
- </tr>
- </table>
- </div>
- <div style="position: absolute; top: 10px; left: 10px;">
- <table>
- <tr>
- <td style="vertical-align: top">
- <span style="width: 20px; height: 20px;"></span>
- </td>
- </tr>
- </table>
- </div>
- <div style="position: absolute; top: 10px; left: 10px;">
- <table>
- <tr>
- <td style="vertical-align: bottom">
- <span style="width: 20px; height: 20px;"></span>
- </td>
- </tr>
- </table>
- </div>
-
- <!-- scripts of different heights: they should all be aligned in the
- middle of the cell -->
- <div style="position: absolute; top: 10px; left: 120px;">
- <table>
- <tr>
- <td style="width: 14em; height: 14em;">
- <math>
- <mspace height="7em" depth="7em"/>
- <mspace width="10px" height="1em" depth="1em" mathbackground="red"/>
- <msubsup>
- <mspace width="10px" height="1em" depth="1em" mathbackground="green"/>
- <mspace height="4em"/>
- <mspace height="1em"/>
- </msubsup>
- <msubsup>
- <mspace width="10px" height="1em" depth="1em" mathbackground="blue"/>
- <mspace height="1em"/>
- <mspace height="4em"/>
- </msubsup>
- <msubsup>
- <mspace width="10px" height="1em" depth="1em" mathbackground="yellow"/>
- <mspace height="4em"/>
- <mspace height="4em"/>
- </msubsup>
- </math>
- </td>
- </tr>
- </table>
- </div>
-
- </body>
-</html>
Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (202906 => 202907)
--- trunk/LayoutTests/platform/ios-simulator/TestExpectations 2016-07-07 14:26:08 UTC (rev 202906)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations 2016-07-07 14:29:25 UTC (rev 202907)
@@ -675,9 +675,6 @@
mathml/presentation/attributes-mathvariant.html [ Skip ]
mathml/presentation/tokenElements-mathvariant.html [ Skip ]
-# MathML tests that fail:
-mathml/presentation/scripts-height.html [ ImageOnlyFailure ]
-
# <rdar://problem/19215305> ASSERT(m_cgFont.get()) fails in FontPlatformData::ctFont()
svg/text/svg-fallback-font-crash.html
svg/css/font-face-variant-crash.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes