layout/reftests/mathml/subscript-italic-correction.html

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 <!doctype html>
michael@0 2 <html class="reftest-wait">
michael@0 3 <head>
michael@0 4 <title>subscript</title>
michael@0 5 <meta charset="utf-8"/>
michael@0 6 <script type="text/javascript">
michael@0 7 function verifyItalicCorrections()
michael@0 8 {
michael@0 9 var epsilon = 2;
michael@0 10 for (var i = 0; i < 8; i += 2) {
michael@0 11 var sub = document.getElementById("s" + i);
michael@0 12 var sup = document.getElementById("s" + (i+1));
michael@0 13 var italicCorrection =
michael@0 14 sup.getBoundingClientRect().left - sub.getBoundingClientRect().left;
michael@0 15 if (italicCorrection < epsilon) {
michael@0 16 return false;
michael@0 17 }
michael@0 18 }
michael@0 19 return true;
michael@0 20 }
michael@0 21
michael@0 22 function doTest()
michael@0 23 {
michael@0 24 if (verifyItalicCorrections()) {
michael@0 25 document.body.style.background = "#5f5";
michael@0 26 }
michael@0 27 document.documentElement.removeAttribute("class");
michael@0 28 }
michael@0 29 window.addEventListener("MozReftestInvalidate", doTest, false);
michael@0 30 </script>
michael@0 31 </head>
michael@0 32 <body style="background: #f00; font-size: 50px;">
michael@0 33
michael@0 34 <div>
michael@0 35 <math>
michael@0 36 <msubsup>
michael@0 37 <mi mathbackground="#5f5">f</mi>
michael@0 38 <mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
michael@0 39 <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
michael@0 40 </msubsup>
michael@0 41 </math>
michael@0 42 </div>
michael@0 43
michael@0 44 <br/>
michael@0 45
michael@0 46 <div>
michael@0 47 <math>
michael@0 48 <mmultiscripts>
michael@0 49 <mi mathbackground="#5f5">f</mi>
michael@0 50 <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
michael@0 51 <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
michael@0 52 <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
michael@0 53 <mspace id="s5" width="50px" height="50px" mathbackground="blue"/>
michael@0 54 <mspace id="s6" width="50px" height="50px" mathbackground="blue"/>
michael@0 55 <mspace id="s7" width="50px" height="50px" mathbackground="blue"/>
michael@0 56 </mmultiscripts>
michael@0 57 </math>
michael@0 58 </div>
michael@0 59
michael@0 60 </body>
michael@0 61 </html>

mercurial