summaryrefslogtreecommitdiffstats
path: root/layout/reftests/mathml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/reftests/mathml
parentInitial commit. (diff)
downloadfirefox-upstream/124.0.1.tar.xz
firefox-upstream/124.0.1.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/mathml')
-rw-r--r--layout/reftests/mathml/largeop-1-ref.html0
-rw-r--r--layout/reftests/mathml/largeop-1.html0
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-base-ref.html14
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-base.html16
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html15
-rw-r--r--layout/reftests/mathml/mathml-mmultiscript-mprescript.html18
-rw-r--r--layout/reftests/mathml/mirror-op-1-ref.html19
-rw-r--r--layout/reftests/mathml/mirror-op-1.html14
-rw-r--r--layout/reftests/mathml/mirror-op-2-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-2.html9
-rw-r--r--layout/reftests/mathml/mirror-op-3-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-3.html9
-rw-r--r--layout/reftests/mathml/mirror-op-4-ref.html9
-rw-r--r--layout/reftests/mathml/mirror-op-4.html9
-rw-r--r--layout/reftests/mathml/mmultiscript-align-ref.html42
-rw-r--r--layout/reftests/mathml/mmultiscript-align.html38
-rw-r--r--layout/reftests/mathml/mo-glyph-size-ref.html14
-rw-r--r--layout/reftests/mathml/mo-glyph-size.html50
-rw-r--r--layout/reftests/mathml/mpadded-7-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-7.html16
-rw-r--r--layout/reftests/mathml/mpadded-8-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-8.html16
-rw-r--r--layout/reftests/mathml/mpadded-9-ref.html15
-rw-r--r--layout/reftests/mathml/mpadded-9.html16
-rw-r--r--layout/reftests/mathml/mstyle-2-ref.xhtml110
-rw-r--r--layout/reftests/mathml/mstyle-2.xhtml113
-rw-r--r--layout/reftests/mathml/mstyle-3-ref.xhtml133
-rw-r--r--layout/reftests/mathml/mstyle-3.xhtml136
-rw-r--r--layout/reftests/mathml/mstyle-4-ref.xhtml75
-rw-r--r--layout/reftests/mathml/mstyle-4.xhtml78
-rw-r--r--layout/reftests/mathml/multiscripts-1-ref.html71
-rw-r--r--layout/reftests/mathml/multiscripts-1.html71
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-false-ref.html114
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-false.html98
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-true-ref.html114
-rw-r--r--layout/reftests/mathml/munder-mover-align-accent-true.html98
-rw-r--r--layout/reftests/mathml/munderover-align-accent-false-ref.html132
-rw-r--r--layout/reftests/mathml/munderover-align-accent-false.html104
-rw-r--r--layout/reftests/mathml/munderover-align-accent-true-ref.html132
-rw-r--r--layout/reftests/mathml/munderover-align-accent-true.html104
-rw-r--r--layout/reftests/mathml/munderover-empty-scripts-ref.html35
-rw-r--r--layout/reftests/mathml/munderover-empty-scripts.html32
-rw-r--r--layout/reftests/mathml/overbar-width-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/overbar-width-1.xhtml25
-rw-r--r--layout/reftests/mathml/radicalbar-1.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1a.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1b.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1c.html48
-rw-r--r--layout/reftests/mathml/radicalbar-1d.html48
-rw-r--r--layout/reftests/mathml/radicalbar-2.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2a.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2b.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2c.html47
-rw-r--r--layout/reftests/mathml/radicalbar-2d.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3a.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3b.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3c.html47
-rw-r--r--layout/reftests/mathml/radicalbar-3d.html47
-rw-r--r--layout/reftests/mathml/reftest.list55
-rw-r--r--layout/reftests/mathml/scale-stretchy-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/scale-stretchy-1.xhtml41
-rw-r--r--layout/reftests/mathml/scale-stretchy-2-ref.xhtml26
-rw-r--r--layout/reftests/mathml/scale-stretchy-2.xhtml41
-rw-r--r--layout/reftests/mathml/scale-stretchy-3-ref.xhtml27
-rw-r--r--layout/reftests/mathml/scale-stretchy-3.xhtml43
-rw-r--r--layout/reftests/mathml/scale-stretchy-4-ref.xhtml27
-rw-r--r--layout/reftests/mathml/scale-stretchy-4.xhtml43
-rw-r--r--layout/reftests/mathml/scale-stretchy-5-ref.xhtml14
-rw-r--r--layout/reftests/mathml/scale-stretchy-5.xhtml14
-rw-r--r--layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html25
-rw-r--r--layout/reftests/mathml/scriptlevel-movablelimits-1.html25
-rw-r--r--layout/reftests/mathml/semantics-1-ref.xhtml66
-rw-r--r--layout/reftests/mathml/semantics-1.xhtml66
-rw-r--r--layout/reftests/mathml/semantics-2-ref.html19
-rw-r--r--layout/reftests/mathml/semantics-2.html19
-rw-r--r--layout/reftests/mathml/semantics-3-ref.html21
-rw-r--r--layout/reftests/mathml/semantics-3.html21
-rw-r--r--layout/reftests/mathml/semantics-5-ref.html17
-rw-r--r--layout/reftests/mathml/semantics-5.html17
-rw-r--r--layout/reftests/mathml/stretchy-1-ref.html14
-rw-r--r--layout/reftests/mathml/stretchy-1.html14
-rw-r--r--layout/reftests/mathml/stretchy-largeop-1-ref.html56
-rw-r--r--layout/reftests/mathml/stretchy-largeop-1.html81
-rw-r--r--layout/reftests/mathml/stretchy-largeop-2-ref.html111
-rw-r--r--layout/reftests/mathml/stretchy-largeop-2.html137
-rw-r--r--layout/reftests/mathml/stretchy-largeop-3-ref.html123
-rw-r--r--layout/reftests/mathml/stretchy-largeop-3.html156
-rw-r--r--layout/reftests/mathml/subscript-italic-correction-ref.html36
-rw-r--r--layout/reftests/mathml/subscript-italic-correction.html61
-rw-r--r--layout/reftests/mathml/underbar-width-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/underbar-width-1.xhtml25
92 files changed, 4391 insertions, 0 deletions
diff --git a/layout/reftests/mathml/largeop-1-ref.html b/layout/reftests/mathml/largeop-1-ref.html
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/layout/reftests/mathml/largeop-1-ref.html
diff --git a/layout/reftests/mathml/largeop-1.html b/layout/reftests/mathml/largeop-1.html
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/layout/reftests/mathml/largeop-1.html
diff --git a/layout/reftests/mathml/mathml-mmultiscript-base-ref.html b/layout/reftests/mathml/mathml-mmultiscript-base-ref.html
new file mode 100644
index 0000000000..45f43e9f9b
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-base-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mmultiscript with only base</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mtext>base</mtext>
+ </mmultiscripts>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-base.html b/layout/reftests/mathml/mathml-mmultiscript-base.html
new file mode 100644
index 0000000000..f2832df479
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-base.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mmultiscript with only base and none as placeholder</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mtext>base</mtext>
+ <none/>
+ <none/>
+ </mmultiscripts>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html b/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
new file mode 100644
index 0000000000..b30e7fb976
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-mprescript-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mmultiscript with mprescripts without none</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mtext>base</mtext>
+ <mprescripts/>
+ </mmultiscripts>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathml-mmultiscript-mprescript.html b/layout/reftests/mathml/mathml-mmultiscript-mprescript.html
new file mode 100644
index 0000000000..5bc0b5a5ad
--- /dev/null
+++ b/layout/reftests/mathml/mathml-mmultiscript-mprescript.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mmultiscript with mprescripts with none as placeholders</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mtext>base</mtext>
+ <none/>
+ <none/>
+ <mprescripts/>
+ </mmultiscripts>
+
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-1-ref.html b/layout/reftests/mathml/mirror-op-1-ref.html
new file mode 100644
index 0000000000..d7515156c3
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-1-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <style type="text/css">
+ mo {
+ transform: scaleX(-1.0);
+ }
+ </style>
+ <body>
+
+ <p><math><mo>(</mo></math></p>
+ <p><math><mo>)</mo></math></p>
+ <p><math><mo>[</mo></math></p>
+ <p><math><mo>]</mo></math></p>
+ <p><math><mo>{</mo></math></p>
+ <p><math><mo>}</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-1.html b/layout/reftests/mathml/mirror-op-1.html
new file mode 100644
index 0000000000..bb59e16c23
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math dir="rtl"><mo>(</mo></math></p>
+ <p><math dir="rtl"><mo>)</mo></math></p>
+ <p><math dir="rtl"><mo>[</mo></math></p>
+ <p><math dir="rtl"><mo>]</mo></math></p>
+ <p><math dir="rtl"><mo>{</mo></math></p>
+ <p><math dir="rtl"><mo>}</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-2-ref.html b/layout/reftests/mathml/mirror-op-2-ref.html
new file mode 100644
index 0000000000..c67710cca6
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-2-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block"><mo>&#x2211;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-2.html b/layout/reftests/mathml/mirror-op-2.html
new file mode 100644
index 0000000000..5db6819cfe
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-2.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block" dir="rtl"><mo>&#x2211;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-3-ref.html b/layout/reftests/mathml/mirror-op-3-ref.html
new file mode 100644
index 0000000000..fc3a183ef3
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-3-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block"><mo>&#x221A;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-3.html b/layout/reftests/mathml/mirror-op-3.html
new file mode 100644
index 0000000000..501af10926
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block" dir="rtl"><mo>&#x221A;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-4-ref.html b/layout/reftests/mathml/mirror-op-4-ref.html
new file mode 100644
index 0000000000..6c39a47a33
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-4-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block"><mo>&#x222B;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mirror-op-4.html b/layout/reftests/mathml/mirror-op-4.html
new file mode 100644
index 0000000000..ba1acf89f7
--- /dev/null
+++ b/layout/reftests/mathml/mirror-op-4.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test mirror op</title></head>
+ <body>
+
+ <p><math display="block" dir="rtl"><mo>&#x222B;</mo></math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mmultiscript-align-ref.html b/layout/reftests/mathml/mmultiscript-align-ref.html
new file mode 100644
index 0000000000..337852837f
--- /dev/null
+++ b/layout/reftests/mathml/mmultiscript-align-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>alignment of mmultiscript sub/superscripts</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mspace width="50px" height="50px" mathbackground="red"/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ <mspace width="50px" height="10px"/>
+ </mrow>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mprescripts/>
+ <mrow>
+ <mspace width="50px" height="10px"/>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ </mmultiscripts>
+ </math>
+ <br/>
+ <math>
+ <mmultiscripts>
+ <mspace width="50px" height="50px" mathbackground="red"/>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ <mspace width="50px" height="10px"/>
+ </mrow>
+ <mprescripts/>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mrow>
+ <mspace width="50px" height="10px"/>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ </mmultiscripts>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mmultiscript-align.html b/layout/reftests/mathml/mmultiscript-align.html
new file mode 100644
index 0000000000..44fb713a34
--- /dev/null
+++ b/layout/reftests/mathml/mmultiscript-align.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>alignment of mmultiscript sub/superscripts</title>
+ </head>
+
+ <body>
+ <math>
+ <mmultiscripts>
+ <mspace width="50px" height="50px" mathbackground="red"/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mprescripts/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ </mmultiscripts>
+ </math>
+ <br/>
+ <math>
+ <mmultiscripts>
+ <mspace width="50px" height="50px" mathbackground="red"/>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ <mprescripts/>
+ <mspace width="100px" height="10px" mathbackground="green"/>
+ <mrow>
+ <mspace width="50px" height="10px" mathbackground="blue"/>
+ </mrow>
+ </mmultiscripts>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mo-glyph-size-ref.html b/layout/reftests/mathml/mo-glyph-size-ref.html
new file mode 100644
index 0000000000..e4dd43747e
--- /dev/null
+++ b/layout/reftests/mathml/mo-glyph-size-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+<!-- Bug 1219068 -->
+
+<div id="hider"
+ style="position:absolute; top:0; left:0; background-color:green;
+ height:1em; width:100%; z-index:1; padding-top:5px;
+ padding-bottom:5px;" />
+</body>
+</html>
diff --git a/layout/reftests/mathml/mo-glyph-size.html b/layout/reftests/mathml/mo-glyph-size.html
new file mode 100644
index 0000000000..c0cc726daf
--- /dev/null
+++ b/layout/reftests/mathml/mo-glyph-size.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<meta charset="UTF-8">
+</head>
+<body>
+<!-- Bug 1219068 -->
+
+<math style="position:absolute; top: 0; font-size:1em; z-index: 0;" display="block">
+<mrow>
+ <mo>|</mo>
+ <mrow>
+ <mi>f</mi>
+ <mrow>
+ <mn>(</mn>
+ <mi>x</mi>
+ <mn>)</mn>
+ </mrow>
+ <mn>-</mn>
+ <mrow>
+ <mi>f</mi>
+ <mrow>
+ <mn>(</mn>
+ <msub>
+ <mi>x</mi>
+ <mn>0</mn>
+ </msub>
+ <mn>)</mn>
+ </mrow>
+ </mrow>
+ </mrow>
+ <mo>|</mo>
+</mrow>
+</math>
+<div id="hider"
+ style="position:absolute; top:0; left:0; background-color:green;
+ height:1em; width:100%; z-index:1; padding-top:5px;
+ padding-bottom:5px; visibility:hidden" />
+ <script>
+ function obscureMathML() {
+ var hider = document.getElementById("hider");
+ hider.style.visibility="visible";
+ // The math should now be completely obscured
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", obscureMathML);
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-7-ref.html b/layout/reftests/mathml/mpadded-7-ref.html
new file mode 100644
index 0000000000..50f14246ee
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-7-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" height="100height" depth="0">
+ <mphantom>
+ <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-7.html b/layout/reftests/mathml/mpadded-7.html
new file mode 100644
index 0000000000..94d51b5845
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-7.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <!--height in term of height should not depend on the characters-->
+ <mpadded mathbackground="red" height="100height" depth="0">
+ <mphantom>
+ <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-8-ref.html b/layout/reftests/mathml/mpadded-8-ref.html
new file mode 100644
index 0000000000..e01e6498f2
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-8-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" height="100width" depth="0">
+ <mphantom>
+ <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-8.html b/layout/reftests/mathml/mpadded-8.html
new file mode 100644
index 0000000000..4f203d4225
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-8.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <!--height in term of width should not depend on the characters-->
+ <mpadded mathbackground="red" height="100width" depth="0">
+ <mphantom>
+ <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-9-ref.html b/layout/reftests/mathml/mpadded-9-ref.html
new file mode 100644
index 0000000000..e2a4943edd
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-9-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" width="100width">
+ <mphantom>
+ <mtext>&#x1D687;<!-- Mathematical Monospace Capital X --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-9.html b/layout/reftests/mathml/mpadded-9.html
new file mode 100644
index 0000000000..2b86721f50
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-9.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <!--with fixed width, height + depth should not depend on the characters-->
+ <mpadded mathbackground="red" width="100width">
+ <mphantom>
+ <mtext>&#x1D692;<!-- Mathematical Monospace Small I --></mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-2-ref.xhtml b/layout/reftests/mathml/mstyle-2-ref.xhtml
new file mode 100644
index 0000000000..a8843780cb
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-2-ref.xhtml
@@ -0,0 +1,110 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<table>
+ <tbody>
+ <tr>
+ <td>mpadded: width</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: lspace</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: height</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msup>
+ <mrow>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: depth</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msub>
+ <mrow>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: width</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: height</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msup>
+ <mrow>
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: depth</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msub>
+ <mrow>
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-2.xhtml b/layout/reftests/mathml/mstyle-2.xhtml
new file mode 100644
index 0000000000..f11f3ad8cd
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-2.xhtml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<!-- The attributes below should no longer have effect on <mstyle>/<math>
+ elements. See bug 838509 -->
+
+<table>
+ <tbody>
+ <tr>
+ <td>mpadded: width</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" width="1em">
+ <mstyle width="1em">
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: lspace</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" lspace="1em">
+ <mstyle lspace="1em">
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: height</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" height="1em">
+ <mstyle height="1em">
+ <msup>
+ <mrow>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mpadded: depth</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" depth="1em">
+ <mstyle depth="1em">
+ <msub>
+ <mrow>
+ <mtext>_</mtext>
+ <mpadded/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: width</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" width="1em">
+ <mstyle width="1em">
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: height</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" height="1em">
+ <mstyle height="1em">
+ <msup>
+ <mrow>
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mspace: depth</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" depth="1em">
+ <mstyle depth="1em">
+ <msub>
+ <mrow>
+ <mtext>_</mtext>
+ <mspace/>
+ <mtext>_</mtext>
+ </mrow>
+ <mtext>_</mtext>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-3-ref.xhtml b/layout/reftests/mathml/mstyle-3-ref.xhtml
new file mode 100644
index 0000000000..66c03f89ad
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-3-ref.xhtml
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<table>
+ <tbody>
+ <tr>
+ <td>mo: form</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mrow>
+ <!-- We assume that the infix/postfix forms of _ do -->
+ <!-- not have the same lspace/rspace values in the operator dictionary -->
+ <mtext>_</mtext>
+ <mo>_</mo>
+ <mtext>_</mtext>
+ </mrow>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: lspace, rspace</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mrow>
+ <!-- We assume that the infix form of _ has -->
+ <!-- nonzero lspace/rspace values in the operator dictionary -->
+ <mtext>_</mtext>
+ <mo>_</mo>
+ <mtext>_</mtext>
+ </mrow>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: stretchy</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mover>
+ <!-- We assume that the arrow has stretchy=true in the operator dictionary -->
+ <mtext>abcd</mtext>
+ <mo>&#x2192;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: accent</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mover>
+ <!-- We assume &#x23de; has accent=true in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23de;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: maxsize</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mo>(</mo>
+ <mspace height="3em"/>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: minsize</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mo>(</mo>
+ <mspace height="1em"/>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: symmetric</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <!-- We assume that ( has symmetric=true in the operator dictionary -->
+ <mstyle>
+ <mtext>_</mtext>
+ <mo minsize="200%">(</mo>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: movablelimits</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <!-- We assume that &#x2211; has movablelimits=true in the operator dictionary -->
+ <mstyle>
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: largeop</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <!-- We assume that &#x2211; has largeop=true in the operator dictionary -->
+ <mstyle>
+ <mo>&#x2211;</mo>
+ </mstyle>
+ </math></td>
+ </tr>
+ <!--
+ fence: This attribute generally has no direct effect on the visual rendering.
+ separator: This attribute generally has no direct effect on the visual rendering.
+ -->
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-3.xhtml b/layout/reftests/mathml/mstyle-3.xhtml
new file mode 100644
index 0000000000..4b395d3942
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-3.xhtml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<!-- The attributes below (except math@display) should no longer have effect on
+ <mstyle>/<math> elements. See bug 838509 -->
+
+<table>
+ <tbody>
+ <tr>
+ <td>mo: form</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" form="postfix">
+ <mstyle form="postfix">
+ <mrow>
+ <!-- We assume that the infix/postfix forms of _ do -->
+ <!-- not have the same lspace/rspace values in the operator dictionary -->
+ <mtext>_</mtext>
+ <mo>_</mo>
+ <mtext>_</mtext>
+ </mrow>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: lspace, rspace</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" lspace="0" rspace="0">
+ <mstyle lspace="0" rspace="0">
+ <mrow>
+ <!-- We assume that the infix form of _ has -->
+ <!-- nonzero lspace/rspace values in the operator dictionary -->
+ <mtext>_</mtext>
+ <mo>_</mo>
+ <mtext>_</mtext>
+ </mrow>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: stretchy</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" stretchy="false">
+ <mstyle stretchy="false">
+ <mover>
+ <!-- We assume that the arrow has stretchy=true in the operator dictionary -->
+ <mtext>abcd</mtext>
+ <mo>&#x2192;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: accent</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false">
+ <mstyle accent="false">
+ <mover>
+ <!-- We assume &#x23de; has accent=true in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23de;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: maxsize</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" maxsize="100%">
+ <mstyle maxsize="100%">
+ <mo>(</mo>
+ <mspace height="3em"/>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: minsize</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" minsize="300%">
+ <mstyle minsize="300%">
+ <mo>(</mo>
+ <mspace height="1em"/>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: symmetric</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" symmetric="false">
+ <!-- We assume that ( has symmetric=true in the operator dictionary -->
+ <mstyle symmetric="false">
+ <mtext>_</mtext>
+ <mo minsize="200%">(</mo>
+ <mtext>_</mtext>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: movablelimits</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" movablelimits="false">
+ <!-- We assume that &#x2211; has movablelimits=true in the operator dictionary -->
+ <mstyle movablelimits="false">
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mo: largeop</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" display="block" largeop="false">
+ <!-- We assume that &#x2211; has largeop=true in the operator dictionary -->
+ <mstyle largeop="false">
+ <mo>&#x2211;</mo>
+ </mstyle>
+ </math></td>
+ </tr>
+ <!--
+ fence: This attribute generally has no direct effect on the visual rendering.
+ separator: This attribute generally has no direct effect on the visual rendering.
+ -->
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-4-ref.xhtml b/layout/reftests/mathml/mstyle-4-ref.xhtml
new file mode 100644
index 0000000000..e82876083e
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-4-ref.xhtml
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<table>
+ <tbody>
+ <tr>
+ <td>mover: accent</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mover>
+ <!-- We assume &#x23de; is accent in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23de;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>munder: accentunder</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <munder>
+ <!-- We assume &#x23df; is accent in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23df;</mo>
+ </munder>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>munderover: accent, accentunder</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <munderover>
+ <!-- We assume &#x23de; and &#x23df; are accents in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23df;</mo>
+ <mo>&#x23de;</mo>
+ </munderover>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-4.xhtml b/layout/reftests/mathml/mstyle-4.xhtml
new file mode 100644
index 0000000000..e934977557
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-4.xhtml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="us-ascii"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=us-ascii" />
+ <title>Test mstyle</title>
+ <style type="text/css">
+ table { width: 100%; border-collapse: collapse; }
+ td { border: solid black 1px; }
+ </style>
+</head>
+
+<body>
+
+<!-- The attributes below should no longer have effect on <mstyle>/<math>
+ elements. See bug 838509 -->
+
+<table>
+ <tbody>
+ <tr>
+ <td>mover: accent</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false">
+ <mstyle accent="false">
+ <mover>
+ <!-- We assume &#x23de; is accent in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23de;</mo>
+ </mover>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>munder: accentunder</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" accentunder="false">
+ <mstyle accentunder="false">
+ <munder>
+ <!-- We assume &#x23df; is accent in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23df;</mo>
+ </munder>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>munderover: accent, accentunder</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" accent="false" accentunder="false">
+ <mstyle accent="false" accentunder="false">
+ <munderover>
+ <!-- We assume &#x23de; and &#x23df; are accents in the operator dictionary -->
+ <mrow>
+ <mi>x</mi>
+ <mo>+</mo>
+ <mi>y</mi>
+ <mo>+</mo>
+ <mi>z</mi>
+ </mrow>
+ <mo>&#x23df;</mo>
+ <mo>&#x23de;</mo>
+ </munderover>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/multiscripts-1-ref.html b/layout/reftests/mathml/multiscripts-1-ref.html
new file mode 100644
index 0000000000..2fcc142503
--- /dev/null
+++ b/layout/reftests/mathml/multiscripts-1-ref.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Comparison of script elements</title></head>
+ <body>
+ msubsup:
+ <math>
+ <mmultiscripts style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">ccc</mtext>
+ </mmultiscripts>
+ </math>
+
+ <br><br>
+
+ msubsup:
+ <math>
+ <mmultiscripts style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ <none/>
+ </mmultiscripts>
+ </math>
+
+ <br><br>
+
+ msup / msubsup:
+ <math>
+ <mmultiscripts style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <none/>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </mmultiscripts>
+ </math>
+
+ <math>
+ <mmultiscripts style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <none/>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </mmultiscripts>
+ </math>
+
+ <br><br>
+
+
+ mrow / msub:
+ <math>
+ <mrow style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ </mrow>
+ </math>
+
+ <math>
+ <mrow style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ </mrow>
+ </math>
+
+ <br><br>
+
+ msupsub:
+ <math>
+ <mmultiscripts style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <none />
+ <none />
+ </mmultiscripts>
+ </math>
+
+</body></html>
diff --git a/layout/reftests/mathml/multiscripts-1.html b/layout/reftests/mathml/multiscripts-1.html
new file mode 100644
index 0000000000..fa45ff3699
--- /dev/null
+++ b/layout/reftests/mathml/multiscripts-1.html
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><title>Comparison of script elements</title></head>
+ <body>
+ msubsup:
+ <math>
+ <msubsup style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">ccc</mtext>
+ </msubsup>
+ </math>
+
+ <br><br>
+
+ <!-- Different rules apply to msub, so it won't provide equivalent output -->
+ msubsup:
+ <math>
+ <msubsup style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ <mrow></mrow>
+ </msubsup>
+ </math>
+
+ <br><br>
+
+ msup / msubsup:
+ <math>
+ <msup style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </msup>
+ </math>
+
+ <math>
+ <msubsup style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mrow></mrow>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </msubsup>
+ </math>
+
+ <br><br>
+
+ mrow / msub:
+ <math>
+ <mrow style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ </mrow>
+ </math>
+
+ <math>
+ <msub style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mrow></mrow>
+ </msub>
+ </math>
+
+ <br><br>
+
+ msupsub:
+ <math>
+ <msubsup style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mrow></mrow>
+ <mrow></mrow>
+ </msubsup>
+ </math>
+
+</body></html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-false-ref.html b/layout/reftests/mathml/munder-mover-align-accent-false-ref.html
new file mode 100644
index 0000000000..ff98924f80
--- /dev/null
+++ b/layout/reftests/mathml/munder-mover-align-accent-false-ref.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="false" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="2">mover</th>
+ <th colspan="2">munder</th>
+ </tr>
+ <tr>
+ <td align="center"><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <mover>
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <mover>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder>
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munder>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-false.html b/layout/reftests/mathml/munder-mover-align-accent-false.html
new file mode 100644
index 0000000000..14696c286d
--- /dev/null
+++ b/layout/reftests/mathml/munder-mover-align-accent-false.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="false" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="2">mover</th>
+ <th colspan="2">munder</th>
+ </tr>
+ <tr>
+ <td align="center"><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <mover>
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <mover>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder>
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-true-ref.html b/layout/reftests/mathml/munder-mover-align-accent-true-ref.html
new file mode 100644
index 0000000000..9ed8c4e518
--- /dev/null
+++ b/layout/reftests/mathml/munder-mover-align-accent-true-ref.html
@@ -0,0 +1,114 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="true" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="2">mover</th>
+ <th colspan="2">munder</th>
+ </tr>
+ <tr>
+ <td align="center"><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <mover accent="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <mover accent="true">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder accentunder="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munder>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder accentunder="true">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munder-mover-align-accent-true.html b/layout/reftests/mathml/munder-mover-align-accent-true.html
new file mode 100644
index 0000000000..e98e0ef677
--- /dev/null
+++ b/layout/reftests/mathml/munder-mover-align-accent-true.html
@@ -0,0 +1,98 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="true" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="2">mover</th>
+ <th colspan="2">munder</th>
+ </tr>
+ <tr>
+ <td align="center"><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow>
+ </td>
+ <td align="center">
+ <mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <mover accent="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <mover accent="true">
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </mover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder accentunder="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munder accentunder="true">
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-false-ref.html b/layout/reftests/mathml/munderover-align-accent-false-ref.html
new file mode 100644
index 0000000000..7948407abf
--- /dev/null
+++ b/layout/reftests/mathml/munderover-align-accent-false-ref.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="false" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="6">munderover</th>
+ </tr>
+ <tr>
+ <td align="center"><math><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ <mo>&lt;</mo>
+ <mi>Under<mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ <mo>&gt;</mo>
+ <mi>Under</mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow></math>
+ </td>
+ <td align="center"><math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></math></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <munderover accent="false" accentunder="false">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="false" accentunder="false">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="false" accentunder="false">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="false" accentunder="false">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-false.html b/layout/reftests/mathml/munderover-align-accent-false.html
new file mode 100644
index 0000000000..d2ab965d96
--- /dev/null
+++ b/layout/reftests/mathml/munderover-align-accent-false.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="false" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="4">munderover</th>
+ </tr>
+ <tr>
+ <td align="center"><math><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ <mo>&lt;</mo>
+ <mi>Under<mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ <mo>&gt;</mo>
+ <mi>Under</mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow></math>
+ </td>
+ <td align="center"><math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></math></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <munderover>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover>
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-true-ref.html b/layout/reftests/mathml/munderover-align-accent-true-ref.html
new file mode 100644
index 0000000000..d4c88c06e1
--- /dev/null
+++ b/layout/reftests/mathml/munderover-align-accent-true-ref.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="true" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="6">munderover</th>
+ </tr>
+ <tr>
+ <td align="center"><math><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ <mo>&lt;</mo>
+ <mi>Under<mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ <mo>&gt;</mo>
+ <mi>Under</mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow></math>
+ </td>
+ <td align="center"><math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></math></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mrow>
+ <mspace height="15px" width="25px"/>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="25px"/>
+ </mrow>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-align-accent-true.html b/layout/reftests/mathml/munderover-align-accent-true.html
new file mode 100644
index 0000000000..3067ae5ea8
--- /dev/null
+++ b/layout/reftests/mathml/munderover-align-accent-true.html
@@ -0,0 +1,104 @@
+<!DOCTYPE html>
+<html>
+ <head><title></title></head>
+ <body>
+ <h2> Test with accent="true" </h2>
+ <table border="1">
+ <tr>
+ <th colspan="4">munderover</th>
+ </tr>
+ <tr>
+ <td align="center"><math><mrow>
+ <mi>Over</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ <mo>&lt;</mo>
+ <mi>Under<mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ <mo>&gt;</mo>
+ <mi>Under</mi>
+ </mrow></math>
+ </td>
+ <td align="center">
+ <math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&lt;</mo>
+ <mi>Base</mi>
+ </mrow></math>
+ </td>
+ <td align="center"><math><mrow>
+ <mi>Over = Under</mi>
+ <mo>&gt;</mo>
+ <mi>Base</mi>
+ </mrow></math></td>
+ </tr>
+ <tr>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mspace height="15px" width="50px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mspace height="15px" width="75px" mathbackground="blue"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ <td align="center">
+ <math>
+ <munderover accent="true" accentunder="true">
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ <mspace height="15px" width="75px" mathbackground="red"/>
+ </munderover>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <th>
+ <h5>Under & Over</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </th>
+ <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</th>
+ <th>
+ <h5>Base</h5>
+
+ <math>
+ <mrow>
+ <mspace height="15px" width="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </th>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-empty-scripts-ref.html b/layout/reftests/mathml/munderover-empty-scripts-ref.html
new file mode 100644
index 0000000000..27d858309d
--- /dev/null
+++ b/layout/reftests/mathml/munderover-empty-scripts-ref.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test munderover with empty scripts</title>
+ </head>
+ <body>
+
+ <p>munder / munderover with empty overscript:
+ <math>
+ <munderover style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ <mspace></mspace>
+ </munderover>
+ </math></p>
+
+ <p>mover / munderover with empty underscript:
+ <math>
+ <munderover style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mspace></mspace>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </munderover>
+ </math></p>
+
+ <p>mrow / munder with empty scripts:
+ <math>
+ <munderover style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mspace></mspace>
+ <mspace></mspace>
+ </munderover>
+ </math></p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/munderover-empty-scripts.html b/layout/reftests/mathml/munderover-empty-scripts.html
new file mode 100644
index 0000000000..5704c5c74d
--- /dev/null
+++ b/layout/reftests/mathml/munderover-empty-scripts.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test munderover with empty scripts</title>
+ </head>
+ <body>
+
+ <p>munder / munderover with empty overscript:
+ <math>
+ <munder style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </munder>
+ </math></p>
+
+ <p>mover / munderover with empty underscript:
+ <math>
+ <mover style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ <mtext style="background-color: rgba(0, 255, 0, 0.4);">bbb</mtext>
+ </mover>
+ </math></p>
+
+ <p>mrow / munder with empty scripts:
+ <math>
+ <mrow style="background: red;">
+ <mtext style="background-color: rgba(0, 0, 255, 0.4);">AAA</mtext>
+ </mrow>
+ </math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/overbar-width-1-ref.xhtml b/layout/reftests/mathml/overbar-width-1-ref.xhtml
new file mode 100644
index 0000000000..64e89f403f
--- /dev/null
+++ b/layout/reftests/mathml/overbar-width-1-ref.xhtml
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ html { background-color: grey; }
+ div { display: inline-block;
+ font-size: 30px;
+ line-height: 60px; /* Ensure space for overbar */
+ border: 1px solid white;
+ padding: 2px; /* 10% error allowed in char selection */
+ background-color: black;
+ color: red; }
+ </style>
+ </head>
+<body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <mover>
+ <mi>ai</mi>
+ <mo>&#xaf;</mo>
+ </mover>
+ </mphantom>
+ </math>
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/mathml/overbar-width-1.xhtml b/layout/reftests/mathml/overbar-width-1.xhtml
new file mode 100644
index 0000000000..ab261d061d
--- /dev/null
+++ b/layout/reftests/mathml/overbar-width-1.xhtml
@@ -0,0 +1,25 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Check width of stretchy OverBar</title>
+ <style type="text/css">
+ html { background-color: grey; }
+ div { display: inline-block;
+ font-size: 30px;
+ line-height: 60px; /* Ensure space for overbar */
+ border: 1px solid white;
+ padding: 2px; /* 10% error allowed in char selection */
+ background-color: black;
+ color: black; }
+ </style>
+ </head>
+<body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mi>ai</mi>
+ <mo>&#xaf;</mo>
+ </mover>
+ </math>
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-1.html b/layout/reftests/mathml/radicalbar-1.html
new file mode 100644
index 0000000000..326164c0fa
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-1a.html b/layout/reftests/mathml/radicalbar-1a.html
new file mode 100644
index 0000000000..bf2e5147ae
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-1a.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+ <html reftest-zoom=".5">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-1b.html b/layout/reftests/mathml/radicalbar-1b.html
new file mode 100644
index 0000000000..a469943e79
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-1b.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+ <html reftest-zoom=".4">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-1c.html b/layout/reftests/mathml/radicalbar-1c.html
new file mode 100644
index 0000000000..0485fe4136
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-1c.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+ <html reftest-zoom=".3">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-1d.html b/layout/reftests/mathml/radicalbar-1d.html
new file mode 100644
index 0000000000..f89db4ded3
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-1d.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+ <html reftest-zoom=".2">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-2.html b/layout/reftests/mathml/radicalbar-2.html
new file mode 100644
index 0000000000..1870493cb4
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-2.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-2a.html b/layout/reftests/mathml/radicalbar-2a.html
new file mode 100644
index 0000000000..9856fa868c
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-2a.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.5">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-2b.html b/layout/reftests/mathml/radicalbar-2b.html
new file mode 100644
index 0000000000..7df074c40e
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-2b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.4">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-2c.html b/layout/reftests/mathml/radicalbar-2c.html
new file mode 100644
index 0000000000..138bad31ab
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-2c.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.3">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-2d.html b/layout/reftests/mathml/radicalbar-2d.html
new file mode 100644
index 0000000000..7f12882422
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-2d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.2">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-3.html b/layout/reftests/mathml/radicalbar-3.html
new file mode 100644
index 0000000000..12fa3ae050
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-3.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-3a.html b/layout/reftests/mathml/radicalbar-3a.html
new file mode 100644
index 0000000000..24ebfec8e5
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-3a.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.5">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-3b.html b/layout/reftests/mathml/radicalbar-3b.html
new file mode 100644
index 0000000000..1aeafb6cb7
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-3b.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.4">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-3c.html b/layout/reftests/mathml/radicalbar-3c.html
new file mode 100644
index 0000000000..e9e7e7ae55
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-3c.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.3">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/radicalbar-3d.html b/layout/reftests/mathml/radicalbar-3d.html
new file mode 100644
index 0000000000..7d780af44c
--- /dev/null
+++ b/layout/reftests/mathml/radicalbar-3d.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+ <html reftest-zoom="0.2">
+ <head>
+ <!-- Default to invisible text -->
+ <style type="text/css" media="screen, print">
+ .hidden {
+ color: white;
+ }
+ .visible {
+ color: black;
+ }
+ </style>
+ </head>
+ <body>
+ <!-- Nest successive radicals and test that the horizontal bar of one of them is drawn.
+ Because the comparison is for inequality with about:blank, at most one can be visible -->
+ <math>
+ <mrow>
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="visible">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="1em" height="1em" />
+ <msqrt class="hidden">
+ <mspace width="20em" height="1em" />
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </msqrt>
+ </mrow>
+ </math>
+
+ <!-- Block out all but the horizontal bar of the visible radical -->
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 20em; height: 10em; background: white;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/reftest.list b/layout/reftests/mathml/reftest.list
new file mode 100644
index 0000000000..b143a25174
--- /dev/null
+++ b/layout/reftests/mathml/reftest.list
@@ -0,0 +1,55 @@
+random-if(smallScreen&&Android) fuzzy(0-255,0-200) fuzzy-if(geckoview,201-216,200-250) fuzzy-if(winWidget,114-255,245-361) fuzzy-if(OSX,79-153,240-250) == mirror-op-1.html mirror-op-1-ref.html
+!= mirror-op-2.html mirror-op-2-ref.html
+!= mirror-op-3.html mirror-op-3-ref.html
+!= mirror-op-4.html mirror-op-4-ref.html
+== overbar-width-1.xhtml overbar-width-1-ref.xhtml
+== stretchy-largeop-1.html stretchy-largeop-1-ref.html
+== stretchy-largeop-2.html stretchy-largeop-2-ref.html
+== stretchy-largeop-3.html stretchy-largeop-3-ref.html
+== underbar-width-1.xhtml underbar-width-1-ref.xhtml
+== semantics-1.xhtml semantics-1-ref.xhtml
+== semantics-2.html semantics-2-ref.html
+== semantics-3.html semantics-3-ref.html
+pref(mathml.stixgeneral_operator_stretching.disabled,false) == semantics-5.html semantics-5-ref.html # bug 1309429; bug 1648335
+fuzzy-if(OSX,0-16,0-8) == mstyle-3.xhtml mstyle-3-ref.xhtml
+fuzzy-if(OSX,0-1,0-4) == mstyle-4.xhtml mstyle-4-ref.xhtml
+== scale-stretchy-1.xhtml scale-stretchy-1-ref.xhtml
+!= scale-stretchy-2.xhtml scale-stretchy-2-ref.xhtml
+fails-if(OSX>=1010) == scale-stretchy-3.xhtml scale-stretchy-3-ref.xhtml
+!= scale-stretchy-4.xhtml scale-stretchy-4-ref.xhtml
+!= scale-stretchy-5.xhtml scale-stretchy-5-ref.xhtml
+!= stretchy-1.html stretchy-1-ref.html
+== mpadded-7.html mpadded-7-ref.html
+== mpadded-8.html mpadded-8-ref.html
+== mpadded-9.html mpadded-9-ref.html
+== scriptlevel-movablelimits-1.html scriptlevel-movablelimits-1-ref.html
+== munderover-align-accent-false.html munderover-align-accent-false-ref.html
+== munderover-align-accent-true.html munderover-align-accent-true-ref.html
+== munder-mover-align-accent-true.html munder-mover-align-accent-true-ref.html
+== munder-mover-align-accent-false.html munder-mover-align-accent-false-ref.html
+== munderover-empty-scripts.html munderover-empty-scripts-ref.html
+== mo-glyph-size.html mo-glyph-size-ref.html
+fuzzy(0-1,0-80) fuzzy-if(Android,0-255,0-105) fuzzy-if(gtkWidget,0-255,0-136) skip-if(winWidget) == multiscripts-1.html multiscripts-1-ref.html # Windows: bug 1314684; Android: bug 1392254; Linux: bug 1599638
+== mathml-mmultiscript-base.html mathml-mmultiscript-base-ref.html
+== mathml-mmultiscript-mprescript.html mathml-mmultiscript-mprescript-ref.html
+== mmultiscript-align.html mmultiscript-align-ref.html
+fails-if(winWidget) fuzzy-if(gtkWidget,255-255,776226-776226) == subscript-italic-correction.html subscript-italic-correction-ref.html # bug 961482 (Windows), bug 1599640 (Linux)
+
+# radicalbar*.html tests rely on reftest-zoom to verify the visibility of the
+# radical bar at different zoom levels. There does not seem to be any equivalent
+# way of testing that via WPT. See bug 1850661.
+!= radicalbar-1.html about:blank
+!= radicalbar-1a.html about:blank
+!= radicalbar-1b.html about:blank
+!= radicalbar-1c.html about:blank
+!= radicalbar-1d.html about:blank
+!= radicalbar-2.html about:blank
+!= radicalbar-2a.html about:blank
+!= radicalbar-2b.html about:blank
+!= radicalbar-2c.html about:blank
+!= radicalbar-2d.html about:blank
+!= radicalbar-3.html about:blank
+!= radicalbar-3a.html about:blank
+!= radicalbar-3b.html about:blank
+!= radicalbar-3c.html about:blank
+!= radicalbar-3d.html about:blank
diff --git a/layout/reftests/mathml/scale-stretchy-1-ref.xhtml b/layout/reftests/mathml/scale-stretchy-1-ref.xhtml
new file mode 100644
index 0000000000..e1182941c0
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-1-ref.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Maximal size for a vertical arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mspace height="55px" depth="55px" width="50px"
+ style="background: red;"/>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-1.xhtml b/layout/reftests/mathml/scale-stretchy-1.xhtml
new file mode 100644
index 0000000000..76f0620dfd
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-1.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Maximal size for a vertical arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mo style="color: blue;">&#x290B;</mo>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mspace height="55px" depth="55px" width="50px"
+ style="background: red;"/>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-2-ref.xhtml b/layout/reftests/mathml/scale-stretchy-2-ref.xhtml
new file mode 100644
index 0000000000..e219fe0be6
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-2-ref.xhtml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Minimal size for a vertical arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mspace height="44px" depth="44px" width="50px"
+ style="background: green;"/>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-2.xhtml b/layout/reftests/mathml/scale-stretchy-2.xhtml
new file mode 100644
index 0000000000..e89910586d
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-2.xhtml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Minimal size for a vertical arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mo style="color: blue;">&#x290B;</mo>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ <table style="position: absolute;">
+ <tr>
+ <td><div style="height: 200px; width: 5px; background: black"/></td>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mspace height="50px" depth="50px" width="5px"
+ style="background: yellow" />
+ <mspace height="44px" depth="44px" width="50px"
+ style="background: green;"/>
+ </mrow>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-3-ref.xhtml b/layout/reftests/mathml/scale-stretchy-3-ref.xhtml
new file mode 100644
index 0000000000..7a671c1cad
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-3-ref.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Maximal size for a horizontal arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder accentunder="false">
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mspace width="110px" height="25px" depth="25px"
+ style="background: red;"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-3.xhtml b/layout/reftests/mathml/scale-stretchy-3.xhtml
new file mode 100644
index 0000000000..a21b03f61d
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-3.xhtml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Maximal size for a horizontal arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder accentunder="false">
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mo style="color: blue;">&#x21DB;</mo>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder accentunder="false">
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mspace width="110px" height="25px" depth="25px"
+ style="background: red;"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-4-ref.xhtml b/layout/reftests/mathml/scale-stretchy-4-ref.xhtml
new file mode 100644
index 0000000000..87cb94d305
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-4-ref.xhtml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Minimal size for a horizontal arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mspace width="88px" height="25px" depth="25px"
+ style="background: green;"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-4.xhtml b/layout/reftests/mathml/scale-stretchy-4.xhtml
new file mode 100644
index 0000000000..693fdc7ed4
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-4.xhtml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Minimal size for a horizontal arrow stretched by scaling</title>
+ </head>
+
+ <body>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mo style="color: blue;">&#x21DB;</mo>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ <table style="position: absolute;">
+ <tr align="center">
+ <td><div style="width: 200px; height: 5px; background: black"/></td>
+ </tr>
+ <tr align="center">
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mspace width="100px" height="5px" style="background: yellow"/>
+ <mspace width="88px" height="25px" depth="25px"
+ style="background: green;"/>
+ </munder>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-5-ref.xhtml b/layout/reftests/mathml/scale-stretchy-5-ref.xhtml
new file mode 100644
index 0000000000..8dc382e304
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-5-ref.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Largeop in display mode stretched by scaling</title>
+</head>
+
+<body>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mo largeop="false">&#x2A0C;</mo>
+</math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/scale-stretchy-5.xhtml b/layout/reftests/mathml/scale-stretchy-5.xhtml
new file mode 100644
index 0000000000..a79e757d73
--- /dev/null
+++ b/layout/reftests/mathml/scale-stretchy-5.xhtml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Largeop in display mode stretched by scaling</title>
+</head>
+
+<body>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mo>&#x2A0C;</mo>
+</math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html b/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html
new file mode 100644
index 0000000000..bbffa910ab
--- /dev/null
+++ b/layout/reftests/mathml/scriptlevel-movablelimits-1-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test accent/accentunder</title></head>
+ <body>
+ <math displaystyle="false">
+ <munderover>
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ </math>
+ <math displaystyle="false">
+ <munder>
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ </munder>
+ </math>
+ <math displaystyle="false">
+ <mover>
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ </mover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scriptlevel-movablelimits-1.html b/layout/reftests/mathml/scriptlevel-movablelimits-1.html
new file mode 100644
index 0000000000..f3ef2e53ba
--- /dev/null
+++ b/layout/reftests/mathml/scriptlevel-movablelimits-1.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test accent/accentunder</title></head>
+ <body>
+ <math displaystyle="false">
+ <munderover accentunder="true" accent="true">
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ <mi>b</mi>
+ </munderover>
+ </math>
+ <math displaystyle="false">
+ <munder accentunder="true">
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ </munder>
+ </math>
+ <math displaystyle="false">
+ <mover accent="true">
+ <mo>&#x2211;</mo>
+ <mi>a</mi>
+ </mover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/semantics-1-ref.xhtml b/layout/reftests/mathml/semantics-1-ref.xhtml
new file mode 100644
index 0000000000..f5a6d4d493
--- /dev/null
+++ b/layout/reftests/mathml/semantics-1-ref.xhtml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=utf-8" />
+ <title>Various tests for semantics</title>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math, p {
+ font: 25px Ahem;
+ }
+ </style>
+</head>
+
+<body>
+<!-- displaystyle (bug 468059) -->
+<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <semantics>
+ <mstyle displaystyle="true">
+ <munderover>
+ <mo movablelimits="true">pXp</mo>
+ <mtext>XpXpXp</mtext>
+ <mtext>XpXpXp</mtext>
+ </munderover>
+ </mstyle>
+ </semantics>
+</math></p>
+
+<!-- unwanted whitespace (bug 512418) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mrow>
+ <mo>lcm</mo>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>,</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ <mo>=</mo>
+ <mfrac>
+ <mrow>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>&#x2062;</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ <mrow>
+ <mo>gcd</mo>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>,</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ </mfrac>
+ </mrow>
+</math>XpXpXp</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-1.xhtml b/layout/reftests/mathml/semantics-1.xhtml
new file mode 100644
index 0000000000..d4ea92a4e5
--- /dev/null
+++ b/layout/reftests/mathml/semantics-1.xhtml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="content-type"
+ content="application/xhtml+xml; charset=utf-8" />
+ <title>Various tests for semantics</title>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math, p {
+ font: 25px Ahem;
+ }
+</style>
+</head>
+
+<body>
+<!-- displaystyle (bug 468059) -->
+<p><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <semantics>
+ <munderover>
+ <mo movablelimits="true">pXp</mo>
+ <mtext>XpXpXp</mtext>
+ <mtext>XpXpXp</mtext>
+ </munderover>
+ </semantics>
+</math></p>
+
+<!-- unwanted whitespace (bug 512418) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <semantics>
+ <mrow>
+ <mrow>
+ <mo>lcm</mo>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>,</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ <mo>=</mo>
+ <mfrac>
+ <mrow>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>&#x2062;</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ <mrow>
+ <mo>gcd</mo>
+ <mo>(</mo>
+ <mn>a</mn>
+ <mo>,</mo>
+ <mn>b</mn>
+ <mo>)</mo>
+ </mrow>
+ </mfrac>
+ </mrow>
+ </semantics>
+</math>XpXpXp</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-2-ref.html b/layout/reftests/mathml/semantics-2-ref.html
new file mode 100644
index 0000000000..43b52b17db
--- /dev/null
+++ b/layout/reftests/mathml/semantics-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Various tests for semantics</title>
+ <meta charset="utf-8"/>
+</head>
+
+<body>
+ <p>Empty semantics: <math><mrow></mrow></math></p>
+ <p>annotation: <math><mrow><annotation>annotation</annotation></mrow></math></p>
+ <p>annotation-xml: <math><mrow><annotation-xml encoding="MathML-Presentation"><mtext>annotation-xml</mtext></annotation-xml></mrow></math></p>
+ <p>presentation MathML (no annotations): <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
+ <p>content MathML (no annotations): <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
+ <p>presentation MathML ; annotation: <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
+ <p>presentation MathML ; annotation-xml: <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
+ <p>content MathML ; annotation: <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
+ <p>content MathML ; annotation-xml: <math><mrow><csymbol>content MathML</csymbol></mrow></math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-2.html b/layout/reftests/mathml/semantics-2.html
new file mode 100644
index 0000000000..2c7d99ac3d
--- /dev/null
+++ b/layout/reftests/mathml/semantics-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Various tests for semantics</title>
+ <meta charset="utf-8"/>
+</head>
+
+<body>
+ <p>Empty semantics: <math><semantics></semantics></math></p>
+ <p>annotation: <math><semantics><annotation>annotation</annotation></semantics></math></p>
+ <p>annotation-xml: <math><semantics><annotation-xml encoding="MathML-Presentation"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
+ <p>presentation MathML (no annotations): <math><semantics><mtext>presentation MathML</mtext></semantics></math></p>
+ <p>content MathML (no annotations): <math><semantics><csymbol>content MathML</csymbol></semantics></math></p>
+ <p>presentation MathML ; annotation: <math><semantics><mtext>presentation MathML</mtext><annotation>annotation</annotation></semantics></math></p>
+ <p>presentation MathML ; annotation-xml: <math><semantics><mtext>presentation MathML</mtext><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
+ <p>content MathML ; annotation: <math><semantics><csymbol>content MathML</csymbol><annotation>annotation</annotation></semantics></math></p>
+ <p>content MathML ; annotation-xml: <math><semantics><csymbol>content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml></semantics></math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-3-ref.html b/layout/reftests/mathml/semantics-3-ref.html
new file mode 100644
index 0000000000..8d42de963c
--- /dev/null
+++ b/layout/reftests/mathml/semantics-3-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Various tests for semantics</title>
+ <meta charset="utf-8"/>
+</head>
+
+<body>
+ <p>annotation 1: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation 2: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation 3: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+
+ <p>annotation-xml 1: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 2: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 3: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 4: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 5: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 6: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+ <p>annotation-xml 7: <math><mrow><csymbol>Content MathML</csymbol></mrow></math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-3.html b/layout/reftests/mathml/semantics-3.html
new file mode 100644
index 0000000000..92a93c774f
--- /dev/null
+++ b/layout/reftests/mathml/semantics-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Various tests for semantics</title>
+ <meta charset="utf-8"/>
+</head>
+
+<body>
+ <p>annotation 1: <math><semantics><csymbol>Content MathML</csymbol><annotation>annotation</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
+ <p>annotation 2: <math><semantics><csymbol>Content MathML</csymbol><annotation encoding="application/x-tex">\sin x + 5</annotation><annotation>error</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
+ <p>annotation 3: <math><semantics><csymbol>Content MathML</csymbol><annotation src="external-resource">error</annotation><annotation>annotation</annotation><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml></semantics></math></p>
+
+ <p>annotation-xml 1: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/mathml-presentation+xml"><mtext>application/mathml-presentation+xml</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 2: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="MathML-Presentation"><mtext>MathML-Presentation</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 3: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="image/svg+xml"><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">image/svg+xml</text></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 4: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="SVG1.1"><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">SVG1.1</text></svg></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 5: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="application/xhtml+xml"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>application/xhtml+xml</title></head><body><p>application/xhtml+xml</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></math></p>
+ <p>annotation-xml 6: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="text/html"><html><head><title>text/html</title></head><body><p>text/html</p></body></html></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>error</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+ <p>annotation-xml 7: <math><semantics><csymbol>Content MathML</csymbol><annotation-xml encoding="unknown"><mtext>error</mtext></annotation-xml><annotation-xml encoding="application/mathml-presentation+xml"><mtext>annotation-xml</mtext></annotation-xml><annotation>error</annotation></semantics></math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-5-ref.html b/layout/reftests/mathml/semantics-5-ref.html
new file mode 100644
index 0000000000..9184cdcc81
--- /dev/null
+++ b/layout/reftests/mathml/semantics-5-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>semantics - embellished operator (bug 21479)</title>
+ <meta charset="utf-8"/>
+</head>
+<body>
+ <p>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mspace width="300px" height="10px" mathbackground="black"></mspace>
+ <mo>&#xaf;</mo>
+ </mover>
+ </math>
+ </p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/semantics-5.html b/layout/reftests/mathml/semantics-5.html
new file mode 100644
index 0000000000..0c2ad9541a
--- /dev/null
+++ b/layout/reftests/mathml/semantics-5.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>semantics - embellished operator (bug 21479)</title>
+ <meta charset="utf-8"/>
+</head>
+<body>
+ <p>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mspace width="300px" height="10px" mathbackground="black"></mspace>
+ <semantics><mo>&#xaf;</mo></semantics>
+ </mover>
+ </math>
+ </p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-1-ref.html b/layout/reftests/mathml/stretchy-1-ref.html
new file mode 100644
index 0000000000..23950c02fa
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-1-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test stretchy equal (bug 854339)</title></head>
+ <body>
+
+ <math>
+ <munder>
+ <mi>AVERYLONGBASE</mi>
+ <mo stretchy="false">=</mo>
+ </munder>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-1.html b/layout/reftests/mathml/stretchy-1.html
new file mode 100644
index 0000000000..d4cfcb24f5
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-1.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test stretchy equal (bug 854339)</title></head>
+ <body>
+
+ <math>
+ <munder>
+ <mi>AVERYLONGBASE</mi>
+ <mo stretchy="true">=</mo>
+ </munder>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-1-ref.html b/layout/reftests/mathml/stretchy-largeop-1-ref.html
new file mode 100644
index 0000000000..b65a38958f
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-1-ref.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo0">(</mo>
+ <mo>∫</mo>
+ <mo id="mo1">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mo id="mo0a">(</mo>
+ <mo>∫</mo>
+ <mo id="mo1a">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo2">(</mo>
+ <mo>&Product;</mo>
+ <mo id="mo3">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mo id="mo2a">(</mo>
+ <mo>&Product;</mo>
+ <mo id="mo3a">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <!-- &bigotimes; included in the test to check for an assertion involving
+ the direction of the largeop pre-stretch -->
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo4">(</mo>
+ <mo>&bigotimes;</mo>
+ <mo id="mo5">)</mo>
+ <mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-1.html b/layout/reftests/mathml/stretchy-largeop-1.html
new file mode 100644
index 0000000000..bb63c8a435
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-1.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+
+ function verifyGreaterThan(aElement, aReference) {
+ /* Verify that the height of the element is greater than that of the
+ reference, and otherwise paint the element in red. */
+ var element = document.getElementById(aElement);
+ var ref = document.getElementById(aReference);
+ if (element.getBoundingClientRect().height -
+ ref.getBoundingClientRect().height <= 1) {
+ element.setAttribute("mathcolor", "red");
+ }
+ }
+
+ function doTest() {
+ /* Ensure that the parentheses in the displaystyle case stretch more
+ than the alternative. */
+ verifyGreaterThan("mo0", "mo0a");
+ verifyGreaterThan("mo1", "mo1a");
+ verifyGreaterThan("mo2", "mo2a");
+ verifyGreaterThan("mo3", "mo3a");
+
+ document.documentElement.removeAttribute("class");
+
+ }
+ </script>
+ </head>
+ <body onload="doTest();">
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo0">(</mo>
+ <mo>∫</mo>
+ <mo id="mo1">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mo id="mo0a">(</mo>
+ <mo>∫</mo>
+ <mo id="mo1a">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo2">(</mo>
+ <mo>&Product;</mo>
+ <mo id="mo3">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mo id="mo2a">(</mo>
+ <mo>&Product;</mo>
+ <mo id="mo3a">)</mo>
+ <mrow>
+ </math>
+ </p>
+ <p>
+ <!-- &bigotimes; included in the test to check for an assertion involving
+ the direction of the largeop pre-stretch -->
+ <math displaystyle="true">
+ <mrow>
+ <mo id="mo4">(</mo>
+ <mo>&bigotimes;</mo>
+ <mo id="mo5">)</mo>
+ <mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-2-ref.html b/layout/reftests/mathml/stretchy-largeop-2-ref.html
new file mode 100644
index 0000000000..d06d26527b
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-2-ref.html
@@ -0,0 +1,111 @@
+<!DOCTYPE html>
+<!-- Test that non-stretchy largeops are bigger in display mode -->
+
+<html>
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo0">&bigodot;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo1">&bigoplus;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo2">&#x2a03;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo3">&#x2a05;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo4">&#x2a07;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo5">&#x2a08;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo6">&#x2a09;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo7">&#x2a0a;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo8">&#x2afc;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo9">&#x2aff;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef0">&bigodot;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef1">&bigoplus;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef2">&#x2a03;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef3">&#x2a05;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef4">&#x2a07;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef5">&#x2a08;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef6">&#x2a09;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef7">&#x2a0a;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef8">&#x2afc;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef9">&#x2aff;</mo>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-2.html b/layout/reftests/mathml/stretchy-largeop-2.html
new file mode 100644
index 0000000000..c7f40580ec
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-2.html
@@ -0,0 +1,137 @@
+<!DOCTYPE html>
+<!-- Test that non-stretchy largeops are bigger in display mode -->
+
+<html class="reftest-wait">
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+
+ function verifyGreaterThan(aElement, aReference) {
+ /* Verify that the height of the element is greater than that of the
+ reference, and otherwise paint the element in red. */
+ var element = document.getElementById(aElement);
+ var ref = document.getElementById(aReference);
+ if (element.getBoundingClientRect().height -
+ ref.getBoundingClientRect().height <= 1) {
+ element.setAttribute("mathcolor", "red");
+ }
+ }
+
+ function doTest() {
+ /* Ensure that largeops are bigger in displaystyle */
+ var numTests = 10; // zero indexed
+ var opPrefix = "mo";
+ var refPrefix = "moRef";
+ for (var i = 0; i < numTests; i++)
+ {
+ verifyGreaterThan(opPrefix + i, refPrefix + i);
+ }
+ document.documentElement.removeAttribute("class");
+
+ }
+ </script>
+ </head>
+ <body onload="doTest();">
+ <p>
+ <math displaystyle="true">
+ <mo id="mo0">&bigodot;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo1">&bigoplus;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo2">&#x2a03;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo3">&#x2a05;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo4">&#x2a07;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo5">&#x2a08;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo6">&#x2a09;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo7">&#x2a0a;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo8">&#x2afc;</mo>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="mo9">&#x2aff;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef0">&bigodot;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef1">&bigoplus;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef2">&#x2a03;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef3">&#x2a05;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef4">&#x2a07;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef5">&#x2a08;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef6">&#x2a09;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef7">&#x2a0a;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef8">&#x2afc;</mo>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mo id="moRef9">&#x2aff;</mo>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-largeop-3-ref.html b/layout/reftests/mathml/stretchy-largeop-3-ref.html
new file mode 100644
index 0000000000..83837c8b30
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-3-ref.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<!-- Test that non-stretchy largeops do not stretch -->
+
+<html>
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8" />
+ </head>
+ <body>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo0">&bigodot;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo1">&bigoplus;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo2">&#x2a03;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo3">&#x2a05;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo4">&#x2a07;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo5">&#x2a08;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo6">&#x2a09;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo7">&#x2a0a;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo8">&#x2afc;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo9">&#x2aff;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="moRef0">&bigodot;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef1">&bigoplus;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef2">&#x2a03;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef3">&#x2a05;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef4">&#x2a07;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef5">&#x2a08;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef6">&#x2a09;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef7">&#x2a0a;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef8">&#x2afc;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef9">&#x2aff;</mo>
+ </math>
+ </p>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/stretchy-largeop-3.html b/layout/reftests/mathml/stretchy-largeop-3.html
new file mode 100644
index 0000000000..5fe3149894
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-largeop-3.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<!-- Test that non-stretchy largeops do not stretch -->
+
+<html class="reftest-wait">
+ <head>
+ <title>Largeop stretching</title>
+ <meta charset="utf-8" />
+ <script type="text/javascript">
+
+ function almostEqual(aX, aY) {
+ var epsilon = 2;
+ return Math.abs(aX - aY) < epsilon;
+ }
+
+ function verifySize(aElement, aReference) {
+ /* Verify if the size of the element matches the reference, and
+ otherwise paint the element in red. */
+ var element = document.getElementById(aElement);
+ var ref = document.getElementById(aReference);
+ if (!almostEqual(element.getBoundingClientRect().height,
+ ref.getBoundingClientRect().height) ||
+ !almostEqual(element.getBoundingClientRect().width,
+ ref.getBoundingClientRect().width)) {
+ element.setAttribute("mathcolor", "red");
+ }
+ }
+
+ function doTest() {
+ /* Ensure that largeops are bigger in displaystyle */
+ var numTests = 10; // zero indexed
+ var opPrefix = "mo";
+ var refPrefix = "moRef";
+ for (var i = 0; i < numTests; i++)
+ {
+ verifySize(opPrefix + i, refPrefix + i);
+ }
+ document.documentElement.removeAttribute("class");
+
+ }
+ </script>
+ </head>
+ <body onload="doTest();">
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo0">&bigodot;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo1">&bigoplus;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo2">&#x2a03;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo3">&#x2a05;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo4">&#x2a07;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo5">&#x2a08;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo6">&#x2a09;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo7">&#x2a0a;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo8">&#x2afc;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mrow>
+ <mspace height="3em" />
+ <mo id="mo9">&#x2aff;</mo>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math displaystyle="true">
+ <mo id="moRef0">&bigodot;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef1">&bigoplus;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef2">&#x2a03;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef3">&#x2a05;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef4">&#x2a07;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef5">&#x2a08;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef6">&#x2a09;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef7">&#x2a0a;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef8">&#x2afc;</mo>
+ </math>
+ <math displaystyle="true">
+ <mo id="moRef9">&#x2aff;</mo>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/subscript-italic-correction-ref.html b/layout/reftests/mathml/subscript-italic-correction-ref.html
new file mode 100644
index 0000000000..a4527325cd
--- /dev/null
+++ b/layout/reftests/mathml/subscript-italic-correction-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>subscript</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body style="background: #5f5; font-size: 50px;">
+
+ <div>
+ <math>
+ <msubsup>
+ <mi mathbackground="#5f5">f</mi>
+ <mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
+ </msubsup>
+ </math>
+ </div>
+
+ <br/>
+
+ <div>
+ <math>
+ <mmultiscripts>
+ <mi mathbackground="#5f5">f</mi>
+ <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s5" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s6" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s7" width="50px" height="50px" mathbackground="blue"/>
+ </mmultiscripts>
+ </math>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/subscript-italic-correction.html b/layout/reftests/mathml/subscript-italic-correction.html
new file mode 100644
index 0000000000..04be7ba5f9
--- /dev/null
+++ b/layout/reftests/mathml/subscript-italic-correction.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>subscript</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function verifyItalicCorrections()
+ {
+ var epsilon = 2;
+ for (var i = 0; i < 8; i += 2) {
+ var sub = document.getElementById("s" + i);
+ var sup = document.getElementById("s" + (i+1));
+ var italicCorrection =
+ sup.getBoundingClientRect().left - sub.getBoundingClientRect().left;
+ if (italicCorrection < epsilon) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ function doTest()
+ {
+ if (verifyItalicCorrections()) {
+ document.body.style.background = "#5f5";
+ }
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body style="background: #f00; font-size: 50px;">
+
+ <div>
+ <math>
+ <msubsup>
+ <mi mathbackground="#5f5">f</mi>
+ <mspace id="s0" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s1" width="50px" height="50px" mathbackground="blue"/>
+ </msubsup>
+ </math>
+ </div>
+
+ <br/>
+
+ <div>
+ <math>
+ <mmultiscripts>
+ <mi mathbackground="#5f5">f</mi>
+ <mspace id="s2" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s3" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s4" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s5" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s6" width="50px" height="50px" mathbackground="blue"/>
+ <mspace id="s7" width="50px" height="50px" mathbackground="blue"/>
+ </mmultiscripts>
+ </math>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/underbar-width-1-ref.xhtml b/layout/reftests/mathml/underbar-width-1-ref.xhtml
new file mode 100644
index 0000000000..737673ccb1
--- /dev/null
+++ b/layout/reftests/mathml/underbar-width-1-ref.xhtml
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ html { background-color: grey; }
+ div { display: inline-block;
+ font-size: 30px;
+ line-height: 60px; /* Ensure space for underbar */
+ border: 1px solid white;
+ padding: 2px; /* 10% error allowed in char selection */
+ background-color: black;
+ color: red; }
+ </style>
+ </head>
+<body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <munder>
+ <mn>1</mn>
+ <mo>&#x332;</mo>
+ </munder>
+ </mphantom>
+ </math>
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/mathml/underbar-width-1.xhtml b/layout/reftests/mathml/underbar-width-1.xhtml
new file mode 100644
index 0000000000..473b25b91d
--- /dev/null
+++ b/layout/reftests/mathml/underbar-width-1.xhtml
@@ -0,0 +1,25 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Check width of stretchy OverBar</title>
+ <style type="text/css">
+ html { background-color: grey; }
+ div { display: inline-block;
+ font-size: 30px;
+ line-height: 60px; /* Ensure space for underbar */
+ border: 1px solid white;
+ padding: 2px; /* 10% error allowed in char selection */
+ background-color: black;
+ color: black; }
+ </style>
+ </head>
+<body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mn>1</mn>
+ <mo>&#x332;</mo>
+ </munder>
+ </math>
+ </div>
+</body>
+</html>