summaryrefslogtreecommitdiffstats
path: root/layout/reftests/mathml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:44:51 +0000
commit9e3c08db40b8916968b9f30096c7be3f00ce9647 (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/mathml
parentInitial commit. (diff)
downloadthunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.tar.xz
thunderbird-9e3c08db40b8916968b9f30096c7be3f00ce9647.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/mathml')
-rw-r--r--layout/reftests/mathml/162063-mathml.xhtml41
-rw-r--r--layout/reftests/mathml/345563-sub.xhtml22
-rw-r--r--layout/reftests/mathml/345563-sup.xhtml22
-rw-r--r--layout/reftests/mathml/347348-1-ref.xhtml17
-rw-r--r--layout/reftests/mathml/347348-1.xhtml24
-rw-r--r--layout/reftests/mathml/347496-1-ref.xhtml22
-rw-r--r--layout/reftests/mathml/347496-1.xhtml22
-rw-r--r--layout/reftests/mathml/355548-1-ref.xml36
-rw-r--r--layout/reftests/mathml/355548-1.xml36
-rw-r--r--layout/reftests/mathml/355548-2-ref.xml24
-rw-r--r--layout/reftests/mathml/355548-2.xml36
-rw-r--r--layout/reftests/mathml/355548-3-ref.xml53
-rw-r--r--layout/reftests/mathml/355548-3.xml60
-rw-r--r--layout/reftests/mathml/355548-4-ref.xml11
-rw-r--r--layout/reftests/mathml/355548-4.xml41
-rw-r--r--layout/reftests/mathml/355548-5-ref.xml7
-rw-r--r--layout/reftests/mathml/355548-5.xml7
-rw-r--r--layout/reftests/mathml/370692-1-ref.xhtml12
-rw-r--r--layout/reftests/mathml/370692-1.xhtml12
-rw-r--r--layout/reftests/mathml/373533-1.xhtml32
-rw-r--r--layout/reftests/mathml/373533-2.xhtml31
-rw-r--r--layout/reftests/mathml/373533-3.xhtml31
-rw-r--r--layout/reftests/mathml/393760-1-ref.xml27
-rw-r--r--layout/reftests/mathml/393760-1.xml27
-rw-r--r--layout/reftests/mathml/393760-2-ref.xml5
-rw-r--r--layout/reftests/mathml/393760-2.xml11
-rw-r--r--layout/reftests/mathml/414123-ref.xhtml33
-rw-r--r--layout/reftests/mathml/414123.xhtml42
-rw-r--r--layout/reftests/mathml/columnlines-1-ref.html77
-rw-r--r--layout/reftests/mathml/columnlines-1a.html77
-rw-r--r--layout/reftests/mathml/columnlines-1b.html77
-rw-r--r--layout/reftests/mathml/columnlines-1c.html77
-rw-r--r--layout/reftests/mathml/columnlines-2-ref.html41
-rw-r--r--layout/reftests/mathml/columnlines-2a.html41
-rw-r--r--layout/reftests/mathml/columnlines-2b.html41
-rw-r--r--layout/reftests/mathml/columnlines-3-1-ref.html32
-rw-r--r--layout/reftests/mathml/columnlines-3-1.html48
-rw-r--r--layout/reftests/mathml/columnlines-3-2-ref.html32
-rw-r--r--layout/reftests/mathml/columnlines-3-2.html48
-rw-r--r--layout/reftests/mathml/css-spacing-1-ref.html36
-rw-r--r--layout/reftests/mathml/css-spacing-1.html29
-rw-r--r--layout/reftests/mathml/default-font-ref.html14
-rw-r--r--layout/reftests/mathml/default-font.html15
-rw-r--r--layout/reftests/mathml/dir-1-ref.html61
-rw-r--r--layout/reftests/mathml/dir-1.html61
-rw-r--r--layout/reftests/mathml/dir-2-ref.html61
-rw-r--r--layout/reftests/mathml/dir-2.html61
-rw-r--r--layout/reftests/mathml/dir-3-ref.html11
-rw-r--r--layout/reftests/mathml/dir-3.html105
-rw-r--r--layout/reftests/mathml/dir-4-ref.html18
-rw-r--r--layout/reftests/mathml/dir-5-ref.html37
-rw-r--r--layout/reftests/mathml/dir-5.html76
-rw-r--r--layout/reftests/mathml/dir-6a-ref.html67
-rw-r--r--layout/reftests/mathml/dir-6a.html67
-rw-r--r--layout/reftests/mathml/disabled-scriptlevel-1-ref.html129
-rw-r--r--layout/reftests/mathml/disabled-scriptlevel-1-ref.xhtml133
-rw-r--r--layout/reftests/mathml/disabled-scriptlevel-1.html129
-rw-r--r--layout/reftests/mathml/disabled-scriptlevel-1.xhtml133
-rw-r--r--layout/reftests/mathml/dtls-1-ref.html132
-rw-r--r--layout/reftests/mathml/dtls-1.html134
-rw-r--r--layout/reftests/mathml/dtls-2-ref.html175
-rw-r--r--layout/reftests/mathml/dtls-2.html213
-rw-r--r--layout/reftests/mathml/dtls-3-ref.html175
-rw-r--r--layout/reftests/mathml/dtls-3.html216
-rw-r--r--layout/reftests/mathml/dynamic-mi-ref.xhtml11
-rw-r--r--layout/reftests/mathml/dynamic-mi.xhtml11
-rw-r--r--layout/reftests/mathml/embellished-op-1-1-ref.html21
-rw-r--r--layout/reftests/mathml/embellished-op-1-1.html21
-rw-r--r--layout/reftests/mathml/embellished-op-1-2-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-2.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-3-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-3.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-4-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-4.html18
-rw-r--r--layout/reftests/mathml/embellished-op-1-5-ref.html22
-rw-r--r--layout/reftests/mathml/embellished-op-1-5.html22
-rw-r--r--layout/reftests/mathml/embellished-op-2-1-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-2-1.html18
-rw-r--r--layout/reftests/mathml/embellished-op-2-2-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-2-2.html18
-rw-r--r--layout/reftests/mathml/embellished-op-2-3-ref.html22
-rw-r--r--layout/reftests/mathml/embellished-op-2-3.html18
-rw-r--r--layout/reftests/mathml/embellished-op-2-4-ref.html26
-rw-r--r--layout/reftests/mathml/embellished-op-2-4.html26
-rw-r--r--layout/reftests/mathml/embellished-op-3-1-ref.html25
-rw-r--r--layout/reftests/mathml/embellished-op-3-1.html25
-rw-r--r--layout/reftests/mathml/embellished-op-3-2-ref.html19
-rw-r--r--layout/reftests/mathml/embellished-op-3-2.html19
-rw-r--r--layout/reftests/mathml/embellished-op-3-3-ref.html21
-rw-r--r--layout/reftests/mathml/embellished-op-3-3.html19
-rw-r--r--layout/reftests/mathml/embellished-op-3-4-ref.html21
-rw-r--r--layout/reftests/mathml/embellished-op-3-4.html21
-rw-r--r--layout/reftests/mathml/embellished-op-3-5-ref.html21
-rw-r--r--layout/reftests/mathml/embellished-op-3-5.html19
-rw-r--r--layout/reftests/mathml/embellished-op-4-1-ref.html21
-rw-r--r--layout/reftests/mathml/embellished-op-4-1.html18
-rw-r--r--layout/reftests/mathml/embellished-op-4-2-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-4-2.html18
-rw-r--r--layout/reftests/mathml/embellished-op-4-3-ref.html18
-rw-r--r--layout/reftests/mathml/embellished-op-4-3.html18
-rw-r--r--layout/reftests/mathml/embellished-op-5-1.html22
-rw-r--r--layout/reftests/mathml/embellished-op-5-2.html20
-rw-r--r--layout/reftests/mathml/embellished-op-5-ref.html17
-rw-r--r--layout/reftests/mathml/font-inflation-1-ref.html74
-rw-r--r--layout/reftests/mathml/font-inflation-1.html107
-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/link-1.xhtml12
-rw-r--r--layout/reftests/mathml/link-ref.xhtml11
-rw-r--r--layout/reftests/mathml/maction-dynamic-1-ref.html58
-rw-r--r--layout/reftests/mathml/maction-dynamic-1.html107
-rw-r--r--layout/reftests/mathml/maction-dynamic-2-ref.html52
-rw-r--r--layout/reftests/mathml/maction-dynamic-2.html96
-rw-r--r--layout/reftests/mathml/maction-dynamic-3-ref.html36
-rw-r--r--layout/reftests/mathml/maction-dynamic-3.html138
-rw-r--r--layout/reftests/mathml/maction-dynamic-embellished-op-ref.html41
-rw-r--r--layout/reftests/mathml/maction-dynamic-embellished-op.html67
-rw-r--r--layout/reftests/mathml/maction-selection-ref.html49
-rw-r--r--layout/reftests/mathml/maction-selection.html64
-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/mathml-negativespace-ref.html55
-rw-r--r--layout/reftests/mathml/mathml-negativespace.html54
-rw-r--r--layout/reftests/mathml/mathml-type-supported-ref.xml4
-rw-r--r--layout/reftests/mathml/mathml-type-supported.xhtml10
-rw-r--r--layout/reftests/mathml/mathscript-1-ref.html45
-rw-r--r--layout/reftests/mathml/mathscript-1.html37
-rw-r--r--layout/reftests/mathml/mathscript-2-ref.html25
-rw-r--r--layout/reftests/mathml/mathscript-2.html39
-rw-r--r--layout/reftests/mathml/mathssty.woffbin0 -> 1384 bytes
-rw-r--r--layout/reftests/mathml/mathvariant-1a-ref.html233
-rw-r--r--layout/reftests/mathml/mathvariant-1a.html224
-rw-r--r--layout/reftests/mathml/mathvariant-1b-ref.html126
-rw-r--r--layout/reftests/mathml/mathvariant-1b.html126
-rw-r--r--layout/reftests/mathml/mathvariant-1c-ref.html247
-rw-r--r--layout/reftests/mathml/mathvariant-1c.html247
-rw-r--r--layout/reftests/mathml/mathvariant-1d-ref.html64
-rw-r--r--layout/reftests/mathml/mathvariant-1d.html64
-rw-r--r--layout/reftests/mathml/mathvariant-2-ref.html25
-rw-r--r--layout/reftests/mathml/mathvariant-2.html25
-rw-r--r--layout/reftests/mathml/mathvariant-4-ref.html55
-rw-r--r--layout/reftests/mathml/mathvariant-4.html46
-rw-r--r--layout/reftests/mathml/mathvariant-5-ref.html49
-rw-r--r--layout/reftests/mathml/mathvariant-5.html70
-rw-r--r--layout/reftests/mathml/menclose-1-ref.html21
-rw-r--r--layout/reftests/mathml/menclose-1a.html21
-rw-r--r--layout/reftests/mathml/menclose-1b.html21
-rw-r--r--layout/reftests/mathml/menclose-1d.html21
-rw-r--r--layout/reftests/mathml/menclose-1e.html21
-rw-r--r--layout/reftests/mathml/menclose-1f.html21
-rw-r--r--layout/reftests/mathml/menclose-1g.html21
-rw-r--r--layout/reftests/mathml/menclose-1h.html21
-rw-r--r--layout/reftests/mathml/menclose-1i.html21
-rw-r--r--layout/reftests/mathml/menclose-1j.html21
-rw-r--r--layout/reftests/mathml/menclose-1k.html21
-rw-r--r--layout/reftests/mathml/menclose-1l.html21
-rw-r--r--layout/reftests/mathml/menclose-1m.html21
-rw-r--r--layout/reftests/mathml/menclose-1n.html21
-rw-r--r--layout/reftests/mathml/menclose-1o.html21
-rw-r--r--layout/reftests/mathml/menclose-1p.html21
-rw-r--r--layout/reftests/mathml/menclose-1q.html13
-rw-r--r--layout/reftests/mathml/menclose-2-actuarial-ref.html38
-rw-r--r--layout/reftests/mathml/menclose-2-actuarial.html36
-rw-r--r--layout/reftests/mathml/menclose-2-bottom-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-bottom.html35
-rw-r--r--layout/reftests/mathml/menclose-2-box-ref.html39
-rw-r--r--layout/reftests/mathml/menclose-2-box.html37
-rw-r--r--layout/reftests/mathml/menclose-2-circle-ref.html38
-rw-r--r--layout/reftests/mathml/menclose-2-circle.html36
-rw-r--r--layout/reftests/mathml/menclose-2-downdiagonalstrike-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-downdiagonalstrike.html35
-rw-r--r--layout/reftests/mathml/menclose-2-horizontalstrike-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-horizontalstrike.html35
-rw-r--r--layout/reftests/mathml/menclose-2-left-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-left.html35
-rw-r--r--layout/reftests/mathml/menclose-2-longdiv-ref.html39
-rw-r--r--layout/reftests/mathml/menclose-2-longdiv.html37
-rw-r--r--layout/reftests/mathml/menclose-2-phasorangle-ref.html41
-rw-r--r--layout/reftests/mathml/menclose-2-phasorangle.html39
-rw-r--r--layout/reftests/mathml/menclose-2-right-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-right.html35
-rw-r--r--layout/reftests/mathml/menclose-2-roundedbox-ref.html36
-rw-r--r--layout/reftests/mathml/menclose-2-roundedbox.html34
-rw-r--r--layout/reftests/mathml/menclose-2-top-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-top.html35
-rw-r--r--layout/reftests/mathml/menclose-2-updiagonalarrow-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-updiagonalarrow.html35
-rw-r--r--layout/reftests/mathml/menclose-2-updiagonalstrike-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-updiagonalstrike.html35
-rw-r--r--layout/reftests/mathml/menclose-2-verticalstrike-ref.html37
-rw-r--r--layout/reftests/mathml/menclose-2-verticalstrike.html35
-rw-r--r--layout/reftests/mathml/menclose-3-box-ref.html15
-rw-r--r--layout/reftests/mathml/menclose-3-box.html15
-rw-r--r--layout/reftests/mathml/menclose-3-default-ref.html15
-rw-r--r--layout/reftests/mathml/menclose-3-default.html15
-rw-r--r--layout/reftests/mathml/menclose-3-invalid-ref.html13
-rw-r--r--layout/reftests/mathml/menclose-3-invalid.html15
-rw-r--r--layout/reftests/mathml/menclose-3-madruwb-ref.html15
-rw-r--r--layout/reftests/mathml/menclose-3-madruwb.html15
-rw-r--r--layout/reftests/mathml/menclose-3-multiple-ref.html15
-rw-r--r--layout/reftests/mathml/menclose-3-multiple.html15
-rw-r--r--layout/reftests/mathml/menclose-3-unknown-ref.html15
-rw-r--r--layout/reftests/mathml/menclose-3-unknown.html15
-rw-r--r--layout/reftests/mathml/menclose-4.html29
-rw-r--r--layout/reftests/mathml/menclose-5-actuarial-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-actuarial.html18
-rw-r--r--layout/reftests/mathml/menclose-5-bottom-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-bottom.html18
-rw-r--r--layout/reftests/mathml/menclose-5-box-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-box.html18
-rw-r--r--layout/reftests/mathml/menclose-5-circle-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-circle.html18
-rw-r--r--layout/reftests/mathml/menclose-5-downdiagonalstrike-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-downdiagonalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-5-horizontalstrike-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-horizontalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-5-left-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-left.html18
-rw-r--r--layout/reftests/mathml/menclose-5-longdiv-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-longdiv.html18
-rw-r--r--layout/reftests/mathml/menclose-5-madruwb-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-madruwb.html18
-rw-r--r--layout/reftests/mathml/menclose-5-phasorangle-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-phasorangle.html18
-rw-r--r--layout/reftests/mathml/menclose-5-right-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-right.html18
-rw-r--r--layout/reftests/mathml/menclose-5-roundedbox-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-roundedbox.html18
-rw-r--r--layout/reftests/mathml/menclose-5-top-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-top.html18
-rw-r--r--layout/reftests/mathml/menclose-5-updiagonalarrow-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-updiagonalarrow.html18
-rw-r--r--layout/reftests/mathml/menclose-5-updiagonalstrike-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-updiagonalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-5-verticalstrike-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-5-verticalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-6-actuarial.html18
-rw-r--r--layout/reftests/mathml/menclose-6-bottom.html18
-rw-r--r--layout/reftests/mathml/menclose-6-box.html18
-rw-r--r--layout/reftests/mathml/menclose-6-circle.html18
-rw-r--r--layout/reftests/mathml/menclose-6-downdiagonalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-6-horizontalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-6-left.html18
-rw-r--r--layout/reftests/mathml/menclose-6-longdiv.html18
-rw-r--r--layout/reftests/mathml/menclose-6-madruwb.html18
-rw-r--r--layout/reftests/mathml/menclose-6-phasorangle.html22
-rw-r--r--layout/reftests/mathml/menclose-6-ref.html11
-rw-r--r--layout/reftests/mathml/menclose-6-right.html18
-rw-r--r--layout/reftests/mathml/menclose-6-roundedbox.html18
-rw-r--r--layout/reftests/mathml/menclose-6-top.html18
-rw-r--r--layout/reftests/mathml/menclose-6-updiagonalarrow.html18
-rw-r--r--layout/reftests/mathml/menclose-6-updiagonalstrike.html18
-rw-r--r--layout/reftests/mathml/menclose-6-verticalstrike.html18
-rw-r--r--layout/reftests/mathml/mfrac-A-4-ref.html16
-rw-r--r--layout/reftests/mathml/mfrac-A-4.html18
-rw-r--r--layout/reftests/mathml/mfrac-A-5-ref.html14
-rw-r--r--layout/reftests/mathml/mfrac-A-5.html14
-rw-r--r--layout/reftests/mathml/mfrac-A-8-ref.html16
-rw-r--r--layout/reftests/mathml/mfrac-A-8.html18
-rw-r--r--layout/reftests/mathml/mfrac-B-2-3-ref.html14
-rw-r--r--layout/reftests/mathml/mfrac-B-2.html21
-rw-r--r--layout/reftests/mathml/mfrac-B-3.html21
-rw-r--r--layout/reftests/mathml/mfrac-C-2-ref.html14
-rw-r--r--layout/reftests/mathml/mfrac-C-2.html21
-rw-r--r--layout/reftests/mathml/mfrac-D-2-ref.html14
-rw-r--r--layout/reftests/mathml/mfrac-D-2.html21
-rw-r--r--layout/reftests/mathml/mfrac-E-1-ref.html20
-rw-r--r--layout/reftests/mathml/mfrac-E-1.html31
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-1-ref.xhtml22
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-1.xhtml22
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-2-ref.xhtml22
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-2.xhtml22
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-3-ref.xhtml37
-rw-r--r--layout/reftests/mathml/mfrac-linethickness-3.xhtml37
-rw-r--r--layout/reftests/mathml/mi-mathvariant-1-ref.xhtml9
-rw-r--r--layout/reftests/mathml/mi-mathvariant-1.xhtml9
-rw-r--r--layout/reftests/mathml/mi-mathvariant-2-ref.xhtml17
-rw-r--r--layout/reftests/mathml/mi-mathvariant-2.xhtml9
-rw-r--r--layout/reftests/mathml/mi-mathvariant-3-ref.html12
-rw-r--r--layout/reftests/mathml/mi-mathvariant-3.html14
-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-accent-dynamic-ref.html12
-rw-r--r--layout/reftests/mathml/mo-accent-dynamic.html19
-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/mo-invisibleoperators-2-ref.html28
-rw-r--r--layout/reftests/mathml/mo-invisibleoperators-2.html42
-rw-r--r--layout/reftests/mathml/mo-invisibleoperators-ref.html13
-rw-r--r--layout/reftests/mathml/mo-invisibleoperators.html26
-rw-r--r--layout/reftests/mathml/mo-movablelimits-dynamic-ref.html15
-rw-r--r--layout/reftests/mathml/mo-movablelimits-dynamic.html22
-rw-r--r--layout/reftests/mathml/mpadded-1-2-ref.html33
-rw-r--r--layout/reftests/mathml/mpadded-1-2.html16
-rw-r--r--layout/reftests/mathml/mpadded-1-ref.html33
-rw-r--r--layout/reftests/mathml/mpadded-1.html16
-rw-r--r--layout/reftests/mathml/mpadded-2-ref.html32
-rw-r--r--layout/reftests/mathml/mpadded-2.html16
-rw-r--r--layout/reftests/mathml/mpadded-3-ref.html37
-rw-r--r--layout/reftests/mathml/mpadded-3.html16
-rw-r--r--layout/reftests/mathml/mpadded-4-ref.html16
-rw-r--r--layout/reftests/mathml/mpadded-4.html17
-rw-r--r--layout/reftests/mathml/mpadded-5-ref.html45
-rw-r--r--layout/reftests/mathml/mpadded-5.html19
-rw-r--r--layout/reftests/mathml/mpadded-6-ref.html16
-rw-r--r--layout/reftests/mathml/mpadded-6.html17
-rw-r--r--layout/reftests/mathml/mpadded-7-ref.html22
-rw-r--r--layout/reftests/mathml/mpadded-7.html23
-rw-r--r--layout/reftests/mathml/mpadded-8-ref.html22
-rw-r--r--layout/reftests/mathml/mpadded-8.html23
-rw-r--r--layout/reftests/mathml/mpadded-9-ref.html23
-rw-r--r--layout/reftests/mathml/mpadded-9.html24
-rw-r--r--layout/reftests/mathml/mphantom-1-ref.html12
-rw-r--r--layout/reftests/mathml/mphantom-1.html29
-rw-r--r--layout/reftests/mathml/mphantom-2-ref.html22
-rw-r--r--layout/reftests/mathml/mphantom-2.html25
-rw-r--r--layout/reftests/mathml/mspace-1-ref.html27
-rw-r--r--layout/reftests/mathml/mspace-1.html18
-rw-r--r--layout/reftests/mathml/mstyle-1-ref.xhtml123
-rw-r--r--layout/reftests/mathml/mstyle-1.xhtml123
-rw-r--r--layout/reftests/mathml/mstyle-2-ref.xhtml144
-rw-r--r--layout/reftests/mathml/mstyle-2.xhtml147
-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/mstyle-5-ref.xhtml17
-rw-r--r--layout/reftests/mathml/mstyle-5.xhtml20
-rw-r--r--layout/reftests/mathml/mtable-align-negative-rownumber-2-ref.html21
-rw-r--r--layout/reftests/mathml/mtable-align-negative-rownumber-2.html21
-rw-r--r--layout/reftests/mathml/mtable-align-negative-rownumber-ref.html15
-rw-r--r--layout/reftests/mathml/mtable-align-negative-rownumber.html15
-rw-r--r--layout/reftests/mathml/mtable-align-whitespace-ref.html346
-rw-r--r--layout/reftests/mathml/mtable-align-whitespace.html342
-rw-r--r--layout/reftests/mathml/mtable-columnalign-multi-mtable-dynamic.html146
-rw-r--r--layout/reftests/mathml/mtable-columnalign-multi-mtable.html128
-rw-r--r--layout/reftests/mathml/mtable-columnalign-multi-mtr-dynamic.html155
-rw-r--r--layout/reftests/mathml/mtable-columnalign-multi-mtr.html128
-rw-r--r--layout/reftests/mathml/mtable-columnalign-multi-ref.html128
-rw-r--r--layout/reftests/mathml/mtable-columnalign-single-mtable-dynamic.html146
-rw-r--r--layout/reftests/mathml/mtable-columnalign-single-mtable.html128
-rw-r--r--layout/reftests/mathml/mtable-columnalign-single-mtr-dynamic.html155
-rw-r--r--layout/reftests/mathml/mtable-columnalign-single-mtr.html128
-rw-r--r--layout/reftests/mathml/mtable-columnalign-single-ref.html128
-rw-r--r--layout/reftests/mathml/mtable-columnlines-multi-mtable-dynamic.html105
-rw-r--r--layout/reftests/mathml/mtable-columnlines-multi-ref.html90
-rw-r--r--layout/reftests/mathml/mtable-columnlines-single-mtable-dynamic.html105
-rw-r--r--layout/reftests/mathml/mtable-columnlines-single-ref.html90
-rw-r--r--layout/reftests/mathml/mtable-rowalign-multi-mtable-dynamic.html146
-rw-r--r--layout/reftests/mathml/mtable-rowalign-multi-mtable.html128
-rw-r--r--layout/reftests/mathml/mtable-rowalign-multi-ref.html128
-rw-r--r--layout/reftests/mathml/mtable-rowalign-single-mtable-dynamic.html146
-rw-r--r--layout/reftests/mathml/mtable-rowalign-single-mtable.html128
-rw-r--r--layout/reftests/mathml/mtable-rowalign-single-mtr-dynamic.html155
-rw-r--r--layout/reftests/mathml/mtable-rowalign-single-mtr.html128
-rw-r--r--layout/reftests/mathml/mtable-rowalign-single-ref.html128
-rw-r--r--layout/reftests/mathml/mtable-rowlines-multi-mtable-dynamic.html105
-rw-r--r--layout/reftests/mathml/mtable-rowlines-multi-ref.html90
-rw-r--r--layout/reftests/mathml/mtable-rowlines-single-mtable-dynamic.html105
-rw-r--r--layout/reftests/mathml/mtable-rowlines-single-ref.html90
-rw-r--r--layout/reftests/mathml/mtable-width-ref.html45
-rw-r--r--layout/reftests/mathml/mtable-width.html46
-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-accent-dynamic-ref.html12
-rw-r--r--layout/reftests/mathml/munderover-accent-dynamic.html19
-rw-r--r--layout/reftests/mathml/munderover-accentunder-dynamic-ref.html12
-rw-r--r--layout/reftests/mathml/munderover-accentunder-dynamic.html19
-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/negative-mspace-1-ref.html25
-rw-r--r--layout/reftests/mathml/negative-mspace-1.html27
-rw-r--r--layout/reftests/mathml/non-spacing-accent-1-ref.xhtml17
-rw-r--r--layout/reftests/mathml/non-spacing-accent-1.xhtml18
-rw-r--r--layout/reftests/mathml/number-size-1-ref.xhtml7
-rw-r--r--layout/reftests/mathml/number-size-1.xhtml7
-rw-r--r--layout/reftests/mathml/op-dict-10-ref.html11
-rw-r--r--layout/reftests/mathml/op-dict-10.html11
-rw-r--r--layout/reftests/mathml/op-dict-11-ref.html11
-rw-r--r--layout/reftests/mathml/op-dict-11.html11
-rw-r--r--layout/reftests/mathml/opentype-fraction-dynamic-linethickness-ref.html29
-rw-r--r--layout/reftests/mathml/opentype-fraction-dynamic-linethickness.html38
-rw-r--r--layout/reftests/mathml/opentype-stretchy-ref.html69
-rw-r--r--layout/reftests/mathml/opentype-stretchy.html69
-rw-r--r--layout/reftests/mathml/operator-1-ref.xhtml9
-rw-r--r--layout/reftests/mathml/operator-1.xhtml9
-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/positive-namedspace-ref.html54
-rw-r--r--layout/reftests/mathml/positive-namedspace.html55
-rw-r--r--layout/reftests/mathml/quotes-1-ref.xhtml18
-rw-r--r--layout/reftests/mathml/quotes-1.xhtml39
-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.list319
-rw-r--r--layout/reftests/mathml/rowlines-1-ref.html77
-rw-r--r--layout/reftests/mathml/rowlines-1a.html77
-rw-r--r--layout/reftests/mathml/rowlines-1b.html77
-rw-r--r--layout/reftests/mathml/rowlines-1c.html77
-rw-r--r--layout/reftests/mathml/rowlines-2-ref.html51
-rw-r--r--layout/reftests/mathml/rowlines-2a.html51
-rw-r--r--layout/reftests/mathml/rowlines-2b.html51
-rw-r--r--layout/reftests/mathml/rowlines-3-1-ref.html34
-rw-r--r--layout/reftests/mathml/rowlines-3-1.html53
-rw-r--r--layout/reftests/mathml/rowlines-3-2-ref.html34
-rw-r--r--layout/reftests/mathml/rowlines-3-2.html53
-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-1-ref.html129
-rw-r--r--layout/reftests/mathml/scriptlevel-1.html129
-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/scriptshift-1-ref.xhtml30
-rw-r--r--layout/reftests/mathml/scriptshift-1.xhtml30
-rw-r--r--layout/reftests/mathml/semantics-1-ref.xhtml95
-rw-r--r--layout/reftests/mathml/semantics-1.xhtml107
-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.html20
-rw-r--r--layout/reftests/mathml/semantics-3.html21
-rw-r--r--layout/reftests/mathml/semantics-4-ref.html24
-rw-r--r--layout/reftests/mathml/semantics-4.html36
-rw-r--r--layout/reftests/mathml/shadow-dom-1-ref.html13
-rw-r--r--layout/reftests/mathml/shadow-dom-1.html18
-rw-r--r--layout/reftests/mathml/ssty-1-ref.html337
-rw-r--r--layout/reftests/mathml/ssty-1.html324
-rw-r--r--layout/reftests/mathml/ssty-2-ref.html275
-rw-r--r--layout/reftests/mathml/ssty-2.html267
-rw-r--r--layout/reftests/mathml/ssty-3-ref.html219
-rw-r--r--layout/reftests/mathml/ssty-3.html207
-rw-r--r--layout/reftests/mathml/ssty-4-ref.html156
-rw-r--r--layout/reftests/mathml/ssty-4.html186
-rw-r--r--layout/reftests/mathml/ssty.woffbin0 -> 1412 bytes
-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/stretchy-mover-1-ref.html16
-rw-r--r--layout/reftests/mathml/stretchy-mover-1a.html22
-rw-r--r--layout/reftests/mathml/stretchy-mover-1b.html22
-rw-r--r--layout/reftests/mathml/stretchy-mover-2-ref.html20
-rw-r--r--layout/reftests/mathml/stretchy-mover-2a.html22
-rw-r--r--layout/reftests/mathml/stretchy-mover-2b.html22
-rw-r--r--layout/reftests/mathml/stretchy-mover-3-ref.html16
-rw-r--r--layout/reftests/mathml/stretchy-mover-3.html16
-rw-r--r--layout/reftests/mathml/stretchy-msup-1-ref.html16
-rw-r--r--layout/reftests/mathml/stretchy-msup-1a.html16
-rw-r--r--layout/reftests/mathml/stretchy-msup-1b.html18
-rw-r--r--layout/reftests/mathml/stretchy-msup-1c.html20
-rw-r--r--layout/reftests/mathml/stretchy-msup-1d.html19
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1-ref.html19
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1a.html19
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1b.html21
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1c.html17
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1d.html20
-rw-r--r--layout/reftests/mathml/stretchy-munderover-1e.html20
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2-ref.html22
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2a.html22
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2b.html24
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2c.html20
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2d.html22
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2e.html22
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2f.html24
-rw-r--r--layout/reftests/mathml/stretchy-munderover-2g.html23
-rw-r--r--layout/reftests/mathml/stretchy-munderover-3-ref.html19
-rw-r--r--layout/reftests/mathml/stretchy-munderover-3a.html19
-rw-r--r--layout/reftests/mathml/stretchy-munderover-3b.html17
-rw-r--r--layout/reftests/mathml/stretchy-munderover-3c.html20
-rw-r--r--layout/reftests/mathml/stretchy-munderover-3d.html17
-rw-r--r--layout/reftests/mathml/stretchy-underbar-1-ref.xhtml17
-rw-r--r--layout/reftests/mathml/stretchy-underbar-1.xhtml18
-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/table-width-1-ref.xhtml79
-rw-r--r--layout/reftests/mathml/table-width-1.xhtml76
-rw-r--r--layout/reftests/mathml/table-width-2-ref.html36
-rw-r--r--layout/reftests/mathml/table-width-2.html36
-rw-r--r--layout/reftests/mathml/table-width-3-ref.html103
-rw-r--r--layout/reftests/mathml/table-width-3.html90
-rw-r--r--layout/reftests/mathml/table-width-4-ref.html63
-rw-r--r--layout/reftests/mathml/table-width-4.html64
-rw-r--r--layout/reftests/mathml/tablespacing-1-ref.html66
-rw-r--r--layout/reftests/mathml/tablespacing-1.html66
-rw-r--r--layout/reftests/mathml/tablespacing-2-ref.html134
-rw-r--r--layout/reftests/mathml/tablespacing-2.html134
-rw-r--r--layout/reftests/mathml/tablespacing-3-ref.html133
-rw-r--r--layout/reftests/mathml/tablespacing-3.html133
-rw-r--r--layout/reftests/mathml/tablespacing-4-ref.html95
-rw-r--r--layout/reftests/mathml/tablespacing-4.html123
-rw-r--r--layout/reftests/mathml/tablespacing-5-ref.html274
-rw-r--r--layout/reftests/mathml/tablespacing-5.html295
-rw-r--r--layout/reftests/mathml/tablespacing-5a-ref.html278
-rw-r--r--layout/reftests/mathml/tablespacing-5a.html295
-rw-r--r--layout/reftests/mathml/tablespacing-6-ref.html123
-rw-r--r--layout/reftests/mathml/tablespacing-6.html135
-rw-r--r--layout/reftests/mathml/tablespacing-7-ref.html97
-rw-r--r--layout/reftests/mathml/tablespacing-7.html97
-rw-r--r--layout/reftests/mathml/tablespacing-8-ref.html38
-rw-r--r--layout/reftests/mathml/tablespacing-8a.html39
-rw-r--r--layout/reftests/mathml/tablespacing-8b.html38
-rw-r--r--layout/reftests/mathml/underbar-width-1-ref.xhtml26
-rw-r--r--layout/reftests/mathml/underbar-width-1.xhtml25
-rw-r--r--layout/reftests/mathml/whitespace-trim-1-ref.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-1.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-2-ref.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-2.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-3-ref.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-3.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-4-ref.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-4.html2
-rw-r--r--layout/reftests/mathml/whitespace-trim-5-ref.html5
-rw-r--r--layout/reftests/mathml/whitespace-trim-5.html5
555 files changed, 27347 insertions, 0 deletions
diff --git a/layout/reftests/mathml/162063-mathml.xhtml b/layout/reftests/mathml/162063-mathml.xhtml
new file mode 100644
index 0000000000..39402c20f2
--- /dev/null
+++ b/layout/reftests/mathml/162063-mathml.xhtml
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<script type="text/javascript">
+/* <![CDATA[ */
+function boom()
+{
+ var q = document.getElementById("target");
+ remove(q);
+ document.documentElement.className = "";
+
+}
+
+function remove(n)
+{
+ n.parentNode.removeChild(n);
+}
+
+window.addEventListener("MozReftestInvalidate", boom);
+/* ]]> */
+</script>
+<title> test for pseudo removal</title>
+</head>
+
+<body>
+ <div style="display:table; border-spacing:10px; background-color:Maroon">
+ <math xmlns="http://www.w3.org/1998/Math/MathML" id="target">
+ <msup>
+ <mfenced>
+ <mrow>
+ <mi>a</mi>
+ <mo>+</mo>
+ <mi>b</mi>
+ </mrow>
+ </mfenced>
+ <mn>2</mn>
+ </msup>
+ </math>
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/mathml/345563-sub.xhtml b/layout/reftests/mathml/345563-sub.xhtml
new file mode 100644
index 0000000000..0d777528b9
--- /dev/null
+++ b/layout/reftests/mathml/345563-sub.xhtml
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" >
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+
+</head>
+
+<body>
+
+<p>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msub>
+ <mi>x</mi>
+ <mn>2</mn>
+ </msub>
+ </math>
+</p>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/345563-sup.xhtml b/layout/reftests/mathml/345563-sup.xhtml
new file mode 100644
index 0000000000..dc57aa3506
--- /dev/null
+++ b/layout/reftests/mathml/345563-sup.xhtml
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" >
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+
+</head>
+
+<body>
+
+<p>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mi>x</mi>
+ <mn>2</mn>
+ </msup>
+ </math>
+</p>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/347348-1-ref.xhtml b/layout/reftests/mathml/347348-1-ref.xhtml
new file mode 100644
index 0000000000..25c84495fe
--- /dev/null
+++ b/layout/reftests/mathml/347348-1-ref.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+</head>
+
+<body>
+
+<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mrow>
+ <mi>x</mi>
+ <mo id="mo"></mo>
+ <mi>y</mi>
+ </mrow>
+</math></div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/347348-1.xhtml b/layout/reftests/mathml/347348-1.xhtml
new file mode 100644
index 0000000000..cf04a46447
--- /dev/null
+++ b/layout/reftests/mathml/347348-1.xhtml
@@ -0,0 +1,24 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+<script>
+function foo()
+{
+ var mo = document.getElementById("mo");
+ mo.removeChild(mo.firstChild);
+}
+</script>
+</head>
+
+<body onload="foo();">
+
+<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mrow>
+ <mi>x</mi>
+ <mo id="mo">=</mo>
+ <mi>y</mi>
+ </mrow>
+</math></div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/347496-1-ref.xhtml b/layout/reftests/mathml/347496-1-ref.xhtml
new file mode 100644
index 0000000000..bb0a53ab5c
--- /dev/null
+++ b/layout/reftests/mathml/347496-1-ref.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<body>
+
+<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mfenced open="[" close="]">
+ <mtable id="table" rowlines="dashed">
+ <mtr>
+ <mtd><mi>x</mi></mtd>
+ <mtd><mi>y</mi></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mi>z</mi></mtd>
+ <mtd><mi>w</mi></mtd>
+ </mtr>
+ </mtable>
+ </mfenced>
+</math></div>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/347496-1.xhtml b/layout/reftests/mathml/347496-1.xhtml
new file mode 100644
index 0000000000..50a50bfb64
--- /dev/null
+++ b/layout/reftests/mathml/347496-1.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<body onload="document.getElementById('table').setAttribute('rowlines', 'dashed')">
+
+<div><math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mfenced open="[" close="]">
+ <mtable id="table">
+ <mtr>
+ <mtd><mi>x</mi></mtd>
+ <mtd><mi>y</mi></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mi>z</mi></mtd>
+ <mtd><mi>w</mi></mtd>
+ </mtr>
+ </mtable>
+ </mfenced>
+</math></div>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/355548-1-ref.xml b/layout/reftests/mathml/355548-1-ref.xml
new file mode 100644
index 0000000000..d075797725
--- /dev/null
+++ b/layout/reftests/mathml/355548-1-ref.xml
@@ -0,0 +1,36 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:96px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:192px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:96px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:192px;">Id</m:mi></m:mstyle>
+</m:math></p>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:96px;">Id</m:mi></m:mstyle>
+</m:math></p>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+</m:math></p>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+</m:math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-1.xml b/layout/reftests/mathml/355548-1.xml
new file mode 100644
index 0000000000..95449c1a79
--- /dev/null
+++ b/layout/reftests/mathml/355548-1.xml
@@ -0,0 +1,36 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mi>Id</m:mi>
+ <m:mstyle scriptlevel="+1"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle scriptlevel="+2"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle scriptlevel="+3"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+1"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+1"><m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+1"><m:mstyle scriptlevel="-3"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+2"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+2"><m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+2"><m:mstyle scriptlevel="-3"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+3"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+3"><m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+3"><m:mstyle scriptlevel="-3"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+4"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+4"><m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle scriptlevel="+4"><m:mstyle scriptlevel="-3"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-2-ref.xml b/layout/reftests/mathml/355548-2-ref.xml
new file mode 100644
index 0000000000..5081099aec
--- /dev/null
+++ b/layout/reftests/mathml/355548-2-ref.xml
@@ -0,0 +1,24 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:10px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:10px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:20px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:40px;">Id</m:mi></m:mstyle>
+</m:math></p>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:72px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:18px;">Id</m:mi></m:mstyle>
+</m:math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-2.xml b/layout/reftests/mathml/355548-2.xml
new file mode 100644
index 0000000000..0326fecf53
--- /dev/null
+++ b/layout/reftests/mathml/355548-2.xml
@@ -0,0 +1,36 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<!-- Test interactions between CSS font-size and scriptlevel changes -->
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+5"><m:mi>Id</m:mi></m:mstyle>
+ <!-- Test that we can explicitly go below scriptminsize -->
+ <m:mi style="font-size:10px;">Id</m:mi>
+ <!-- Test that a relative font-size ignores the scriptlevel change in the same element -->
+ <m:mstyle scriptlevel="+5" style="font-size:100%;"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- Test that scriptlevel changes are incremental (this should be 24px) -->
+ <m:mstyle scriptlevel="+1" style="font-size:48px;"><m:mstyle scriptlevel="+1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- Decreasing the font size due to a scriptlevel change should do nothing when we're below minscriptsize -->
+ <m:mstyle style="font-size:10px;"><m:mstyle scriptlevel="+1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <!-- but we can increase -->
+ <m:mstyle style="font-size:10px;"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+ <m:mstyle style="font-size:10px;"><m:mstyle scriptlevel="-2"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- An absolute font-size value resets the unconstrained size to that value, so we
+ can increase above that value with a negative scriptlevel change -->
+ <m:mstyle scriptlevel="+5"><m:mstyle style="font-size:24px;"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle></m:mstyle>
+ <!-- A relative font-size value resets the unconstrained to that value, resolved relative to the constrained size -->
+ <m:mstyle scriptlevel="+2"><m:mstyle style="font-size:200%;"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle></m:mstyle>
+ <!-- The unconstrained size does not cap the font size to below scriptminsize (so this is 18px) -->
+ <m:mstyle scriptlevel="+2"><m:mstyle style="font-size:50%;"><m:mstyle scriptlevel="-1"><m:mi>Id</m:mi></m:mstyle></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-3-ref.xml b/layout/reftests/mathml/355548-3-ref.xml
new file mode 100644
index 0000000000..43fc0cc4b4
--- /dev/null
+++ b/layout/reftests/mathml/355548-3-ref.xml
@@ -0,0 +1,53 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:30px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:30px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px; background:green;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px; background:green;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px; background:rgb(0,255,0);">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px; background:rgb(0,255,0);">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px; color:green;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px; color:green;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:48px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+<p><m:math>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:24px;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:0;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:0;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:0;">Id</m:mi></m:mstyle>
+ <m:mstyle><m:mi style="font-size:20px;">Id</m:mi></m:mstyle>
+</m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-3.xml b/layout/reftests/mathml/355548-3.xml
new file mode 100644
index 0000000000..e76e418517
--- /dev/null
+++ b/layout/reftests/mathml/355548-3.xml
@@ -0,0 +1,60 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<!-- Test attribute parsing -->
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- MathML number attributes cannot start with '+' -->
+ <m:mstyle scriptsizemultiplier="+1"><m:mstyle scriptlevel="+1"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle mathsize="30px"><m:mi>Id</m:mi></m:mstyle>
+ <!-- CSS takes priority over mathsize -->
+ <m:mstyle mathsize="24px" style="font-size:30px;"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle mathsize="small"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="normal"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="big"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle mathbackground="green"><m:mi>Id</m:mi></m:mstyle>
+ <!-- CSS takes priority over mathbackground -->
+ <m:mstyle mathbackground="red" style="background:green;"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle mathbackground="#0F0"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathbackground="#00FF00"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle mathcolor="green"><m:mi>Id</m:mi></m:mstyle>
+ <!-- CSS takes priority over mathcolor -->
+ <m:mstyle mathcolor="red" style="color:green;"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- test invalid values for MathML length attributes -->
+ <m:mstyle mathsize="20 px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize=".px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="..px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="+20px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="0.5"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="24.px"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <!-- test valid values for MathML length attributes -->
+ <m:mstyle mathsize=" 24px "><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="24.0px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="50%"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize=".0px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="-0px"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="0"><m:mi>Id</m:mi></m:mstyle>
+ <m:mstyle mathsize="20PX"><m:mi>Id</m:mi></m:mstyle>
+</m:mstyle></m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-4-ref.xml b/layout/reftests/mathml/355548-4-ref.xml
new file mode 100644
index 0000000000..4424c25d3d
--- /dev/null
+++ b/layout/reftests/mathml/355548-4-ref.xml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<head>
+<style>
+.v { font: 48px "Verdana"; }
+</style>
+</head>
+<body>
+<p><span class="v">Hello</span></p>
+<m:math><m:mstyle><m:mi style="font-size:24px; font-family:Verdana">Id</m:mi></m:mstyle></m:math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-4.xml b/layout/reftests/mathml/355548-4.xml
new file mode 100644
index 0000000000..5a73aff01c
--- /dev/null
+++ b/layout/reftests/mathml/355548-4.xml
@@ -0,0 +1,41 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<style>
+/* test the situation where an nsStyleFont is cached in the rule tree but we have to blow it
+ away because MathML is suddenly introduced */
+.v { font: 48px "Verdana"; }
+</style>
+<script>
+function addMathML() {
+ function createMathMLElement(tag) {
+ return document.createElementNS("http://www.w3.org/1998/Math/MathML", tag);
+ }
+
+ var body = document.getElementById("body");
+ body.offsetTop;
+
+ // if we don't blow away the rule tree correctly, then we will cache an nsStyleFont with
+ // a scriptsizemultiplier of 0.71 (the default) and use it to style mstyle2, so the
+ // scriptlevel change will not scale the text by 0.5
+ var math = createMathMLElement("math");
+ var mstyle = createMathMLElement("mstyle");
+ mstyle.setAttribute("scriptsizemultiplier", "0.5");
+ var mstyle2 = createMathMLElement("mstyle");
+ mstyle2.setAttribute("class", "v");
+ var mstyle3 = createMathMLElement("mstyle");
+ mstyle3.setAttribute("scriptlevel", "+1");
+ var mi = createMathMLElement("mi");
+ mi.textContent = "Id";
+ mstyle3.appendChild(mi);
+ mstyle2.appendChild(mstyle3);
+ mstyle.appendChild(mstyle2);
+ math.appendChild(mstyle);
+ body.appendChild(math);
+ document.documentElement.className = '';
+}
+</script>
+</head>
+<body id="body" onload="addMathML()">
+<p><span class="v">Hello</span></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-5-ref.xml b/layout/reftests/mathml/355548-5-ref.xml
new file mode 100644
index 0000000000..fb71442ab4
--- /dev/null
+++ b/layout/reftests/mathml/355548-5-ref.xml
@@ -0,0 +1,7 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle scriptlevel="+1"><m:mstyle style="font-family:serif;"><m:mi>Id</m:mi></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/355548-5.xml b/layout/reftests/mathml/355548-5.xml
new file mode 100644
index 0000000000..30dbbc8831
--- /dev/null
+++ b/layout/reftests/mathml/355548-5.xml
@@ -0,0 +1,7 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+<p><m:math><m:mstyle scriptlevel="0" scriptsizemultiplier="0.5" scriptminsize="18px" style="font-size:48px;">
+ <m:mstyle style="font-family:sans-serif;"><m:mstyle scriptlevel="+1"><m:mstyle style="font-family:serif;"><m:mi>Id</m:mi></m:mstyle></m:mstyle></m:mstyle>
+</m:mstyle></m:math></p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/370692-1-ref.xhtml b/layout/reftests/mathml/370692-1-ref.xhtml
new file mode 100644
index 0000000000..2e01559d27
--- /dev/null
+++ b/layout/reftests/mathml/370692-1-ref.xhtml
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<table>
+ <mathml:mtr xmlns:mathml="http://www.w3.org/1998/Math/MathML">
+ <mathml:mo>+</mathml:mo>
+ <td>bar</td>
+ </mathml:mtr>
+ <tr><td>baz</td></tr>
+</table>
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/370692-1.xhtml b/layout/reftests/mathml/370692-1.xhtml
new file mode 100644
index 0000000000..a1ed3ba96d
--- /dev/null
+++ b/layout/reftests/mathml/370692-1.xhtml
@@ -0,0 +1,12 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+<table>
+ <mathml:mtr rowspan="2" xmlns:mathml="http://www.w3.org/1998/Math/MathML">
+ <mathml:mo>+</mathml:mo>
+ <td>bar</td>
+ </mathml:mtr>
+ <tr><td>baz</td></tr>
+</table>
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/373533-1.xhtml b/layout/reftests/mathml/373533-1.xhtml
new file mode 100644
index 0000000000..593b1319fd
--- /dev/null
+++ b/layout/reftests/mathml/373533-1.xhtml
@@ -0,0 +1,32 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:math="http://www.w3.org/1998/Math/MathML">
+<head></head>
+<body>
+
+<xul:box collapsed="true"><math:mrow><div id="div">
+<p id="para">Foo bar</p>
+</div></math:mrow></xul:box>
+
+<script type="application/javascript">
+document.body.offsetWidth;
+
+try
+{
+ var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
+
+ var para = document.getElementById("para");
+ var div = document.getElementById("div");
+ var hbox = document.createElementNS(XUL_NS, 'hbox');
+
+ div.appendChild(hbox);
+ div.removeChild(para);
+}
+catch (e)
+{
+ document.body.appendChild(document.createTextNode(e));
+}
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/373533-2.xhtml b/layout/reftests/mathml/373533-2.xhtml
new file mode 100644
index 0000000000..e269415a21
--- /dev/null
+++ b/layout/reftests/mathml/373533-2.xhtml
@@ -0,0 +1,31 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:math="http://www.w3.org/1998/Math/MathML"><head>
+</head>
+<body><xul:box collapsed="true"><math:mrow><div id="div">
+<p id="para">Foo bar</p>
+
+</div></math:mrow></xul:box>
+
+<script type="application/javascript">
+try
+{
+ document.body.offsetWidth;
+
+ var para = document.getElementById("para");
+ var div = document.getElementById("div");
+ var hbox = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ 'hbox');
+
+ div.appendChild(hbox);
+
+ document.body.offsetWidth;
+
+ div.appendChild(para);
+}
+catch (e)
+{
+ document.body.appendChild(document.createTextNode(e));
+}
+</script>
+</body></html>
diff --git a/layout/reftests/mathml/373533-3.xhtml b/layout/reftests/mathml/373533-3.xhtml
new file mode 100644
index 0000000000..e2e1a65342
--- /dev/null
+++ b/layout/reftests/mathml/373533-3.xhtml
@@ -0,0 +1,31 @@
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+ xmlns:math="http://www.w3.org/1998/Math/MathML">
+<head>
+</head><body><xul:box collapsed="true"><math:mrow><div id="div">
+<p id="para">Foo bar</p>
+
+</div></math:mrow></xul:box>
+
+<script type="application/javascript">
+try
+{
+ document.body.offsetWidth;
+
+ var para = document.getElementById("para");
+ var div = document.getElementById("div");
+ var hbox = document.createElementNS("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
+ 'hbox');
+
+ div.appendChild(hbox);
+
+ document.body.offsetWidth;
+
+ div.removeChild(para);
+}
+catch (e)
+{
+ document.body.appendChild(document.createTextNode(e));
+}
+</script>
+</body></html>
diff --git a/layout/reftests/mathml/393760-1-ref.xml b/layout/reftests/mathml/393760-1-ref.xml
new file mode 100644
index 0000000000..027bdf1b7d
--- /dev/null
+++ b/layout/reftests/mathml/393760-1-ref.xml
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+
+<!-- ... assuming that color inherits -->
+<p>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+</p>
+
+<!-- ... assuming that color inherits -->
+<p>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span style="color: green"><m:math><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+</p>
+
+<!-- ... assuming that mathbackground works on m:mstyle -->
+<p><m:math><m:mstyle mathbackground="lightgreen"><m:mi>Y</m:mi></m:mstyle></m:math></p>
+<p><m:math><m:mstyle mathbackground="lightgreen"><m:mi>Y</m:mi></m:mstyle></m:math></p>
+
+<!-- ... assuming that mathbackground works on m:mstyle -->
+<p><m:math><m:mstyle mathbackground="lightgreen"><m:mfenced><m:mi>x</m:mi></m:mfenced></m:mstyle></m:math></p>
+<p><m:math><m:mstyle mathbackground="lightgreen"><m:mfenced><m:mi>x</m:mi></m:mfenced></m:mstyle></m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/393760-1.xml b/layout/reftests/mathml/393760-1.xml
new file mode 100644
index 0000000000..b82cd587aa
--- /dev/null
+++ b/layout/reftests/mathml/393760-1.xml
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+
+<!-- Test that CSS color works on m:math and m:mstyle -->
+<p>
+ <span><m:math style="color: green;"><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span><m:math><m:mstyle style="color: green;"><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span><m:math><m:mstyle><m:mi style="color: green;">X</m:mi></m:mstyle></m:math></span>
+</p>
+
+<!-- Test that mathcolor works on m:mi, m:mstyle and m:math -->
+<p>
+ <span><m:math mathcolor="green"><m:mstyle><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span><m:math><m:mstyle mathcolor="green"><m:mi>X</m:mi></m:mstyle></m:math></span>
+ <span><m:math><m:mstyle><m:mi mathcolor="green">X</m:mi></m:mstyle></m:math></span>
+</p>
+
+<!-- Test that mathbackground and CSS background work on m:mi -->
+<p><m:math><m:mi mathbackground="lightgreen">Y</m:mi></m:math></p>
+<p><m:math><m:mi style="background: lightgreen">Y</m:mi></m:math></p>
+
+<!-- Test that mathbackground and CSS background work on m:mfenced -->
+<p><m:math><m:mfenced mathbackground="lightgreen"><m:mi>x</m:mi></m:mfenced></m:math></p>
+<p><m:math><m:mfenced style="background: lightgreen;"><m:mi>x</m:mi></m:mfenced></m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/393760-2-ref.xml b/layout/reftests/mathml/393760-2-ref.xml
new file mode 100644
index 0000000000..58dd5a5d8c
--- /dev/null
+++ b/layout/reftests/mathml/393760-2-ref.xml
@@ -0,0 +1,5 @@
+<html style="background: #88F; color: #88F;" xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/393760-2.xml b/layout/reftests/mathml/393760-2.xml
new file mode 100644
index 0000000000..b8e9b4ae12
--- /dev/null
+++ b/layout/reftests/mathml/393760-2.xml
@@ -0,0 +1,11 @@
+<html style="background: #88F; color: #88F;" xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML">
+<body>
+
+<!-- Test that text that should be invisible is invisible (assuming text is drawn at all) -->
+<p>This should be invisible.</p>
+
+<!-- Test that color inherits into MathML (assuming MathML text is drawn at all) -->
+<p><m:math><m:mi>x</m:mi></m:math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/414123-ref.xhtml b/layout/reftests/mathml/414123-ref.xhtml
new file mode 100644
index 0000000000..5448508848
--- /dev/null
+++ b/layout/reftests/mathml/414123-ref.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Testcase for bug 414123</title>
+</head>
+<body>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mn mathvariant="italic">M</mn>
+ <mn>2</mn>
+ </msup>
+</math>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mn mathvariant="italic">M</mn>
+ <mn>2</mn>
+ </msup>
+</math>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mn mathvariant="italic">M</mn>
+ <mn>2</mn>
+ </msup>
+</math>
+
+</body>
+</html>
+
diff --git a/layout/reftests/mathml/414123.xhtml b/layout/reftests/mathml/414123.xhtml
new file mode 100644
index 0000000000..f41d4a7161
--- /dev/null
+++ b/layout/reftests/mathml/414123.xhtml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Testcase for bug 414123</title>
+<script>
+function boom() {
+ var t = document.createTextNode('M')
+ document.getElementById('mi1').appendChild(t);
+
+ var mi = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mi");
+ var mn = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn");
+ var msup = document.createElementNS("http://www.w3.org/1998/Math/MathML", "msup");
+ mi.appendChild(document.createTextNode('M'));
+ mn.appendChild(document.createTextNode('2'));
+ msup.appendChild(mi);
+ msup.appendChild(mn);
+ document.getElementById('m').appendChild(msup);
+}
+</script>
+</head>
+<body onload="boom()">
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mi id="mi1"></mi>
+ <mn>2</mn>
+ </msup>
+</math>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msup>
+ <mi>M</mi>
+ <mn>2</mn>
+ </msup>
+</math>
+
+<math id="m" xmlns="http://www.w3.org/1998/Math/MathML"></math>
+
+</body>
+</html>
+
diff --git a/layout/reftests/mathml/columnlines-1-ref.html b/layout/reftests/mathml/columnlines-1-ref.html
new file mode 100644
index 0000000000..e5ea01a7de
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1-ref.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable>
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-1a.html b/layout/reftests/mathml/columnlines-1a.html
new file mode 100644
index 0000000000..3f391c2966
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1a.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="none">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-1b.html b/layout/reftests/mathml/columnlines-1b.html
new file mode 100644
index 0000000000..9ee1a3e35f
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1b.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="solid">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-1c.html b/layout/reftests/mathml/columnlines-1c.html
new file mode 100644
index 0000000000..d1bd0d7ce3
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-1c.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="dashed">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-2-ref.html b/layout/reftests/mathml/columnlines-2-ref.html
new file mode 100644
index 0000000000..84c96c5fe3
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2-ref.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="solid none dashed dashed dashed">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-2a.html b/layout/reftests/mathml/columnlines-2a.html
new file mode 100644
index 0000000000..ea3ed5abe0
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2a.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="solid none dashed">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-2b.html b/layout/reftests/mathml/columnlines-2b.html
new file mode 100644
index 0000000000..36182d60ad
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-2b.html
@@ -0,0 +1,41 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable columnlines="solid none dashed dashed dashed solid solid none solid none">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-3-1-ref.html b/layout/reftests/mathml/columnlines-3-1-ref.html
new file mode 100644
index 0000000000..ce49f5dad4
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-1-ref.html
@@ -0,0 +1,32 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable columnlines="dashed">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 115px; left: 0px;
+ width: 50px; height: 55px; background: red;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-3-1.html b/layout/reftests/mathml/columnlines-3-1.html
new file mode 100644
index 0000000000..80c46858e6
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-1.html
@@ -0,0 +1,48 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <!-- We assume there is a gap of more than 1px between dashes. Hence
+ putting two dashed lines with only one pixel of difference in their
+ vertical coordinates should not render the same as one dashed line
+ alone. The opposite is true for continuous line.
+ The red squares allow to ignore the difference at the bounds -->
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable columnlines="dashed">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 6px; left: 5px;">
+ <math>
+ <mtable columnlines="dashed">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 115px; left: 0px;
+ width: 50px; height: 55px; background: red;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-3-2-ref.html b/layout/reftests/mathml/columnlines-3-2-ref.html
new file mode 100644
index 0000000000..6549ad5263
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-2-ref.html
@@ -0,0 +1,32 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable columnlines="solid">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 115px; left: 0px;
+ width: 50px; height: 55px; background: red;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/columnlines-3-2.html b/layout/reftests/mathml/columnlines-3-2.html
new file mode 100644
index 0000000000..789013d9f0
--- /dev/null
+++ b/layout/reftests/mathml/columnlines-3-2.html
@@ -0,0 +1,48 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <!-- We assume there is a gap of more than 1px between dashes. Hence
+ putting two dashed lines with only one pixel of difference in their
+ vertical coordinates should not render the same as one dashed line
+ alone. The opposite is true for continuous line.
+ The red squares allow to ignore the difference at the bounds -->
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable columnlines="solid">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 6px; left: 5px;">
+ <math>
+ <mtable columnlines="solid">
+ <mtr>
+ <mtd><mspace height="150px"></mspace></mtd>
+ <mtd><mspace height="150px"></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 115px; left: 0px;
+ width: 50px; height: 55px; background: red;"></div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/css-spacing-1-ref.html b/layout/reftests/mathml/css-spacing-1-ref.html
new file mode 100644
index 0000000000..22969f3513
--- /dev/null
+++ b/layout/reftests/mathml/css-spacing-1-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS spacing properties</title>
+ <style type="text/css">
+ math {
+ line-height: normal;
+ word-spacing: normal;
+ letter-spacing: normal;
+ }
+ </style>
+ </head>
+
+ <body>
+ <p style="line-height: 30pt;
+ word-spacing: 2em;
+ letter-spacing: 2em;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mo>(</mo>
+ <mtable rowspacing="0pt" columnspacing="0em">
+ <mtr>
+ <mtd><mtext>row 1 column 1</mtext></mtd>
+ <mtd><mtext>row 1 column 2</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>row 2 column 1</mtext></mtd>
+ <mtd><mtext>row 2 column 2</mtext></mtd>
+ </mtr>
+ </mtable>
+ <mo>)</mo>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/css-spacing-1.html b/layout/reftests/mathml/css-spacing-1.html
new file mode 100644
index 0000000000..59de4b544c
--- /dev/null
+++ b/layout/reftests/mathml/css-spacing-1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS spacing properties</title>
+ </head>
+
+ <body>
+ <p style="line-height: 30pt;
+ word-spacing: 2em;
+ letter-spacing: 2em;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+ <mrow>
+ <mo>(</mo>
+ <mtable rowspacing="0pt" columnspacing="0em">
+ <mtr>
+ <mtd><mtext>row 1 column 1</mtext></mtd>
+ <mtd><mtext>row 1 column 2</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>row 2 column 1</mtext></mtd>
+ <mtd><mtext>row 2 column 2</mtext></mtd>
+ </mtr>
+ </mtable>
+ <mo>)</mo>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/default-font-ref.html b/layout/reftests/mathml/default-font-ref.html
new file mode 100644
index 0000000000..9917f14b6f
--- /dev/null
+++ b/layout/reftests/mathml/default-font-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>default font</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body style="font: 20px monospace;">
+
+ <math style="font-family: serif; font-size: 40px;">
+ <mn>x-math language</mn>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/default-font.html b/layout/reftests/mathml/default-font.html
new file mode 100644
index 0000000000..5e8f808215
--- /dev/null
+++ b/layout/reftests/mathml/default-font.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>default font</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body style="font: 20px monospace;">
+
+ <!-- font.minimum-size.x-math set to 40 -->
+ <math>
+ <mn>x-math language</mn>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-1-ref.html b/layout/reftests/mathml/dir-1-ref.html
new file mode 100644
index 0000000000..a77be855c4
--- /dev/null
+++ b/layout/reftests/mathml/dir-1-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+ <p>
+ math:
+ <math>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </math>
+ </p>
+
+ <p>
+ mrow:
+ <math>
+ <mrow>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ mstyle:
+ <math>
+ <mstyle>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </mstyle>
+ </math>
+ </p>
+
+ <p>
+ mpadded lspace="25px" width="150px":
+ <math>
+ <mspace width="1px" height="25px" mathbackground="black"/>
+ <mpadded lspace="50px" width="150px">
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </mpadded>
+ <mspace width="1px" height="25px" mathbackground="black"/>
+ </math>
+ </p>
+
+ <p>
+ mfenced open="A" close="D" separators="BC":
+ <math>
+ <mfenced open="D" close="A" separators="CB">
+ <mtext>c</mtext>
+ <mtext>b</mtext>
+ <mtext>a</mtext>
+ </mfenced>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-1.html b/layout/reftests/mathml/dir-1.html
new file mode 100644
index 0000000000..2b4ce236c5
--- /dev/null
+++ b/layout/reftests/mathml/dir-1.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+ <p>
+ math:
+ <math dir="rtl">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </math>
+ </p>
+
+ <p>
+ mrow:
+ <math>
+ <mrow dir="rtl">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </mrow>
+ </math>
+ </p>
+
+ <p>
+ mstyle:
+ <math>
+ <mstyle dir="rtl">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </mstyle>
+ </math>
+ </p>
+
+ <p>
+ mpadded lspace="25px" width="150px":
+ <math dir="rtl">
+ <mspace width="1px" height="25px" mathbackground="black"/>
+ <mpadded lspace="25px" width="150px">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </mpadded>
+ <mspace width="1px" height="25px" mathbackground="black"/>
+ </math>
+ </p>
+
+ <p>
+ mfenced open="A" close="D" separators="BC":
+ <math dir="rtl">
+ <mfenced open="A" close="D" separators="BC">
+ <mtext>a</mtext>
+ <mtext>b</mtext>
+ <mtext>c</mtext>
+ </mfenced>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-2-ref.html b/layout/reftests/mathml/dir-2-ref.html
new file mode 100644
index 0000000000..8a1c908c14
--- /dev/null
+++ b/layout/reftests/mathml/dir-2-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+ <p>
+ menclose:
+ <math>
+ <menclose>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="left":
+ <math>
+ <menclose notation="left">
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="right":
+ <math>
+ <menclose notation="right">
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="updiagonalstrike":
+ <math>
+ <menclose notation="updiagonalstrike">
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="downdiagonalstrike":
+ <math>
+ <menclose notation="downdiagonalstrike">
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ </menclose>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-2.html b/layout/reftests/mathml/dir-2.html
new file mode 100644
index 0000000000..7844e9e6bd
--- /dev/null
+++ b/layout/reftests/mathml/dir-2.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+ <p>
+ menclose:
+ <math dir="rtl">
+ <menclose>
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="left":
+ <math dir="rtl">
+ <menclose notation="left">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="right":
+ <math dir="rtl">
+ <menclose notation="right">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="updiagonalstrike":
+ <math dir="rtl">
+ <menclose notation="updiagonalstrike">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </menclose>
+ </math>
+ </p>
+
+ <p>
+ menclose notation="downdiagonalstrike":
+ <math dir="rtl">
+ <menclose notation="downdiagonalstrike">
+ <mspace width="25px" height="25px" mathbackground="red"/>
+ <mspace width="25px" height="25px" mathbackground="green"/>
+ <mspace width="25px" height="25px" mathbackground="blue"/>
+ </menclose>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-3-ref.html b/layout/reftests/mathml/dir-3-ref.html
new file mode 100644
index 0000000000..3260aef204
--- /dev/null
+++ b/layout/reftests/mathml/dir-3-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body style="background: white;">
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <div style="width: 30px; height: 500px; background: black;"></div>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-3.html b/layout/reftests/mathml/dir-3.html
new file mode 100644
index 0000000000..a932d464c0
--- /dev/null
+++ b/layout/reftests/mathml/dir-3.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body style="background: white;">
+
+ <!-- The visible part of the formulas below should be covered by the
+ black rectangle when dir=rtl -->
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <!-- msup -->
+ <math dir="rtl">
+ <msup>
+ <mspace width="20px" height="20px"/>
+ <mspace width="20px" height="20px" mathbackground="red"/>
+ </msup>
+ </math><br/>
+ <!-- msub -->
+ <math dir="rtl">
+ <msub>
+ <mspace width="20px" height="20px"/>
+ <mspace width="20px" height="20px" mathbackground="orange"/>
+ </msub>
+ </math><br/>
+ <!-- msubsup -->
+ <math dir="rtl">
+ <msubsup>
+ <mspace width="20px" height="20px"/>
+ <mspace width="20px" height="20px" mathbackground="green"/>
+ <mspace width="20px" height="20px" mathbackground="blue"/>
+ </msubsup>
+ </math><br/>
+ <!-- mmultiscripts -->
+ <math dir="rtl">
+ <mmultiscripts>
+ <mspace/>
+ <mspace width="20px" height="20px" mathbackground="cyan"/>
+ <mspace width="20px" height="20px" mathbackground="yellow"/>
+ <mprescripts/>
+ <mspace width="20px" height="20px"/>
+ <mspace width="20px" height="20px"/>
+ </mmultiscripts>
+ </math><br/>
+ <!-- munder (mo with movablelimits=true and displaystyle=false) -->
+ <math dir="rtl">
+ <munder>
+ <mpadded width="20px">
+ <mphantom>
+ <mo movablelimits="true" displaystyle="false">|</mo>
+ </mphantom>
+ </mpadded>
+ <mspace width="20px" height="20px" mathbackground="magenta"/>
+ </munder>
+ </math><br/>
+ <!-- mover (mo with movablelimits=true and displaystyle=false) -->
+ <math dir="rtl">
+ <mover>
+ <mpadded width="20px">
+ <mphantom>
+ <mo movablelimits="true" displaystyle="false">|</mo>
+ </mphantom>
+ </mpadded>
+ <mspace width="20px" height="20px" mathbackground="cyan"/>
+ </mover>
+ </math><br/>
+ <!-- munderover (mo with movablelimits=true and displaystyle=false) -->
+ <math dir="rtl">
+ <munderover>
+ <mpadded width="20px">
+ <mphantom>
+ <mo movablelimits="true" displaystyle="false">|</mo>
+ </mphantom>
+ </mpadded>
+ <mspace width="20px" height="20px" mathbackground="yellow"/>
+ <mspace width="20px" height="20px" mathbackground="grey"/>
+ </munderover>
+ </math><br/>
+ <!-- mroot -->
+ <math dir="rtl">
+ <mstyle mathcolor="white">
+ <mroot>
+ <mspace width="20px" height="20px" mathbackground="orange"/>
+ <mspace width="20px" height="20px"/>
+ </mroot>
+ </mstyle>
+ </math><br/>
+ <!-- msqrt -->
+ <math dir="rtl">
+ <mstyle mathcolor="white">
+ <msqrt>
+ <!-- Here, we assume that (width of radical + width of mspace)
+ is greater than the width of the black rectangle (i.e.
+ width of radical > 30 - 25 = 5px), so the test fails if the
+ radical is placed on the left. -->
+ <mspace width="25px" height="20px" mathbackground="grey"/>
+ </msqrt>
+ </mstyle>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <div style="width: 30px; height: 500px; background: black;"></div>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-4-ref.html b/layout/reftests/mathml/dir-4-ref.html
new file mode 100644
index 0000000000..f4dbe0e32f
--- /dev/null
+++ b/layout/reftests/mathml/dir-4-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body style="background: white;">
+
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 100px; height: 100px;
+ text-align: center; background: black;">
+ <div style="position: absolute;
+ width: 35px; height: 100px; background: red;"></div>
+ <div style="position: absolute; left: 40px;
+ width: 20px; height: 100px; background: blue;"></div>
+ <div style="position: absolute; left: 60px; width: 40px; height: 100px;
+ background: green;"></div>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-5-ref.html b/layout/reftests/mathml/dir-5-ref.html
new file mode 100644
index 0000000000..e3b99e389d
--- /dev/null
+++ b/layout/reftests/mathml/dir-5-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 200px; height: 200px;">
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 0px; background: red;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 40px; background: green;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 80px; background: magenta;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 120px; background: blue;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 160px; background: yellow;"></div>
+ </div>
+
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 200px; height: 200px;">
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: -5px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 35px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 75px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 115px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 155px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 195px; background: black;"></div>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-5.html b/layout/reftests/mathml/dir-5.html
new file mode 100644
index 0000000000..dca12c49be
--- /dev/null
+++ b/layout/reftests/mathml/dir-5.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+
+ <!-- mmultiscripts. The formulas
+
+ 1 3 3 1
+ X in dir=ltr and X in dir=rtl
+ 2 4 4 2
+
+ do not match perfectly, so we use an alternative == reftest here
+ which is less strict. -->
+
+ <!-- five vertical bands: red, green, magenta, blue and yellow -->
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 200px; height: 200px;">
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 0px; background: red;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 40px; background: green;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 80px; background: magenta;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 120px; background: blue;"></div>
+ <div style="position: absolute; width: 40px; height: 200px;
+ left: 160px; background: yellow;"></div>
+ </div>
+
+ <!-- a mmultiscripts element whose children are squares of different
+ colors. In dir=rtl, the color of each square should match the one of
+ the band over which the square is positioned. Hence, this
+ mmultiscripts should not be visible. -->
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 200px; height: 200px;">
+ <math dir="rtl">
+ <mmultiscripts>
+ <mspace width="40px" height="40px" mathbackground="magenta"/>
+
+ <mspace width="40px" height="40px" mathbackground="green"/>
+ <mspace width="40px" height="40px" mathbackground="green"/>
+
+ <mspace width="40px" height="40px" mathbackground="red"/>
+ <mspace width="40px" height="40px" mathbackground="red"/>
+
+ <mprescripts/>
+
+ <mspace width="40px" height="40px" mathbackground="yellow"/>
+ <mspace width="40px" height="40px" mathbackground="yellow"/>
+
+ <mspace width="40px" height="40px" mathbackground="blue"/>
+ <mspace width="40px" height="40px" mathbackground="blue"/>
+ </mmultiscripts>
+ </math>
+ </div>
+
+ <!-- We add black vertical bands to cover spaces between the children of
+ mmultiscripts. -->
+ <div style="position: absolute;
+ top: 5px; left: 5px; width: 200px; height: 200px;">
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: -5px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 35px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 75px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 115px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 155px; background: black;"></div>
+ <div style="position: absolute; width: 10px; height: 200px;
+ left: 195px; background: black;"></div>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-6a-ref.html b/layout/reftests/mathml/dir-6a-ref.html
new file mode 100644
index 0000000000..d66b9c2710
--- /dev/null
+++ b/layout/reftests/mathml/dir-6a-ref.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+
+ <p>
+ mtable:
+ <math>
+ <mtable rowspacing="">
+ <mtr>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ <p>
+ mtable:
+ <math>
+ <mtable frame="solid">
+ <mtr>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dir-6a.html b/layout/reftests/mathml/dir-6a.html
new file mode 100644
index 0000000000..ffa208ef8b
--- /dev/null
+++ b/layout/reftests/mathml/dir-6a.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Test dir=rtl</title></head>
+ <body>
+
+ <p>
+ mtable:
+ <math dir="rtl">
+ <mtable rowspacing="">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ <p>
+ mtable:
+ <math dir="rtl">
+ <mtable frame="solid">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/disabled-scriptlevel-1-ref.html b/layout/reftests/mathml/disabled-scriptlevel-1-ref.html
new file mode 100644
index 0000000000..76658a0b67
--- /dev/null
+++ b/layout/reftests/mathml/disabled-scriptlevel-1-ref.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mtext>O</mtext>
+ <mstyle scriptlevel="1"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </randomelement>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </randomelement>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mroot>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </randomelement>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <msub>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mprescripts/>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </randomelement>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <munder>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munderover>
+ </mstyle>
+ </randomelement>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/disabled-scriptlevel-1-ref.xhtml b/layout/reftests/mathml/disabled-scriptlevel-1-ref.xhtml
new file mode 100644
index 0000000000..6b22791ab8
--- /dev/null
+++ b/layout/reftests/mathml/disabled-scriptlevel-1-ref.xhtml
@@ -0,0 +1,133 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ <style>
+ h2 {
+ text-align:center;
+ }
+ </style>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mtext>O</mtext>
+ <mstyle scriptlevel="1"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </randomelement>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </randomelement>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <mroot>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </randomelement>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <msub>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mprescripts/>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </randomelement>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <randomelement>
+ <mstyle scriptsizemultiplier="2">
+ <munder>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munderover>
+ </mstyle>
+ </randomelement>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/disabled-scriptlevel-1.html b/layout/reftests/mathml/disabled-scriptlevel-1.html
new file mode 100644
index 0000000000..9cd388f1c7
--- /dev/null
+++ b/layout/reftests/mathml/disabled-scriptlevel-1.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mtext>O</mtext>
+ <mstyle scriptlevel="1"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mroot>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </math>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <msub>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mprescripts/>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <munder>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munderover>
+ </mstyle>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/disabled-scriptlevel-1.xhtml b/layout/reftests/mathml/disabled-scriptlevel-1.xhtml
new file mode 100644
index 0000000000..5d710a787c
--- /dev/null
+++ b/layout/reftests/mathml/disabled-scriptlevel-1.xhtml
@@ -0,0 +1,133 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ <style>
+ h2 {
+ text-align:center;
+ }
+ </style>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle scriptsizemultiplier="2">
+ <mtext>O</mtext>
+ <mstyle scriptlevel="1"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle scriptsizemultiplier="2">
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle scriptsizemultiplier="2">
+ <mroot>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </math>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle scriptsizemultiplier="2">
+ <msub>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mprescripts/>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle scriptsizemultiplier="2">
+ <munder>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munderover>
+ </mstyle>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dtls-1-ref.html b/layout/reftests/mathml/dtls-1-ref.html
new file mode 100644
index 0000000000..0257d61aff
--- /dev/null
+++ b/layout/reftests/mathml/dtls-1-ref.html
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+<head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ math {
+ font-family: dtls-1;
+ }
+ </style>
+</head>
+<body>
+ <math>
+ <mover accent="true">
+ <mn>b</mn>
+ <mn>c</mn>
+ </mover>
+ <munder accentunder="true">
+ <mn>c</mn>
+ <mn>c</mn>
+ </munder>
+ <munderover accent="true" accentunder="true">
+ <mn>b</mn>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover accent="true">
+ <mover accent="true">
+ <mn>b</mn>
+ <mn>b</mn>
+ </mover>
+ <mn>c</mn>
+ </mover>
+ <mover accent="true">
+ <mover accent="true">
+ <mn>b</mn>
+ <mn>b</mn>
+ </mover>
+ <mover accent="true">
+ <mn>b</mn>
+ <mn>c</mn>
+ </mover>
+ </mover>
+ <munderover accent="true" accentunder="true">
+ <munderover accent="true" accentunder="true">
+ <mn>b</mn>
+ <mn>b</mn>
+ <mn>b</mn>
+ </munderover>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <munderover accent="true" accentunder="true">
+ <mn>b</mn>
+ <mn>b</mn>
+ <mn>b</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <mn>b</mn>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <mn>b</mn>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover accent="true">
+ <mn>c</mn>
+ <mn>c</mn>
+ </mover>
+ <munder accentunder="true">
+ <mn>c</mn>
+ <mn>c</mn>
+ </munder>
+ <munderover accent="true" accentunder="true">
+ <mn>c</mn>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover accent="false">
+ <mn>c</mn>
+ <mn>c</mn>
+ </mover>
+ <munderover accent="false" accentunder="false">
+ <mn>c</mn>
+ <mn>c</mn>
+ <mn>c</mn>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover>
+ <mo movablelimits="true">c</mo>
+ <mo>c</mo>
+ </mover>
+ <munderover>
+ <mo movablelimits="true">c</mo>
+ <mo>c</mo>
+ <mo>c</mo>
+ </munderover>
+ <mover accent="true">
+ <mo movablelimits="true">c</mo>
+ <mo>c</mo>
+ </mover>
+ <munderover accent="true">
+ <mo movablelimits="true">c</mo>
+ <mo>c</mo>
+ <mo>c</mo>
+ </munderover>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/dtls-1.html b/layout/reftests/mathml/dtls-1.html
new file mode 100644
index 0000000000..396324417f
--- /dev/null
+++ b/layout/reftests/mathml/dtls-1.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ math {
+ font-family: dtls-1;
+ }
+ </style>
+</head>
+<body>
+ <math>
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <munder accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </munder>
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover accent="true">
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <mn>a</mn>
+ </mover>
+ <mover accent="true">
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ </mover>
+ <munderover accent="true" accentunder="true">
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-feature-settings: 'dtls' 0">
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <munder accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </munder>
+ <munderover accent="true" accentunder="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mover accent="false">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <munderover accent="false" accentunder="false">
+ <mn>a</mn>
+ <mn>a</mn>
+ <mn>a</mn>
+ </munderover>
+ </math>
+
+ <p>
+
+ <math>
+ <mover>
+ <mo movablelimits="true">a</mo>
+ <mo>a</mo>
+ </mover>
+ <munderover>
+ <mo movablelimits="true">a</mo>
+ <mo>a</mo>
+ <mo>a</mo>
+ </munderover>
+ <mover accent="true">
+ <mo movablelimits="true">a</mo>
+ <mo>a</mo>
+ </mover>
+ <munderover accent="true">
+ <mo movablelimits="true">a</mo>
+ <mo>a</mo>
+ <mo>a</mo>
+ </munderover>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/dtls-2-ref.html b/layout/reftests/mathml/dtls-2-ref.html
new file mode 100644
index 0000000000..3a4e28375c
--- /dev/null
+++ b/layout/reftests/mathml/dtls-2-ref.html
@@ -0,0 +1,175 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>b</mo>
+ <!-- deliberately invalid -->
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mo>c</mo>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mrow>
+ <mrow>
+ <mrow>
+ <mo>b</mo>
+ </mrow>
+ </mrow>
+ </mrow>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style ="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>c</mo>
+ <mo>c</mo>
+ </mover>
+ <mover accent="true">
+ <mo>c</mo>
+ <mo>c</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover1" accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="false" id="mover2">
+ <mo>c</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover3">
+ <mo>c</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo movablelimits="true">c</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dtls-2.html b/layout/reftests/mathml/dtls-2.html
new file mode 100644
index 0000000000..41cf880a8f
--- /dev/null
+++ b/layout/reftests/mathml/dtls-2.html
@@ -0,0 +1,213 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover0">
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>a</mo>
+ <mo id="mo0"></mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>a</mo>
+ <mo id="mo1">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';" id="mstyle0">
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle1">
+ <mover accent="true">
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ <mover accent="true">
+ <mn>a</mn>
+ <mn>a</mn>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mrow>
+ <mrow>
+ <mrow id="mrow0">
+ </mrow>
+ </mrow>
+ </mrow>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle4" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ <mover accent="true">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ <mover accent="true">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover1">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover2">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover3">
+ <mo>a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo id="mo2">a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo id="mo3" movablelimits="true">a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <script>
+ function doTest()
+ {
+ var mo = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo.innerHTML = "a";
+ // An added child gets dtls font feature
+ document.getElementById("mover0").appendChild(mo);
+ // A child with changed text gets dtls font feature
+ document.getElementById("mo0").innerHTML = "a";
+ // A relocated child loses dtls font feature setting
+ document.getElementById("mstyle0").appendChild(document.getElementById("mo1"));
+ // A change in style
+ document.getElementById("mstyle1").setAttribute("style", "font-family: 'dtls-1';");
+
+ // dtls gets added to descendants as well
+ var mo1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo1.innerHTML = "a";
+ document.getElementById("mrow0").appendChild(mo1);
+ // removing explicit dtls setting works
+ document.getElementById("mstyle4").setAttribute(
+ "style", "font-family: 'dtls-1';")
+ // setting an explicit dtls font feature
+ document.getElementById("mstyle5").setAttribute(
+ "style" , "font-family: 'dtls-1'; font-feature-settings: 'dtls' 0");
+
+ // Adding accent="true" applies dtls font feature
+ document.getElementById("mover1").setAttribute("accent", "true");
+ // Changing accent="true" to false removes dtls font feature
+ document.getElementById("mover2").setAttribute("accent", "false");
+ // Removing accent="true" removes dtls font feature
+ document.getElementById("mover3").removeAttribute("accent");
+
+ // Movablelimits disables dtls font feature
+ document.getElementById("mo2").setAttribute("movablelimits", "true");
+ // Removing movablelimits restores dtls font feature
+ document.getElementById("mo3").removeAttribute("movablelimits");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dtls-3-ref.html b/layout/reftests/mathml/dtls-3-ref.html
new file mode 100644
index 0000000000..ce608acccb
--- /dev/null
+++ b/layout/reftests/mathml/dtls-3-ref.html
@@ -0,0 +1,175 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <!-- deliberately invalid -->
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mo>&#x1d520;</mo>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d51f;</mo>
+ </mover>
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mrow>
+ <mrow>
+ <mrow>
+ <mo>&#x1d51f;</mo>
+ </mrow>
+ </mrow>
+ </mrow>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style ="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ <mover accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0">
+ <mover accent="true">
+ <mover accent="true">
+ <mo>&#x1d520;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ <mover accent="true">
+ <mo>&#x1d520;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover1" accent="true">
+ <mo>&#x1d51f;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="false" id="mover2">
+ <mo>&#x1d520;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover3">
+ <mo>&#x1d520;</mo>
+ <mo>&#x1d520;</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>&#x1d51e;</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo>b</mo>
+ <mo>c</mo>
+ </mover>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dtls-3.html b/layout/reftests/mathml/dtls-3.html
new file mode 100644
index 0000000000..1602d997da
--- /dev/null
+++ b/layout/reftests/mathml/dtls-3.html
@@ -0,0 +1,216 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover0">
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur" id="mo0"></mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur" id="mo1">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';" id="mstyle0">
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle1">
+ <mover accent="true">
+ <mover accent="true">
+ <mn mathvariant="fraktur">a</mn>
+ <mn mathvariant="fraktur">a</mn>
+ </mover>
+ <mover accent="true">
+ <mn mathvariant="fraktur">a</mn>
+ <mn mathvariant="fraktur">a</mn>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mrow>
+ <mrow>
+ <mrow id="mrow0">
+ </mrow>
+ </mrow>
+ </mrow>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle4" style ="font-family: 'dtls-1'; font-feature-settings: 'dtls' 0">
+ <mover accent="true">
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ <mover accent="true">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover id="mover1">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover2">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true" id="mover3">
+ <mo mathvariant="fraktur">a</mo>
+ <mo mathvariant="fraktur">a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo id="mo2">a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'dtls-1';">
+ <mover accent="true">
+ <mo mathvariant="fraktur" id="mo3">a</mo>
+ <mo>a</mo>
+ </mover>
+ </mstyle>
+ </math>
+
+ <script>
+ function doTest()
+ {
+ var mo = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo.innerHTML = "a";
+ mo.setAttribute("mathvariant", "fraktur");
+ // An added child gets dtls font feature
+ document.getElementById("mover0").appendChild(mo);
+ // A child with changed text gets dtls font feature
+ document.getElementById("mo0").innerHTML = "a";
+ // A relocated child loses dtls font feature setting
+ document.getElementById("mstyle0").appendChild(document.getElementById("mo1"));
+ // A change in style
+ document.getElementById("mstyle1").setAttribute("style", "font-family: 'dtls-1';");
+
+ // dtls gets added to descendants as well
+ var mo1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo1.innerHTML = "a";
+ mo1.setAttribute("mathvariant", "fraktur");
+ document.getElementById("mrow0").appendChild(mo1);
+ // removing explicit dtls setting works
+ document.getElementById("mstyle4").setAttribute(
+ "style", "font-family: 'dtls-1';")
+ // setting an explicit dtls font feature
+ document.getElementById("mstyle5").setAttribute(
+ "style" , "font-family: 'dtls-1'; font-feature-settings: 'dtls' 0");
+
+ // Adding accent="true" applies dtls font feature
+ document.getElementById("mover1").setAttribute("accent", "true");
+ // Changing accent="true" to false removes dtls font feature
+ document.getElementById("mover2").setAttribute("accent", "false");
+ // Removing accent="true" removes dtls font feature
+ document.getElementById("mover3").removeAttribute("accent");
+
+ // dtls applies when mathvariant is set
+ document.getElementById("mo2").setAttribute("mathvariant", "fraktur");
+
+ // dtls still applies when mathvariant is removed
+ document.getElementById("mo3").removeAttribute("mathvariant");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/dynamic-mi-ref.xhtml b/layout/reftests/mathml/dynamic-mi-ref.xhtml
new file mode 100644
index 0000000000..672592bbbe
--- /dev/null
+++ b/layout/reftests/mathml/dynamic-mi-ref.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reftest for bug 409125</title>
+</head>
+
+<body>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi id="mi">mi</mi></math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/dynamic-mi.xhtml b/layout/reftests/mathml/dynamic-mi.xhtml
new file mode 100644
index 0000000000..beabdb2385
--- /dev/null
+++ b/layout/reftests/mathml/dynamic-mi.xhtml
@@ -0,0 +1,11 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>Reftest for bug 409125</title>
+</head>
+
+<body onload="document.getElementById('mi').firstChild.data = 'mi';">
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mi id="mi"> </mi></math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-1-ref.html b/layout/reftests/mathml/embellished-op-1-1-ref.html
new file mode 100644
index 0000000000..35e7ae42ad
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-1-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: maction</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- maction whose selected child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <maction actiontype="toggle" selection="2">
+ <mo stretchy="false">&#xaf;</mo>
+ <mo stretchy="false">&#xaf;</mo>
+ </maction>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-1.html b/layout/reftests/mathml/embellished-op-1-1.html
new file mode 100644
index 0000000000..0e9ae3b9dc
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: maction</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- maction whose selected child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <maction actiontype="toggle" selection="2">
+ <mo stretchy="false">&#xaf;</mo>
+ <mo>&#xaf;</mo>
+ </maction>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-2-ref.html b/layout/reftests/mathml/embellished-op-1-2-ref.html
new file mode 100644
index 0000000000..1350915919
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mrow</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mrow whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo stretchy="false">&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-2.html b/layout/reftests/mathml/embellished-op-1-2.html
new file mode 100644
index 0000000000..8cf655e58e
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mrow</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mrow whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-3-ref.html b/layout/reftests/mathml/embellished-op-1-3-ref.html
new file mode 100644
index 0000000000..f05828f8b1
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-3-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mstyle</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mstyle whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mstyle><mo stretchy="false">&#xaf;</mo></mstyle>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-3.html b/layout/reftests/mathml/embellished-op-1-3.html
new file mode 100644
index 0000000000..a2297da04b
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mstyle</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mstyle whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mstyle><mo>&#xaf;</mo></mstyle>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-4-ref.html b/layout/reftests/mathml/embellished-op-1-4-ref.html
new file mode 100644
index 0000000000..5dbe3c5efe
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-4-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mpadded</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mpadded whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mpadded><mo stretchy="false">&#xaf;</mo></mpadded>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-4.html b/layout/reftests/mathml/embellished-op-1-4.html
new file mode 100644
index 0000000000..841d0648aa
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-4.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mpadded</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mpadded whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mpadded><mo>&#xaf;</mo></mpadded>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-5-ref.html b/layout/reftests/mathml/embellished-op-1-5-ref.html
new file mode 100644
index 0000000000..8cd6bcd95c
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-5-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mphantom</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mphantom whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mtext>g</mtext>
+ <mphantom><mo stretchy="false">&#xaf;</mo></mphantom>
+ <mtext>h</mtext>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-1-5.html b/layout/reftests/mathml/embellished-op-1-5.html
new file mode 100644
index 0000000000..19da59a07a
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-1-5.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 1: mphantom</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- mphantom whose child is embellished op -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mtext>g</mtext>
+ <mphantom><mo>&#xaf;</mo></mphantom>
+ <mtext>h</mtext>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-1-ref.html b/layout/reftests/mathml/embellished-op-2-1-ref.html
new file mode 100644
index 0000000000..890845ec1c
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- first child space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mtext>g</mtext><mo stretchy="false">&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-1.html b/layout/reftests/mathml/embellished-op-2-1.html
new file mode 100644
index 0000000000..9c36b95eb7
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- first child space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mtext>g</mtext><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-2-ref.html b/layout/reftests/mathml/embellished-op-2-2-ref.html
new file mode 100644
index 0000000000..670345564d
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- last child space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo stretchy="false">&#xaf;</mo><mtext>g</mtext></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-2.html b/layout/reftests/mathml/embellished-op-2-2.html
new file mode 100644
index 0000000000..59696fd9d1
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- last child space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo>&#xaf;</mo><mtext>g</mtext></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-3-ref.html b/layout/reftests/mathml/embellished-op-2-3-ref.html
new file mode 100644
index 0000000000..5041324f38
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-3-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- first and last children space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mtext>g</mtext>
+ <mo stretchy="false">&#xaf;</mo>
+ <mtext>h</mtext>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-3.html b/layout/reftests/mathml/embellished-op-2-3.html
new file mode 100644
index 0000000000..f2220eff87
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- first and last children space-like -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mtext>g</mtext><mo>&#xaf;</mo><mtext>h</mtext></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-4-ref.html b/layout/reftests/mathml/embellished-op-2-4-ref.html
new file mode 100644
index 0000000000..0b39465171
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-4-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- many space-like children -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mspace/>
+ <mtext>g</mtext>
+ <mspace/>
+ <mo stretchy="false">&#xaf;</mo>
+ <mspace/>
+ <mspace/>
+ <mtext>h</mtext>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-2-4.html b/layout/reftests/mathml/embellished-op-2-4.html
new file mode 100644
index 0000000000..199b5e8fc0
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-2-4.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: ignore space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- many space-like children -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mspace/>
+ <mtext>g</mtext>
+ <mspace/>
+ <mo>&#xaf;</mo>
+ <mspace/>
+ <mspace/>
+ <mtext>h</mtext>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-1-ref.html b/layout/reftests/mathml/embellished-op-3-1-ref.html
new file mode 100644
index 0000000000..fb651c11a7
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-1-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like maction -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <maction actiontype="toggle" selection="2">
+ <mi>g</mi>
+ <mspace/>
+ </maction>
+ <mo stretchy="false">&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-1.html b/layout/reftests/mathml/embellished-op-3-1.html
new file mode 100644
index 0000000000..c229de35d4
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-1.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like maction -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <maction actiontype="toggle" selection="2">
+ <mi>g</mi>
+ <mspace/>
+ </maction>
+ <mo>&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-2-ref.html b/layout/reftests/mathml/embellished-op-3-2-ref.html
new file mode 100644
index 0000000000..2d1510aa94
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mrow -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mrow><mspace/></mrow><mo stretchy="false">&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-2.html b/layout/reftests/mathml/embellished-op-3-2.html
new file mode 100644
index 0000000000..4b0e6f094b
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mrow -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mrow><mspace/></mrow><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-3-ref.html b/layout/reftests/mathml/embellished-op-3-3-ref.html
new file mode 100644
index 0000000000..9c22107eb1
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-3-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mstyle -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mstyle><mspace/></mstyle><mo stretchy="false">&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-3.html b/layout/reftests/mathml/embellished-op-3-3.html
new file mode 100644
index 0000000000..826b86adb8
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-3.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mstyle -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mstyle><mspace/></mstyle><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-4-ref.html b/layout/reftests/mathml/embellished-op-3-4-ref.html
new file mode 100644
index 0000000000..6e8b9c94ae
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-4-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mpadded -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mpadded><mspace/></mpadded><mo stretchy="false">&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-4.html b/layout/reftests/mathml/embellished-op-3-4.html
new file mode 100644
index 0000000000..a822be31cc
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-4.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mpadded -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mpadded><mspace/></mpadded><mo>&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-5-ref.html b/layout/reftests/mathml/embellished-op-3-5-ref.html
new file mode 100644
index 0000000000..f0e5141495
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-5-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mphantom -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mphantom><mspace/></mphantom><mo stretchy="false">&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-3-5.html b/layout/reftests/mathml/embellished-op-3-5.html
new file mode 100644
index 0000000000..e681513d4d
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-3-5.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators: maction and mrow-like as space-like children
+ </title>
+ </head>
+
+ <body>
+ <div>
+ <!-- space-like mphantom -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mphantom><mspace/></mphantom><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-1-ref.html b/layout/reftests/mathml/embellished-op-4-1-ref.html
new file mode 100644
index 0000000000..034f4f5351
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-1-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-1: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- two embellished operators -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow>
+ <mo stretchy="false">&#xaf;</mo>
+ <mo stretchy="false">&#xaf;</mo>
+ </mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-1.html b/layout/reftests/mathml/embellished-op-4-1.html
new file mode 100644
index 0000000000..b35119c507
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-1: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- two embellished operators -->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo>&#xaf;</mo><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-2-ref.html b/layout/reftests/mathml/embellished-op-4-2-ref.html
new file mode 100644
index 0000000000..2b59fc59a3
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-2: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- a non-space-like child before-->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mi>g</mi><mo stretchy="false">&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-2.html b/layout/reftests/mathml/embellished-op-4-2.html
new file mode 100644
index 0000000000..508e8684ff
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-2: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- a non-space-like child before-->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mi>g</mi><mo>&#xaf;</mo></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-3-ref.html b/layout/reftests/mathml/embellished-op-4-3-ref.html
new file mode 100644
index 0000000000..c898799d77
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-3-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-3: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- a non-space-like child after-->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo stretchy="false">&#xaf;</mo><mi>g</mi></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-4-3.html b/layout/reftests/mathml/embellished-op-4-3.html
new file mode 100644
index 0000000000..fa58c70cd5
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-4-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 4-3: some non-space-like children</title>
+ </head>
+
+ <body>
+ <div>
+ <!-- a non-space-like child after-->
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mtext>abcdef</mtext>
+ <mrow><mo>&#xaf;</mo><mi>g</mi></mrow>
+ </mover>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-5-1.html b/layout/reftests/mathml/embellished-op-5-1.html
new file mode 100644
index 0000000000..1a494b83c9
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-5-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 5: vertical stretchy operator</title>
+ </head>
+
+ <body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mrow>
+ <msub>
+ <mo>|</mo>
+ <mspace/>
+ </msub>
+ </mrow>
+ <mspace height="30px" depth="30px"/>
+ </mrow>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-5-2.html b/layout/reftests/mathml/embellished-op-5-2.html
new file mode 100644
index 0000000000..2fbd96c395
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-5-2.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 5: vertical stretchy operator</title>
+ </head>
+
+ <body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <msub>
+ <mo>|</mo>
+ <mspace/>
+ </msub>
+ <mspace height="30px" depth="30px"/>
+ </mrow>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/embellished-op-5-ref.html b/layout/reftests/mathml/embellished-op-5-ref.html
new file mode 100644
index 0000000000..7ba40a4e7b
--- /dev/null
+++ b/layout/reftests/mathml/embellished-op-5-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>embellished operators 5: vertical stretchy operator</title>
+ </head>
+
+ <body>
+ <div>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mo>|</mo>
+ <mspace height="30px" depth="30px"/>
+ </mrow>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/font-inflation-1-ref.html b/layout/reftests/mathml/font-inflation-1-ref.html
new file mode 100644
index 0000000000..1f711b1918
--- /dev/null
+++ b/layout/reftests/mathml/font-inflation-1-ref.html
@@ -0,0 +1,74 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Font Inflation</title>
+ <meta charset="utf-8"/>
+ <style>
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ p, math {
+ font-family: serif;
+ }
+ </style>
+ </head>
+ <body>
+
+<p>The text
+'<math>
+ <mrow id="ref">
+ <mtext style="font-family: dtls-1">&#x1D51E;</mtext>
+ <mtext>+</mtext>
+ </mrow>
+ </math>'
+should have the same size as inline math
+'<math>
+ <mrow id="inline">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </math>'
+or math in a table: '<math><mtable><mtr>
+ <mtd>
+ <mrow id="cell">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </mtd>
+ </mtr></mtable></math>'
+(but not necessarily the same size as block-level math
+<math display="block">
+ <mrow id="display">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </math>
+because it forms a BFC and hence is its own inflation container.)
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem
+ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
+eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
+in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor
+sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
+labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
+aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
+amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
+et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
+ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
+in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
+officia deserunt mollit anim id est laborum.</p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/font-inflation-1.html b/layout/reftests/mathml/font-inflation-1.html
new file mode 100644
index 0000000000..45e25f21d5
--- /dev/null
+++ b/layout/reftests/mathml/font-inflation-1.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Font Inflation</title>
+ <meta charset="utf-8"/>
+ <style>
+ @font-face {
+ font-family: "dtls-1";
+ src: url(../fonts/math/dtls-1.otf);
+ }
+ p, math {
+ font-family: serif;
+ }
+ </style>
+ <script type="text/javascript">
+ function almostEqual(aX, aY) {
+ var epsilon = 2.6;
+ 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. */
+ if (!almostEqual(aElement.getBoundingClientRect().height,
+ aReference.getBoundingClientRect().height) ||
+ !almostEqual(aElement.getBoundingClientRect().width,
+ aReference.getBoundingClientRect().width)) {
+ aElement.setAttribute("mathcolor", "red");
+ }
+ }
+
+ function verifySizes() {
+ /* Compare the size of the elements in the inline and display equations
+ against the reference mtext elements. */
+ var ref = document.getElementById("ref");
+ var inline = document.getElementById("inline");
+ var cell = document.getElementById("cell");
+ for (var i = 0; i < ref.children.length; i++) {
+ verifySize(inline.children[i], ref.children[i]);
+ verifySize(cell.children[i], ref.children[i]);
+ }
+
+ document.documentElement.removeAttribute("class");
+ }
+
+ window.addEventListener("MozReftestInvalidate", verifySizes);
+ </script>
+ </head>
+ <body>
+
+<p>The text
+'<math>
+ <mrow id="ref">
+ <mtext style="font-family: dtls-1">&#x1D51E;</mtext>
+ <mtext>+</mtext>
+ </mrow>
+ </math>'
+should have the same size as inline math
+'<math>
+ <mrow id="inline">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </math>'
+or math in a table: '<math><mtable><mtr>
+ <mtd>
+ <mrow id="cell">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </mtd>
+ </mtr></mtable></math>'
+(but not necessarily the same size as block-level math
+<math display="block">
+ <mrow id="display">
+ <mtext style="font-family: dtls-1" mathvariant="fraktur">a</mtext>
+ <mo>+</mo>
+ </mrow>
+ </math>
+because it forms a BFC and hence is its own inflation container.)
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem
+ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
+incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
+nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
+eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
+in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor
+sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
+labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis
+aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
+fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit
+amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore
+et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
+ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor
+in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
+officia deserunt mollit anim id est laborum.</p>
+
+ </body>
+</html>
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/link-1.xhtml b/layout/reftests/mathml/link-1.xhtml
new file mode 100644
index 0000000000..f98bbccb55
--- /dev/null
+++ b/layout/reftests/mathml/link-1.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Test XLink</title>
+</head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML"
+ xmlns:xlink="http://www.w3.org/1999/xlink">
+ <mtext xlink:type="simple" href="www.mozilla.org">MathML Link</mtext>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/link-ref.xhtml b/layout/reftests/mathml/link-ref.xhtml
new file mode 100644
index 0000000000..a5ac817f18
--- /dev/null
+++ b/layout/reftests/mathml/link-ref.xhtml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Test link</title>
+</head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mtext>MathML Link</mtext>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-1-ref.html b/layout/reftests/mathml/maction-dynamic-1-ref.html
new file mode 100644
index 0000000000..d4e9c91d74
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-1-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dynamic maction 1</title>
+</head>
+
+<body>
+
+<p>
+<math>
+ <mtext>__2__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__1__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__1__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mn>1</mn>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__2__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__3__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__3__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__3__</mtext>
+</math>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-1.html b/layout/reftests/mathml/maction-dynamic-1.html
new file mode 100644
index 0000000000..9f848a6f43
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-1.html
@@ -0,0 +1,107 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<title>dynamic maction 1</title>
+</head>
+
+<body>
+
+<p>
+<math>
+ <maction id="m1" actiontype="toggle">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m2" actiontype="toggle" selection="2">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m3" actiontype="toggle" selection="2">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m4" actiontype="toggle">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m5" actiontype="toggle">
+ <mtext id="m51">__1__</mtext>
+ <mtext id="m52">__2__</mtext>
+ <mtext id="m53">__3__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m6" actiontype="toggle" selection="3">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m7" actiontype="toggle">
+ <mtext id="m71">__1__</mtext>
+ <mtext id="m72">__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m8" actiontype="toggle">
+ <mtext id="m81">__1__</mtext>
+ <mtext id="m82">__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<script>
+function doTest() {
+ document.getElementById("m1").setAttribute("selection", "2");
+ document.getElementById("m2").removeAttribute("selection");
+ document.getElementById("m3").setAttribute("actiontype", "statusline");
+ document.getElementById("m4").setAttribute("actiontype", "statusline");
+
+ var child51 = document.getElementById("m51");
+ document.getElementById("m5").removeChild(child51);
+
+ var child53 = document.getElementById("m53");
+ document.getElementById("m6").appendChild(child53.cloneNode(true));
+
+ var child71 = document.getElementById("m71");
+ document.getElementById("m7").insertBefore(child53.cloneNode(true), child71);
+
+ var child81 = document.getElementById("m81");
+ document.getElementById("m8").replaceChild(child53.cloneNode(true), child81);
+
+ document.documentElement.removeAttribute('class');
+}
+window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-2-ref.html b/layout/reftests/mathml/maction-dynamic-2-ref.html
new file mode 100644
index 0000000000..da9e8681a5
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-2-ref.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dynamic maction 2</title>
+</head>
+
+<body>
+
+<p>
+<math>
+ <mtext>__1__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__1__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__2__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__2__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__1__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__3__</mtext>
+</math>
+</p>
+
+<p>
+<math>
+ <mtext>__3__</mtext>
+</math>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-2.html b/layout/reftests/mathml/maction-dynamic-2.html
new file mode 100644
index 0000000000..fc6e48f744
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-2.html
@@ -0,0 +1,96 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<title>dynamic maction 2</title>
+</head>
+
+<body>
+
+<p>
+<math>
+ <maction id="m1" actiontype="statusline">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m2" actiontype="statusline" selection="2">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m3" actiontype="statusline" selection="2">
+ <mtext>__1__</mtext>
+ <mtext>__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m4" actiontype="statusline">
+ <mtext id="m41">__1__</mtext>
+ <mtext id="m42">__2__</mtext>
+ <mtext id="m43">__3__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m5" actiontype="statusline">
+ <mtext>__1__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m6" actiontype="statusline">
+ <mtext id="m61">__1__</mtext>
+ <mtext id="m62">__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m7" actiontype="statusline">
+ <mtext id="m71">__1__</mtext>
+ <mtext id="m72">__2__</mtext>
+ </maction>
+</math>
+</p>
+
+<script>
+function doTest() {
+ document.getElementById("m1").setAttribute("selection", "2");
+ document.getElementById("m2").removeAttribute("selection");
+ document.getElementById("m3").setAttribute("actiontype", "toggle");
+
+ var child41 = document.getElementById("m41");
+ document.getElementById("m4").removeChild(child41);
+
+ var child43 = document.getElementById("m43");
+ document.getElementById("m5").appendChild(child43.cloneNode(true));
+
+ var child61 = document.getElementById("m61");
+ document.getElementById("m6").insertBefore(child43.cloneNode(true), child61);
+
+ var child71 = document.getElementById("m71");
+ document.getElementById("m7").replaceChild(child43.cloneNode(true), child71);
+
+ document.documentElement.removeAttribute('class');
+}
+window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-3-ref.html b/layout/reftests/mathml/maction-dynamic-3-ref.html
new file mode 100644
index 0000000000..9a8f940334
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-3-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>dynamic maction 3</title>
+</head>
+
+<body>
+
+<!-- This element generates an invalid markup error. -->
+<!-- We are assuming here that all invalid MathML markups look the same. -->
+<p><math><msup><mi>x</mi></msup></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><msup><mi>x</mi></msup></math></p>
+
+<p><math><msup><mi>x</mi></msup></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><mtext>--1--</mtext></math></p>
+
+<p><math><msup><mi>x</mi></msup></math></p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-3.html b/layout/reftests/mathml/maction-dynamic-3.html
new file mode 100644
index 0000000000..06ce27d231
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-3.html
@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<title>dynamic maction 3</title>
+</head>
+
+<body>
+
+<p>
+<math>
+ <maction id="m1" actiontype="toggle">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m2" actiontype="toggle" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m3" actiontype="toggle" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m4" actiontype="toggle">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m5" actiontype="toggle" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m6" actiontype="toggle">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m7">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m8" actiontype="unknown-action-type">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m9" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m10" actiontype="unknown-action-type" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m11" actiontype="statusline">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<p>
+<math>
+ <maction id="m12" actiontype="statusline" selection="5">
+ <mtext>--1--</mtext>
+ <mtext>--2--</mtext>
+ </maction>
+</math>
+</p>
+
+<script>
+ function doTest() {
+ document.getElementById("m1").setAttribute("selection", "5");
+ document.getElementById("m2").setAttribute("selection", "1");
+ document.getElementById("m3").setAttribute("actiontype", "statusline");
+ document.getElementById("m4").removeAttribute("actiontype");
+ document.getElementById("m5").setAttribute("actiontype", "unknown-action-type");
+ document.getElementById("m6").setAttribute("actiontype", "unknown-action-type");
+ document.getElementById("m7").setAttribute("actiontype", "toggle");
+ document.getElementById("m8").setAttribute("actiontype", "toggle");
+ document.getElementById("m9").setAttribute("actiontype", "statusline");
+ document.getElementById("m10").setAttribute("actiontype", "statusline");
+ document.getElementById("m11").setAttribute("selection", "5");
+ document.getElementById("m12").setAttribute("actiontype", "toggle");
+
+ document.documentElement.removeAttribute('class');
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-embellished-op-ref.html b/layout/reftests/mathml/maction-dynamic-embellished-op-ref.html
new file mode 100644
index 0000000000..c9616bedb1
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-embellished-op-ref.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+<title>dynamic maction and embellished op</title>
+<style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ p, math {
+ font: 25px Ahem;
+ }
+</style>
+</head>
+
+<body>
+
+ <p>É<math><maction actiontype="toggle" id="m1" selection="2"><mn>X</mn><mo>p</mo></maction></math>É</p>
+ <p>É<math><maction actiontype="toggle" id="m2" selection="2"><mo>p</mo><mn>X</mn></maction></math>É</p>
+
+ <p>É<math><maction actiontype="toggle" id="m3"><mo>p</mo></maction></math>É</p>
+ <p>É<math><maction actiontype="toggle" id="m3bis"><mn>X</mn><mo>p</mo></maction></math>É</p>
+
+ <p>{<math><maction actiontype="toggle" id="m4"><mn>X</mn></maction></math>}</p>
+ <p>{<math><maction actiontype="toggle" id="m4bis"><mo>p</mo><mn>X</mn></maction></math>}</p>
+
+
+ <p>[<math>
+ <mstyle id="m5" selection="2"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></mstyle>
+ </math>]</p>
+ <p>[<math>
+ <mstyle id="m6" selection="2"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></mstyle>
+ </math>]</p>
+
+ <p>(<math id="m7" selection="2"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></math>)</p>
+ <p>(<math id="m8" selection="2"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></math>)</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-dynamic-embellished-op.html b/layout/reftests/mathml/maction-dynamic-embellished-op.html
new file mode 100644
index 0000000000..7b66469918
--- /dev/null
+++ b/layout/reftests/mathml/maction-dynamic-embellished-op.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+
+<head>
+<title>dynamic maction and embellished op</title>
+<style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ p, math {
+ font: 25px Ahem;
+ }
+</style>
+</head>
+
+<body>
+
+ <p>É<math><maction actiontype="toggle" id="m1"><mn>X</mn><mo>p</mo></maction></math>É</p>
+ <p>É<math><maction actiontype="toggle" id="m2"><mo>p</mo><mn>X</mn></maction></math>É</p>
+
+ <p>É<math><maction actiontype="toggle" id="m3"><mn>X</mn><mo>p</mo></maction></math>É</p>
+ <p>É<math><maction actiontype="toggle" id="m3bis"><mo>p</mo></maction></math>É</p>
+
+ <p>{<math><maction actiontype="toggle" id="m4"><mo>p</mo><mn>X</mn></maction></math>}</p>
+ <p>{<math><maction actiontype="toggle" id="m4bis"><mn>X</mn></maction></math>}</p>
+
+
+ <p>[<math>
+ <mstyle id="m5"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></mstyle>
+ </math>]</p>
+ <p>[<math>
+ <mstyle id="m6"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></mstyle>
+ </math>]</p>
+
+ <p>(<math id="m7"><maction actiontype="toggle"><mn>X</mn><mo>p</mo></maction></math>)</p>
+ <p>(<math id="m8"><maction actiontype="toggle"><mo>p</mo><mn>X</mn></maction></math>)</p>
+
+<script>
+function doTest()
+{
+ document.getElementById("m1").setAttribute("selection", "2");
+ document.getElementById("m2").setAttribute("selection", "2");
+
+ var m3 = document.getElementById("m3");
+ var m3bis = document.getElementById("m3bis");
+ m3bis.insertBefore(m3.removeChild(m3.firstChild), m3bis.firstChild);
+
+ var m4 = document.getElementById("m4");
+ var m4bis = document.getElementById("m4bis");
+ m4bis.insertBefore(m4.removeChild(m4.firstChild), m4bis.firstChild);
+
+ document.getElementById("m5").setAttribute("selection", "2");
+ document.getElementById("m6").setAttribute("selection", "2");
+
+ document.getElementById("m7").setAttribute("selection", "2");
+ document.getElementById("m8").setAttribute("selection", "2");
+
+ document.documentElement.removeAttribute("class");
+}
+
+window.addEventListener("MozReftestInvalidate", doTest);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-selection-ref.html b/layout/reftests/mathml/maction-selection-ref.html
new file mode 100644
index 0000000000..9c5e6b8600
--- /dev/null
+++ b/layout/reftests/mathml/maction-selection-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>maction selection</title>
+</head>
+
+<body>
+
+<p>Statusline:
+<math>
+ <msqrt><mi>x</mi></msqrt>
+</math>
+</p>
+
+<p>Tooltip:
+<math>
+ <msqrt><mi>x</mi></msqrt>
+</math>
+</p>
+
+<p>Toggle:
+<math>
+ <mfrac>
+ <mn>6</mn>
+ <mn>8</mn>
+ </mfrac>
+</math>
+</p>
+
+<p>Toggle 2:
+<math>
+ <maction actiontype="toggle" selection="1">
+
+ <mfrac>
+ <mn>6</mn>
+ <mn>8</mn>
+ </mfrac>
+
+ <mfrac>
+ <mn>3</mn>
+ <mn>4</mn>
+ </mfrac>
+
+ </maction>
+</math>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/maction-selection.html b/layout/reftests/mathml/maction-selection.html
new file mode 100644
index 0000000000..ce08748b75
--- /dev/null
+++ b/layout/reftests/mathml/maction-selection.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>maction selection</title>
+</head>
+
+<body>
+
+<p>Statusline:
+<math>
+ <maction actiontype="statusline" selection="2">
+ <msqrt><mi>x</mi></msqrt>
+ <mtext>square root of x</mtext>
+ </maction>
+</math>
+</p>
+
+<p>Tooltip:
+<math>
+ <maction actiontype="tooltip" selection="2">
+ <msqrt><mi>x</mi></msqrt>
+ <mtext>square root of x</mtext>
+ </maction>
+</math>
+</p>
+
+<p>Toggle:
+<math>
+ <maction actiontype="toggle" selection="2">
+
+ <mfrac>
+ <mn>3</mn>
+ <mn>4</mn>
+ </mfrac>
+
+ <mfrac>
+ <mn>6</mn>
+ <mn>8</mn>
+ </mfrac>
+
+ </maction>
+</math>
+</p>
+
+<p>Toggle 2:
+<math>
+ <maction actiontype="toggle" selection="2">
+
+ <mfrac>
+ <mn>3</mn>
+ <mn>4</mn>
+ </mfrac>
+
+ <mfrac>
+ <mn>6</mn>
+ <mn>8</mn>
+ </mfrac>
+
+ </maction>
+</math>
+</p>
+
+</body>
+</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/mathml-negativespace-ref.html b/layout/reftests/mathml/mathml-negativespace-ref.html
new file mode 100644
index 0000000000..b7727952eb
--- /dev/null
+++ b/layout/reftests/mathml/mathml-negativespace-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+ <head></head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativeveryverythinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativeverythinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativethinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativemediummathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativethickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativeverythickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="negativeveryverythickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathml-negativespace.html b/layout/reftests/mathml/mathml-negativespace.html
new file mode 100644
index 0000000000..7415f000c9
--- /dev/null
+++ b/layout/reftests/mathml/mathml-negativespace.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head></head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.0555555556em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.111111111em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.166666667em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.222222222em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.277777778em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.333333333em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="-0.388888889em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathml-type-supported-ref.xml b/layout/reftests/mathml/mathml-type-supported-ref.xml
new file mode 100644
index 0000000000..1a471a2c6e
--- /dev/null
+++ b/layout/reftests/mathml/mathml-type-supported-ref.xml
@@ -0,0 +1,4 @@
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mspace style="position: absolute; top: 0; left: 0; background: green;"
+ width="100px" height="100px" depth="0"/>
+</math>
diff --git a/layout/reftests/mathml/mathml-type-supported.xhtml b/layout/reftests/mathml/mathml-type-supported.xhtml
new file mode 100644
index 0000000000..3fec7f1ab6
--- /dev/null
+++ b/layout/reftests/mathml/mathml-type-supported.xhtml
@@ -0,0 +1,10 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>Test mime type application/mathml+xml</title>
+</head>
+<body>
+ <object type="application/mathml+xml" data="mathml-type-supported-ref.xml"
+ style="position: absolute; top: 0; left: 0; background: red;
+ width: 100px; height: 100px;"/>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mathscript-1-ref.html b/layout/reftests/mathml/mathscript-1-ref.html
new file mode 100644
index 0000000000..76d95465bf
--- /dev/null
+++ b/layout/reftests/mathml/mathscript-1-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<head>
+
+ <!-- This font only has glyphs defined for 'A', 'B', 'C' and 'D', and is
+ designed purely for testing ssty and OpenType 'math' script
+ functionality
+ The glyphs for 'A' and 'D' are identical, the difference between them is
+ that 'A' supports the ssty font feature.
+ 'A' with ssty = 1 maps to 'B'
+ 'A' with ssty = 2 maps to 'C'
+ The difference between this font and ssty.woff is that the font feature
+ is contained within the OpenType 'math' script. -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "mathssty";
+ src: url("mathssty.woff");
+ }
+ </style>
+</head>
+<body>
+
+ <!-- Demonstrate that it has no effect outside MathML -->
+ <div style="font-family: 'mathssty';">D</div>
+ <div style="font-family: 'mathssty';">D</div>
+
+ <!-- Demonstrate that it works within MathML -->
+ <math>
+ <mstyle style="font-family: 'mathssty';">
+ <mrow>
+ <mo>D</mo>
+ <mo>B</mo>
+ <mo>C</mo>
+ </mrow>
+ </mstyle>
+ </math>
+ <p>
+ <!-- verify it works for the other elements except mtext -->
+ <math>
+ <mstyle style="font-family: 'mathssty';">
+ <mi mathvariant="normal">C</mi>
+ <mn>C</mn>
+ <mtext>D</mtext>
+ </mstyle>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/mathscript-1.html b/layout/reftests/mathml/mathscript-1.html
new file mode 100644
index 0000000000..8ec15d218f
--- /dev/null
+++ b/layout/reftests/mathml/mathscript-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "mathssty";
+ src: url("mathssty.woff");
+ }
+ </style>
+</head>
+<body>
+
+ <!-- Demonstrate that it has no effect outside MathML -->
+ <div style="font-family: 'mathssty';
+ font-feature-settings: 'ssty' 1">A</div>
+ <div style="font-family: 'mathssty';
+ font-feature-settings: 'ssty' 2">A</div>
+
+ <!-- Demonstrate that it works within MathML -->
+ <math>
+ <mstyle style="font-family: 'mathssty';">
+ <mrow>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo style="font-feature-settings: 'ssty' 1">A</mo>
+ <mo style="font-feature-settings: 'ssty' 2">A</mo>
+ </mrow>
+ </mstyle>
+ </math>
+ <p>
+ <!-- verify it works for the other elements except mtext -->
+ <math>
+ <mstyle style="font-family: 'mathssty'; font-feature-settings: 'ssty' 2">
+ <mi mathvariant="normal">A</mi>
+ <mn>A</mn>
+ <mtext>A</mtext>
+ </mstyle>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/mathscript-2-ref.html b/layout/reftests/mathml/mathscript-2-ref.html
new file mode 100644
index 0000000000..6681292474
--- /dev/null
+++ b/layout/reftests/mathml/mathscript-2-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic OpenType 'math' script tests</title>
+ <!-- See mathscript-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "mathssty";
+ src: url("mathssty.woff");
+ }
+ </style>
+ </head>
+ <body>
+
+ <!-- Demonstrate that it has no effect outside MathML -->
+ <div style="font-family: 'mathssty';" >DD</div>
+
+ <!-- Demonstrate that it works within MathML -->
+ <math>
+ <mstyle style="font-family: 'mathssty';">
+ <mo>CC</mo>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathscript-2.html b/layout/reftests/mathml/mathscript-2.html
new file mode 100644
index 0000000000..d402246631
--- /dev/null
+++ b/layout/reftests/mathml/mathscript-2.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic OpenType 'math' script tests</title>
+ <!-- See mathscript-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "mathssty";
+ src: url("mathssty.woff");
+ }
+ </style>
+ </head>
+ <body>
+
+ <!-- Demonstrate that it has no effect outside MathML -->
+ <div style="font-family: 'mathssty';
+ font-feature-settings: 'ssty' " id="div0">A</div>
+
+ <!-- Demonstrate that it works within MathML -->
+ <math>
+ <mstyle style="font-family: 'mathssty'; font-feature-settings: 'ssty' 2">
+ <mo id="mo0">A</mo>
+ </mstyle>
+ </math>
+
+ <script>
+ function doTest()
+ {
+ // Does nothing to non-MathML
+ document.getElementById("div0").appendChild(document.createTextNode("A"));
+ // Does something to MathML
+ document.getElementById("mo0").appendChild(document.createTextNode("A"));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathssty.woff b/layout/reftests/mathml/mathssty.woff
new file mode 100644
index 0000000000..eb6a667753
--- /dev/null
+++ b/layout/reftests/mathml/mathssty.woff
Binary files differ
diff --git a/layout/reftests/mathml/mathvariant-1a-ref.html b/layout/reftests/mathml/mathvariant-1a-ref.html
new file mode 100644
index 0000000000..b70be9312f
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1a-ref.html
@@ -0,0 +1,233 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext>ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
+ <mtext>abcdefghijklmnopqrstuvwxyz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d400;&#x1d401;&#x1d402;&#x1d403;&#x1d404;&#x1d405;
+ &#x1d406;&#x1d407;&#x1d408;&#x1d409;&#x1d40a;&#x1d40b;
+ &#x1d40c;&#x1d40d;&#x1d40e;&#x1d40f;&#x1d410;&#x1d411;
+ &#x1d412;&#x1d413;&#x1d414;&#x1d415;&#x1d416;&#x1d417;
+ &#x1d418;&#x1d419;
+ &#x1d41a;&#x1d41b;&#x1d41c;&#x1d41d;&#x1d41e;&#x1d41f;
+ &#x1d420;&#x1d421;&#x1d422;&#x1d423;&#x1d424;&#x1d425;
+ &#x1d426;&#x1d427;&#x1d428;&#x1d429;&#x1d42a;&#x1d42b;
+ &#x1d42c;&#x1d42d;&#x1d42e;&#x1d42f;&#x1d430;&#x1d431;
+ &#x1d432;&#x1d433;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d434;&#x1d435;&#x1d436;&#x1d437;&#x1d438;&#x1d439;
+ &#x1d43a;&#x1d43b;&#x1d43c;&#x1d43d;&#x1d43e;&#x1d43f;
+ &#x1d440;&#x1d441;&#x1d442;&#x1d443;&#x1d444;&#x1d445;
+ &#x1d446;&#x1d447;&#x1d448;&#x1d449;&#x1d44a;&#x1d44b;
+ &#x1d44c;&#x1d44d;
+ &#x1d44e;&#x1d44f;&#x1d450;&#x1d451;&#x1d452;&#x1d453;
+ &#x1d454;&#x210e;&#x1d456;&#x1d457;&#x1d458;&#x1d459;
+ &#x1d45a;&#x1d45b;&#x1d45c;&#x1d45d;&#x1d45e;&#x1d45f;
+ &#x1d460;&#x1d461;&#x1d462;&#x1d463;&#x1d464;&#x1d465;
+ &#x1d466;&#x1d467;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d468;&#x1d469;&#x1d46a;&#x1d46b;&#x1d46c;&#x1d46d;
+ &#x1d46e;&#x1d46f;&#x1d470;&#x1d471;&#x1d472;&#x1d473;
+ &#x1d474;&#x1d475;&#x1d476;&#x1d477;&#x1d478;&#x1d479;
+ &#x1d47a;&#x1d47b;&#x1d47c;&#x1d47d;&#x1d47e;&#x1d47f;
+ &#x1d480;&#x1d481;
+ &#x1d482;&#x1d483;&#x1d484;&#x1d485;&#x1d486;&#x1d487;
+ &#x1d488;&#x1d489;&#x1d48a;&#x1d48b;&#x1d48c;&#x1d48d;
+ &#x1d48e;&#x1d48f;&#x1d490;&#x1d491;&#x1d492;&#x1d493;
+ &#x1d494;&#x1d495;&#x1d496;&#x1d497;&#x1d498;&#x1d499;
+ &#x1d49a;&#x1d49b;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d49c;&#x212c;&#x1d49e;&#x1d49f;&#x2130;&#x2131;
+ &#x1d4a2;&#x210b;&#x2110;&#x1d4a5;&#x1d4a6;&#x2112;
+ &#x2133;&#x1d4a9;&#x1d4aa;&#x1d4ab;&#x1d4ac;&#x211b;
+ &#x1d4ae;&#x1d4af;&#x1d4b0;&#x1d4b1;&#x1d4b2;&#x1d4b3;
+ &#x1d4b4;&#x1d4b5;
+ &#x1d4b6;&#x1d4b7;&#x1d4b8;&#x1d4b9;&#x212f;&#x1d4bb;
+ &#x210a;&#x1d4bd;&#x1d4be;&#x1d4bf;&#x1d4c0;&#x1d4c1;
+ &#x1d4c2;&#x1d4c3;&#x2134;&#x1d4c5;&#x1d4c6;&#x1d4c7;
+ &#x1d4c8;&#x1d4c9;&#x1d4ca;&#x1d4cb;&#x1d4cc;&#x1d4cd;
+ &#x1d4ce;&#x1d4cf;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d4d0;&#x1d4d1;&#x1d4d2;&#x1d4d3;&#x1d4d4;&#x1d4d5;
+ &#x1d4d6;&#x1d4d7;&#x1d4d8;&#x1d4d9;&#x1d4da;&#x1d4db;
+ &#x1d4dc;&#x1d4dd;&#x1d4de;&#x1d4df;&#x1d4e0;&#x1d4e1;
+ &#x1d4e2;&#x1d4e3;&#x1d4e4;&#x1d4e5;&#x1d4e6;&#x1d4e7;
+ &#x1d4e8;&#x1d4e9;
+ &#x1d4ea;&#x1d4eb;&#x1d4ec;&#x1d4ed;&#x1d4ee;&#x1d4ef;
+ &#x1d4f0;&#x1d4f1;&#x1d4f2;&#x1d4f3;&#x1d4f4;&#x1d4f5;
+ &#x1d4f6;&#x1d4f7;&#x1d4f8;&#x1d4f9;&#x1d4fa;&#x1d4fb;
+ &#x1d4fc;&#x1d4fd;&#x1d4fe;&#x1d4ff;&#x1d500;&#x1d501;
+ &#x1d502;&#x1d503;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d504;&#x1d505;&#x212d;&#x1d507;&#x1d508;&#x1d509;
+ &#x1d50a;&#x210c;&#x2111;&#x1d50d;&#x1d50e;&#x1d50f;
+ &#x1d510;&#x1d511;&#x1d512;&#x1d513;&#x1d514;&#x211c;
+ &#x1d516;&#x1d517;&#x1d518;&#x1d519;&#x1d51a;&#x1d51b;
+ &#x1d51c;&#x2128;
+ &#x1d51e;&#x1d51f;&#x1d520;&#x1d521;&#x1d522;&#x1d523;
+ &#x1d524;&#x1d525;&#x1d526;&#x1d527;&#x1d528;&#x1d529;
+ &#x1d52a;&#x1d52b;&#x1d52c;&#x1d52d;&#x1d52e;&#x1d52f;
+ &#x1d530;&#x1d531;&#x1d532;&#x1d533;&#x1d534;&#x1d535;
+ &#x1d536;&#x1d537;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d538;&#x1d539;&#x2102;&#x1d53b;&#x1d53c;&#x1d53d;
+ &#x1d53e;&#x210d;&#x1d540;&#x1d541;&#x1d542;&#x1d543;
+ &#x1d544;&#x2115;&#x1d546;&#x2119;&#x211a;&#x211d;
+ &#x1d54a;&#x1d54b;&#x1d54c;&#x1d54d;&#x1d54e;&#x1d54f;
+ &#x1d550;&#x2124;
+ &#x1d552;&#x1d553;&#x1d554;&#x1d555;&#x1d556;&#x1d557;
+ &#x1d558;&#x1d559;&#x1d55a;&#x1d55b;&#x1d55c;&#x1d55d;
+ &#x1d55e;&#x1d55f;&#x1d560;&#x1d561;&#x1d562;&#x1d563;
+ &#x1d564;&#x1d565;&#x1d566;&#x1d567;&#x1d568;&#x1d569;
+ &#x1d56a;&#x1d56b;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d56c;&#x1d56d;&#x1d56e;&#x1d56f;&#x1d570;&#x1d571;
+ &#x1d572;&#x1d573;&#x1d574;&#x1d575;&#x1d576;&#x1d577;
+ &#x1d578;&#x1d579;&#x1d57a;&#x1d57b;&#x1d57c;&#x1d57d;
+ &#x1d57e;&#x1d57f;&#x1d580;&#x1d581;&#x1d582;&#x1d583;
+ &#x1d584;&#x1d585;
+ &#x1d586;&#x1d587;&#x1d588;&#x1d589;&#x1d58a;&#x1d58b;
+ &#x1d58c;&#x1d58d;&#x1d58e;&#x1d58f;&#x1d590;&#x1d591;
+ &#x1d592;&#x1d593;&#x1d594;&#x1d595;&#x1d596;&#x1d597;
+ &#x1d598;&#x1d599;&#x1d59a;&#x1d59b;&#x1d59c;&#x1d59d;
+ &#x1d59e;&#x1d59f;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d5a0;&#x1d5a1;&#x1d5a2;&#x1d5a3;&#x1d5a4;&#x1d5a5;
+ &#x1d5a6;&#x1d5a7;&#x1d5a8;&#x1d5a9;&#x1d5aa;&#x1d5ab;
+ &#x1d5ac;&#x1d5ad;&#x1d5ae;&#x1d5af;&#x1d5b0;&#x1d5b1;
+ &#x1d5b2;&#x1d5b3;&#x1d5b4;&#x1d5b5;&#x1d5b6;&#x1d5b7;
+ &#x1d5b8;&#x1d5b9;
+ &#x1d5ba;&#x1d5bb;&#x1d5bc;&#x1d5bd;&#x1d5be;&#x1d5bf;
+ &#x1d5c0;&#x1d5c1;&#x1d5c2;&#x1d5c3;&#x1d5c4;&#x1d5c5;
+ &#x1d5c6;&#x1d5c7;&#x1d5c8;&#x1d5c9;&#x1d5ca;&#x1d5cb;
+ &#x1d5cc;&#x1d5cd;&#x1d5ce;&#x1d5cf;&#x1d5d0;&#x1d5d1;
+ &#x1d5d2;&#x1d5d3;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d5d4;&#x1d5d5;&#x1d5d6;&#x1d5d7;&#x1d5d8;&#x1d5d9;
+ &#x1d5da;&#x1d5db;&#x1d5dc;&#x1d5dd;&#x1d5de;&#x1d5df;
+ &#x1d5e0;&#x1d5e1;&#x1d5e2;&#x1d5e3;&#x1d5e4;&#x1d5e5;
+ &#x1d5e6;&#x1d5e7;&#x1d5e8;&#x1d5e9;&#x1d5ea;&#x1d5eb;
+ &#x1d5ec;&#x1d5ed;
+ &#x1d5ee;&#x1d5ef;&#x1d5f0;&#x1d5f1;&#x1d5f2;&#x1d5f3;
+ &#x1d5f4;&#x1d5f5;&#x1d5f6;&#x1d5f7;&#x1d5f8;&#x1d5f9;
+ &#x1d5fa;&#x1d5fb;&#x1d5fc;&#x1d5fd;&#x1d5fe;&#x1d5ff;
+ &#x1d600;&#x1d601;&#x1d602;&#x1d603;&#x1d604;&#x1d605;
+ &#x1d606;&#x1d607;</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d608;&#x1d609;&#x1d60a;&#x1d60b;&#x1d60c;&#x1d60d;
+ &#x1d60e;&#x1d60f;&#x1d610;&#x1d611;&#x1d612;&#x1d613;
+ &#x1d614;&#x1d615;&#x1d616;&#x1d617;&#x1d618;&#x1d619;
+ &#x1d61a;&#x1d61b;&#x1d61c;&#x1d61d;&#x1d61e;&#x1d61f;
+ &#x1d620;&#x1d621;
+ &#x1d622;&#x1d623;&#x1d624;&#x1d625;&#x1d626;&#x1d627;
+ &#x1d628;&#x1d629;&#x1d62a;&#x1d62b;&#x1d62c;&#x1d62d;
+ &#x1d62e;&#x1d62f;&#x1d630;&#x1d631;&#x1d632;&#x1d633;
+ &#x1d634;&#x1d635;&#x1d636;&#x1d637;&#x1d638;&#x1d639;
+ &#x1d63a;&#x1d63b;</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d63c;&#x1d63d;&#x1d63e;&#x1d63f;&#x1d640;&#x1d641;
+ &#x1d642;&#x1d643;&#x1d644;&#x1d645;&#x1d646;&#x1d647;
+ &#x1d648;&#x1d649;&#x1d64a;&#x1d64b;&#x1d64c;&#x1d64d;
+ &#x1d64e;&#x1d64f;&#x1d650;&#x1d651;&#x1d652;&#x1d653;
+ &#x1d654;&#x1d655;
+ &#x1d656;&#x1d657;&#x1d658;&#x1d659;&#x1d65a;&#x1d65b;
+ &#x1d65c;&#x1d65d;&#x1d65e;&#x1d65f;&#x1d660;&#x1d661;
+ &#x1d662;&#x1d663;&#x1d664;&#x1d665;&#x1d666;&#x1d667;
+ &#x1d668;&#x1d669;&#x1d66a;&#x1d66b;&#x1d66c;&#x1d66d;
+ &#x1d66e;&#x1d66f;</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d670;&#x1d671;&#x1d672;&#x1d673;&#x1d674;&#x1d675;
+ &#x1d676;&#x1d677;&#x1d678;&#x1d679;&#x1d67a;&#x1d67b;
+ &#x1d67c;&#x1d67d;&#x1d67e;&#x1d67f;&#x1d680;&#x1d681;
+ &#x1d682;&#x1d683;&#x1d684;&#x1d685;&#x1d686;&#x1d687;
+ &#x1d688;&#x1d689;
+ &#x1d68a;&#x1d68b;&#x1d68c;&#x1d68d;&#x1d68e;&#x1d68f;
+ &#x1d690;&#x1d691;&#x1d692;&#x1d693;&#x1d694;&#x1d695;
+ &#x1d696;&#x1d697;&#x1d698;&#x1d699;&#x1d69a;&#x1d69b;
+ &#x1d69c;&#x1d69d;&#x1d69e;&#x1d69f;&#x1d6a0;&#x1d6a1;
+ &#x1d6a2;&#x1d6a3;</mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1a.html b/layout/reftests/mathml/mathvariant-1a.html
new file mode 100644
index 0000000000..50a3bb0e44
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1a.html
@@ -0,0 +1,224 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="normal">ABCDEFGHIJKLMNOPQRSTUVWXYZ</mtext>
+ <mtext mathvariant="normal">abcdefghijklmnopqrstuvwxyz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="italic">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-italic">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="script">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-script">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="fraktur">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="double-struck">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-fraktur">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-sans-serif">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-italic">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-bold-italic">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="monospace">
+ ABCDEF
+ GHIJKL
+ MNOPQR
+ STUVWX
+ YZ
+ abcdef
+ ghijkl
+ mnopqr
+ stuvwx
+ yz</mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1b-ref.html b/layout/reftests/mathml/mathvariant-1b-ref.html
new file mode 100644
index 0000000000..6dd2f622a0
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1b-ref.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext>0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d7ce;&#x1d7cf;&#x1d7d0;&#x1d7d1;&#x1d7d2;&#x1d7d3;
+ &#x1d7d4;&#x1d7d5;&#x1d7d6;&#x1d7d7;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d7d8;&#x1d7d9;&#x1d7da;&#x1d7db;&#x1d7dc;&#x1d7dd;
+ &#x1d7de;&#x1d7df;&#x1d7e0;&#x1d7e1;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d7e2;&#x1d7e3;&#x1d7e4;&#x1d7e5;&#x1d7e6;&#x1d7e7;
+ &#x1d7e8;&#x1d7e9;&#x1d7ea;&#x1d7eb;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d7ec;&#x1d7ed;&#x1d7ee;&#x1d7ef;&#x1d7f0;&#x1d7f1;
+ &#x1d7f2;&#x1d7f3;&#x1d7f4;&#x1d7f5;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d7f6;&#x1d7f7;&#x1d7f8;&#x1d7f9;&#x1d7fa;&#x1d7fb;
+ &#x1d7fc;&#x1d7fd;&#x1d7fe;&#x1d7ff;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1b.html b/layout/reftests/mathml/mathvariant-1b.html
new file mode 100644
index 0000000000..f5b4e338d6
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1b.html
@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="normal">0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="italic">0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-italic">0123456789</mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="script">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-script">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="fraktur">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="double-struck">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-fraktur">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-sans-serif">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-italic">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-bold-italic">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="monospace">
+ 012345
+ 6789
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1c-ref.html b/layout/reftests/mathml/mathvariant-1c-ref.html
new file mode 100644
index 0000000000..6a4f8cf1c4
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1c-ref.html
@@ -0,0 +1,247 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d6a8;&#x1d6a9;&#x1d6aa;&#x1d6ab;&#x1d6ac;&#x1d6ad;
+ &#x1d6ae;&#x1d6af;&#x1d6b0;&#x1d6b1;&#x1d6b2;&#x1d6b3;
+ &#x1d6b4;&#x1d6b5;&#x1d6b6;&#x1d6b7;&#x1d6b8;&#x1d6b9;
+ &#x1d6ba;&#x1d6bb;&#x1d6bc;&#x1d6bd;&#x1d6be;&#x1d6bf;
+ &#x1d6c0;&#x1d6c1;&#x1d6c2;&#x1d6c3;&#x1d6c4;&#x1d6c5;
+ &#x1d6c6;&#x1d6c7;&#x1d6c8;&#x1d6c9;&#x1d6ca;&#x1d6cb;
+ &#x1d6cc;&#x1d6cd;&#x1d6ce;&#x1d6cf;&#x1d6d0;&#x1d6d1;
+ &#x1d6d2;&#x1d6d3;&#x1d6d4;&#x1d6d5;&#x1d6d6;&#x1d6d7;
+ &#x1d6d8;&#x1d6d9;&#x1d6da;&#x1d6db;&#x1d6dc;&#x1d6dd;
+ &#x1d6de;&#x1d6df;&#x1d6e0;&#x1d6e1;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d6e2;&#x1d6e3;&#x1d6e4;&#x1d6e5;&#x1d6e6;&#x1d6e7;
+ &#x1d6e8;&#x1d6e9;&#x1d6ea;&#x1d6eb;&#x1d6ec;&#x1d6ed;
+ &#x1d6ee;&#x1d6ef;&#x1d6f0;&#x1d6f1;&#x1d6f2;&#x1d6f3;
+ &#x1d6f4;&#x1d6f5;&#x1d6f6;&#x1d6f7;&#x1d6f8;&#x1d6f9;
+ &#x1d6fa;&#x1d6fb;&#x1d6fc;&#x1d6fd;&#x1d6fe;&#x1d6ff;
+ &#x1d700;&#x1d701;&#x1d702;&#x1d703;&#x1d704;&#x1d705;
+ &#x1d706;&#x1d707;&#x1d708;&#x1d709;&#x1d70a;&#x1d70b;
+ &#x1d70c;&#x1d70d;&#x1d70e;&#x1d70f;&#x1d710;&#x1d711;
+ &#x1d712;&#x1d713;&#x1d714;&#x1d715;&#x1d716;&#x1d717;
+ &#x1d718;&#x1d719;&#x1d71a;&#x1d71b;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d71c;&#x1d71d;&#x1d71e;&#x1d71f;&#x1d720;&#x1d721;
+ &#x1d722;&#x1d723;&#x1d724;&#x1d725;&#x1d726;&#x1d727;
+ &#x1d728;&#x1d729;&#x1d72a;&#x1d72b;&#x1d72c;&#x1d72d;
+ &#x1d72e;&#x1d72f;&#x1d730;&#x1d731;&#x1d732;&#x1d733;
+ &#x1d734;&#x1d735;&#x1d736;&#x1d737;&#x1d738;&#x1d739;
+ &#x1d73a;&#x1d73b;&#x1d73c;&#x1d73d;&#x1d73e;&#x1d73f;
+ &#x1d740;&#x1d741;&#x1d742;&#x1d743;&#x1d744;&#x1d745;
+ &#x1d746;&#x1d747;&#x1d748;&#x1d749;&#x1d74a;&#x1d74b;
+ &#x1d74c;&#x1d74d;&#x1d74e;&#x1d74f;&#x1d750;&#x1d751;
+ &#x1d752;&#x1d753;&#x1d754;&#x1d755;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d756;&#x1d757;&#x1d758;&#x1d759;&#x1d75a;&#x1d75b;
+ &#x1d75c;&#x1d75d;&#x1d75e;&#x1d75f;&#x1d760;&#x1d761;
+ &#x1d762;&#x1d763;&#x1d764;&#x1d765;&#x1d766;&#x1d767;
+ &#x1d768;&#x1d769;&#x1d76a;&#x1d76b;&#x1d76c;&#x1d76d;
+ &#x1d76e;&#x1d76f;&#x1d770;&#x1d771;&#x1d772;&#x1d773;
+ &#x1d774;&#x1d775;&#x1d776;&#x1d777;&#x1d778;&#x1d779;
+ &#x1d77a;&#x1d77b;&#x1d77c;&#x1d77d;&#x1d77e;&#x1d77f;
+ &#x1d780;&#x1d781;&#x1d782;&#x1d783;&#x1d784;&#x1d785;
+ &#x1d786;&#x1d787;&#x1d788;&#x1d789;&#x1d78a;&#x1d78b;
+ &#x1d78c;&#x1d78d;&#x1d78e;&#x1d78f;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1d790;&#x1d791;&#x1d792;&#x1d793;&#x1d794;&#x1d795;
+ &#x1d796;&#x1d797;&#x1d798;&#x1d799;&#x1d79a;&#x1d79b;
+ &#x1d79c;&#x1d79d;&#x1d79e;&#x1d79f;&#x1d7a0;&#x1d7a1;
+ &#x1d7a2;&#x1d7a3;&#x1d7a4;&#x1d7a5;&#x1d7a6;&#x1d7a7;
+ &#x1d7a8;&#x1d7a9;&#x1d7aa;&#x1d7ab;&#x1d7ac;&#x1d7ad;
+ &#x1d7ae;&#x1d7af;&#x1d7b0;&#x1d7b1;&#x1d7b2;&#x1d7b3;
+ &#x1d7b4;&#x1d7b5;&#x1d7b6;&#x1d7b7;&#x1d7b8;&#x1d7b9;
+ &#x1d7ba;&#x1d7bb;&#x1d7bc;&#x1d7bd;&#x1d7be;&#x1d7bf;
+ &#x1d7c0;&#x1d7c1;&#x1d7c2;&#x1d7c3;&#x1d7c4;&#x1d7c5;
+ &#x1d7c6;&#x1d7c7;&#x1d7c8;&#x1d7c9;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1c.html b/layout/reftests/mathml/mathvariant-1c.html
new file mode 100644
index 0000000000..bbbafd3cd8
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1c.html
@@ -0,0 +1,247 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="normal">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="italic">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-italic">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="script">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-script">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="fraktur">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="double-struck">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-fraktur">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="bold-sans-serif">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-italic">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="sans-serif-bold-italic">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="monospace">
+ &#x0391;&#x0392;&#x0393;&#x0394;&#x0395;&#x0396;
+ &#x0397;&#x0398;&#x0399;&#x039a;&#x039b;&#x039c;
+ &#x039d;&#x039e;&#x039f;&#x03a0;&#x03a1;&#x03f4;
+ &#x03a3;&#x03a4;&#x03a5;&#x03a6;&#x03a7;&#x03a8;
+ &#x03a9;&#x2207;&#x03b1;&#x03b2;&#x03b3;&#x03b4;
+ &#x03b5;&#x03b6;&#x03b7;&#x03b8;&#x03b9;&#x03ba;
+ &#x03bb;&#x03bc;&#x03bd;&#x03be;&#x03bf;&#x03c0;
+ &#x03c1;&#x03c2;&#x03c3;&#x03c4;&#x03c5;&#x03c6;
+ &#x03c7;&#x03c8;&#x03c9;&#x2202;&#x03f5;&#x03d1;
+ &#x03f0;&#x03d5;&#x03f1;&#x03d6;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-1d-ref.html b/layout/reftests/mathml/mathvariant-1d-ref.html
new file mode 100644
index 0000000000..2529bef082
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1d-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1EEA1;&#x1EEA2;&#x1EEA3;&#x1EEA5;&#x1EEA6;&#x1EEA7;
+ &#x1EEA8;&#x1EEA9;&#x1EEAB;&#x1EEAC;&#x1EEAD;&#x1EEAE;
+ &#x1EEAF;&#x1EEB0;&#x1EEB1;&#x1EEB2;&#x1EEB3;&#x1EEB4;
+ &#x1EEB5;&#x1EEB6;&#x1EEB7;&#x1EEB8;&#x1EEB9;&#x1EEBA;
+ &#x1EEBB
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1EE21;&#x1EE22;&#x1EE24;&#x1EE27;&#x1EE29;&#x1EE2A;
+ &#x1EE2B;&#x1EE2C;&#x1EE2D;&#x1EE2E;&#x1EE2F;&#x1EE30;
+ &#x1EE31;&#x1EE32;&#x1EE34;&#x1EE35;&#x1EE36;&#x1EE37;
+ &#x1EE39;&#x1EE3B;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1EE42;&#x1EE47;&#x1EE49;&#x1EE4B;&#x1EE4D;&#x1EE4E;
+ &#x1EE4F;&#x1EE51;&#x1EE52;&#x1EE54;&#x1EE57;&#x1EE59
+ &#x1EE5B;&#x1EE5D;&#x1EE5F;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1EE80;&#x1EE81;&#x1EE82;&#x1EE83;&#x1EE84;&#x1EE85;
+ &#x1EE86;&#x1EE87;&#x1EE88;&#x1EE89;&#x1EE8B;&#x1EE8C;
+ &#x1EE8D;&#x1EE8E;&#x1EE8F;&#x1EE90;&#x1EE91;&#x1EE92;
+ &#x1EE93;&#x1EE94;&#x1EE95;&#x1EE96;&#x1EE97;&#x1EE98;
+ &#x1EE99;&#x1EE9A;&#x1EE9B;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext>
+ &#x1EE61;&#x1EE62;&#x1EE64;&#x1EE67;&#x1EE68;&#x1EE69;
+ &#x1EE6A;&#x1EE6C;&#x1EE6D;&#x1EE6E;&#x1EE6F;&#x1EE70;
+ &#x1EE71;&#x1EE72;&#x1EE74;&#x1EE75;&#x1EE76;&#x1EE77;
+ &#x1EE79;&#x1EE7A;&#x1EE7B;&#x1EE7C;&#x1EE7E;
+ </mtext>
+ </mrow>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/mathvariant-1d.html b/layout/reftests/mathml/mathvariant-1d.html
new file mode 100644
index 0000000000..83dfa3bf82
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-1d.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+
+ <head>
+ <title>Test mathvariant character mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="double-struck">
+ &#x0628;&#x062C;&#x062F;&#x0648;&#x0632;&#x062D;
+ &#x0637;&#x064A;&#x0644;&#x0645;&#x0646;&#x0633;
+ &#x0639;&#x0641;&#x0635;&#x0642;&#x0631;&#x0634;
+ &#x062A;&#x062B;&#x062E;&#x0630;&#x0636;&#x0638;
+ &#x063A;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="initial">
+ &#x0628;&#x062C;&#x0647;&#x062D;&#x064A;&#x0643;
+ &#x0644;&#x0645;&#x0646;&#x0633;&#x0639;&#x0641;
+ &#x0635;&#x0642;&#x0634;&#x062A;&#x062B;&#x062E;
+ &#x0636;&#x063A;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="tailed">
+ &#x062C;&#x062D;&#x064A;&#x0644;&#x0646;&#x0633;
+ &#x0639;&#x0635;&#x0642;&#x0634;&#x062E;&#x0636;
+ &#x063A;&#x06BA;&#x066F;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="looped">
+ &#x0627;&#x0628;&#x062C;&#x062F;&#x0647;&#x0648;
+ &#x0632;&#x062D;&#x0637;&#x064A;&#x0644;&#x0645;
+ &#x0646;&#x0633;&#x0639;&#x0641;&#x0635;&#x0642;
+ &#x0631;&#x0634;&#x062A;&#x062B;&#x062E;&#x0630;
+ &#x0636;&#x0638;&#x063A;
+ </mtext>
+ </mrow>
+ </math>
+ <br>
+ <math>
+ <mrow>
+ <mtext mathvariant="stretched">
+ &#x0628;&#x062C;&#x0647;&#x062D;&#x0637;&#x064A;
+ &#x0643;&#x0645;&#x0646;&#x0633;&#x0639;&#x0641;
+ &#x0635;&#x0642;&#x0634;&#x062A;&#x062B;&#x062E;
+ &#x0636;&#x0638;&#x063A;&#x066E;&#x06A1;
+ </mtext>
+ </mrow>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/mathvariant-2-ref.html b/layout/reftests/mathml/mathvariant-2-ref.html
new file mode 100644
index 0000000000..6118ad058a
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-2-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mathvariant exception mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext>&#x1d6a4;&#x1d6a5;</mtext>
+ <mtext>&#x0131;&#x0237;</mtext>
+ <mtext>&#x1d7ca;&#x1d7cb;</mtext>
+ <mtext>&#x03DC;&#x03DD;</mtext>
+ </mrow>
+ </math>
+ <p>
+ <math>
+ <mrow>
+ <mi mathvariant="italic">&imath;</mi>
+ <mi mathvariant="italic">&jmath;</mi>
+ <mi mathvariant="normal">&imath;&imath;</mi>
+ <mi mathvariant="normal">&jmath;&jmath;</mi>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-2.html b/layout/reftests/mathml/mathvariant-2.html
new file mode 100644
index 0000000000..c731122855
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mathvariant exception mappings</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="italic">&#x0131;&#x0237;</mtext>
+ <mtext mathvariant="bold">&#x0131;&#x0237;</mtext>
+ <mtext mathvariant="bold">&#x03DC;&#x03DD;</mtext>
+ <mtext mathvariant="italic">&#x03DC;&#x03DD;</mtext>
+ </mrow>
+ </math>
+ <p>
+ <math>
+ <mrow>
+ <mi>&imath;</mi>
+ <mi>&jmath;</mi>
+ <mi>&imath;&imath;</mi>
+ <mi>&jmath;&jmath;</mi>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-4-ref.html b/layout/reftests/mathml/mathvariant-4-ref.html
new file mode 100644
index 0000000000..717eab9f20
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-4-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>More mathvariant tests</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <!-- mathvariant on characters that are already in the Mathematical
+ AlphanumericSymbols or are exceptions (should not have any
+ effect).-->
+ <mtext>&#x1d49c;</mtext>
+ <mtext>&#x212c;</mtext>
+ <!-- mathvariant on characters for which there is no equivalent mathvariant
+ form in Unicode (should not have any effect) -->
+ <mtext>&#x00e1;</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <!-- mathvariant on multi-char token elements (should apply to all the
+ characters) -->
+ <mtext>&#x1d670;&#x1d670;&#x1d670;</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <!-- mathvariant on mstyle (should apply to all token element descendants
+ like single-char mi, mtext etc) -->
+ <mtext mathvariant="sans-serif">cos</mtext>
+ <mo>&#x2061;</mo>
+ <mi mathvariant="sans-serif">x</mi>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <!-- mathvariant on math (should apply to all token element descendants
+ like single-char mi, mtext etc) -->
+ <mtext mathvariant="sans-serif">cos</mtext>
+ <mo>&#x2061;</mo>
+ <mi mathvariant="sans-serif">x</mi>
+ </mrow>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-4.html b/layout/reftests/mathml/mathvariant-4.html
new file mode 100644
index 0000000000..f3982b2c2e
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-4.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>More mathvariant tests</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mtext mathvariant="fraktur">&#x1d49c;</mtext>
+ <mtext mathvariant="fraktur">&#x212c;</mtext>
+ <mtext mathvariant="fraktur">&#x00e1;</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <mtext mathvariant="monospace">AAA</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle mathvariant="sans-serif">
+ <mrow>
+ <mtext>cos</mtext>
+ <mo>&#x2061;</mo>
+ <mi>x</mi>
+ </mrow>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math mathvariant="sans-serif">
+ <mrow>
+ <mtext>cos</mtext>
+ <mo>&#x2061;</mo>
+ <mi>x</mi>
+ </mrow>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-5-ref.html b/layout/reftests/mathml/mathvariant-5-ref.html
new file mode 100644
index 0000000000..1854ce4b13
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-5-ref.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic mathvariant tests</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mi id="Mi0" mathvariant="script">A</mi>
+ <mi id="Mi1">BB</mi>
+ <mi id="Mi2">B</mi>
+ <mi id="Mi3">A</mi>
+ <mi id="Mi4" mathvariant="script">A</mi>
+ <mtext id="Mtext0">A</mtext>
+ <mtext id="Mtext2" mathvariant="script">A</mtext>
+ <mtext id="Mtext4" mathvariant="script">A</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <mstyle id="Mstyle0" mathvariant="fraktur">
+ <mtext>Hello</mtext>
+ </mstyle>
+ <mstyle id="Mstyle1" mathvariant="monospace">
+ <mtext>Hello</mtext>
+ </mstyle>
+ <mstyle id="Mstyle2">
+ <mtext>Hello</mtext>
+ </mstyle>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math id="Math0" mathvariant="fraktur">
+ <mtext>Hello</mtext>
+ </math>
+ <math id="Math1" mathvariant="monospace">
+ <mtext>Hello</mtext>
+ </math>
+ <math id="Math2">
+ <mtext>Hello</mtext>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mathvariant-5.html b/layout/reftests/mathml/mathvariant-5.html
new file mode 100644
index 0000000000..a680460565
--- /dev/null
+++ b/layout/reftests/mathml/mathvariant-5.html
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic mathvariant tests</title>
+ </head>
+ <body>
+ <math>
+ <mrow>
+ <mi id="Mi0">A</mi>
+ <mi id="Mi1">A</mi>
+ <mi id="Mi2">AA</mi>
+ <mi id="Mi3" mathvariant="fraktur">A</mi>
+ <mi id="Mi4" mathvariant="monospace">A</mi>
+ <mtext id="Mtext0" mathvariant="monospace">A</mtext>
+ <mtext id="Mtext2" mathvariant="monospace">A</mtext>
+ <mtext id="Mtext4">A</mtext>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math>
+ <mrow>
+ <mstyle id="Mstyle0">
+ <mtext>Hello</mtext>
+ </mstyle>
+ <mstyle id="Mstyle1" mathvariant="bold-fraktur">
+ <mtext>Hello</mtext>
+ </mstyle>
+ <mstyle id="Mstyle2" mathvariant="bold">
+ <mtext>Hello</mtext>
+ </mstyle>
+ </mrow>
+ </math>
+
+ <p>
+
+ <math id="Math0">
+ <mtext>Hello</mtext>
+ </math>
+ <math id="Math1" mathvariant="fraktur">
+ <mtext>Hello</mtext>
+ </math>
+ <math id="Math2" mathvariant="bold">
+ <mtext>Hello</mtext>
+ </math>
+ <script>
+ function doTest()
+ {
+ document.getElementById("Mi0").setAttribute("mathvariant", "script");
+ document.getElementById("Mi1").innerHTML = "BB";
+ document.getElementById("Mi2").innerHTML = "B";
+ document.getElementById("Mi3").removeAttribute("mathvariant");
+ document.getElementById("Mi4").setAttribute("mathvariant", "script");
+ document.getElementById("Mtext0").removeAttribute("mathvariant");
+ document.getElementById("Mtext2").setAttribute("mathvariant", "script");
+ document.getElementById("Mtext4").setAttribute("mathvariant", "script");
+ document.getElementById("Mstyle0").setAttribute("mathvariant", "fraktur");
+ document.getElementById("Mstyle1").setAttribute("mathvariant", "monospace");
+ document.getElementById("Mstyle2").removeAttribute("mathvariant");
+ document.getElementById("Math0").setAttribute("mathvariant", "fraktur");
+ document.getElementById("Math1").setAttribute("mathvariant", "monospace");
+ document.getElementById("Math2").removeAttribute("mathvariant");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1-ref.html b/layout/reftests/mathml/menclose-1-ref.html
new file mode 100644
index 0000000000..2302a2b8d8
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1-ref.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1a.html b/layout/reftests/mathml/menclose-1a.html
new file mode 100644
index 0000000000..649ea0ea2e
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1a.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="longdiv">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1b.html b/layout/reftests/mathml/menclose-1b.html
new file mode 100644
index 0000000000..d46e43d422
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1b.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="actuarial">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1d.html b/layout/reftests/mathml/menclose-1d.html
new file mode 100644
index 0000000000..6c98cdb962
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1d.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="box">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1e.html b/layout/reftests/mathml/menclose-1e.html
new file mode 100644
index 0000000000..6c1d4bc2d1
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1e.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="roundedbox">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1f.html b/layout/reftests/mathml/menclose-1f.html
new file mode 100644
index 0000000000..f4409e20bf
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1f.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="circle">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1g.html b/layout/reftests/mathml/menclose-1g.html
new file mode 100644
index 0000000000..97a88eba28
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1g.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="left">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1h.html b/layout/reftests/mathml/menclose-1h.html
new file mode 100644
index 0000000000..fa17c07895
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1h.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="right">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1i.html b/layout/reftests/mathml/menclose-1i.html
new file mode 100644
index 0000000000..062ef17f59
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1i.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="top">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1j.html b/layout/reftests/mathml/menclose-1j.html
new file mode 100644
index 0000000000..175f65aa39
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1j.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="bottom">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1k.html b/layout/reftests/mathml/menclose-1k.html
new file mode 100644
index 0000000000..03f9d15fc8
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1k.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="updiagonalstrike">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1l.html b/layout/reftests/mathml/menclose-1l.html
new file mode 100644
index 0000000000..dce96364d4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1l.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="downdiagonalstrike">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1m.html b/layout/reftests/mathml/menclose-1m.html
new file mode 100644
index 0000000000..4acdaf914d
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1m.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="verticalstrike">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1n.html b/layout/reftests/mathml/menclose-1n.html
new file mode 100644
index 0000000000..3557fc3483
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1n.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="horizontalstrike">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1o.html b/layout/reftests/mathml/menclose-1o.html
new file mode 100644
index 0000000000..231aeaa09b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1o.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="madruwb">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1p.html b/layout/reftests/mathml/menclose-1p.html
new file mode 100644
index 0000000000..5bff5e02fe
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1p.html
@@ -0,0 +1,21 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: test that attributes have an effect -->
+ <math>
+ <menclose notation="updiagonalarrow">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-1q.html b/layout/reftests/mathml/menclose-1q.html
new file mode 100644
index 0000000000..0e185e72fc
--- /dev/null
+++ b/layout/reftests/mathml/menclose-1q.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose</title>
+ </head>
+ <body>
+ <math>
+ <menclose notation="phasorangle">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-actuarial-ref.html b/layout/reftests/mathml/menclose-2-actuarial-ref.html
new file mode 100644
index 0000000000..c20b4acff6
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-actuarial-ref.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose actuarial</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) +
+ "L" + ((box.width+box.left) + "," + box.top) +
+ "L" + ((box.width+box.left) + "," + box.bottom ));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="actuarial">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-actuarial.html b/layout/reftests/mathml/menclose-2-actuarial.html
new file mode 100644
index 0000000000..67d2adae79
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-actuarial.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose actuarial</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) +
+ "L" + ((box.width+box.left) + "," + box.top) +
+ "L" + ((box.width+box.left) + "," + box.bottom ));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="actuarial">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-bottom-ref.html b/layout/reftests/mathml/menclose-2-bottom-ref.html
new file mode 100644
index 0000000000..4dc90550a7
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-bottom-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose bottom</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.height)) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="bottom">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-bottom.html b/layout/reftests/mathml/menclose-2-bottom.html
new file mode 100644
index 0000000000..b4436d6130
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-bottom.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose bottom</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.height)) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="bottom">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-box-ref.html b/layout/reftests/mathml/menclose-2-box-ref.html
new file mode 100644
index 0000000000..83529f92b2
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-box-ref.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose box</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ r = document.getElementById("rect");
+ r.setAttribute("x", box.left );
+ r.setAttribute("y", box.top );
+ r.setAttribute("width", box.width );
+ r.setAttribute("height", box.height );
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+
+ <body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="box">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <rect id="rect" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></rect>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-box.html b/layout/reftests/mathml/menclose-2-box.html
new file mode 100644
index 0000000000..4ac62153b4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-box.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose box</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ r = document.getElementById("rect");
+ r.setAttribute("x", box.left );
+ r.setAttribute("y", box.top );
+ r.setAttribute("width", box.width );
+ r.setAttribute("height", box.height );
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+
+ <body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="box">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <rect id="rect" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></rect>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-circle-ref.html b/layout/reftests/mathml/menclose-2-circle-ref.html
new file mode 100644
index 0000000000..b6bfd1ee8b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-circle-ref.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose circle</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("circle").getBoundingClientRect();
+ e = document.getElementById("ellipse");
+ e.setAttribute("cx", (box.left + box.width/2));
+ e.setAttribute("rx", (box.width/2));
+ e.setAttribute("cy", (box.top + box.height/2));
+ e.setAttribute("ry", (box.height/2));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="circle" notation="circle">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <ellipse id="ellipse" style="fill: none; stroke-width: 8px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></ellipse>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-circle.html b/layout/reftests/mathml/menclose-2-circle.html
new file mode 100644
index 0000000000..3f9168f125
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-circle.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose circle</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("circle").getBoundingClientRect();
+ e = document.getElementById("ellipse");
+ e.setAttribute("cx", (box.left + box.width/2));
+ e.setAttribute("rx", (box.width/2));
+ e.setAttribute("cy", (box.top + box.height/2));
+ e.setAttribute("ry", (box.height/2));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="circle" notation="circle">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <ellipse id="ellipse" style="fill: none; stroke-width: 8px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></ellipse>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-downdiagonalstrike-ref.html b/layout/reftests/mathml/menclose-2-downdiagonalstrike-ref.html
new file mode 100644
index 0000000000..631b43deed
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-downdiagonalstrike-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose downdiagonalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (box.width + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="downdiagonalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 6px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-downdiagonalstrike.html b/layout/reftests/mathml/menclose-2-downdiagonalstrike.html
new file mode 100644
index 0000000000..1b2ce98734
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-downdiagonalstrike.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose downdiagonalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (box.width + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="downdiagonalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 6px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-horizontalstrike-ref.html b/layout/reftests/mathml/menclose-2-horizontalstrike-ref.html
new file mode 100644
index 0000000000..57849ca8ee
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-horizontalstrike-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose horizontalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.bottom)/2 ) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="horizontalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;" ></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-horizontalstrike.html b/layout/reftests/mathml/menclose-2-horizontalstrike.html
new file mode 100644
index 0000000000..5fbc878870
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-horizontalstrike.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose horizontalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.bottom)/2 ) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="horizontalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-left-ref.html b/layout/reftests/mathml/menclose-2-left-ref.html
new file mode 100644
index 0000000000..9522546191
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-left-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose left</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="left">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-left.html b/layout/reftests/mathml/menclose-2-left.html
new file mode 100644
index 0000000000..1d7ef06657
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-left.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose left</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="left">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-longdiv-ref.html b/layout/reftests/mathml/menclose-2-longdiv-ref.html
new file mode 100644
index 0000000000..dea61e936b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-longdiv-ref.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose longdiv</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ var x = " " + box.left + "," + box.top + " " ;
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.height)) +
+ "Q" + ((box.left + 15) + "," + (box.top + box.height)/2) + x +
+ "L" + ((box.left + box.width) + "," + box.top));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="longdiv">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 11px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-longdiv.html b/layout/reftests/mathml/menclose-2-longdiv.html
new file mode 100644
index 0000000000..ee9208afa3
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-longdiv.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose longdiv</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ var x = " " + box.left + "," + box.top + " " ;
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.top + box.height)) +
+ "Q" + ((box.left + 15) + "," + (box.top + box.height)/2) + x +
+ "L" + ((box.left + box.width) + "," + box.top));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="longdiv">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 11px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-phasorangle-ref.html b/layout/reftests/mathml/menclose-2-phasorangle-ref.html
new file mode 100644
index 0000000000..acce533dd9
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-phasorangle-ref.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose phasorangle</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ var w = 8 * 2; // kPhasorangleWidth * rulethickness
+ var H = 2 * w; // slope 2
+
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.right + "," + box.bottom) +
+ "L" + (box.left + "," + box.bottom ) +
+ "l" + ((w) + "," + (-H)));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="phasorangle">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 5px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-phasorangle.html b/layout/reftests/mathml/menclose-2-phasorangle.html
new file mode 100644
index 0000000000..284b1b18bc
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-phasorangle.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose phasorangle</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ var w = 8 * 2; // kPhasorangleWidth * rulethickness
+ var H = 2 * w; // slope 2
+
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.right + "," + box.bottom) +
+ "L" + (box.left + "," + box.bottom ) +
+ "l" + ((w) + "," + (-H)));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="phasorangle">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 5px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-right-ref.html b/layout/reftests/mathml/menclose-2-right-ref.html
new file mode 100644
index 0000000000..2f881e585d
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-right-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose right</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + ((box.left + box.width) + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="right">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-right.html b/layout/reftests/mathml/menclose-2-right.html
new file mode 100644
index 0000000000..078b45e7f5
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-right.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose right</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + ((box.left + box.width) + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="right">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-roundedbox-ref.html b/layout/reftests/mathml/menclose-2-roundedbox-ref.html
new file mode 100644
index 0000000000..b60dcae4b0
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-roundedbox-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="utf-8"/>
+ <title>menclose roundedbox</title>
+
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("roundedbox").getBoundingClientRect();
+ r = document.getElementById("box");
+ r.style.left = (box.left - 6) + "px";
+ r.style.top = (box.top - 6) + "px";
+ r.style.width = (box.width - 6) + "px";
+ r.style.height = (box.height - 6) + "px";
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+</head>
+<body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="roundedbox" notation="roundedbox">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div id="box" style="position: absolute; border:10px solid #000; border-radius:10px 10px 10px 10px;" >
+ </div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-roundedbox.html b/layout/reftests/mathml/menclose-2-roundedbox.html
new file mode 100644
index 0000000000..508019fe0a
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-roundedbox.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="utf-8"/>
+ <title>menclose roundedbox</title>
+
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("roundedbox").getBoundingClientRect();
+ r = document.getElementById("box");
+ r.style.left = (box.left - 6) + "px";
+ r.style.top = (box.top - 6) + "px";
+ r.style.width = (box.width - 6) + "px";
+ r.style.height = (box.height - 6) + "px";
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+</head>
+<body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="roundedbox" notation="roundedbox">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div id="box" style="position: absolute; border:10px solid #000; border-radius:10px 10px 10px 10px;" >
+ </div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-top-ref.html b/layout/reftests/mathml/menclose-2-top-ref.html
new file mode 100644
index 0000000000..6d517e2168
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-top-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose top</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="top">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-top.html b/layout/reftests/mathml/menclose-2-top.html
new file mode 100644
index 0000000000..b95774d10e
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-top.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose top</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.top) + " " +
+ "l" + (box.width + "," + 0));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="top">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-updiagonalarrow-ref.html b/layout/reftests/mathml/menclose-2-updiagonalarrow-ref.html
new file mode 100644
index 0000000000..bea51f38aa
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-updiagonalarrow-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalarrow</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.height + box.top)) +
+ "L" + ((box.width + box.left) + "," + box.top));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="updiagonalarrow">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 11px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-updiagonalarrow.html b/layout/reftests/mathml/menclose-2-updiagonalarrow.html
new file mode 100644
index 0000000000..14c6aa548f
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-updiagonalarrow.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalarrow</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + (box.height + box.top)) +
+ "L" + ((box.width + box.left) + "," + box.top));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="updiagonalarrow">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 11px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-updiagonalstrike-ref.html b/layout/reftests/mathml/menclose-2-updiagonalstrike-ref.html
new file mode 100644
index 0000000000..e9c53156be
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-updiagonalstrike-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.bottom) + " " +
+ "l" + (box.width + "," + (-box.height)));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="updiagonalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 5px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-updiagonalstrike.html b/layout/reftests/mathml/menclose-2-updiagonalstrike.html
new file mode 100644
index 0000000000..92b647c0d8
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-updiagonalstrike.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + (box.left + "," + box.bottom) + " " +
+ "l" + (box.width + "," + (-box.height)));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="updiagonalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 5px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-verticalstrike-ref.html b/layout/reftests/mathml/menclose-2-verticalstrike-ref.html
new file mode 100644
index 0000000000..7205b47396
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-verticalstrike-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose verticalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + ((box.right + box.left)/2 + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <mphantom>
+ <menclose id="box" notation="verticalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </mphantom>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-2-verticalstrike.html b/layout/reftests/mathml/menclose-2-verticalstrike.html
new file mode 100644
index 0000000000..29c54d75dc
--- /dev/null
+++ b/layout/reftests/mathml/menclose-2-verticalstrike.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose verticalstrike</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box = document.getElementById("box").getBoundingClientRect();
+ document.getElementById("path").setAttribute("d",
+ "M" + ((box.right + box.left)/2 + "," + box.top) + " " +
+ "l" + (0 + "," + box.height));
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="box" notation="verticalstrike">
+ <mspace width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+
+ <div style="position: absolute; left: 0px; top: 0px;">
+ <svg width="500px" height="500px">
+ <path id="path" style="fill: none; stroke-width: 3px; stroke: green; stroke-linecap: round; shape-rendering: crispEdges;"></path>
+ </svg>
+ </div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-box-ref.html b/layout/reftests/mathml/menclose-3-box-ref.html
new file mode 100644
index 0000000000..0d718ee05c
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-box-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose box</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="left top right bottom">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-box.html b/layout/reftests/mathml/menclose-3-box.html
new file mode 100644
index 0000000000..69c3e8f688
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-box.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose box</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="box">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-default-ref.html b/layout/reftests/mathml/menclose-3-default-ref.html
new file mode 100644
index 0000000000..db9d4375ad
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-default-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose default</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose>
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-default.html b/layout/reftests/mathml/menclose-3-default.html
new file mode 100644
index 0000000000..ae2ad36d32
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-default.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose default</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="longdiv">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-invalid-ref.html b/layout/reftests/mathml/menclose-3-invalid-ref.html
new file mode 100644
index 0000000000..08e455c779
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-invalid-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose invalid</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-invalid.html b/layout/reftests/mathml/menclose-3-invalid.html
new file mode 100644
index 0000000000..5af96ba201
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-invalid.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose invalid</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="not_a_vaild_notation">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-madruwb-ref.html b/layout/reftests/mathml/menclose-3-madruwb-ref.html
new file mode 100644
index 0000000000..58ed5903b4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-madruwb-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose madruwb</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: madruwb -->
+ <math>
+ <menclose notation="right bottom"><mi>x</mi></menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-madruwb.html b/layout/reftests/mathml/menclose-3-madruwb.html
new file mode 100644
index 0000000000..0c616e0f1e
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-madruwb.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test menclose madruwb</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <!-- menclose: madruwb -->
+ <math>
+ <menclose notation="madruwb"><mi>x</mi></menclose>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-multiple-ref.html b/layout/reftests/mathml/menclose-3-multiple-ref.html
new file mode 100644
index 0000000000..c42a504bb2
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-multiple-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose multiple</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="top top left circle">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-multiple.html b/layout/reftests/mathml/menclose-3-multiple.html
new file mode 100644
index 0000000000..01f0536c0e
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-multiple.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose multiple</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="circle left top">
+ <mspace width="100px" height="50px"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-unknown-ref.html b/layout/reftests/mathml/menclose-3-unknown-ref.html
new file mode 100644
index 0000000000..20f3a72eb9
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-unknown-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose unknown</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="circle">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-3-unknown.html b/layout/reftests/mathml/menclose-3-unknown.html
new file mode 100644
index 0000000000..88f5b0d2d1
--- /dev/null
+++ b/layout/reftests/mathml/menclose-3-unknown.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose unknown</title>
+ <meta charset="utf-8"/>
+ </head>
+
+ <body>
+ <math>
+ <menclose notation="circle unknown">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-4.html b/layout/reftests/mathml/menclose-4.html
new file mode 100644
index 0000000000..19cb5f145b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-4.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose inner and outer circle</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var box1 = document.getElementById("outer").getBoundingClientRect();
+ var box2 = document.getElementById("inner").getBoundingClientRect();
+ var epsilon = 0.1;
+ if ((box1.width >= ((Math.sqrt(2) - epsilon)*box2.width)) && (box1.height >= ((Math.sqrt(2) - epsilon)*box2.height))) {
+ document.body.innerHTML = "Pass";
+ }
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <div style="position: absolute; left: 20px; top: 20px;">
+ <math>
+ <menclose id="outer" notation="circle">
+ <mspace id="inner" width="200px" height="100px"></mspace>
+ </menclose>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-actuarial-ref.html b/layout/reftests/mathml/menclose-5-actuarial-ref.html
new file mode 100644
index 0000000000..a8a020338c
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-actuarial-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose actuarial</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="actuarial"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-actuarial.html b/layout/reftests/mathml/menclose-5-actuarial.html
new file mode 100644
index 0000000000..475b08e3c0
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-actuarial.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose actuarial</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","actuarial");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-bottom-ref.html b/layout/reftests/mathml/menclose-5-bottom-ref.html
new file mode 100644
index 0000000000..b489c08d08
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-bottom-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose bottom</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="bottom"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-bottom.html b/layout/reftests/mathml/menclose-5-bottom.html
new file mode 100644
index 0000000000..6589b9119d
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-bottom.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose bottom</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","bottom");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-box-ref.html b/layout/reftests/mathml/menclose-5-box-ref.html
new file mode 100644
index 0000000000..3b47a31e95
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-box-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose box</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="box"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-box.html b/layout/reftests/mathml/menclose-5-box.html
new file mode 100644
index 0000000000..b6d7f1b63b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-box.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose box</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","box");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-circle-ref.html b/layout/reftests/mathml/menclose-5-circle-ref.html
new file mode 100644
index 0000000000..cf9b8ec436
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-circle-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose circle</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="circle"><mspace width="100px" height="50px"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-circle.html b/layout/reftests/mathml/menclose-5-circle.html
new file mode 100644
index 0000000000..8566d825cd
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-circle.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose circle</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","circle");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-downdiagonalstrike-ref.html b/layout/reftests/mathml/menclose-5-downdiagonalstrike-ref.html
new file mode 100644
index 0000000000..466b327bd7
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-downdiagonalstrike-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose downdiagonalstrike</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="downdiagonalstrike"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-downdiagonalstrike.html b/layout/reftests/mathml/menclose-5-downdiagonalstrike.html
new file mode 100644
index 0000000000..ec3bda8cf4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-downdiagonalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose downdiagonalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","downdiagonalstrike");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-horizontalstrike-ref.html b/layout/reftests/mathml/menclose-5-horizontalstrike-ref.html
new file mode 100644
index 0000000000..9ac8418ba0
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-horizontalstrike-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose horizontalstrike</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="horizontalstrike"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-horizontalstrike.html b/layout/reftests/mathml/menclose-5-horizontalstrike.html
new file mode 100644
index 0000000000..3411d9b062
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-horizontalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose horizontalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","horizontalstrike");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-left-ref.html b/layout/reftests/mathml/menclose-5-left-ref.html
new file mode 100644
index 0000000000..025c446f0b
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-left-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose left</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="left"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-left.html b/layout/reftests/mathml/menclose-5-left.html
new file mode 100644
index 0000000000..30e2c852ae
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-left.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose left</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","left");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-longdiv-ref.html b/layout/reftests/mathml/menclose-5-longdiv-ref.html
new file mode 100644
index 0000000000..c6e072fcb9
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-longdiv-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose longdiv</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="longdiv"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-longdiv.html b/layout/reftests/mathml/menclose-5-longdiv.html
new file mode 100644
index 0000000000..e22763d4d8
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-longdiv.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose longdiv</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","longdiv");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-madruwb-ref.html b/layout/reftests/mathml/menclose-5-madruwb-ref.html
new file mode 100644
index 0000000000..06ef436580
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-madruwb-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose madruwb</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="madruwb"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-madruwb.html b/layout/reftests/mathml/menclose-5-madruwb.html
new file mode 100644
index 0000000000..9b77a61dd9
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-madruwb.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose madruwb</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","madruwb");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-phasorangle-ref.html b/layout/reftests/mathml/menclose-5-phasorangle-ref.html
new file mode 100644
index 0000000000..331875a99d
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-phasorangle-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose actuarial</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="phasorangle"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-phasorangle.html b/layout/reftests/mathml/menclose-5-phasorangle.html
new file mode 100644
index 0000000000..066c1fd6f1
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-phasorangle.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose phasorangle</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","phasorangle");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-right-ref.html b/layout/reftests/mathml/menclose-5-right-ref.html
new file mode 100644
index 0000000000..bee5728b98
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-right-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose right</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="right"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-right.html b/layout/reftests/mathml/menclose-5-right.html
new file mode 100644
index 0000000000..0e87f1a8cd
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-right.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose right</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","right");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-roundedbox-ref.html b/layout/reftests/mathml/menclose-5-roundedbox-ref.html
new file mode 100644
index 0000000000..da4500d5fd
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-roundedbox-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose roundedbox</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="roundedbox"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-roundedbox.html b/layout/reftests/mathml/menclose-5-roundedbox.html
new file mode 100644
index 0000000000..6ae4afc751
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-roundedbox.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose roundedbox</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","roundedbox");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-top-ref.html b/layout/reftests/mathml/menclose-5-top-ref.html
new file mode 100644
index 0000000000..94ffb8881a
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-top-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose top</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="top"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-top.html b/layout/reftests/mathml/menclose-5-top.html
new file mode 100644
index 0000000000..5cf5917e51
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-top.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose top</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","top");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-updiagonalarrow-ref.html b/layout/reftests/mathml/menclose-5-updiagonalarrow-ref.html
new file mode 100644
index 0000000000..9c235e85fa
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-updiagonalarrow-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose updiagonalarrow</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="updiagonalarrow"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-updiagonalarrow.html b/layout/reftests/mathml/menclose-5-updiagonalarrow.html
new file mode 100644
index 0000000000..c9430e79bb
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-updiagonalarrow.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalarrow</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","updiagonalarrow");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-updiagonalstrike-ref.html b/layout/reftests/mathml/menclose-5-updiagonalstrike-ref.html
new file mode 100644
index 0000000000..2e5bce42ea
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-updiagonalstrike-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose updiagonalstrike</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="updiagonalstrike"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-updiagonalstrike.html b/layout/reftests/mathml/menclose-5-updiagonalstrike.html
new file mode 100644
index 0000000000..9881741bb6
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-updiagonalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","updiagonalstrike");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-verticalstrike-ref.html b/layout/reftests/mathml/menclose-5-verticalstrike-ref.html
new file mode 100644
index 0000000000..4295e9f9d4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-verticalstrike-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose verticalstrike</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="verticalstrike"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-5-verticalstrike.html b/layout/reftests/mathml/menclose-5-verticalstrike.html
new file mode 100644
index 0000000000..4a7f111578
--- /dev/null
+++ b/layout/reftests/mathml/menclose-5-verticalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose verticalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').setAttribute("notation","verticalstrike");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose"><mspace width="100px" height="50px"></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-actuarial.html b/layout/reftests/mathml/menclose-6-actuarial.html
new file mode 100644
index 0000000000..2ee1cd1edb
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-actuarial.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose actuarial</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="actuarial"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-bottom.html b/layout/reftests/mathml/menclose-6-bottom.html
new file mode 100644
index 0000000000..e5c1a0df7a
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-bottom.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose bottom</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="bottom"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-box.html b/layout/reftests/mathml/menclose-6-box.html
new file mode 100644
index 0000000000..70a54a15d9
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-box.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose box</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="box"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-circle.html b/layout/reftests/mathml/menclose-6-circle.html
new file mode 100644
index 0000000000..cef1d1fcd4
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-circle.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose circle</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="circle"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-downdiagonalstrike.html b/layout/reftests/mathml/menclose-6-downdiagonalstrike.html
new file mode 100644
index 0000000000..c23bd1e42a
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-downdiagonalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose downdiagonalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="downdiagonalstrike"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-horizontalstrike.html b/layout/reftests/mathml/menclose-6-horizontalstrike.html
new file mode 100644
index 0000000000..265f032918
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-horizontalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose horizontalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="horizontalstrike"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-left.html b/layout/reftests/mathml/menclose-6-left.html
new file mode 100644
index 0000000000..c62ccd6a7d
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-left.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose left</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="left"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-longdiv.html b/layout/reftests/mathml/menclose-6-longdiv.html
new file mode 100644
index 0000000000..4011492f8e
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-longdiv.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose longdiv</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="longdiv"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-madruwb.html b/layout/reftests/mathml/menclose-6-madruwb.html
new file mode 100644
index 0000000000..ea19448a99
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-madruwb.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose madruwb</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="madruwb"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-phasorangle.html b/layout/reftests/mathml/menclose-6-phasorangle.html
new file mode 100644
index 0000000000..d2b6cc580f
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-phasorangle.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose phasorangle</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math>
+ <menclose id="testMenclose" notation="phasorangle">
+ <mspace width="100px" height="50px" mathbackground="blue"></mspace>
+ </menclose>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-ref.html b/layout/reftests/mathml/menclose-6-ref.html
new file mode 100644
index 0000000000..5b091e76dd
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>menclose 6 reference</title>
+ </head>
+ <body>
+ <p>
+ <math><menclose><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-right.html b/layout/reftests/mathml/menclose-6-right.html
new file mode 100644
index 0000000000..af33a59974
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-right.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose right</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="right"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-roundedbox.html b/layout/reftests/mathml/menclose-6-roundedbox.html
new file mode 100644
index 0000000000..752cdc68e3
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-roundedbox.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose roundedbox</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="roundedbox"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-top.html b/layout/reftests/mathml/menclose-6-top.html
new file mode 100644
index 0000000000..3e1988a790
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-top.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose top</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="top"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-updiagonalarrow.html b/layout/reftests/mathml/menclose-6-updiagonalarrow.html
new file mode 100644
index 0000000000..a3e6f58463
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-updiagonalarrow.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalarrow</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="updiagonalarrow"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-updiagonalstrike.html b/layout/reftests/mathml/menclose-6-updiagonalstrike.html
new file mode 100644
index 0000000000..6892b48658
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-updiagonalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose updiagonalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="updiagonalstrike"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/menclose-6-verticalstrike.html b/layout/reftests/mathml/menclose-6-verticalstrike.html
new file mode 100644
index 0000000000..0812293bde
--- /dev/null
+++ b/layout/reftests/mathml/menclose-6-verticalstrike.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>menclose verticalstrike</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('testMenclose').removeAttribute("notation");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <p>
+ <math><menclose id="testMenclose" notation="verticalstrike"><mspace width="100px" height="50px" mathbackground="blue"></mspace></menclose></math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-4-ref.html b/layout/reftests/mathml/mfrac-A-4-ref.html
new file mode 100644
index 0000000000..3a4915147d
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-4-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac denomalign</title>
+ </head>
+ <body>
+ <div style="position: absolute;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="0">
+ <mspace width="100px" height="20px" mathbackground="red"></mspace>
+ <mspace width="50px" height="20px" mathbackground="red"></mspace>
+ </mfrac>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-4.html b/layout/reftests/mathml/mfrac-A-4.html
new file mode 100644
index 0000000000..79f3e25074
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-4.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac denomalign</title>
+ </head>
+ <body>
+ <div style="position: absolute;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="0">
+ <mspace width="100px" height="20px" mathbackground="red"></mspace>
+ <mpadded width="100px" lspace="25px">
+ <mspace width="50px" height="20px" mathbackground="red"></mspace>
+ </mpadded>
+ </mfrac>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-5-ref.html b/layout/reftests/mathml/mfrac-A-5-ref.html
new file mode 100644
index 0000000000..440d6cf2d6
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-5-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ </head>
+ <body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac>
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-5.html b/layout/reftests/mathml/mfrac-A-5.html
new file mode 100644
index 0000000000..c8b5f9d9c5
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-5.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ </head>
+ <body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="100%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-8-ref.html b/layout/reftests/mathml/mfrac-A-8-ref.html
new file mode 100644
index 0000000000..f16b037090
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-8-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac numalign</title>
+ </head>
+ <body>
+ <div style="position: absolute;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="0">
+ <mspace width="50px" height="20px" mathbackground="red"></mspace>
+ <mspace width="100px" height="20px" mathbackground="red"></mspace>
+ </mfrac>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-A-8.html b/layout/reftests/mathml/mfrac-A-8.html
new file mode 100644
index 0000000000..3655b6ac05
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-A-8.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac numalign</title>
+ </head>
+ <body>
+ <div style="position: absolute;">
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="0">
+ <mpadded width="100px" lspace="25px">
+ <mspace width="50px" height="20px" mathbackground="red"></mspace>
+ </mpadded>
+ <mspace width="100px" height="20px" mathbackground="red"></mspace>
+ </mfrac>
+ </math>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-B-2-3-ref.html b/layout/reftests/mathml/mfrac-B-2-3-ref.html
new file mode 100644
index 0000000000..1c231455bf
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-B-2-3-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ </head>
+ <body>
+ <math>
+ <mfrac style="font-size: 300%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-B-2.html b/layout/reftests/mathml/mfrac-B-2.html
new file mode 100644
index 0000000000..c2ee64a0f5
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-B-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac linethickness</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById("testMfrac").removeAttribute("linethickness");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mfrac id="testMfrac" style="font-size: 300%" linethickness="200%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-B-3.html b/layout/reftests/mathml/mfrac-B-3.html
new file mode 100644
index 0000000000..fb5d9a0c6c
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-B-3.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac linethickness</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById("testMfrac").removeAttribute("linethickness");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mfrac id="testMfrac" style="font-size: 300%" linethickness="50%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-C-2-ref.html b/layout/reftests/mathml/mfrac-C-2-ref.html
new file mode 100644
index 0000000000..c5d73a9bba
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-C-2-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ </head>
+ <body>
+ <math>
+ <mfrac style="font-size: 300%" linethickness="200%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-C-2.html b/layout/reftests/mathml/mfrac-C-2.html
new file mode 100644
index 0000000000..ac5106d1db
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-C-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac linethickness</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById("testMfrac").setAttribute("linethickness","200%");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mfrac id="testMfrac" style="font-size: 300%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-D-2-ref.html b/layout/reftests/mathml/mfrac-D-2-ref.html
new file mode 100644
index 0000000000..0a6155e785
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-D-2-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ </head>
+ <body>
+ <math>
+ <mfrac style="font-size: 300%" linethickness="50%">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-D-2.html b/layout/reftests/mathml/mfrac-D-2.html
new file mode 100644
index 0000000000..febf668991
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-D-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac linethickness</title>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById("testMfrac").setAttribute("linethickness","50%");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mfrac id="testMfrac" style="font-size: 300%" linethickness="thin">
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-E-1-ref.html b/layout/reftests/mathml/mfrac-E-1-ref.html
new file mode 100644
index 0000000000..966d356ba2
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-E-1-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac childnode update</title>
+ </head>
+ <body>
+ <math>
+ <mfrac style="font-size: 300%">
+ <mfrac>
+ <mi> a </mi>
+ <mi> b </mi>
+ </mfrac>
+ <mfrac>
+ <mi> c </mi>
+ <mi> d </mi>
+ </mfrac>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-E-1.html b/layout/reftests/mathml/mfrac-E-1.html
new file mode 100644
index 0000000000..e931564515
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-E-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac childnode update</title>
+ <script type="text/javascript">
+ function doTest() {
+ var x = document.getElementById("innerMfrac");
+ var y = document.createElementNS("http://www.w3.org/1998/Math/MathML","mi");
+ var z = document.createElementNS("http://www.w3.org/1998/Math/MathML","mi");
+ y.innerHTML = "c";
+ z.innerHTML = "d";
+ x.appendChild(y);
+ x.appendChild(z);
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <mfrac style="font-size: 300%">
+ <mfrac>
+ <mi> a </mi>
+ <mi> b </mi>
+ </mfrac>
+ <mfrac id="innerMfrac">
+ </mfrac>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-1-ref.xhtml b/layout/reftests/mathml/mfrac-linethickness-1-ref.xhtml
new file mode 100644
index 0000000000..99faab1c27
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-1-ref.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="100%">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-1.xhtml b/layout/reftests/mathml/mfrac-linethickness-1.xhtml
new file mode 100644
index 0000000000..7394f6d0b6
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-1.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-2-ref.xhtml b/layout/reftests/mathml/mfrac-linethickness-2-ref.xhtml
new file mode 100644
index 0000000000..7394f6d0b6
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-2-ref.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-2.xhtml b/layout/reftests/mathml/mfrac-linethickness-2.xhtml
new file mode 100644
index 0000000000..b2dc010a68
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-2.xhtml
@@ -0,0 +1,22 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="2">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-3-ref.xhtml b/layout/reftests/mathml/mfrac-linethickness-3-ref.xhtml
new file mode 100644
index 0000000000..68c8633554
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-3-ref.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mfrac-linethickness-3.xhtml b/layout/reftests/mathml/mfrac-linethickness-3.xhtml
new file mode 100644
index 0000000000..ca11826284
--- /dev/null
+++ b/layout/reftests/mathml/mfrac-linethickness-3.xhtml
@@ -0,0 +1,37 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfrac linethickness="2km">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac linethickness = "cat">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac linethickness = "-2px">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ <mo>=</mo>
+ <mfrac linethickness="1">
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfrac>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-1-ref.xhtml b/layout/reftests/mathml/mi-mathvariant-1-ref.xhtml
new file mode 100644
index 0000000000..36a21e79ef
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-1-ref.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mi mathvariant="normal">cos</mi>
+ <mo>&#x2061;</mo>
+ <mi mathvariant="italic">x</mi>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-1.xhtml b/layout/reftests/mathml/mi-mathvariant-1.xhtml
new file mode 100644
index 0000000000..d85c2c4b2d
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-1.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mi>cos</mi>
+ <mo>&#x2061;</mo>
+ <mi>x</mi>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-2-ref.xhtml b/layout/reftests/mathml/mi-mathvariant-2-ref.xhtml
new file mode 100644
index 0000000000..edee2a9b43
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-2-ref.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <!-- infinity has no corresponding mathematical italic alphanumeric
+ character and so should not be rendered with italic style.
+ bug 413115.
+ -->
+ <mi mathvariant="normal">&#x221e;</mi>
+ <!-- PLANCK CONSTANT already has italic style, and shouldn't have
+ additional slant applied -->
+ <mi mathvariant="normal">&#x210e;</mi>
+ <!-- mathvariant on single-char mi (the mathvariant property should
+ override the default italicness)-->
+ <mi>&#x1d505;</mi>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-2.xhtml b/layout/reftests/mathml/mi-mathvariant-2.xhtml
new file mode 100644
index 0000000000..ae1db6e1ee
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-2.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mi>&#x221e;</mi>
+ <mi>&#x210e;</mi>
+ <mi mathvariant="fraktur">B</mi>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-3-ref.html b/layout/reftests/mathml/mi-mathvariant-3-ref.html
new file mode 100644
index 0000000000..27a58b9ba0
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-3-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Mathematica Alphanumeric Italic</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <math><mstyle mathbackground="red"><mphantom><mi>X</mi></mphantom></mstyle></math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mi-mathvariant-3.html b/layout/reftests/mathml/mi-mathvariant-3.html
new file mode 100644
index 0000000000..aa503da9a9
--- /dev/null
+++ b/layout/reftests/mathml/mi-mathvariant-3.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Mathematica Alphanumeric Italic</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- The lowercase italic o should be smaller than the uppercase italic X
+ (this will fail if missing char boxes are used) -->
+ <math><mstyle mathbackground="red"><mphantom><mi>o</mi></mphantom></mstyle></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..10ea93669a
--- /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 {
+ -moz-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-accent-dynamic-ref.html b/layout/reftests/mathml/mo-accent-dynamic-ref.html
new file mode 100644
index 0000000000..c25181d142
--- /dev/null
+++ b/layout/reftests/mathml/mo-accent-dynamic-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <title>mo@accent</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <munderover><mtext>X</mtext><mo accent="true">O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/mo-accent-dynamic.html b/layout/reftests/mathml/mo-accent-dynamic.html
new file mode 100644
index 0000000000..d4bfc62fc6
--- /dev/null
+++ b/layout/reftests/mathml/mo-accent-dynamic.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mo@accent</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('mathOperator').setAttribute('accent', 'true');
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <munderover><mtext>X</mtext><mo id="mathOperator">O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
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/mo-invisibleoperators-2-ref.html b/layout/reftests/mathml/mo-invisibleoperators-2-ref.html
new file mode 100644
index 0000000000..152c84cd9c
--- /dev/null
+++ b/layout/reftests/mathml/mo-invisibleoperators-2-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <math>
+ <mo>1</mo>
+ </math>
+ <p>
+ <math>
+ <mo>2</mo>
+ </math>
+ <p>
+ <math>
+ <mo>3</mo>
+ </math>
+ <p>
+ <math>
+ <mo>4</mo>
+ </math>
+ <p>
+ <table>
+ <tr>
+ <td style="border: 1px solid;">
+ <math>
+ <mo>x</mo>
+ </math>
+ </td>
+ </tr>
+ </table>
+</html>
diff --git a/layout/reftests/mathml/mo-invisibleoperators-2.html b/layout/reftests/mathml/mo-invisibleoperators-2.html
new file mode 100644
index 0000000000..bee0e77cbd
--- /dev/null
+++ b/layout/reftests/mathml/mo-invisibleoperators-2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <body>
+ <math>
+ <mo id="mo1">&#x2061;<!-- FUNCTION APPLICATION --></mo>
+ </math>
+ <p>
+ <math>
+ <mo id="mo2">&#x2062;<!-- INVISIBLE TIMES --></mo>
+ </math>
+ <p>
+ <math>
+ <mo id="mo3">&#x2063;<!-- INVISIBLE SEPARATOR --></mo>
+ </math>
+ <p>
+ <math>
+ <mo id="mo4">&#x2064;<!-- INVISIBLE PLUS --></mo>
+ </math>
+ <p>
+ <!-- Test preferred width after dynamic change-->
+ <table>
+ <tr>
+ <td style="border: 1px solid;">
+ <math>
+ <mo id="mo5">&ApplyFunction;</mo>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('mo1').firstChild.data = '1';
+ document.getElementById('mo2').firstChild.data = '2';
+ document.getElementById('mo3').firstChild.data = '3';
+ document.getElementById('mo4').firstChild.data = '4';
+ document.getElementById('mo5').firstChild.data = 'x';
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mo-invisibleoperators-ref.html b/layout/reftests/mathml/mo-invisibleoperators-ref.html
new file mode 100644
index 0000000000..2b7d9c6add
--- /dev/null
+++ b/layout/reftests/mathml/mo-invisibleoperators-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ <mn>5</mn>
+ <mspace height="2em" width="0.1em"></mspace>
+ </mrow>
+ </math>
+</html>
diff --git a/layout/reftests/mathml/mo-invisibleoperators.html b/layout/reftests/mathml/mo-invisibleoperators.html
new file mode 100644
index 0000000000..6937dafc80
--- /dev/null
+++ b/layout/reftests/mathml/mo-invisibleoperators.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <math>
+ <mrow>
+ <mn>1</mn>
+ <mo>&#x2061;<!-- FUNCTION APPLICATION --></mo>
+ <mn>2</mn>
+ <mo>&#x2062;<!-- INVISIBLE TIMES --></mo>
+ <mn>3</mn>
+ <mo>&#x2063;<!-- INVISIBLE SEPARATOR --></mo>
+ <mn>4</mn>
+ <mo>&#x2064;<!-- INVISIBLE PLUS --></mo>
+ <mn>5</mn>
+ <!-- Hack. The invisible operators may not belong to the same font as
+ the numbers, so they may have different heights. The mspace
+ compensates for this by ensuring the height of the mrow does not
+ depend on character height -->
+ <mspace height="2em" width="0.1em"></mspace>
+ </mrow>
+ </math>
+ <p>
+ <!-- Should be invisible -->
+ <math>
+ <mo style="background: red; color: blue;">&ApplyFunction;</mo>
+ </math>
+</html>
diff --git a/layout/reftests/mathml/mo-movablelimits-dynamic-ref.html b/layout/reftests/mathml/mo-movablelimits-dynamic-ref.html
new file mode 100644
index 0000000000..41e80c0d4b
--- /dev/null
+++ b/layout/reftests/mathml/mo-movablelimits-dynamic-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mo@movablelimits</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <munder>
+ <mo>∑</mo>
+ <mi>x</mi>
+ </munder>
+ </math>
+ </body>
+ </html> \ No newline at end of file
diff --git a/layout/reftests/mathml/mo-movablelimits-dynamic.html b/layout/reftests/mathml/mo-movablelimits-dynamic.html
new file mode 100644
index 0000000000..6f4c1a0277
--- /dev/null
+++ b/layout/reftests/mathml/mo-movablelimits-dynamic.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mo@movablelimits</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('a').removeAttribute('movablelimits');
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <munder>
+ <mo id="a" movablelimits="false">∑</mo>
+ <mi>x</mi>
+ </munder>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/mpadded-1-2-ref.html b/layout/reftests/mathml/mpadded-1-2-ref.html
new file mode 100644
index 0000000000..f92891ba47
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-1-2-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#bigsquare {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#smallsquare {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 20px;
+ top: 60px;
+ background: red;
+ }
+ /*left = lspace = 20px;
+ top = heightBig - voffset - heightSmall;
+ = 50 + 20 - 10
+ = 60px */
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare">
+ <div id="smallsquare">
+ </div>
+ </div>
+ </body>
+<html>
diff --git a/layout/reftests/mathml/mpadded-1-2.html b/layout/reftests/mathml/mpadded-1-2.html
new file mode 100644
index 0000000000..1c797f9133
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-1-2.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="20px" voffset="-20px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-1-ref.html b/layout/reftests/mathml/mpadded-1-ref.html
new file mode 100644
index 0000000000..44d3afc65a
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-1-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#bigsquare {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#smallsquare {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 20px;
+ top: 10px;
+ background: red;
+ }
+ /*left = lspace = 20px;
+ top = heightBig - voffset - heightSmall;
+ = 50 - 30 - 10
+ = 10px */
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare">
+ <div id="smallsquare">
+ </div>
+ </div>
+ </body>
+<html>
diff --git a/layout/reftests/mathml/mpadded-1.html b/layout/reftests/mathml/mpadded-1.html
new file mode 100644
index 0000000000..8b62cd0c77
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="20px" voffset="30px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-2-ref.html b/layout/reftests/mathml/mpadded-2-ref.html
new file mode 100644
index 0000000000..82ab252d8f
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-2-ref.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#square1 {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ background: blue;
+ }
+
+ div#square2 {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 10px;
+ top: 55px;
+ background: red;
+ }
+ /* left = lspace = 10;
+ top = heightBig - heightSmall - voffset;
+ top = 50 - 10 + 15 = 55px */
+ </style>
+ </head>
+ <body>
+ <div id="square1">
+ <div id="square2">
+ </div>
+ </div>
+ </body>
+<html>
diff --git a/layout/reftests/mathml/mpadded-2.html b/layout/reftests/mathml/mpadded-2.html
new file mode 100644
index 0000000000..0fbac790c6
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-2.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="10px" voffset="-15px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-3-ref.html b/layout/reftests/mathml/mpadded-3-ref.html
new file mode 100644
index 0000000000..5bb134d73a
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-3-ref.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded height depth</title>
+ <style type="text/css">
+ div#bigsquare1 {
+ position: absolute;
+ width: 100px;
+ height: 50px;
+ background: blue;
+ }
+
+ div#smallsquare1 {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: 0px;
+ top: 30px;
+ background: red;
+ }
+ /* left = lspace = 0;
+ top = heightBig - heightSmall - voffset;
+ = 50 - 10 - 10*/
+ </style>
+ </head>
+ <body>
+ <div id="bigsquare1">
+ <div id="smallsquare1">
+ </div>
+ </div>
+
+ <div id="bigsquare2">
+ <div id="smallsquare2">
+ </div>
+ </div>
+ </body>
+<html>
diff --git a/layout/reftests/mathml/mpadded-3.html b/layout/reftests/mathml/mpadded-3.html
new file mode 100644
index 0000000000..829467726a
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-3.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded height depth</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="0px"
+ lspace="0px" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-4-ref.html b/layout/reftests/mathml/mpadded-4-ref.html
new file mode 100644
index 0000000000..0ff6f8733c
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-4-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="3height" depth="3depth"
+ lspace="0" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-4.html b/layout/reftests/mathml/mpadded-4.html
new file mode 100644
index 0000000000..39618c83a9
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-4.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <!-- if lspace is used as a pseudounit, the lspace value is 0 -->
+ <mpadded mathbackground="blue" width="100px" height="3height" depth="3depth"
+ lspace="3lspace" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-5-ref.html b/layout/reftests/mathml/mpadded-5-ref.html
new file mode 100644
index 0000000000..267ab95e64
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-5-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ <style type="text/css">
+ div#square1 {
+ position:absolute;
+ width: 20px;
+ height: 20px;
+ left: -25px;
+ top: 25px;
+ background: red;
+ }
+ div#square2 {
+ position: absolute;
+ width: 100px;
+ height: 100px;
+ left: 40px;
+ top:30px;
+ background: blue;
+ }
+
+ div#square3 {
+ position:absolute;
+ width: 200px;
+ height: 200px;
+ background: green;
+ }
+ /* left = lspace = -25;
+ top = HeightBig - HeightSmall - voffsetSmall
+ = 50 - 10 - 15 = 25px */
+ /* left = lsapce = 40px;
+ top = HeightVeryBig - HeightBig - voffsetBig
+ = 100 - 50 - 20 = 30px */
+ </style>
+ </head>
+ <body>
+ <div id="square3">
+ <div id="square2">
+ <div id="square1">
+ </div>
+ </div>
+ </div>
+ </body>
+<html>
diff --git a/layout/reftests/mathml/mpadded-5.html b/layout/reftests/mathml/mpadded-5.html
new file mode 100644
index 0000000000..f85087af3d
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-5.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="green" width="200px" height="100px" depth="100px"
+ lspace="40px" voffset="20px">
+ <mpadded mathbackground="blue" width="100px" height="50px" depth="50px"
+ lspace="-25px" voffset="15px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-6-ref.html b/layout/reftests/mathml/mpadded-6-ref.html
new file mode 100644
index 0000000000..ea5db6a31b
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-6-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="blue" width="100px" height="100px" depth="0px"
+ lspace="20px" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mpadded-6.html b/layout/reftests/mathml/mpadded-6.html
new file mode 100644
index 0000000000..d75eaf7c46
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-6.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <!--if height, depth or width is a negative value, 0px is the value applied -->
+ <mpadded mathbackground="blue" width="100px" height="100px" depth="-100px"
+ lspace="20px" voffset="10px">
+ <mpadded mathbackground="red" width="20px" height="10px"
+ depth="10px">
+ </mpadded>
+ </mpadded>
+ </math>
+ </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..b01e7f4a6d
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-7-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" height="100height" depth="0">
+ <mphantom>
+ <mtext style="font-family: monospace">X</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <math>
+ <mpadded mathbackground="red" height="100height" depth="0">
+ <mphantom>
+ <mtext mathvariant="monospace">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..bb9c5890ea
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-7.html
@@ -0,0 +1,23 @@
+<!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 style="font-family: monospace">_</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <math>
+ <mpadded mathbackground="red" height="100height" depth="0">
+ <mphantom>
+ <mtext mathvariant="monospace">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..1b8963df64
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-8-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" height="100width" depth="0">
+ <mphantom>
+ <mtext style="font-family: monospace">X</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <math>
+ <mpadded mathbackground="red" height="100width" depth="0">
+ <mphantom>
+ <mtext mathvariant="monospace">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..274925906b
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-8.html
@@ -0,0 +1,23 @@
+<!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 style="font-family: monospace">|</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <math>
+ <mpadded mathbackground="red" height="100width" depth="0">
+ <mphantom>
+ <mtext mathvariant="monospace">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..9e5f3c6b80
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-9-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test mpadded</title>
+ </head>
+ <body>
+ <math>
+ <mpadded mathbackground="red" width="100width">
+ <mphantom>
+ <mtext style="font-family: monospace">X</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <br>
+ <math>
+ <mpadded mathbackground="red" width="100width">
+ <mphantom>
+ <mtext mathvariant="monospace">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..8e8b92b0d6
--- /dev/null
+++ b/layout/reftests/mathml/mpadded-9.html
@@ -0,0 +1,24 @@
+<!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 style="font-family: monospace">|</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ <br>
+ <math>
+ <mpadded mathbackground="red" width="100width">
+ <mphantom>
+ <mtext mathvariant="monospace">i</mtext>
+ </mphantom>
+ </mpadded>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mphantom-1-ref.html b/layout/reftests/mathml/mphantom-1-ref.html
new file mode 100644
index 0000000000..2cc362f91a
--- /dev/null
+++ b/layout/reftests/mathml/mphantom-1-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mphantom</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- <mphantom> should be invisible. -->
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mphantom-1.html b/layout/reftests/mathml/mphantom-1.html
new file mode 100644
index 0000000000..85f40d8080
--- /dev/null
+++ b/layout/reftests/mathml/mphantom-1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mphantom</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test different kinds of content inside <mphantom>. -->
+ <p><math>
+ <mrow style="visibility: hidden">
+ <msqrt>
+ <mfrac>
+ <mn>1</mn>
+ <mi>x</mi>
+ </mfrac>
+ </msqrt>
+ <mo>+</mo>
+ <menclose notation="box updiagonalstrike">
+ <mover>
+ <mspace width="3em" height="1em" mathbackground="red"/>
+ <mo>‾</mo>
+ </mover>
+ </menclose>
+ </mrow>
+ </math></p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mphantom-2-ref.html b/layout/reftests/mathml/mphantom-2-ref.html
new file mode 100644
index 0000000000..56f13e302c
--- /dev/null
+++ b/layout/reftests/mathml/mphantom-2-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mphantom</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <p>
+ <math>
+ <mtext>LEFT</mtext>
+ <munderover>
+ <mspace width="4em" height="3em" depth="2em"/>
+ <mtext>BELOW</mtext>
+ <mtext>ABOVE</mtext>
+ </munderover>
+ <mtext>RIGHT</mtext>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mphantom-2.html b/layout/reftests/mathml/mphantom-2.html
new file mode 100644
index 0000000000..898e846064
--- /dev/null
+++ b/layout/reftests/mathml/mphantom-2.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mphantom</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test that <mphantom> has the size of its content. -->
+ <p>
+ <math>
+ <mtext>LEFT</mtext>
+ <munderover>
+ <mphantom>
+ <mspace width="4em" height="3em" depth="2em" mathbackground="red"/>
+ </mphantom>
+ <mtext>BELOW</mtext>
+ <mtext>ABOVE</mtext>
+ </munderover>
+ <mtext>RIGHT</mtext>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mspace-1-ref.html b/layout/reftests/mathml/mspace-1-ref.html
new file mode 100644
index 0000000000..3a9e9d4a8d
--- /dev/null
+++ b/layout/reftests/mathml/mspace-1-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <title>mspace</title>
+</head>
+
+<body>
+
+ <div style="position: absolute;
+ top: 0; left: 0;
+ width: 50px; height: 6em;
+ background: red;"></div>
+
+ <div style="position: absolute;
+ top: 2em; left: 50px;
+ width: 40px; height: 3em;
+ background: green;"></div>
+
+ <div style="position: absolute;
+ top: 1em; left: 90px;
+ width: 30px; height: 3em;
+ background: blue;"></div>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/mspace-1.html b/layout/reftests/mathml/mspace-1.html
new file mode 100644
index 0000000000..76d76a93c0
--- /dev/null
+++ b/layout/reftests/mathml/mspace-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+ <title>mspace</title>
+</head>
+
+<body>
+
+ <math style="position: absolute; top: 0; left: 0; margin: 0; padding: 0;">
+ <mspace width="50px" height="3em" depth="3em" mathbackground="red"/>
+ <mspace width="40px" height="1em" depth="2em" mathbackground="green"/>
+ <mspace width="30px" height="2em" depth="1em" mathbackground="blue"/>
+ </math>
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/mstyle-1-ref.xhtml b/layout/reftests/mathml/mstyle-1-ref.xhtml
new file mode 100644
index 0000000000..c8fdc36df8
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-1-ref.xhtml
@@ -0,0 +1,123 @@
+<?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>mfenced: open, close, separators </td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mfenced>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfenced>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>menclose: notation</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <menclose>
+ <mtext>menclose</mtext>
+ </menclose>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: bevelled, linethickness</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mfrac>
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: numalign</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mfrac>
+ <mn>1</mn>
+ <mn>234</mn>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: denomalign</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mfrac>
+ <mn>123</mn>
+ <mn>4</mn>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mmultiscripts: subscriptshift, superscriptshift </td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mmultiscripts>
+ <mi>a</mi>
+ <mi>b</mi>
+ <mi>c</mi>
+ <mprescripts/>
+ <mi>e</mi>
+ <mi>f</mi>
+ </mmultiscripts>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msubsup: subscriptshift, superscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msubsup>
+ <mi>a</mi>
+ <mi>b</mi>
+ <mi>c</mi>
+ </msubsup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msub: subscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msub>
+ <mi>a</mi>
+ <mi>b</mi>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msup: superscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <msup>
+ <mi>a</mi>
+ <mi>b</mi>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-1.xhtml b/layout/reftests/mathml/mstyle-1.xhtml
new file mode 100644
index 0000000000..692bcc5e0d
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-1.xhtml
@@ -0,0 +1,123 @@
+<?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>mfenced: open, close, separators </td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle open="[" close="]" separators=";">
+ <mfenced>
+ <mn>1</mn>
+ <mn>2</mn>
+ </mfenced>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>menclose: notation</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle notation="box">
+ <menclose>
+ <mtext>menclose</mtext>
+ </menclose>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: bevelled, linethickness</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle bevelled="true" linethickness="10px">
+ <mfrac>
+ <mi>a</mi>
+ <mi>b</mi>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: numalign</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle numalign="right">
+ <mfrac>
+ <mn>1</mn>
+ <mn>234</mn>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mfrac: denomalign</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle denomalign="right">
+ <mfrac>
+ <mn>123</mn>
+ <mn>4</mn>
+ </mfrac>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mmultiscripts: subscriptshift, superscriptshift </td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle subscriptshift="1em" superscriptshift="1em">
+ <mmultiscripts>
+ <mi>a</mi>
+ <mi>b</mi>
+ <mi>c</mi>
+ <mprescripts/>
+ <mi>e</mi>
+ <mi>f</mi>
+ </mmultiscripts>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msubsup: subscriptshift, superscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle subscriptshift="1em" superscriptshift="1em">
+ <msubsup>
+ <mi>a</mi>
+ <mi>b</mi>
+ <mi>c</mi>
+ </msubsup>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msub: subscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle subscriptshift="1em">
+ <msub>
+ <mi>a</mi>
+ <mi>b</mi>
+ </msub>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>msup: superscriptshift</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle superscriptshift="1em">
+ <msup>
+ <mi>a</mi>
+ <mi>b</mi>
+ </msup>
+ </mstyle>
+ </math></td>
+ </tr>
+ </tbody>
+</table>
+</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..19e8164835
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-2-ref.xhtml
@@ -0,0 +1,144 @@
+<?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>
+ <tr>
+ <td>maction: selection</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <maction actiontype="toggle">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mtable: align</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <mrow>
+ <mtext>_</mtext>
+ <mtable>
+ <mtr>
+ <mtd>
+ <mtext>&#x2015;</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>&#x2015;</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ <mtext>_</mtext>
+ </mrow>
+ </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..93611b0f3b
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-2.xhtml
@@ -0,0 +1,147 @@
+<?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>
+ <tr>
+ <td>maction: selection</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" selection="2">
+ <mstyle selection="2">
+ <maction actiontype="toggle">
+ <mn>1</mn>
+ <mn>2</mn>
+ </maction>
+ </mstyle>
+ </math></td>
+ </tr>
+ <tr>
+ <td>mtable: align</td>
+ <td><math xmlns="http://www.w3.org/1998/Math/MathML" align="baseline">
+ <mstyle align="baseline">
+ <mrow>
+ <mtext>_</mtext>
+ <mtable>
+ <mtr>
+ <mtd>
+ <mtext>&#x2015;</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>&#x2015;</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ <mtext>_</mtext>
+ </mrow>
+ </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..016e1d9e18
--- /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="2">(</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..8fdeb69cb7
--- /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="1">
+ <mstyle maxsize="1">
+ <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="3">
+ <mstyle minsize="3">
+ <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="2">(</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/mstyle-5-ref.xhtml b/layout/reftests/mathml/mstyle-5-ref.xhtml
new file mode 100644
index 0000000000..f4c895e127
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-5-ref.xhtml
@@ -0,0 +1,17 @@
+<?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 with lquote/rquote for ms</title>
+</head>
+<body>
+
+<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mstyle>
+ <ms>text</ms>
+ </mstyle>
+</math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mstyle-5.xhtml b/layout/reftests/mathml/mstyle-5.xhtml
new file mode 100644
index 0000000000..9d7c7f9158
--- /dev/null
+++ b/layout/reftests/mathml/mstyle-5.xhtml
@@ -0,0 +1,20 @@
+<?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 with lquote/rquote for ms</title>
+</head>
+<body>
+
+<!-- The attributes below should no longer have effect on <mstyle>/<math>
+ elements. See bug 838509 -->
+
+<math xmlns="http://www.w3.org/1998/Math/MathML" lquote="(" rquote=")">
+ <mstyle lquote="(" rquote=")">
+ <ms>text</ms>
+ </mstyle>
+</math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-align-negative-rownumber-2-ref.html b/layout/reftests/mathml/mtable-align-negative-rownumber-2-ref.html
new file mode 100644
index 0000000000..0d14017e54
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber-2-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mrow>
+<mtable align="axis 0"><mtr><mtd><mi>&nbsp;</mi></mtd></mtr> <mtr><mtd><mi>&nbsp;</mi></mtd></mtr> <mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr></mtable>
+<mo>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</mo>
+<mtable align="axis 0"><mtr><mtd><mi>&nbsp;</mi></mtd></mtr> <mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr></mtable>
+<mo>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</mo>
+<mtable align="axis 0"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable>
+</mrow>
+</math>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-align-negative-rownumber-2.html b/layout/reftests/mathml/mtable-align-negative-rownumber-2.html
new file mode 100644
index 0000000000..9e8ce3cc93
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber-2.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
+<mrow>
+<mtable align="axis -1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr></mtable>
+<mo>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</mo>
+<mtable align="axis -1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr></mtable>
+<mo>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</mo>
+<mtable align="axis -1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable>
+</mrow>
+</math>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-align-negative-rownumber-ref.html b/layout/reftests/mathml/mtable-align-negative-rownumber-ref.html
new file mode 100644
index 0000000000..ebf3bf8780
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
+<mtable align="axis 3"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable><mo>=</mo>
+<mtable align="axis 1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable></mrow></math>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-align-negative-rownumber.html b/layout/reftests/mathml/mtable-align-negative-rownumber.html
new file mode 100644
index 0000000000..66aaed8f82
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-negative-rownumber.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align attribute: negative rownumber</title>
+</head>
+
+<body>
+
+<div>
+<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
+<mtable align="axis -1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable><mo>=</mo>
+<mtable align="axis 1"><mtr><mtd><mi>a</mi></mtd> <mtd><mi>b</mi></mtd> <mtd><mi>c</mi></mtd></mtr> <mtr><mtd><mi>d</mi></mtd> <mtd><mi>e</mi></mtd> <mtd><mi>f</mi></mtd></mtr> <mtr><mtd><mi>g</mi></mtd> <mtd><mi>h</mi></mtd> <mtd><mi>i</mi></mtd></mtr></mtable></mrow></math>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-align-whitespace-ref.html b/layout/reftests/mathml/mtable-align-whitespace-ref.html
new file mode 100644
index 0000000000..ca7676d5bf
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-whitespace-ref.html
@@ -0,0 +1,346 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align : WhiteSpace Check</title>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+</head>
+
+<body>
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+<br><br><br>
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+
+
+
+</body>
+
+</html>
diff --git a/layout/reftests/mathml/mtable-align-whitespace.html b/layout/reftests/mathml/mtable-align-whitespace.html
new file mode 100644
index 0000000000..a200e9ac3d
--- /dev/null
+++ b/layout/reftests/mathml/mtable-align-whitespace.html
@@ -0,0 +1,342 @@
+<!DOCTYPE html>
+<head>
+<title>mtable align : WhiteSpace Check</title>
+ <style>
+ @font-face
+ {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+ }
+ math {
+ font: 25px Ahem;
+ }
+ </style>
+</head>
+
+<body>
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center-3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center-3 ">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align=" center-3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align=" center-3 ">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align=" center -3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center -3 ">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align=" center -3 ">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+
+<br><br><br>
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="&#xA&#xD;&#x20;center&#xA&#xD;&#x20;-3&#xA&#xD;&#x9;">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="&#xA&#xD;&#x9;&#x20;center&#xA&#xD;&#x9;&#x20;-3&#xA&#xD;&#x9;&#x20;">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center-3&#xA&#xD;&#x9;&#x20;">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="&#xA&#xD;&#x9;&#x20;center-3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="&#xA&#xD;&#x9;&#x20;center-3&#xA&#xD;&#x9;&#x20;">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="&#xA&#xD;&#x9;&#x20;center&#xA&#xD;&#x9;&#x20;-3">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+
+
+ <math>
+
+ <mtext>X</mtext>
+ <mo>=</mo>
+ <mtable frame="solid" align="center&#xA&#xD;&#x9;&#x20;-3&#xA&#xD;&#x9;&#x20;">
+ <mtr>
+ <mtd><mtext>A</mtext></mtd>
+ <mtd><mtext>B</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>C</mtext></mtd>
+ <mtd><mtext>D</mtext></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mtext>E</mtext></mtd>
+ <mtd><mtext>F</mtext></mtd>
+ </mtr>
+ </mtable>
+
+ </math>
+
+</body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-multi-mtable-dynamic.html b/layout/reftests/mathml/mtable-columnalign-multi-mtable-dynamic.html
new file mode 100644
index 0000000000..fbb0a86bf1
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-multi-mtable-dynamic.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+
+ // Table 1 setup
+ table1.setAttribute("columnalign", "left center right");
+ // Table 2 setup
+ table2.setAttribute("columnalign", "right left center");
+ // Table 3 setup
+ table3.setAttribute("columnalign", "center right left");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnalign="left center right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right left center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center right left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-multi-mtable.html b/layout/reftests/mathml/mtable-columnalign-multi-mtable.html
new file mode 100644
index 0000000000..139cba982b
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-multi-mtable.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left center right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="left center right">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right left center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="right left center">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center right left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="center right left">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-multi-mtr-dynamic.html b/layout/reftests/mathml/mtable-columnalign-multi-mtr-dynamic.html
new file mode 100644
index 0000000000..24ea0f0720
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-multi-mtr-dynamic.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+ var rows = undefined;
+
+ // Table 1 setup
+ rows = table1.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "left center right");
+
+ // Table 2 setup
+ rows = table2.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "right left center");
+
+ // Table 3 setup
+ rows = table3.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "center right left");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnalign="left center right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right left center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center right left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-multi-mtr.html b/layout/reftests/mathml/mtable-columnalign-multi-mtr.html
new file mode 100644
index 0000000000..9f37f96abb
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-multi-mtr.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left center right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="left center right">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="left center right">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="left center right">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right left center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="right left center">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="right left center">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="right left center">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center right left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="center right left">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="center right left">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="center right left">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-multi-ref.html b/layout/reftests/mathml/mtable-columnalign-multi-ref.html
new file mode 100644
index 0000000000..538eb2ad11
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-multi-ref.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left center right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right left center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center right left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-single-mtable-dynamic.html b/layout/reftests/mathml/mtable-columnalign-single-mtable-dynamic.html
new file mode 100644
index 0000000000..13a81f0e29
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-single-mtable-dynamic.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+
+ // Table 1 setup
+ table1.setAttribute("columnalign", "left");
+ // Table 2 setup
+ table2.setAttribute("columnalign", "center");
+ // Table 3 setup
+ table3.setAttribute("columnalign", "right");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnalign="left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-single-mtable.html b/layout/reftests/mathml/mtable-columnalign-single-mtable.html
new file mode 100644
index 0000000000..15eedc61ff
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-single-mtable.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="left">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="center">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnalign="right">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-single-mtr-dynamic.html b/layout/reftests/mathml/mtable-columnalign-single-mtr-dynamic.html
new file mode 100644
index 0000000000..8343b021fa
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-single-mtr-dynamic.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+ var rows = undefined;
+
+ // Table 1 setup
+ rows = table1.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "left");
+
+ // Table 2 setup
+ rows = table2.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "center");
+
+ // Table 3 setup
+ rows = table3.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("columnalign", "right");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnalign="left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-single-mtr.html b/layout/reftests/mathml/mtable-columnalign-single-mtr.html
new file mode 100644
index 0000000000..badaeff5cf
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-single-mtr.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="left">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="left">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="left">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="center">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="center">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="center">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr columnalign="right">
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ <mtd>
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="right">
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd>
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr columnalign="right">
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnalign-single-ref.html b/layout/reftests/mathml/mtable-columnalign-single-ref.html
new file mode 100644
index 0000000000..69e7627f5b
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnalign-single-ref.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnalign</title>
+ </head>
+ <body>
+ <b>columnalign="left"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="left">
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="center">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="center">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnalign="right"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>123</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>12345</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd columnalign="right">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd columnalign="right">
+ <mtext>1234567</mtext>
+ </mtd>
+ <mtd>
+ <mtext>1234567</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnlines-multi-mtable-dynamic.html b/layout/reftests/mathml/mtable-columnlines-multi-mtable-dynamic.html
new file mode 100644
index 0000000000..4ced5186a7
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnlines-multi-mtable-dynamic.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnlines</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+
+ // Table 1 setup
+ table1.setAttribute("columnlines", "solid dashed");
+ // Table 2 setup
+ table2.setAttribute("columnlines", "dashed solid");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnlines="solid dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnlines="dashed solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnlines-multi-ref.html b/layout/reftests/mathml/mtable-columnlines-multi-ref.html
new file mode 100644
index 0000000000..f3ec936817
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnlines-multi-ref.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnlines</title>
+ </head>
+ <body>
+ <b>columnlines="solid dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnlines="solid dashed">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnlines="dashed solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnlines="dashed solid">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnlines-single-mtable-dynamic.html b/layout/reftests/mathml/mtable-columnlines-single-mtable-dynamic.html
new file mode 100644
index 0000000000..f2bbe5d672
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnlines-single-mtable-dynamic.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML columnlines</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+
+ // Table 1 setup
+ table1.setAttribute("columnlines", "solid");
+ // Table 2 setup
+ table2.setAttribute("columnlines", "dashed");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>columnlines="solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnlines="dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-columnlines-single-ref.html b/layout/reftests/mathml/mtable-columnlines-single-ref.html
new file mode 100644
index 0000000000..d6fc000c77
--- /dev/null
+++ b/layout/reftests/mathml/mtable-columnlines-single-ref.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML columnlines</title>
+ </head>
+ <body>
+ <b>columnlines="solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnlines="solid">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>columnlines="dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable columnlines="dashed">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-multi-mtable-dynamic.html b/layout/reftests/mathml/mtable-rowalign-multi-mtable-dynamic.html
new file mode 100644
index 0000000000..021b5ffedd
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-multi-mtable-dynamic.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML rowalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+
+ // Table 1 setup
+ table1.setAttribute("rowalign", "top center bottom");
+ // Table 2 setup
+ table2.setAttribute("rowalign", "bottom top center");
+ // Table 3 setup
+ table3.setAttribute("rowalign", "center bottom top");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>rowalign="top center bottom"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom top center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center bottom top"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-multi-mtable.html b/layout/reftests/mathml/mtable-rowalign-multi-mtable.html
new file mode 100644
index 0000000000..9dce35b329
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-multi-mtable.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowalign</title>
+ </head>
+ <body>
+ <b>rowalign="top center bottom"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable rowalign="top center bottom">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom top center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowalign="bottom top center">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center bottom top"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowalign="center bottom top">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-multi-ref.html b/layout/reftests/mathml/mtable-rowalign-multi-ref.html
new file mode 100644
index 0000000000..6e1fc1910a
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-multi-ref.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowalign</title>
+ </head>
+ <body>
+ <b>rowalign="top center bottom"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom top center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center bottom top"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-single-mtable-dynamic.html b/layout/reftests/mathml/mtable-rowalign-single-mtable-dynamic.html
new file mode 100644
index 0000000000..b28f39b6ac
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-single-mtable-dynamic.html
@@ -0,0 +1,146 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML rowalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+
+ // Table 1 setup
+ table1.setAttribute("rowalign", "top");
+ // Table 2 setup
+ table2.setAttribute("rowalign", "center");
+ // Table 3 setup
+ table3.setAttribute("rowalign", "bottom");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>rowalign="top"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-single-mtable.html b/layout/reftests/mathml/mtable-rowalign-single-mtable.html
new file mode 100644
index 0000000000..14b5ccd32a
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-single-mtable.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowalign</title>
+ </head>
+ <body>
+ <b>rowalign="top"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable rowalign="top">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowalign="center">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowalign="bottom">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-single-mtr-dynamic.html b/layout/reftests/mathml/mtable-rowalign-single-mtr-dynamic.html
new file mode 100644
index 0000000000..4de4c45e6f
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-single-mtr-dynamic.html
@@ -0,0 +1,155 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML rowalign</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+ var table3 = document.getElementById("table3");
+ var rows = undefined;
+
+ // Table 1 setup
+ rows = table1.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("rowalign", "top");
+
+ // Table 2 setup
+ rows = table2.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("rowalign", "center");
+
+ // Table 3 setup
+ rows = table3.getElementsByTagName("mtr");
+ for(var i = 0; i < rows.length; i++)
+ rows[i].setAttribute("rowalign", "bottom");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>rowalign="top"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table3">
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-single-mtr.html b/layout/reftests/mathml/mtable-rowalign-single-mtr.html
new file mode 100644
index 0000000000..2492ec8beb
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-single-mtr.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowalign</title>
+ </head>
+ <body>
+ <b>rowalign="top"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr rowalign="top">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="top">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="top">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr rowalign="center">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="center">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="center">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr rowalign="bottom">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="bottom">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr rowalign="bottom">
+ <mtd>
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowalign-single-ref.html b/layout/reftests/mathml/mtable-rowalign-single-ref.html
new file mode 100644
index 0000000000..b343cb7b8e
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowalign-single-ref.html
@@ -0,0 +1,128 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowalign</title>
+ </head>
+ <body>
+ <b>rowalign="top"</b> <br/>
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="top">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="center"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="center">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowalign="bottom"</b> <br />
+ <math>
+ <mstyle>
+ <mtable>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="5px" height="5px" mathbackground="red"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="10px" height="10px" mathbackground="green"></mspace>
+ </mtd>
+ <mtd rowalign="bottom">
+ <mspace width="10px" depth="15px" height="15px" mathbackground="blue"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowlines-multi-mtable-dynamic.html b/layout/reftests/mathml/mtable-rowlines-multi-mtable-dynamic.html
new file mode 100644
index 0000000000..1ec16efc41
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowlines-multi-mtable-dynamic.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML rowlines</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+
+ // Table 1 setup
+ table1.setAttribute("rowlines", "solid dashed");
+ // Table 2 setup
+ table2.setAttribute("rowlines", "dashed solid");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>rowlines="solid dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowlines="dashed solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowlines-multi-ref.html b/layout/reftests/mathml/mtable-rowlines-multi-ref.html
new file mode 100644
index 0000000000..ac5f1f1c2b
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowlines-multi-ref.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowlines</title>
+ </head>
+ <body>
+ <b>rowlines="solid dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowlines="solid dashed">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowlines="dashed solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowlines="dashed solid">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowlines-single-mtable-dynamic.html b/layout/reftests/mathml/mtable-rowlines-single-mtable-dynamic.html
new file mode 100644
index 0000000000..d8afe110bc
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowlines-single-mtable-dynamic.html
@@ -0,0 +1,105 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Test MathML rowlines</title>
+ <script type="text/javascript">
+ function doTest()
+ {
+ var table1 = document.getElementById("table1");
+ var table2 = document.getElementById("table2");
+
+ // Table 1 setup
+ table1.setAttribute("rowlines", "solid");
+ // Table 2 setup
+ table2.setAttribute("rowlines", "dashed");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <b>rowlines="solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table1">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowlines="dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable id="table2">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-rowlines-single-ref.html b/layout/reftests/mathml/mtable-rowlines-single-ref.html
new file mode 100644
index 0000000000..000eaa2a24
--- /dev/null
+++ b/layout/reftests/mathml/mtable-rowlines-single-ref.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Test MathML rowlines</title>
+ </head>
+ <body>
+ <b>rowlines="solid"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowlines="solid">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ <b>rowlines="dashed"</b> <br />
+ <math>
+ <mstyle>
+ <mtable rowlines="dashed">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </mstyle>
+ </math> <br />
+ </body>
+</html>
diff --git a/layout/reftests/mathml/mtable-width-ref.html b/layout/reftests/mathml/mtable-width-ref.html
new file mode 100644
index 0000000000..8550c37352
--- /dev/null
+++ b/layout/reftests/mathml/mtable-width-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable style="width:8em">
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable style="width:30px">
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable>
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+
+ </body>
+</html>
+
diff --git a/layout/reftests/mathml/mtable-width.html b/layout/reftests/mathml/mtable-width.html
new file mode 100644
index 0000000000..2a46568832
--- /dev/null
+++ b/layout/reftests/mathml/mtable-width.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Check that mtable supports the width attribute</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable width="8em">
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable width="30px">
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+<div>
+ <math>
+ <mtext>|</mtext>
+ <mtable width="auto">
+ <mtr>
+ <mtd></mtd>
+ </mtr>
+ </mtable>
+ <mtext>|</mtext>
+ </math>
+</div>
+
+ </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-accent-dynamic-ref.html b/layout/reftests/mathml/munderover-accent-dynamic-ref.html
new file mode 100644
index 0000000000..eaaedf27c0
--- /dev/null
+++ b/layout/reftests/mathml/munderover-accent-dynamic-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <title>munderover@accent</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <munderover accent="true"><mtext>X</mtext><mo>O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/munderover-accent-dynamic.html b/layout/reftests/mathml/munderover-accent-dynamic.html
new file mode 100644
index 0000000000..88b5b35ccf
--- /dev/null
+++ b/layout/reftests/mathml/munderover-accent-dynamic.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>munderover@accent</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('mathOperator').setAttribute('accent', 'true');
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <munderover id="mathOperator"><mtext>X</mtext><mo>O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/munderover-accentunder-dynamic-ref.html b/layout/reftests/mathml/munderover-accentunder-dynamic-ref.html
new file mode 100644
index 0000000000..669f6240f0
--- /dev/null
+++ b/layout/reftests/mathml/munderover-accentunder-dynamic-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+ <html>
+ <head>
+ <title>munderover@accentunder</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <munderover accentunder="true"><mtext>X</mtext><mo>O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/mathml/munderover-accentunder-dynamic.html b/layout/reftests/mathml/munderover-accentunder-dynamic.html
new file mode 100644
index 0000000000..769f184146
--- /dev/null
+++ b/layout/reftests/mathml/munderover-accentunder-dynamic.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>munderover@accentunder</title>
+ <meta charset="utf-8"/>
+ <script type="text/javascript">
+ function doTest() {
+ document.getElementById('mathOperator').setAttribute('accentunder', 'true');
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate",doTest);
+ </script>
+ </head>
+ <body>
+ <math>
+ <munderover id="mathOperator"><mtext>X</mtext><mo>O</mo><mo>O</mo></munderover>
+ </math>
+ </body>
+</html> \ No newline at end of file
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..290fcdb967
--- /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 align="center">
+ <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 align="center">
+ <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 align="center">
+ <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/negative-mspace-1-ref.html b/layout/reftests/mathml/negative-mspace-1-ref.html
new file mode 100644
index 0000000000..ccf1ed995b
--- /dev/null
+++ b/layout/reftests/mathml/negative-mspace-1-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>negative mspace</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mspace width="1em" height="1em" mathbackground="red"></mspace>
+ <mspace width="1em" height="1em" mathbackground="blue"></mspace>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mspace width="1em" height="1em" mathbackground="blue"></mspace>
+ <mspace width="1em" height="1em" mathbackground="red"></mspace>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/negative-mspace-1.html b/layout/reftests/mathml/negative-mspace-1.html
new file mode 100644
index 0000000000..b79b66f151
--- /dev/null
+++ b/layout/reftests/mathml/negative-mspace-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>negative mspace</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mspace width="2em" height="1em" mathbackground="red"></mspace>
+ <mspace width="-1em"/>
+ <mspace width="1em" height="1em" mathbackground="blue"></mspace>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math dir="rtl">
+ <mrow>
+ <mspace width="2em" height="1em" mathbackground="red"></mspace>
+ <mspace width="-1em"/>
+ <mspace width="1em" height="1em" mathbackground="blue"></mspace>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/non-spacing-accent-1-ref.xhtml b/layout/reftests/mathml/non-spacing-accent-1-ref.xhtml
new file mode 100644
index 0000000000..9c5a9145f8
--- /dev/null
+++ b/layout/reftests/mathml/non-spacing-accent-1-ref.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ html { background-color: white }
+ mi { color: white; }
+ mo { color: red; }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mi>a</mi>
+ <mo>&#x302;</mo>
+ </mover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/non-spacing-accent-1.xhtml b/layout/reftests/mathml/non-spacing-accent-1.xhtml
new file mode 100644
index 0000000000..b9133ddd16
--- /dev/null
+++ b/layout/reftests/mathml/non-spacing-accent-1.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Check that non-spacing marks in accents are visible</title>
+ <style type="text/css">
+ html { background-color: white }
+ mi { color: white; }
+ mo { color: black; }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mover>
+ <mi>a</mi>
+ <mo>&#x302;</mo>
+ </mover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/number-size-1-ref.xhtml b/layout/reftests/mathml/number-size-1-ref.xhtml
new file mode 100644
index 0000000000..e84a9ac75e
--- /dev/null
+++ b/layout/reftests/mathml/number-size-1-ref.xhtml
@@ -0,0 +1,7 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mn>2</mn>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/number-size-1.xhtml b/layout/reftests/mathml/number-size-1.xhtml
new file mode 100644
index 0000000000..40c7347adf
--- /dev/null
+++ b/layout/reftests/mathml/number-size-1.xhtml
@@ -0,0 +1,7 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mn mathsize="2">2</mn>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/op-dict-10-ref.html b/layout/reftests/mathml/op-dict-10-ref.html
new file mode 100644
index 0000000000..8026c82489
--- /dev/null
+++ b/layout/reftests/mathml/op-dict-10-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>op-dict mo accent</title>
+</head>
+<body>
+ <math>
+ <munderover><mtext>X</mtext><mo accent="true">&#x2192;</mo><mo>O</mo></munderover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/op-dict-10.html b/layout/reftests/mathml/op-dict-10.html
new file mode 100644
index 0000000000..7c0a524b6e
--- /dev/null
+++ b/layout/reftests/mathml/op-dict-10.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>op-dict mo accent</title>
+</head>
+<body>
+ <math>
+ <munderover><mtext>X</mtext><mo>&#x2192;</mo><mo>O</mo></munderover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/op-dict-11-ref.html b/layout/reftests/mathml/op-dict-11-ref.html
new file mode 100644
index 0000000000..8026c82489
--- /dev/null
+++ b/layout/reftests/mathml/op-dict-11-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>op-dict mo accent</title>
+</head>
+<body>
+ <math>
+ <munderover><mtext>X</mtext><mo accent="true">&#x2192;</mo><mo>O</mo></munderover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/op-dict-11.html b/layout/reftests/mathml/op-dict-11.html
new file mode 100644
index 0000000000..0c59e06bdd
--- /dev/null
+++ b/layout/reftests/mathml/op-dict-11.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>op-dict mo accent</title>
+</head>
+<body>
+ <math>
+ <munderover><mtext>X</mtext><mo accent="false">&#x2192;</mo><mo>O</mo></munderover>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/opentype-fraction-dynamic-linethickness-ref.html b/layout/reftests/mathml/opentype-fraction-dynamic-linethickness-ref.html
new file mode 100644
index 0000000000..36b99f5e51
--- /dev/null
+++ b/layout/reftests/mathml/opentype-fraction-dynamic-linethickness-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mfrac linethickness</title>
+ <style type="text/css">
+ math {
+ font-size: 10px;
+ }
+ @font-face {
+ font-family: fraction-1;
+ src: url(../fonts/math/fraction-1.otf);
+ }
+ </style>
+ </head>
+ <body>
+ <math style="font-family: fraction-1;">
+ <mfrac>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ </mfrac>
+ </math>
+ <math displaystyle="true" style="font-family: fraction-1;">
+ <mfrac>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/opentype-fraction-dynamic-linethickness.html b/layout/reftests/mathml/opentype-fraction-dynamic-linethickness.html
new file mode 100644
index 0000000000..aaf9089e45
--- /dev/null
+++ b/layout/reftests/mathml/opentype-fraction-dynamic-linethickness.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>mfrac linethickness</title>
+ <style type="text/css">
+ math {
+ font-size: 10px;
+ }
+ @font-face {
+ font-family: fraction-1;
+ src: url(../fonts/math/fraction-1.otf);
+ }
+ </style>
+ <script type="text/javascript">
+ function doTest() {
+ var mfracs = document.getElementsByTagName("mfrac");
+ mfracs[0].removeAttribute("linethickness");
+ mfracs[1].removeAttribute("linethickness");
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </head>
+ <body>
+ <math style="font-family: fraction-1;">
+ <mfrac linethickness="200%">
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ </mfrac>
+ </math>
+ <math displaystyle="true" style="font-family: fraction-1;">
+ <mfrac linethickness="200%">
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ <mspace height="1em" width="1em" mathbackground="red"/>
+ </mfrac>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/opentype-stretchy-ref.html b/layout/reftests/mathml/opentype-stretchy-ref.html
new file mode 100644
index 0000000000..9f0f9b43f1
--- /dev/null
+++ b/layout/reftests/mathml/opentype-stretchy-ref.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Open Type MATH - stretchy operator</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ @font-face {
+ font-family: stretchy;
+ src: url(../fonts/math/stretchy.otf);
+ }
+ math {
+ font-family: stretchy;
+ font-size: 10px;
+ }
+ </style>
+ </head>
+ <body>
+
+<!--
+hstretchy = [
+ 0x219C, # leftwards wave arrow
+ 0x219D, # rightwards wave arrow
+ 0x219E, # leftwards two headed arrow
+ 0x21A0, # rightwards two headed arrow
+ 0x21A2 # leftwards arrow with tail
+]
+vstretchy = [
+ 0x219F, # upwards two headed arrow
+ 0x21A1, # downwards two headed arrow
+ 0x21A5, # upwards arrow from bar
+ 0x21A7, # downwards arrow from bar
+ 0x21A8 # up down arrow with base
+]
+
+hstretchy[0] and vstretchy[0] have all the variants and the components. The others only have one of them.
+-->
+
+ <p>
+ <math>
+ <mstyle scriptsizemultiplier="1">
+ <mover><mo stretchy="true">&#x219D;</mo><mspace width="1em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x219E;</mo><mspace width="2em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x21A0;</mo><mspace width="3em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x21A2;</mo><mspace width="15em" height="1px" mathbackground="red"/></mover>
+ </mstyle>
+ </math>
+ </p>
+
+ <p>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="1em">&#x21A1;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="2em">&#x21A5;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="3em">&#x21A7;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="15em">&#x21A8;</mo></mrow></math>
+ </p>
+
+<!--
+DisplayOperatorMinHeight = 8em
+largeop = [0x2A1B, 0x2A1C] # integral with overbar/underbar
+largeop[0] has variants of size 7, 8, 9em
+largeop[1] has one variant of size 8em.
+-->
+ <p>
+ <math displaystyle="true">
+ <mrow><mo>&#x2A1C;</mo></mrow>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/opentype-stretchy.html b/layout/reftests/mathml/opentype-stretchy.html
new file mode 100644
index 0000000000..d86228ca01
--- /dev/null
+++ b/layout/reftests/mathml/opentype-stretchy.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Open Type MATH - stretchy operator</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ @font-face {
+ font-family: stretchy;
+ src: url(../fonts/math/stretchy.otf);
+ }
+ math {
+ font-family: stretchy;
+ font-size: 10px;
+ }
+ </style>
+ </head>
+ <body>
+
+<!--
+hstretchy = [
+ 0x219C, # leftwards wave arrow
+ 0x219D, # rightwards wave arrow
+ 0x219E, # leftwards two headed arrow
+ 0x21A0, # rightwards two headed arrow
+ 0x21A2 # leftwards arrow with tail
+]
+vstretchy = [
+ 0x219F, # upwards two headed arrow
+ 0x21A1, # downwards two headed arrow
+ 0x21A5, # upwards arrow from bar
+ 0x21A7, # downwards arrow from bar
+ 0x21A8 # up down arrow with base
+]
+
+hstretchy[0] and vstretchy[0] have all the variants and the components. The others only have one of them.
+-->
+
+ <p>
+ <math>
+ <mstyle scriptsizemultiplier="1">
+ <mover><mo stretchy="true">&#x219C;</mo><mspace width="1em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x219C;</mo><mspace width="2em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x219C;</mo><mspace width="3em" height="1px" mathbackground="red"/></mover>
+ <mover><mo stretchy="true">&#x219C;</mo><mspace width="15em" height="1px" mathbackground="red"/></mover>
+ </mstyle>
+ </math>
+ </p>
+
+ <p>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="1em">&#x219F;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="2em">&#x219F;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="3em">&#x219F;</mo></mrow></math>
+ <math><mrow><mo symmetric="false" stretchy="true" minsize="15em">&#x219F;</mo></mrow></math>
+ </p>
+
+<!--
+DisplayOperatorMinHeight = 8em
+largeop = [0x2A1B, 0x2A1C] # integral with overbar/underbar
+largeop[0] has variants of size 7, 8, 9em
+largeop[1] has one variant of size 8em.
+-->
+ <p>
+ <math displaystyle="true">
+ <mrow><mo>&#x2A1B;</mo></mrow>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/operator-1-ref.xhtml b/layout/reftests/mathml/operator-1-ref.xhtml
new file mode 100644
index 0000000000..2befdf2440
--- /dev/null
+++ b/layout/reftests/mathml/operator-1-ref.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mn>3</mn>
+ <mo>+</mo>
+ <mn>2</mn>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/operator-1.xhtml b/layout/reftests/mathml/operator-1.xhtml
new file mode 100644
index 0000000000..e07da9e982
--- /dev/null
+++ b/layout/reftests/mathml/operator-1.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mn>3</mn>
+ <mo lspace="-5pt" rspace="-4pt">+</mo>
+ <mn>2</mn>
+ </math>
+</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/positive-namedspace-ref.html b/layout/reftests/mathml/positive-namedspace-ref.html
new file mode 100644
index 0000000000..42e2fda7f0
--- /dev/null
+++ b/layout/reftests/mathml/positive-namedspace-ref.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+ <head></head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.0555555556em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.111111111em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.166666667em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.222222222em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.277777778em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.333333333em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="0.388888889em"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/positive-namedspace.html b/layout/reftests/mathml/positive-namedspace.html
new file mode 100644
index 0000000000..d4f2572803
--- /dev/null
+++ b/layout/reftests/mathml/positive-namedspace.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<html>
+ <head></head>
+ <body>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="veryverythinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="verythinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="thinmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="mediummathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="thickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="verythickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mrow>
+ <mi>x</mi> <mspace width="veryverythickmathspace"></mspace> <mi>y</mi>
+ </mrow>
+ </math>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/quotes-1-ref.xhtml b/layout/reftests/mathml/quotes-1-ref.xhtml
new file mode 100644
index 0000000000..ff3ac0e4ff
--- /dev/null
+++ b/layout/reftests/mathml/quotes-1-ref.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style type="text/css">
+body { font-family:sans-serif; }
+p { height:2em; }
+</style>
+</head>
+<body>
+<p>:L_R</p>
+<p>:L_"</p>
+<p>:"_R</p>
+<p>:L_"</p>
+<p>:"_R</p>
+<p>:"_"</p>
+<p>:"_"</p>
+<p>:"_"</p>
+</body>
+</html>
diff --git a/layout/reftests/mathml/quotes-1.xhtml b/layout/reftests/mathml/quotes-1.xhtml
new file mode 100644
index 0000000000..e833966f8a
--- /dev/null
+++ b/layout/reftests/mathml/quotes-1.xhtml
@@ -0,0 +1,39 @@
+<html xmlns="http://www.w3.org/1999/xhtml" class="reftest-wait">
+<head>
+<style type="text/css">
+body { font-family:sans-serif; }
+p { height:2em; }
+</style>
+</head>
+<body>
+<p>:<ms xmlns="http://www.w3.org/1998/Math/MathML" lquote="L" rquote="R">_</ms></p>
+<p>:<ms id="m1" xmlns="http://www.w3.org/1998/Math/MathML">_</ms></p>
+<p>:<ms id="m2" xmlns="http://www.w3.org/1998/Math/MathML">_</ms></p>
+<p>:<ms id="m3" xmlns="http://www.w3.org/1998/Math/MathML" lquote="_">_</ms></p>
+<p>:<ms id="m4" xmlns="http://www.w3.org/1998/Math/MathML" rquote="_">_</ms></p>
+<p>:<ms id="m5" xmlns="http://www.w3.org/1998/Math/MathML" lquote="_" rquote="_">_</ms></p>
+<p>:<ms id="m6" xmlns="http://www.w3.org/1998/Math/MathML" lquote="_">_</ms></p>
+<p>:<ms id="m7" xmlns="http://www.w3.org/1998/Math/MathML" rquote="_">_</ms></p>
+<script>
+function doTest() {
+ var m1 = document.getElementById("m1");
+ m1.setAttribute("lquote", "L");
+ var m2 = document.getElementById("m2");
+ m2.setAttribute("rquote", "R");
+ var m3 = document.getElementById("m3");
+ m3.setAttribute("lquote", "L");
+ var m4 = document.getElementById("m4");
+ m4.setAttribute("rquote", "R");
+ var m5 = document.getElementById("m5");
+ m5.removeAttribute("lquote");
+ m5.removeAttribute("rquote");
+ var m6 = document.getElementById("m6");
+ m6.removeAttribute("lquote");
+ var m7 = document.getElementById("m7");
+ m7.removeAttribute("rquote");
+ document.documentElement.removeAttribute('class');
+}
+window.addEventListener("MozReftestInvalidate", doTest, false);
+</script>
+</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..5b76d64391
--- /dev/null
+++ b/layout/reftests/mathml/reftest.list
@@ -0,0 +1,319 @@
+ == 162063-mathml.xhtml about:blank
+!= 345563-sub.xhtml 345563-sup.xhtml
+== 347348-1.xhtml 347348-1-ref.xhtml
+== 347496-1.xhtml 347496-1-ref.xhtml
+pref(mathml.scriptminsize_attribute.disabled,false) pref(mathml.scriptsizemultiplier_attribute.disabled,false) == 355548-1.xml 355548-1-ref.xml
+pref(mathml.scriptminsize_attribute.disabled,false) pref(mathml.scriptsizemultiplier_attribute.disabled,false) == 355548-2.xml 355548-2-ref.xml
+pref(mathml.scriptminsize_attribute.disabled,false) pref(mathml.scriptsizemultiplier_attribute.disabled,false) == 355548-3.xml 355548-3-ref.xml
+pref(mathml.scriptminsize_attribute.disabled,false) pref(mathml.scriptsizemultiplier_attribute.disabled,false) == 355548-4.xml 355548-4-ref.xml
+pref(mathml.scriptminsize_attribute.disabled,false) pref(mathml.scriptsizemultiplier_attribute.disabled,false) == 355548-5.xml 355548-5-ref.xml
+== 370692-1.xhtml 370692-1-ref.xhtml
+== 373533-1.xhtml about:blank
+== 373533-2.xhtml about:blank
+== 373533-3.xhtml about:blank
+== 393760-1.xml 393760-1-ref.xml
+fuzzy(0-2,0-529) == 393760-2.xml 393760-2-ref.xml
+== 414123.xhtml 414123-ref.xhtml
+== dir-1.html dir-1-ref.html
+== dir-2.html dir-2-ref.html
+random-if(gtkWidget) == dir-3.html dir-3-ref.html # bug 1309426
+== dir-5.html dir-5-ref.html
+fuzzy-if(cocoaWidget,0-135,0-56) == dir-6a.html dir-6a-ref.html
+== css-spacing-1.html css-spacing-1-ref.html
+pref(mathml.disabled,true) == disabled-scriptlevel-1.html disabled-scriptlevel-1-ref.html
+pref(mathml.disabled,true) == disabled-scriptlevel-1.xhtml disabled-scriptlevel-1-ref.xhtml
+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
+== dynamic-mi.xhtml dynamic-mi-ref.xhtml
+== mphantom-1.html mphantom-1-ref.html
+== mphantom-2.html mphantom-2-ref.html
+== mi-mathvariant-1.xhtml mi-mathvariant-1-ref.xhtml
+== mi-mathvariant-2.xhtml mi-mathvariant-2-ref.xhtml
+!= mi-mathvariant-3.html mi-mathvariant-3-ref.html
+!= non-spacing-accent-1.xhtml non-spacing-accent-1-ref.xhtml
+== overbar-width-1.xhtml overbar-width-1-ref.xhtml
+pref(mathml.ms_lquote_rquote_attributes.disabled,false) == quotes-1.xhtml quotes-1-ref.xhtml
+!= stretchy-underbar-1.xhtml stretchy-underbar-1-ref.xhtml
+!= stretchy-munderover-1a.html stretchy-munderover-1-ref.html
+== stretchy-munderover-1b.html stretchy-munderover-1-ref.html
+fuzzy-if(gtkWidget,0-255,0-1) == stretchy-munderover-1c.html stretchy-munderover-1-ref.html
+== stretchy-munderover-1d.html stretchy-munderover-1-ref.html
+== stretchy-munderover-1e.html stretchy-munderover-1-ref.html
+!= stretchy-munderover-2a.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2b.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2c.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2d.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2e.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2f.html stretchy-munderover-2-ref.html
+== stretchy-munderover-2g.html stretchy-munderover-2-ref.html
+!= stretchy-munderover-3a.html stretchy-munderover-3-ref.html
+== stretchy-munderover-3b.html stretchy-munderover-3-ref.html
+== stretchy-munderover-3c.html stretchy-munderover-3-ref.html
+!= stretchy-munderover-3d.html stretchy-munderover-3-ref.html
+== stretchy-msup-1a.html stretchy-msup-1-ref.html
+== stretchy-msup-1b.html stretchy-msup-1-ref.html
+== stretchy-msup-1c.html stretchy-msup-1-ref.html
+== stretchy-msup-1d.html stretchy-msup-1-ref.html
+== stretchy-mover-1a.html stretchy-mover-1-ref.html
+== stretchy-mover-1b.html stretchy-mover-1-ref.html
+fails == stretchy-mover-2a.html stretchy-mover-2-ref.html
+!= stretchy-mover-2b.html stretchy-mover-2-ref.html
+== stretchy-mover-3.html stretchy-mover-3-ref.html
+== 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
+== table-width-1.xhtml table-width-1-ref.xhtml
+== table-width-2.html table-width-2-ref.html
+== table-width-3.html table-width-3-ref.html
+== table-width-4.html table-width-4-ref.html
+== underbar-width-1.xhtml underbar-width-1-ref.xhtml
+== mathml-type-supported.xhtml mathml-type-supported-ref.xml
+== mtable-align-negative-rownumber.html mtable-align-negative-rownumber-ref.html
+== mtable-align-negative-rownumber-2.html mtable-align-negative-rownumber-2-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-1-1.html embellished-op-1-1-ref.html
+!= embellished-op-1-2.html embellished-op-1-2-ref.html
+!= embellished-op-1-3.html embellished-op-1-3-ref.html
+!= embellished-op-1-4.html embellished-op-1-4-ref.html
+!= embellished-op-1-5.html embellished-op-1-5-ref.html
+!= embellished-op-2-1.html embellished-op-2-1-ref.html
+!= embellished-op-2-2.html embellished-op-2-2-ref.html
+!= embellished-op-2-3.html embellished-op-2-3-ref.html
+!= embellished-op-2-4.html embellished-op-2-4-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-3-1.html embellished-op-3-1-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-3-2.html embellished-op-3-2-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-3-3.html embellished-op-3-3-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-3-4.html embellished-op-3-4-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) != embellished-op-3-5.html embellished-op-3-5-ref.html
+== embellished-op-4-1.html embellished-op-4-1-ref.html
+== embellished-op-4-2.html embellished-op-4-2-ref.html
+== embellished-op-4-3.html embellished-op-4-3-ref.html
+== embellished-op-5-1.html embellished-op-5-ref.html
+== embellished-op-5-2.html embellished-op-5-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) pref(mathml.stixgeneral_operator_stretching.disabled,false) == semantics-1.xhtml semantics-1-ref.xhtml # bug 1309429; bug 1648335
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == semantics-2.html semantics-2-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == semantics-3.html semantics-3-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == semantics-4.html semantics-4-ref.html
+== mstyle-1.xhtml mstyle-1-ref.xhtml
+== mstyle-2.xhtml mstyle-2-ref.xhtml
+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
+== mstyle-5.xhtml mstyle-5-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
+== mspace-1.html mspace-1-ref.html
+== mpadded-1.html mpadded-1-ref.html
+== mpadded-2.html mpadded-2-ref.html
+== mpadded-3.html mpadded-3-ref.html
+== mpadded-4.html mpadded-4-ref.html
+== mpadded-5.html mpadded-5-ref.html
+== mpadded-1-2.html mpadded-1-2-ref.html
+== mpadded-6.html mpadded-6-ref.html
+random-if(gtkWidget) fails-if(geckoview&&device) == mpadded-7.html mpadded-7-ref.html # bug 1309430
+random-if(gtkWidget) == mpadded-8.html mpadded-8-ref.html # bug 1309430
+random-if(gtkWidget) == mpadded-9.html mpadded-9-ref.html # bug 1309430
+pref(mathml.scriptsizemultiplier_attribute.disabled,false) == scriptlevel-1.html scriptlevel-1-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
+== mfrac-linethickness-1.xhtml mfrac-linethickness-1-ref.xhtml
+== mfrac-linethickness-2.xhtml mfrac-linethickness-2-ref.xhtml
+== mfrac-linethickness-3.xhtml mfrac-linethickness-3-ref.xhtml
+pref(mathml.mathspace_names.disabled,false) == mathml-negativespace.html mathml-negativespace-ref.html
+== negative-mspace-1.html negative-mspace-1-ref.html
+!= link-1.xhtml link-ref.xhtml
+== munderover-empty-scripts.html munderover-empty-scripts-ref.html
+pref(mathml.mathspace_names.disabled,false) == positive-namedspace.html positive-namedspace-ref.html
+== mtable-align-whitespace.html mtable-align-whitespace-ref.html
+== mtable-width.html mtable-width-ref.html
+== mtable-rowlines-single-mtable-dynamic.html mtable-rowlines-single-ref.html
+== mtable-rowlines-multi-mtable-dynamic.html mtable-rowlines-multi-ref.html
+== mtable-rowalign-single-mtr.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtr-dynamic.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtable.html mtable-rowalign-single-ref.html
+== mtable-rowalign-single-mtable-dynamic.html mtable-rowalign-single-ref.html
+== mtable-rowalign-multi-mtable.html mtable-rowalign-multi-ref.html
+== mtable-rowalign-multi-mtable-dynamic.html mtable-rowalign-multi-ref.html
+== mtable-columnlines-single-mtable-dynamic.html mtable-columnlines-single-ref.html
+== mtable-columnlines-multi-mtable-dynamic.html mtable-columnlines-multi-ref.html
+== mtable-columnalign-single-mtr.html mtable-columnalign-single-ref.html
+== mtable-columnalign-single-mtr-dynamic.html mtable-columnalign-single-ref.html
+== mtable-columnalign-single-mtable.html mtable-columnalign-single-ref.html
+== mtable-columnalign-single-mtable-dynamic.html mtable-columnalign-single-ref.html
+== mtable-columnalign-multi-mtr.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtr-dynamic.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtable.html mtable-columnalign-multi-ref.html
+== mtable-columnalign-multi-mtable-dynamic.html mtable-columnalign-multi-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == maction-selection.html maction-selection-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == maction-dynamic-embellished-op.html maction-dynamic-embellished-op-ref.html
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == maction-dynamic-1.html maction-dynamic-1-ref.html # bug 773482
+pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == maction-dynamic-2.html maction-dynamic-2-ref.html
+== mo-invisibleoperators.html mo-invisibleoperators-ref.html
+== mo-invisibleoperators-2.html mo-invisibleoperators-2-ref.html
+random-if(gtkWidget) == mo-glyph-size.html mo-glyph-size-ref.html # bug 1309426
+pref(mathml.error_message_layout_for_invalid_markup.disabled,false) pref(mathml.legacy_maction_and_semantics_implementations.disabled,false) == maction-dynamic-3.html maction-dynamic-3-ref.html # bug 773482
+== whitespace-trim-1.html whitespace-trim-1-ref.html
+== whitespace-trim-2.html whitespace-trim-2-ref.html
+== whitespace-trim-3.html whitespace-trim-3-ref.html
+== whitespace-trim-4.html whitespace-trim-4-ref.html
+== whitespace-trim-5.html whitespace-trim-5-ref.html
+random-if(winWidget&&!d2d) == opentype-stretchy.html opentype-stretchy-ref.html
+== opentype-fraction-dynamic-linethickness.html opentype-fraction-dynamic-linethickness-ref.html
+== operator-1.xhtml operator-1-ref.xhtml
+== scriptshift-1.xhtml scriptshift-1-ref.xhtml
+== number-size-1.xhtml number-size-1-ref.xhtml
+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
+!= menclose-1a.html menclose-1-ref.html
+!= menclose-1b.html menclose-1-ref.html
+!= menclose-1d.html menclose-1-ref.html
+!= menclose-1e.html menclose-1-ref.html
+!= menclose-1f.html menclose-1-ref.html
+!= menclose-1g.html menclose-1-ref.html
+!= menclose-1h.html menclose-1-ref.html
+!= menclose-1i.html menclose-1-ref.html
+!= menclose-1j.html menclose-1-ref.html
+!= menclose-1k.html menclose-1-ref.html
+!= menclose-1l.html menclose-1-ref.html
+!= menclose-1m.html menclose-1-ref.html
+!= menclose-1n.html menclose-1-ref.html
+!= menclose-1o.html menclose-1-ref.html
+!= menclose-1p.html menclose-1-ref.html
+!= menclose-1q.html menclose-1-ref.html
+random-if(gtkWidget) == menclose-2-actuarial.html menclose-2-actuarial-ref.html # bug 1309426
+random-if(gtkWidget) == menclose-2-bottom.html menclose-2-bottom-ref.html # bug 1309426
+random-if(gtkWidget) == menclose-2-box.html menclose-2-box-ref.html # bug 1309426
+== menclose-2-circle.html menclose-2-circle-ref.html
+== menclose-2-downdiagonalstrike.html menclose-2-downdiagonalstrike-ref.html
+== menclose-2-horizontalstrike.html menclose-2-horizontalstrike-ref.html
+== menclose-2-left.html menclose-2-left-ref.html
+fuzzy(0-80,0-5) == menclose-2-longdiv.html menclose-2-longdiv-ref.html
+random-if(gtkWidget) == menclose-2-right.html menclose-2-right-ref.html # bug 1309426
+random-if(gtkWidget) == menclose-2-roundedbox.html menclose-2-roundedbox-ref.html # bug 1309426
+== menclose-2-top.html menclose-2-top-ref.html
+random-if(gtkWidget) == menclose-2-updiagonalarrow.html menclose-2-updiagonalarrow-ref.html # bug 1309426
+== menclose-2-updiagonalstrike.html menclose-2-updiagonalstrike-ref.html
+== menclose-2-verticalstrike.html menclose-2-verticalstrike-ref.html
+random-if(gtkWidget) == menclose-2-roundedbox.html menclose-2-roundedbox-ref.html # bug 1309426
+== menclose-2-phasorangle.html menclose-2-phasorangle-ref.html
+== menclose-3-box.html menclose-3-box-ref.html
+== menclose-3-madruwb.html menclose-3-madruwb-ref.html
+== menclose-3-default.html menclose-3-default-ref.html
+== menclose-3-invalid.html menclose-3-invalid-ref.html
+== menclose-3-multiple.html menclose-3-multiple-ref.html
+== menclose-3-unknown.html menclose-3-unknown.html
+== menclose-4.html data:text/html,<body>Pass
+== menclose-5-actuarial.html menclose-5-actuarial-ref.html
+== menclose-5-bottom.html menclose-5-bottom-ref.html
+== menclose-5-box.html menclose-5-box-ref.html
+fuzzy(0-1,0-2) == menclose-5-circle.html menclose-5-circle-ref.html
+fuzzy-if(d2d,0-7,0-1) == menclose-5-downdiagonalstrike.html menclose-5-downdiagonalstrike-ref.html
+== menclose-5-horizontalstrike.html menclose-5-horizontalstrike-ref.html
+== menclose-5-left.html menclose-5-left-ref.html
+== menclose-5-longdiv.html menclose-5-longdiv-ref.html
+== menclose-5-madruwb.html menclose-5-madruwb-ref.html
+== menclose-5-right.html menclose-5-right-ref.html
+fuzzy(0-5,0-5) == menclose-5-roundedbox.html menclose-5-roundedbox-ref.html
+== menclose-5-top.html menclose-5-top-ref.html
+fuzzy(0-1,0-1) == menclose-5-updiagonalarrow.html menclose-5-updiagonalarrow-ref.html
+fuzzy-if(d2d,0-7,0-1) == menclose-5-updiagonalstrike.html menclose-5-updiagonalstrike-ref.html
+== menclose-5-verticalstrike.html menclose-5-verticalstrike-ref.html
+== menclose-5-phasorangle.html menclose-5-phasorangle-ref.html
+== menclose-6-actuarial.html menclose-6-ref.html
+== menclose-6-bottom.html menclose-6-ref.html
+== menclose-6-box.html menclose-6-ref.html
+fuzzy(0-1,0-2) == menclose-6-circle.html menclose-6-ref.html
+fuzzy-if(d2d,0-7,0-1) == menclose-6-downdiagonalstrike.html menclose-6-ref.html
+== menclose-6-horizontalstrike.html menclose-6-ref.html
+== menclose-6-left.html menclose-6-ref.html
+== menclose-6-longdiv.html menclose-6-ref.html
+== menclose-6-madruwb.html menclose-6-ref.html
+== menclose-6-right.html menclose-6-ref.html
+fuzzy(0-2,0-3) == menclose-6-roundedbox.html menclose-6-ref.html
+== menclose-6-top.html menclose-6-ref.html
+== menclose-6-updiagonalarrow.html menclose-6-ref.html
+fuzzy-if(d2d,0-7,0-1) == menclose-6-updiagonalstrike.html menclose-6-ref.html
+== menclose-6-verticalstrike.html menclose-6-ref.html
+== menclose-6-phasorangle.html menclose-6-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)
+fails-if(Android&&emulator) == mathvariant-1a.html mathvariant-1a-ref.html # Bug 1010679, Bug 1392106
+fails-if(Android&&emulator) == mathvariant-1b.html mathvariant-1b-ref.html # Bug 1010679, Bug 1392106
+fails-if(Android&&emulator) == mathvariant-1c.html mathvariant-1c-ref.html # Bug 1010679, Bug 1392106
+== mathvariant-1d.html mathvariant-1d-ref.html
+fails-if(Android&&emulator) == mathvariant-2.html mathvariant-2-ref.html # Bug 1010679
+== mathvariant-4.html mathvariant-4-ref.html
+== mathvariant-5.html mathvariant-5-ref.html
+== dtls-1.html dtls-1-ref.html
+pref(mathml.error_message_layout_for_invalid_markup.disabled,false) == dtls-2.html dtls-2-ref.html
+pref(mathml.error_message_layout_for_invalid_markup.disabled,false) == dtls-3.html dtls-3-ref.html
+== ssty-1.html ssty-1-ref.html
+== ssty-2.html ssty-2-ref.html
+pref(mathml.scriptsizemultiplier_attribute.disabled,false) == ssty-3.html ssty-3-ref.html
+pref(mathml.scriptsizemultiplier_attribute.disabled,false) == ssty-4.html ssty-4-ref.html
+== mathscript-1.html mathscript-1-ref.html
+== mathscript-2.html mathscript-2-ref.html
+== mo-accent-dynamic.html mo-accent-dynamic-ref.html
+== mo-movablelimits-dynamic.html mo-movablelimits-dynamic-ref.html
+== munderover-accent-dynamic.html munderover-accent-dynamic-ref.html
+== munderover-accentunder-dynamic.html munderover-accentunder-dynamic-ref.html
+== columnlines-1a.html columnlines-1-ref.html
+!= columnlines-1b.html columnlines-1-ref.html
+!= columnlines-1c.html columnlines-1-ref.html
+== columnlines-2a.html columnlines-2-ref.html
+== columnlines-2b.html columnlines-2-ref.html
+!= columnlines-3-1.html columnlines-3-1-ref.html
+== columnlines-3-2.html columnlines-3-2-ref.html
+== rowlines-1a.html rowlines-1-ref.html
+!= rowlines-1b.html rowlines-1-ref.html
+!= rowlines-1c.html rowlines-1-ref.html
+== rowlines-2a.html rowlines-2-ref.html
+== rowlines-2b.html rowlines-2-ref.html
+!= rowlines-3-1.html rowlines-3-1-ref.html
+random-if(gtkWidget) == rowlines-3-2.html rowlines-3-2-ref.html # bug 1309426
+== tablespacing-1.html tablespacing-1-ref.html
+== tablespacing-2.html tablespacing-2-ref.html
+== tablespacing-3.html tablespacing-3-ref.html
+== tablespacing-4.html tablespacing-4-ref.html
+== tablespacing-5.html tablespacing-5-ref.html
+== tablespacing-5a.html tablespacing-5a-ref.html
+== tablespacing-6.html tablespacing-6-ref.html
+== tablespacing-7.html tablespacing-7-ref.html
+!= tablespacing-8a.html tablespacing-8-ref.html
+!= tablespacing-8b.html tablespacing-8-ref.html
+== op-dict-10.html op-dict-10-ref.html
+!= op-dict-11.html op-dict-11-ref.html
+== mfrac-A-4.html mfrac-A-4-ref.html
+== mfrac-A-5.html mfrac-A-5-ref.html
+== mfrac-A-8.html mfrac-A-8-ref.html
+== mfrac-B-2.html mfrac-B-2-3-ref.html
+== mfrac-B-3.html mfrac-B-2-3-ref.html
+== mfrac-C-2.html mfrac-C-2-ref.html
+== mfrac-D-2.html mfrac-D-2-ref.html
+== mfrac-E-1.html mfrac-E-1-ref.html
+== shadow-dom-1.html shadow-dom-1-ref.html
+pref(ui.useOverlayScrollbars,1) pref(dom.meta-viewport.enabled,true) pref(font.size.inflation.emPerLine,25) fuzzy-if(!gtkWidget,0-255,0-324) fuzzy-if(gtkWidget,0-255,0-66) == font-inflation-1.html font-inflation-1-ref.html # gtkWidget due to Bug 1607294
+test-pref(font.minimum-size.x-math,40) == default-font.html default-font-ref.html
+!= 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/rowlines-1-ref.html b/layout/reftests/mathml/rowlines-1-ref.html
new file mode 100644
index 0000000000..e5ea01a7de
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1-ref.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable>
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-1a.html b/layout/reftests/mathml/rowlines-1a.html
new file mode 100644
index 0000000000..51073e3d51
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1a.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="none">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-1b.html b/layout/reftests/mathml/rowlines-1b.html
new file mode 100644
index 0000000000..860edda594
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1b.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="solid">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-1c.html b/layout/reftests/mathml/rowlines-1c.html
new file mode 100644
index 0000000000..dd51f155f7
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-1c.html
@@ -0,0 +1,77 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="dashed">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ <mtd>
+ <mn>6</mn>
+ </mtd>
+ <mtd>
+ <mn>7</mn>
+ </mtd>
+ <mtd>
+ <mn>8</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>9</mn>
+ </mtd>
+ <mtd>
+ <mn>10</mn>
+ </mtd>
+ <mtd>
+ <mn>11</mn>
+ </mtd>
+ <mtd>
+ <mn>12</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>13</mn>
+ </mtd>
+ <mtd>
+ <mn>14</mn>
+ </mtd>
+ <mtd>
+ <mn>15</mn>
+ </mtd>
+ <mtd>
+ <mn>16</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-2-ref.html b/layout/reftests/mathml/rowlines-2-ref.html
new file mode 100644
index 0000000000..f66962bad6
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2-ref.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="none dashed solid solid solid">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-2a.html b/layout/reftests/mathml/rowlines-2a.html
new file mode 100644
index 0000000000..2dfa6cb04a
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2a.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="none dashed solid">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-2b.html b/layout/reftests/mathml/rowlines-2b.html
new file mode 100644
index 0000000000..3489239d14
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-2b.html
@@ -0,0 +1,51 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <math>
+ <mtable rowlines="none dashed solid solid solid none dashed dashed none">
+ <mtr>
+ <mtd>
+ <mn>1</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>2</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>3</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>4</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>5</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>*</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-3-1-ref.html b/layout/reftests/mathml/rowlines-3-1-ref.html
new file mode 100644
index 0000000000..9f292f7ce6
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-1-ref.html
@@ -0,0 +1,34 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable width="150px" rowlines="dashed">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 5px; left: 110px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-3-1.html b/layout/reftests/mathml/rowlines-3-1.html
new file mode 100644
index 0000000000..e40b2b7faf
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-1.html
@@ -0,0 +1,53 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <!-- We assume there is a gap of more than 1px between dashes. Hence
+ putting two dashed lines with only one pixel of difference in their
+ horizontal coordinates should not render the same as one dashed line
+ alone. The opposite is true for continuous line.
+ The red squares allow to ignore the difference at the bounds -->
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable width="150px" rowlines="dashed">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 6px;">
+ <math>
+ <mtable width="150px" rowlines="dashed">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 5px; left: 110px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-3-2-ref.html b/layout/reftests/mathml/rowlines-3-2-ref.html
new file mode 100644
index 0000000000..01fe8ad0d4
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-2-ref.html
@@ -0,0 +1,34 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable width="150px" rowlines="solid">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 5px; left: 112px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/rowlines-3-2.html b/layout/reftests/mathml/rowlines-3-2.html
new file mode 100644
index 0000000000..685970faf9
--- /dev/null
+++ b/layout/reftests/mathml/rowlines-3-2.html
@@ -0,0 +1,53 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>mtable frame</title>
+ <!-- Copyright (c) 2011 Design Science, Inc.
+ License: Apache License 2.0 -->
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+
+ <body>
+
+ <!-- We assume there is a gap of more than 1px between dashes. Hence
+ putting two dashed lines with only one pixel of difference in their
+ horizontal coordinates should not render the same as one dashed line
+ alone. The opposite is true for continuous line.
+ The red squares allow to ignore the difference at the bounds -->
+
+ <div style="position: absolute; top: 5px; left: 5px;">
+ <math>
+ <mtable width="150px" rowlines="solid">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 6px;">
+ <math>
+ <mtable width="150px" rowlines="solid">
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ <mtr>
+ <mtd><mspace></mspace></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </div>
+
+ <div style="position: absolute; top: 5px; left: 0px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ <div style="position: absolute; top: 5px; left: 112px;
+ width: 50px; height: 50px; background: red;"></div>
+
+ </body>
+</html>
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-1-ref.html b/layout/reftests/mathml/scriptlevel-1-ref.html
new file mode 100644
index 0000000000..193d29e1c9
--- /dev/null
+++ b/layout/reftests/mathml/scriptlevel-1-ref.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <math>
+ <mstyle>
+ <mtext>O</mtext>
+ <mstyle mathsize="200%"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <math>
+ <mstyle>
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext mathsize="200%">O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <math>
+ <mstyle>
+ <mroot>
+ <mtext>O</mtext>
+ <mtext mathsize="400%">O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </math>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <math>
+ <mstyle>
+ <msub>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ <mprescripts/>
+ <mtext mathsize="200%">O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <math>
+ <mstyle>
+ <munder>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ <mtext mathsize="200%">O</mtext>
+ </munderover>
+ </mstyle>
+ </math>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/scriptlevel-1.html b/layout/reftests/mathml/scriptlevel-1.html
new file mode 100644
index 0000000000..9cd388f1c7
--- /dev/null
+++ b/layout/reftests/mathml/scriptlevel-1.html
@@ -0,0 +1,129 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>scriptlevel</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+
+ <!-- Test scriptlevel on mstyle -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mtext>O</mtext>
+ <mstyle scriptlevel="1"><mtext>O</mtext></mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mfrac element sets displaystyle to "false", or if it was already
+ false increments scriptlevel by 1, within numerator and denominator.
+ -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mstyle displaystyle="false">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ <mstyle displaystyle="true">
+ <mfrac>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mfrac>
+ </mstyle>
+ </mstyle>
+ </math>
+
+ <!-- The mroot element increments scriptlevel by 2, and sets
+ displaystyle to "false", within index, but leaves both attributes
+ unchanged within base.
+ The msqrt element leaves both attributes unchanged within its
+ argument. -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <mroot>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mroot>
+ <msqrt>
+ <mtext>O</mtext>
+ </msqrt>
+ </mstyle>
+ </math>
+
+<!--
+ The msub element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within subscript, but leaves both attributes unchanged within base.
+
+ The msup element [...] increments scriptlevel by 1, and sets displaystyle to
+ "false", within superscript, but leaves both attributes unchanged within
+ base.
+
+ The msubsup element [...] increments scriptlevel by 1, and sets displaystyle
+ to "false", within subscript and superscript, but leaves both attributes
+ unchanged within base.
+
+ The mmultiscripts element increments scriptlevel by 1, and sets displaystyle
+ to "false", within each of its arguments except base, but leaves both
+ attributes unchanged within base.
+ -->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <msub>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msub>
+ <msup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msup>
+ <msubsup>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </msubsup>
+ <mmultiscripts>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mprescripts/>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+<!--
+ The munder element [...] always sets displaystyle to "false" within the
+ underscript, but increments scriptlevel by 1 only when accentunder is
+ "false". Within base, it always leaves both attributes unchanged.
+
+ The mover element [...] always sets displaystyle to "false" within
+ overscript, but increments scriptlevel by 1 only when accent is "false".
+ Within base, it always leaves both attributes unchanged.
+
+ The munderover [..] always sets displaystyle to "false" within underscript
+ and overscript, but increments scriptlevel by 1 only when accentunder or
+ accent, respectively, are "false". Within base, it always leaves both
+ attributes unchanged.
+-->
+ <math>
+ <mstyle scriptsizemultiplier="2">
+ <munder>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munder>
+ <mover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </mover>
+ <munderover>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ <mtext>O</mtext>
+ </munderover>
+ </mstyle>
+ </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/scriptshift-1-ref.xhtml b/layout/reftests/mathml/scriptshift-1-ref.xhtml
new file mode 100644
index 0000000000..04eb6ca55a
--- /dev/null
+++ b/layout/reftests/mathml/scriptshift-1-ref.xhtml
@@ -0,0 +1,30 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msub>
+ <mi>x</mi>
+ <mn>2</mn>
+ </msub>
+ <mo>+</mo>
+ <msup>
+ <mi>x</mi>
+ <mn>2</mn>
+ </msup>
+ <mo>+</mo>
+ <msubsup>
+ <mi>x</mi>
+ <mn>2</mn>
+ <mn>3</mn>
+ </msubsup>
+ <mo>+</mo>
+ <mmultiscripts>
+ <mi> x </mi>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mprescripts/>
+ <mn>4</mn>
+ <mn>5</mn>
+ </mmultiscripts>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/scriptshift-1.xhtml b/layout/reftests/mathml/scriptshift-1.xhtml
new file mode 100644
index 0000000000..67b7d201a3
--- /dev/null
+++ b/layout/reftests/mathml/scriptshift-1.xhtml
@@ -0,0 +1,30 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <msub subscriptshift="-5px">
+ <mi>x</mi>
+ <mn>2</mn>
+ </msub>
+ <mo>+</mo>
+ <msup superscriptshift="-5px">
+ <mi>x</mi>
+ <mn>2</mn>
+ </msup>
+ <mo>+</mo>
+ <msubsup subscriptshift="-5px" superscriptshift="-5px">
+ <mi>x</mi>
+ <mn>2</mn>
+ <mn>3</mn>
+ </msubsup>
+ <mo>+</mo>
+ <mmultiscripts subscriptshift="-5px" superscriptshift="-5px">
+ <mi> x </mi>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mprescripts/>
+ <mn>4</mn>
+ <mn>5</mn>
+ </mmultiscripts>
+ </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..c06b6047fc
--- /dev/null
+++ b/layout/reftests/mathml/semantics-1-ref.xhtml
@@ -0,0 +1,95 @@
+<?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>
+
+<!-- embellished operator (bug 21479) -->
+<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>
+
+<!-- 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>
+
+<!-- maction and semantics (bug 523037) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ <mn>5</mn>
+ </maction>
+</math>XpXpXp</p>
+
+<!-- maction and semantics (bug 523045) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <maction actiontype="toggle" selection="4">
+ <mn>1</mn>
+ <mn>2</mn>
+ <mn>3</mn>
+ <mn>4</mn>
+ <mn>5</mn>
+ </maction>
+</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..40d5b157f8
--- /dev/null
+++ b/layout/reftests/mathml/semantics-1.xhtml
@@ -0,0 +1,107 @@
+<?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>
+
+<!-- embellished operator (bug 21479) -->
+<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>
+
+<!-- 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>
+
+<!-- maction and semantics (bug 523037) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <maction actiontype="toggle" selection="3">
+ <mn>1</mn>
+ <mn>2</mn>
+ <semantics>
+ <mn>3</mn>
+ <annotation encoding="text">three</annotation>
+ </semantics>
+ <semantics>
+ <mn>4</mn>
+ <annotation encoding="text">four</annotation>
+ </semantics>
+ <mn>5</mn>
+ </maction>
+</math>XpXpXp</p>
+
+<!-- maction and semantics (bug 523045) -->
+<p>XpXpXp<math xmlns="http://www.w3.org/1998/Math/MathML">
+ <maction actiontype="toggle" selection="4">
+ <mn>1</mn>
+ <mn>2</mn>
+ <semantics>
+ <mn>3</mn>
+ <annotation encoding="text">three</annotation>
+ </semantics>
+ <semantics>
+ <mn>4</mn>
+ <annotation encoding="text">four</annotation>
+ </semantics>
+ <mn>5</mn>
+ </maction>
+</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..7cb7a35907
--- /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 (invalid): <math><maction></maction></math></p>
+ <p>annotation (invalid): <math><mrow><mtext>annotation</mtext></mrow></math></p>
+ <p>annotation-xml (invalid): <math><mrow><mrow><mtext>annotation-xml</mtext></mrow></mrow></math></p>
+ <p>presentation MathML (no annotations): <math><mrow><mtext>presentation MathML</mtext></mrow></math></p>
+ <p>content MathML (no annotations): <math><maction actiontype="toggle"><csymbol>content MathML</csymbol></maction></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><mtext>annotation</mtext></mrow></math></p>
+ <p>content MathML ; annotation-xml: <math><mrow><mrow><mtext>annotation-xml</mtext></mrow></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..1f18cd2f9e
--- /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 (invalid): <math><semantics></semantics></math></p>
+ <p>annotation (invalid): <math><semantics><annotation>annotation</annotation></semantics></math></p>
+ <p>annotation-xml (invalid): <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..99b752f344
--- /dev/null
+++ b/layout/reftests/mathml/semantics-3-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Various tests for mrow</title>
+ <meta charset="utf-8"/>
+</head>
+
+<body>
+ <p>annotation 1: <math><mrow><mtext>annotation</mtext></mrow></math></p>
+ <p>annotation 2: <math><mrow><mtext>\sin x + 5</mtext></mrow></math></p>
+ <p>annotation 3: <math><mrow><mtext>annotation</mtext></mrow></math></p>
+
+ <p>annotation-xml 1: <math><mrow><mrow><mtext>application/mathml-presentation+xml</mtext></mrow></mrow></math></p>
+ <p>annotation-xml 2: <math><mrow><mrow><mtext>MathML-Presentation</mtext></mrow></mrow></math></p>
+ <p>annotation-xml 3: <math><mrow><mtext><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">image/svg+xml</text></svg></mtext></mrow></math></p>
+ <p>annotation-xml 4: <math><mrow><mtext><svg xmlns="http://www.w3.org/2000/svg" height="2em"><text y="1em">SVG1.1</text></svg></mtext></mrow></math></p>
+ <p>annotation-xml 5: <math><mrow><mtext><html xmlns="http://www.w3.org/1999/xhtml"><head><title>application/xhtml+xml</title></head><body><p>application/xhtml+xml</p></body></html></mtext></mrow></math></p>
+ <p>annotation-xml 6: <math><mrow><mtext><html><head><title>text/html</title></head><body><p>text/html</p></body></html></mtext></mrow></math></p>
+ <p>annotation-xml 7: <math><mrow><mrow><mtext>annotation-xml</mtext></mrow></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-4-ref.html b/layout/reftests/mathml/semantics-4-ref.html
new file mode 100644
index 0000000000..b618df4658
--- /dev/null
+++ b/layout/reftests/mathml/semantics-4-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+ <mtable width="100%" mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+</math>
+
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+ <mtable mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+</math>
+
+<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML">
+ <mtable width="100%" mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+</math>
+
+<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML">
+ <mtable mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+</math>
diff --git a/layout/reftests/mathml/semantics-4.html b/layout/reftests/mathml/semantics-4.html
new file mode 100644
index 0000000000..ff9dd0c05b
--- /dev/null
+++ b/layout/reftests/mathml/semantics-4.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+ <semantics>
+ <mtable width="100%" mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+ <annotation encoding="application/x-tex">y</annotation>
+ </semantics>
+</math>
+
+<math display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+ <semantics>
+ <mtable mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+ <annotation encoding="application/x-tex">y</annotation>
+ </semantics>
+</math>
+
+<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML">
+ <semantics>
+ <mtable width="100%" mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+ <annotation encoding="application/x-tex">y</annotation>
+ </semantics>
+</math>
+
+<math display="inline" xmlns="http://www.w3.org/1998/Math/MathML">
+ <semantics>
+ <mtable mathbackground="red">
+ <mtr> <mtd><mi>x</mi></mtd> </mtr>
+ </mtable>
+ <annotation encoding="application/x-tex">y</annotation>
+ </semantics>
+</math>
diff --git a/layout/reftests/mathml/shadow-dom-1-ref.html b/layout/reftests/mathml/shadow-dom-1-ref.html
new file mode 100644
index 0000000000..6940cfc77a
--- /dev/null
+++ b/layout/reftests/mathml/shadow-dom-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>Test for bug 1066554 - Shadow DOM loads MathML stylesheets as needed</title>
+<body>
+ <math>
+ <msup>
+ <mi>X</mi>
+ <mi>X</mi>
+ </msup>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/shadow-dom-1.html b/layout/reftests/mathml/shadow-dom-1.html
new file mode 100644
index 0000000000..623f1afb8f
--- /dev/null
+++ b/layout/reftests/mathml/shadow-dom-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<title>Test for bug 1066554 - Shadow DOM loads MathML stylesheets as needed</title>
+<body>
+ <div id="x"></div>
+ <script>
+ function insertShadowMathML() {
+ var x = document.getElementById("x");
+ x.attachShadow({ mode: "open" });
+ x.shadowRoot.innerHTML =
+ '<math><msup><mi>X</mi><mi>X</mi></msup></math>';
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", insertShadowMathML);
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/mathml/ssty-1-ref.html b/layout/reftests/mathml/ssty-1-ref.html
new file mode 100644
index 0000000000..d01b0e5b08
--- /dev/null
+++ b/layout/reftests/mathml/ssty-1-ref.html
@@ -0,0 +1,337 @@
+<!DOCTYPE html>
+<head>
+
+ <!-- This font only has glyphs defined for 'A', 'B', 'C' and 'D', and is
+ designed purely for testing ssty functionality
+ The glyphs for 'A' and 'D' are identical, the difference between them is
+ that 'A' supports the ssty font feature.
+ 'A' with ssty = 1 maps to 'B'
+ 'A' with ssty = 2 maps to 'C'-->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+
+ <!-- Test whether the ssty font feature setting is used appropriately for
+ supscripts et al.
+ Assumes kMathMLDefaultScriptSizeMultiplier is 0.71-->
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <msup>
+ <mo>D</mo>
+ <msup>
+ <mo>B</mo>
+ <msup>
+ <mo>C</mo>
+ <mo>C</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>D</mo>
+ <msub>
+ <mo>B</mo>
+ <msub>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>D</mo>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>D</mo>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- Automatically set ssty ignores user set scriptlevel -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptlevel="-3">
+ <msup>
+ <mo>D</mo>
+ <msup>
+ <mo>B</mo>
+ <msup>
+ <mo>C</mo>
+ <mo>C</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>D</mo>
+ <msub>
+ <mo>B</mo>
+ <msub>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>D</mo>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>D</mo>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- Automatically set ssty ignores user set scriptlevel -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptlevel="1">
+ <msup>
+ <mo>D</mo>
+ <msup>
+ <mo>B</mo>
+ <msup>
+ <mo>C</mo>
+ <mo>C</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>D</mo>
+ <msub>
+ <mo>B</mo>
+ <msub>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>D</mo>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>B</mo>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>D</mo>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>B</mo>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- User set ssty font feature setting overrides automatically set ssty, but
+ only for affected elements -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <msup>
+ <mo>D</mo>
+ <msup>
+ <mo>D</mo>
+ <mo>C</mo>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>D</mo>
+ <msub>
+ <mo>D</mo>
+ <mo>C</mo>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>D</mo>
+ <msubsup>
+ <mo>D</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ <msubsup>
+ <mo>D</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>D</mo>
+ <mmultiscripts>
+ <mo>D</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>D</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
diff --git a/layout/reftests/mathml/ssty-1.html b/layout/reftests/mathml/ssty-1.html
new file mode 100644
index 0000000000..64e1066303
--- /dev/null
+++ b/layout/reftests/mathml/ssty-1.html
@@ -0,0 +1,324 @@
+<!DOCTYPE html>
+<head>
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <mo>A</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- Automatically set ssty ignores scriptlevel -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptlevel="-3">
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <mo>A</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- Automatically set ssty ignores scriptlevel -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptlevel="1">
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo>A</mo>
+ <mo>A</mo> <!-- ssty value capped at 2 -->
+ </msup>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msub>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <!-- User set ssty font feature setting overrides automatically set ssty -->
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <msup>
+ <mo>A</mo>
+ <msup>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ </msup>
+ </msup>
+
+ <msub>
+ <mo>A</mo>
+ <msub>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ </msub>
+ </msub>
+
+ <msubsup>
+ <mo>A</mo>
+ <msubsup>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ <msubsup>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </msubsup>
+ </msubsup>
+
+ <mmultiscripts>
+ <mo>A</mo>
+ <mmultiscripts>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ <mmultiscripts>
+ <mo style="font-feature-settings: 'ssty' 0">A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mmultiscripts>
+ </mmultiscripts>
+ </mstyle>
+ </math>
diff --git a/layout/reftests/mathml/ssty-2-ref.html b/layout/reftests/mathml/ssty-2-ref.html
new file mode 100644
index 0000000000..7e08acd6c8
--- /dev/null
+++ b/layout/reftests/mathml/ssty-2-ref.html
@@ -0,0 +1,275 @@
+<!DOCTYPE html>
+<head>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+ <!-- Test whether the ssty font feature setting is used appropriately for
+ mroot, mfrac, munderover et al.
+ Assumes kMathMLDefaultScriptSizeMultiplier is 0.71-->
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mroot>
+ <mo>D</mo>
+ <mo>C</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>B</mo>
+ <mo>C</mo>
+ </mroot>
+ <mo>B</mo>
+ </mfrac>
+
+ <mover>
+ <mo>D</mo>
+ <mover>
+ <mo>B</mo>
+ <mo>C</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>D</mo>
+ <munder>
+ <mo>B</mo>
+ <mo>C</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>D</mo>
+ <munderover>
+ <mo>B</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ <munderover>
+ <mo>B</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+ <!-- ssty font feature not set on mfrac et al when displaystyle is
+ set (still allowed on mroot, mover et al.)-->
+ <math>
+ <mstyle style="font-family: 'sstyfont';" displaystyle="true">
+ <mroot>
+ <mo>D</mo>
+ <mo>C</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <!-- ssty gets set as script level incremented because displaystyle
+ is now false -->
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>D</mo>
+ <mo>C</mo>
+ </mroot>
+ <mo>D</mo>
+ </mfrac>
+
+ <mover>
+ <mo>D</mo>
+ <mover>
+ <mo>B</mo>
+ <mo>C</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>D</mo>
+ <munder>
+ <mo>B</mo>
+ <mo>C</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>D</mo>
+ <munderover>
+ <mo>B</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ <munderover>
+ <mo>B</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ </munderover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <!-- scriptlevel is not incremented when accent for overframes and
+ accentunder for underframes are true, so there shouldn't be a
+ change in the ssty value -->
+ <mstyle style="font-family: 'sstyfont';">
+ <mover accent="true">
+ <mo>D</mo>
+ <mover accent="true">
+ <mo>D</mo>
+ <mo>D</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="true">
+ <mo>D</mo>
+ <munder accentunder="true">
+ <mo>D</mo>
+ <mo>D</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="true" accent="true">
+ <mo>D</mo>
+ <munderover accentunder="true" accent="true">
+ <mo>D</mo>
+ <mo>D</mo>
+ <mo>D</mo>
+ </munderover>
+ <munderover accentunder="true" accent="true">
+ <mo>D</mo>
+ <mo>D</mo>
+ <mo>D</mo>
+ </munderover>
+ </munderover>
+
+ <mover accent="true">
+ <mo>D</mo>
+ <mover accent="false">
+ <mo>D</mo>
+ <mo>B</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="true">
+ <mo>D</mo>
+ <munder accentunder="false">
+ <mo>D</mo>
+ <mo>B</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="true" accent="true">
+ <mo>D</mo>
+ <munderover accentunder="false" accent="false">
+ <mo>D</mo>
+ <mo>B</mo>
+ <mo>B</mo>
+ </munderover>
+ <munderover accentunder="false" accent="false">
+ <mo>D</mo>
+ <mo>B</mo>
+ <mo>B</mo>
+ </munderover>
+ </munderover>
+
+ <mover accentunder="false" accent="false">
+ <mo>D</mo>
+ <mover accentunder="true" accent="true">
+ <mo>B</mo>
+ <mo>B</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="false" accent="false">
+ <mo>D</mo>
+ <munder accentunder="true" accent="true">
+ <mo>B</mo>
+ <mo>B</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="false" accent="false">
+ <mo>D</mo>
+ <munderover accentunder="true" accent="true">
+ <mo>B</mo>
+ <mo>B</mo>
+ <mo>B</mo>
+ </munderover>
+ <munderover accentunder="true" accent="true">
+ <mo>B</mo>
+ <mo>B</mo>
+ <mo>B</mo>
+ </munderover>
+ </munderover>
+
+ <munderover accentunder="false" accent="true">
+ <mo>D</mo>
+ <munderover accentunder="false" accent="true">
+ <mo>B</mo>
+ <mo>C</mo>
+ <mo>B</mo>
+ </munderover>
+ <munderover accentunder="false" accent="true">
+ <mo>D</mo>
+ <mo>B</mo>
+ <mo>D</mo>
+ </munderover>
+ </munderover>
+
+ <munderover accentunder="true" accent="false">
+ <mo>D</mo>
+ <munderover accentunder="true" accent="false">
+ <mo>D</mo>
+ <mo>D</mo>
+ <mo>B</mo>
+ </munderover>
+ <munderover accentunder="true" accent="false">
+ <mo>B</mo>
+ <mo>B</mo>
+ <mo>C</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+</body> \ No newline at end of file
diff --git a/layout/reftests/mathml/ssty-2.html b/layout/reftests/mathml/ssty-2.html
new file mode 100644
index 0000000000..2ffd24865c
--- /dev/null
+++ b/layout/reftests/mathml/ssty-2.html
@@ -0,0 +1,267 @@
+<!DOCTYPE html>
+<head>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" displaystyle="true">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+
+ <mover accent="true">
+ <mo>A</mo>
+ <mover accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="true">
+ <mo>A</mo>
+ <munder accentunder="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ <mover accentunder="true" accent="true">
+ <mo>A</mo>
+ <mover accentunder="false" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="true" accent="true">
+ <mo>A</mo>
+ <munder accentunder="false" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <munderover accentunder="false" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover accentunder="false" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ <mover accent="false">
+ <mo>A</mo>
+ <mover accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder accentunder="false">
+ <mo>A</mo>
+ <munder accentunder="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover accentunder="false" accent="false">
+ <mo>A</mo>
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover accentunder="true" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ <munderover accentunder="false" accent="true">
+ <mo>A</mo>
+ <munderover accentunder="false" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover accentunder="false" accent="true">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ <munderover accentunder="true" accent="false">
+ <mo>A</mo>
+ <munderover accentunder="true" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover accentunder="true" accent="false">
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+</body>
diff --git a/layout/reftests/mathml/ssty-3-ref.html b/layout/reftests/mathml/ssty-3-ref.html
new file mode 100644
index 0000000000..26d2011889
--- /dev/null
+++ b/layout/reftests/mathml/ssty-3-ref.html
@@ -0,0 +1,219 @@
+<!DOCTYPE html>
+<head>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+
+ <!-- Test changes of scriptsizemultiplier on setting of ssty font feature -->
+
+ <math>
+ <!-- No changes with scriptsizemultipliers that make things bigger -->
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="1.2">
+ <mroot>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mroot>
+ <mo>D</mo>
+ </mfrac>
+
+ <mover>
+ <mo>D</mo>
+ <mover>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>D</mo>
+ <munder>
+ <mo>D</mo>
+ <mo>D</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>D</mo>
+ <munderover>
+ <mo>D</mo>
+ <mo>D</mo>
+ <mo>D</mo>
+ </munderover>
+ <munderover>
+ <mo>D</mo>
+ <mo>D</mo>
+ <mo>D</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <!-- A slower increase in ssty setting.
+ scriptlevel=1 corresponds to ssty=0
+ scriptlevel=2 corresponds to ssty=1
+ scriptlevel=3 corresponds to ssty=2 -->
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="0.8">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <!-- A faster increase in ssty setting.
+ scriptlevel=1 corresponds to ssty=2
+ scriptlevel=2 corresponds to ssty=2
+ scriptlevel=3 corresponds to ssty=2 -->
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="0.5">
+ <mroot>
+ <mo>D</mo>
+ <mo>C</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mroot>
+ <mo>C</mo>
+ </mfrac>
+
+ <mover>
+ <mo>D</mo>
+ <mover>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>D</mo>
+ <munder>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>D</mo>
+ <munderover>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ <munderover>
+ <mo>C</mo>
+ <mo>C</mo>
+ <mo>C</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/ssty-3.html b/layout/reftests/mathml/ssty-3.html
new file mode 100644
index 0000000000..62f436a8f1
--- /dev/null
+++ b/layout/reftests/mathml/ssty-3.html
@@ -0,0 +1,207 @@
+<!DOCTYPE html>
+<head>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+</head>
+<body>
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="1.2">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="0.8">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="0.5">
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+
+ <mfrac>
+ <mroot>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mroot>
+ <mo>A</mo>
+ </mfrac>
+
+ <mover>
+ <mo>A</mo>
+ <mover>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mover>
+ </mover>
+
+ <munder>
+ <mo>A</mo>
+ <munder>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munder>
+ </munder>
+
+ <munderover>
+ <mo>A</mo>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ <munderover>
+ <mo>A</mo>
+ <mo>A</mo>
+ <mo>A</mo>
+ </munderover>
+ </munderover>
+
+ </mstyle>
+ </math>
+</body>
diff --git a/layout/reftests/mathml/ssty-4-ref.html b/layout/reftests/mathml/ssty-4-ref.html
new file mode 100644
index 0000000000..082acbfc49
--- /dev/null
+++ b/layout/reftests/mathml/ssty-4-ref.html
@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic ssty tests</title>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>B</mo>
+ <!-- deliberately invalid -->
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mo>D</mo>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="1.2">
+ <mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" scriptsizemultiplier="0.8">
+ <mfrac>
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ <mfrac>
+ <mo>B</mo>
+ <mo>B</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>B</mo>
+ <mrow>
+ <mrow>
+ <mrow>
+ <mo>B</mo>
+ </mrow>
+ </mrow>
+ </mrow>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style ="font-family: 'sstyfont';">
+ <mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ <mfrac>
+ <mo>C</mo>
+ <mo>C</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'sstyfont'; font-feature-settings: 'ssty' 0">
+ <mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ <mfrac>
+ <mo>D</mo>
+ <mo>D</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/ssty-4.html b/layout/reftests/mathml/ssty-4.html
new file mode 100644
index 0000000000..b04c86b20f
--- /dev/null
+++ b/layout/reftests/mathml/ssty-4.html
@@ -0,0 +1,186 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic ssty tests</title>
+ <!-- See ssty-1-ref.html for an explanation of this font -->
+ <style type="text/css" media="screen, print">
+ @font-face {
+ font-family: "sstyfont";
+ src: url("ssty.woff");
+ }
+ </style>
+ </head>
+ <body>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac id="mfrac0">
+ <mo>A</mo>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>A</mo>
+ <mo id="mo0"></mo>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>A</mo>
+ <mo id="mo1">A</mo>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';" id="mstyle0">
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle1">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle2" style="font-family: 'sstyfont';">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle3" style="font-family: 'sstyfont';">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle style="font-family: 'sstyfont';">
+ <mfrac>
+ <mo>A</mo>
+ <mrow>
+ <mrow>
+ <mrow id="mrow0">
+ </mrow>
+ </mrow>
+ </mrow>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle4" style ="font-family: 'sstyfont'; font-feature-settings: 'ssty' 0">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <p>
+
+ <math>
+ <mstyle id="mstyle5" style ="font-family: 'sstyfont';">
+ <mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ <mfrac>
+ <mo>A</mo>
+ <mo>A</mo>
+ </mfrac>
+ </mfrac>
+ </mstyle>
+ </math>
+
+ <script>
+ function doTest()
+ {
+ var mo = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo.innerHTML = "A";
+ // An added child gets ssty font feature
+ document.getElementById("mfrac0").appendChild(mo);
+ // A child with changed text gets ssty font feature
+ document.getElementById("mo0").innerHTML = "A";
+ // A relocated child loses ssty font feature setting
+ document.getElementById("mstyle0").appendChild(document.getElementById("mo1"));
+ // A change in style
+ document.getElementById("mstyle1").setAttribute("style", "font-family: 'sstyfont';");
+ // Changes in script size multiplier affect ssty setting
+ document.getElementById("mstyle2").setAttribute("scriptsizemultiplier", "1.2");
+ document.getElementById("mstyle3").setAttribute("scriptsizemultiplier", "0.8");
+
+ // ssty gets added to descendants as well
+ var mo1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mo");
+ mo1.innerHTML = "A";
+ document.getElementById("mrow0").appendChild(mo1);
+ // removing explicit ssty setting works
+ document.getElementById("mstyle4").setAttribute(
+ "style", "font-family: 'sstyfont';")
+ // setting an explicit ssty font feature
+ document.getElementById("mstyle5").setAttribute(
+ "style" , "font-family: 'sstyfont'; font-feature-settings: 'ssty' 0")
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/ssty.woff b/layout/reftests/mathml/ssty.woff
new file mode 100644
index 0000000000..19312c713d
--- /dev/null
+++ b/layout/reftests/mathml/ssty.woff
Binary files differ
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/stretchy-mover-1-ref.html b/layout/reftests/mathml/stretchy-mover-1-ref.html
new file mode 100644
index 0000000000..8adf158119
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mn>BBBBBBBBB</mn>
+ </mover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-1a.html b/layout/reftests/mathml/stretchy-mover-1a.html
new file mode 100644
index 0000000000..7458bff151
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-1a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mrow>
+ <mspace width="15em"/>
+ <mrow>
+ <mover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mn>BBBBBBBBB</mn>
+ </mover>
+ </mrow>
+ <mspace width="15em"/>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-1b.html b/layout/reftests/mathml/stretchy-mover-1b.html
new file mode 100644
index 0000000000..eaa9087ed9
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-1b.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mrow>
+ <mspace depth="50em"/>
+ <mrow>
+ <mover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mn>BBBBBBBBB</mn>
+ </mover>
+ </mrow>
+ <mspace depth="50em"/>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-2-ref.html b/layout/reftests/mathml/stretchy-mover-2-ref.html
new file mode 100644
index 0000000000..5dafe6eada
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-2-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mrow>
+ <mrow>
+ <mover>
+ <mo stretchy="false">&#x2191;</mo>
+ <mn>B</mn>
+ </mover>
+ </mrow>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-2a.html b/layout/reftests/mathml/stretchy-mover-2a.html
new file mode 100644
index 0000000000..bc40bdd0c8
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-2a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mrow>
+ <mspace width="10em"/>
+ <mrow>
+ <mover>
+ <mo stretchy="true">&#x2191;</mo>
+ <mn>B</mn>
+ </mover>
+ </mrow>
+ <mspace width="10em"/>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-2b.html b/layout/reftests/mathml/stretchy-mover-2b.html
new file mode 100644
index 0000000000..726b767883
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-2b.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math display=block>
+ <mrow>
+ <mspace depth="5em"/>
+ <mrow>
+ <mover>
+ <mo stretchy="true">&#x2191;</mo>
+ <mn>B</mn>
+ </mover>
+ </mrow>
+ <mspace depth="5em"/>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-3-ref.html b/layout/reftests/mathml/stretchy-mover-3-ref.html
new file mode 100644
index 0000000000..2ed96936e1
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-3-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mover>
+ <mo stretchy="false">&Vert;</mo>
+ <mn>BBBBBBBBB</mn>
+ </mover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-mover-3.html b/layout/reftests/mathml/stretchy-mover-3.html
new file mode 100644
index 0000000000..ec1ba19846
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-mover-3.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy mover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mover>
+ <mo stretchy="true">&Vert;</mo>
+ <mn>BBBBBBBBB</mn>
+ </mover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-msup-1-ref.html b/layout/reftests/mathml/stretchy-msup-1-ref.html
new file mode 100644
index 0000000000..6d791628dd
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-msup-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Non-stretchy msup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <msup>
+ <mo stretchy="false">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ </msup>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-msup-1a.html b/layout/reftests/mathml/stretchy-msup-1a.html
new file mode 100644
index 0000000000..ef07155e7c
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-msup-1a.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Non-stretchy msup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <msup>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ </msup>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-msup-1b.html b/layout/reftests/mathml/stretchy-msup-1b.html
new file mode 100644
index 0000000000..afdad4f915
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-msup-1b.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Non-stretchy msup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <mrow>
+ <msup>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ </msup>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-msup-1c.html b/layout/reftests/mathml/stretchy-msup-1c.html
new file mode 100644
index 0000000000..64807ca647
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-msup-1c.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Non-stretchy msup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <mrow>
+ <mrow>
+ <msup>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ </msup>
+ </mrow>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-msup-1d.html b/layout/reftests/mathml/stretchy-msup-1d.html
new file mode 100644
index 0000000000..2f3011d8bd
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-msup-1d.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Non-stretchy msup</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <mrow>
+ <msup>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ </msup>
+ <mspace width="5em" />
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1-ref.html b/layout/reftests/mathml/stretchy-munderover-1-ref.html
new file mode 100644
index 0000000000..9eac657d5d
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <mrow>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1a.html b/layout/reftests/mathml/stretchy-munderover-1a.html
new file mode 100644
index 0000000000..3676e429fd
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1a.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mo stretchy="false">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1b.html b/layout/reftests/mathml/stretchy-munderover-1b.html
new file mode 100644
index 0000000000..05381e5f36
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1b.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <mrow>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1c.html b/layout/reftests/mathml/stretchy-munderover-1c.html
new file mode 100644
index 0000000000..8db901cb4f
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1c.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1d.html b/layout/reftests/mathml/stretchy-munderover-1d.html
new file mode 100644
index 0000000000..7dc3e91275
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1d.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mspace width="5em" />
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-1e.html b/layout/reftests/mathml/stretchy-munderover-1e.html
new file mode 100644
index 0000000000..2660cea796
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-1e.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mo stretchy="true" lspace="0em" rspace="0em">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mn></mn>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2-ref.html b/layout/reftests/mathml/stretchy-munderover-2-ref.html
new file mode 100644
index 0000000000..690e7adfed
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math >
+ <mrow>
+ <msup>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2a.html b/layout/reftests/mathml/stretchy-munderover-2a.html
new file mode 100644
index 0000000000..a0620efd78
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <msup>
+ <munderover>
+ <mo stretchy="false">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2b.html b/layout/reftests/mathml/stretchy-munderover-2b.html
new file mode 100644
index 0000000000..eadf419dbb
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2b.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <mrow>
+ <msup>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </mrow>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2c.html b/layout/reftests/mathml/stretchy-munderover-2c.html
new file mode 100644
index 0000000000..9c169ba227
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2c.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <msup>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2d.html b/layout/reftests/mathml/stretchy-munderover-2d.html
new file mode 100644
index 0000000000..867bd803fe
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2d.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <msup>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2e.html b/layout/reftests/mathml/stretchy-munderover-2e.html
new file mode 100644
index 0000000000..607a737957
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2e.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <msup>
+ <mrow>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2f.html b/layout/reftests/mathml/stretchy-munderover-2f.html
new file mode 100644
index 0000000000..05ac1b4cba
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2f.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <msup>
+ <mrow>
+ <mrow>
+ <munderover>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </mrow>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-2g.html b/layout/reftests/mathml/stretchy-munderover-2g.html
new file mode 100644
index 0000000000..fd7dda6efc
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-2g.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <msup>
+ <munderover>
+ <mo stretchy="true" lspace="0em" rspace="0em">&#x2192;</mo>
+ <mtext>AAAAAA</mtext>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mtext>CCCCCC</mtext>
+ </msup>
+ <mn></mn>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-3-ref.html b/layout/reftests/mathml/stretchy-munderover-3-ref.html
new file mode 100644
index 0000000000..acc97ad3d1
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-3-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mtext>AAAAAA</mtext>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-3a.html b/layout/reftests/mathml/stretchy-munderover-3a.html
new file mode 100644
index 0000000000..29b18c66b3
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-3a.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mtext>AAAAAA</mtext>
+ <mo stretchy="false">&#x2192;</mo>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-3b.html b/layout/reftests/mathml/stretchy-munderover-3b.html
new file mode 100644
index 0000000000..01ae3aa9d7
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-3b.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <munderover>
+ <mtext>AAAAAA</mtext>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-3c.html b/layout/reftests/mathml/stretchy-munderover-3c.html
new file mode 100644
index 0000000000..9c1f3c3dd9
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-3c.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <mrow>
+ <munderover>
+ <mtext>AAAAAA</mtext>
+ <mo stretchy="true">&#x2192;</mo>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ <mspace width="5em" />
+ </mrow>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-munderover-3d.html b/layout/reftests/mathml/stretchy-munderover-3d.html
new file mode 100644
index 0000000000..3fc2e3df8d
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-munderover-3d.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Stretchy munderover</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+ <!-- See bug 687807 -->
+ <math>
+ <munderover>
+ <mtext>AAAAAA</mtext>
+ <mo stretchy="false">&#x2192;</mo>
+ <mtext>BBBBBB</mtext>
+ </munderover>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-underbar-1-ref.xhtml b/layout/reftests/mathml/stretchy-underbar-1-ref.xhtml
new file mode 100644
index 0000000000..0c9e365741
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-underbar-1-ref.xhtml
@@ -0,0 +1,17 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ html { background-color: white; font-size: 50px }
+ mi { color: white; }
+ mo { color: red; }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mi>long</mi>
+ <mo>&#x332;</mo>
+ </munder>
+ </math>
+</body>
+</html>
diff --git a/layout/reftests/mathml/stretchy-underbar-1.xhtml b/layout/reftests/mathml/stretchy-underbar-1.xhtml
new file mode 100644
index 0000000000..274f9a7547
--- /dev/null
+++ b/layout/reftests/mathml/stretchy-underbar-1.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Check that UnderBar is visible when stretched</title>
+ <style type="text/css">
+ html { background-color: white; font-size: 50px }
+ mi { color: white; }
+ mo { color: black; }
+ </style>
+ </head>
+<body>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <munder>
+ <mi>long</mi>
+ <mo>&#x332;</mo>
+ </munder>
+ </math>
+</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/table-width-1-ref.xhtml b/layout/reftests/mathml/table-width-1-ref.xhtml
new file mode 100644
index 0000000000..49b9965176
--- /dev/null
+++ b/layout/reftests/mathml/table-width-1-ref.xhtml
@@ -0,0 +1,79 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 1px;
+ padding-left: 1px;
+ background-color: black;
+ color: red; }
+ </style>
+ </head>
+<body>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <mn>60</mn>
+ <mo>&#x2062;</mo>
+ <msqrt>
+ <mn>2</mn>
+ <mo>+</mo>
+ <mn>3</mn>
+ <mo>-</mo>
+ <mo>5</mo>
+ </msqrt>
+ </mphantom>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <mroot>
+ <mfrac>
+ <mn>8</mn>
+ <mn>90</mn>
+ </mfrac>
+ <mn>61</mn>
+ </mroot>
+ </mphantom>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <mfenced>
+ <mtable>
+ <mtr><mtd><mn>0</mn></mtd></mtr>
+ <mtr><mtd><mn>80</mn></mtd></mtr>
+ </mtable>
+ </mfenced>
+ </mphantom>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mphantom>
+ <mo>|</mo>
+ <mo>{</mo>
+ <mtable>
+ <mtr><mtd><mn>0</mn></mtd></mtr>
+ <mtr><mtd><mn>5</mn></mtd></mtr>
+ <mtr><mtd><mn>9</mn></mtd></mtr>
+ </mtable>
+ <mo>}</mo>
+ <mo>|</mo>
+ </mphantom>
+ </math>
+ </td>
+ </table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/table-width-1.xhtml b/layout/reftests/mathml/table-width-1.xhtml
new file mode 100644
index 0000000000..0837c49fcb
--- /dev/null
+++ b/layout/reftests/mathml/table-width-1.xhtml
@@ -0,0 +1,76 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Check that the content box is large enough</title>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 1px;
+ padding-left: 1px;
+ background-color: black;
+ color: black; }
+ </style>
+ </head>
+<body>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mn>60</mn>
+ <mo>&#x2062;</mo>
+ <msqrt>
+ <mn>2</mn>
+ <mo>+</mo>
+ <mn>3</mn>
+ <mo>-</mo>
+ <mo>5</mo>
+ </msqrt>
+ </mrow>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mroot>
+ <mfrac>
+ <mn>8</mn>
+ <mn>90</mn>
+ </mfrac>
+ <mn>61</mn>
+ </mroot>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mfenced>
+ <mtable>
+ <mtr><mtd><mn>0</mn></mtd></mtr>
+ <mtr><mtd><mn>80</mn></mtd></mtr>
+ </mtable>
+ </mfenced>
+ </math>
+ </td>
+ </table>
+ <table>
+ <td>
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
+ <mrow>
+ <mo>|</mo>
+ <mo>{</mo>
+ <mtable>
+ <mtr><mtd><mn>0</mn></mtd></mtr>
+ <mtr><mtd><mn>5</mn></mtd></mtr>
+ <mtr><mtd><mn>9</mn></mtd></mtr>
+ </mtable>
+ <mo>}</mo>
+ <mo>|</mo>
+ </mrow>
+ </math>
+ </td>
+ </table>
+</body>
+</html>
diff --git a/layout/reftests/mathml/table-width-2-ref.html b/layout/reftests/mathml/table-width-2-ref.html
new file mode 100644
index 0000000000..265d06d96c
--- /dev/null
+++ b/layout/reftests/mathml/table-width-2-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-2</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+
+ <!-- See bug 459363 -->
+
+ <p>
+ <math>
+ <mtable>
+ <mtr>
+ <mtd><mtext>|</mtext></mtd>
+ <mtd><mrow style="width: 5em;"></mrow></mtd>
+ <mtd><mtext>|</mtext></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mtable>
+ <mtr>
+ <mtd><mtext>|</mtext></mtd>
+ <mtd><mrow style="width: 5em;"></mrow></mtd>
+ <mtd><mtext>|</mtext></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/table-width-2.html b/layout/reftests/mathml/table-width-2.html
new file mode 100644
index 0000000000..a3a41f4477
--- /dev/null
+++ b/layout/reftests/mathml/table-width-2.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-2</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+ </head>
+ <body>
+
+ <!-- See bug 459363 -->
+
+ <p>
+ <math>
+ <mtable>
+ <mtr>
+ <mtd><mtext>|</mtext></mtd>
+ <mtd><mspace width="5em"></mspace></mtd>
+ <mtd><mtext>|</mtext></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ <p>
+ <math>
+ <mtable>
+ <mtr>
+ <mtd><mtext>|</mtext></mtd>
+ <mtd><mpadded width="5em"></mpadded></mtd>
+ <mtd><mtext>|</mtext></mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/table-width-3-ref.html b/layout/reftests/mathml/table-width-3-ref.html
new file mode 100644
index 0000000000..6ae31d7990
--- /dev/null
+++ b/layout/reftests/mathml/table-width-3-ref.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-3</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 1px;
+ padding-left: 1px;
+ background-color: black;
+ color: red; }
+ mi, mtext { font-size: 3em; }
+ span { font-style: italic; display: inline-block; }
+ </style>
+ </head>
+ <body>
+
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mi>f</mi>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mi>f</mi>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mi>f</mi>
+ <mi>f</mi>
+ <mi>f</mi>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mi style="font-style: italic;">fff</mi>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mtext><span>fff</span></mtext>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mtext><span>f</span></mtext>
+ <mtext><span>f</span></mtext>
+ <mtext><span>f</span></mtext>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mphantom>
+ <mtext><span>f</span><span>f</span><span>f</span></mtext>
+ </mphantom>
+ </math>
+ </td>
+ </tr>
+ </table>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/table-width-3.html b/layout/reftests/mathml/table-width-3.html
new file mode 100644
index 0000000000..abf9d9ebfe
--- /dev/null
+++ b/layout/reftests/mathml/table-width-3.html
@@ -0,0 +1,90 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-3</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 1px;
+ padding-left: 1px;
+ background-color: black;
+ color: black; }
+ mi, mtext { font-size: 3em; }
+ span { font-style: italic; display: inline-block; }
+ </style>
+ </head>
+ <body>
+
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mi>f</mi>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mi> f </mi>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mi>f</mi>
+ <mi>f</mi>
+ <mi>f</mi>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mi style="font-style: italic;">fff</mi>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mtext><span>fff</span></mtext>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mtext><span>f</span></mtext>
+ <mtext><span>f</span></mtext>
+ <mtext><span>f</span></mtext>
+ </math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math>
+ <mtext><span>f</span><span>f</span><span>f</span></mtext>
+ </math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/table-width-4-ref.html b/layout/reftests/mathml/table-width-4-ref.html
new file mode 100644
index 0000000000..b0bfbebfc8
--- /dev/null
+++ b/layout/reftests/mathml/table-width-4-ref.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-4</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 2px;
+ padding-left: 1px;
+ background-color: black;
+ color: black; }
+ </style>
+ </head>
+ <body>
+
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mi>ℓ</mi><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mtext>ℓ</mtext><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mtext style="font-style: italic">ℓ</mtext><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mtext mathvariant="script">l</mtext><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mi mathvariant="script">l</mi><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mphantom><mi mathvariant="script">l</mi><mi>i</mi></mphantom></math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/table-width-4.html b/layout/reftests/mathml/table-width-4.html
new file mode 100644
index 0000000000..71eb32bdc5
--- /dev/null
+++ b/layout/reftests/mathml/table-width-4.html
@@ -0,0 +1,64 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>table-width-4</title>
+ <meta charset="utf-8"/>
+ <style type="text/css">
+ html { background-color: grey; }
+ td { border: 1px solid white;
+ padding-top: 0;
+ padding-bottom: 0;
+ padding-right: 2px;
+ padding-left: 1px;
+ background-color: black;
+ color: black; }
+ </style>
+ </head>
+ <body>
+
+ <table>
+ <tr>
+ <td>
+ <math><mi>ℓ</mi><mi>i</mi></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mtext>ℓ</mtext><mi>i</mi></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mtext style="font-style: italic">ℓ</mtext><mi>i</mi></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mtext mathvariant="script">l</mtext><mi>i</mi></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mi mathvariant="script">l</mi><mi>i</mi></math>
+ </td>
+ </tr>
+ </table>
+ <table>
+ <tr>
+ <td>
+ <math><mi mathvariant="script">l</mi>
+ <mi mathvariant="italic">i</mi></math>
+ </td>
+ </tr>
+ </table>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-1-ref.html b/layout/reftests/mathml/tablespacing-1-ref.html
new file mode 100644
index 0000000000..3ad0881e22
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-1-ref.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Table spacing default values</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable rowspacing="1.0ex" columnspacing="0.8em" framespacing="0em 0ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math >
+ <mtable frame="solid" rowspacing="1.0ex" columnspacing="0.8em" framespacing="0.4em 0.5ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-1.html b/layout/reftests/mathml/tablespacing-1.html
new file mode 100644
index 0000000000..864fd23021
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-1.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Table spacing default values</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable rowspacing="">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mtable frame="solid" rowspacing="">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-2-ref.html b/layout/reftests/mathml/tablespacing-2-ref.html
new file mode 100644
index 0000000000..0bf2e4822a
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-2-ref.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Additional values ignored and insufficient ones expanded</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable rowspacing="1.0ex 3.0ex 7.0ex" columnspacing="0.8em 2em 3em" framespacing="0em 0ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mtable rowspacing="1.0ex 3.0ex 3.0ex" columnspacing="0.8em 2em 2em">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-2.html b/layout/reftests/mathml/tablespacing-2.html
new file mode 100644
index 0000000000..e150ab7bac
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-2.html
@@ -0,0 +1,134 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Additional values ignored and insufficient ones expanded</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable rowspacing="1.0ex 3.0ex 7.0ex 10ex 12ex" columnspacing="0.8em 2em 3em 5em 7em" framespacing="6em 9ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mtable rowspacing="1.0ex 3.0ex" columnspacing="0.8em 2em">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-3-ref.html b/layout/reftests/mathml/tablespacing-3-ref.html
new file mode 100644
index 0000000000..f4180d8dfb
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-3-ref.html
@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Single value for rowspacing/columnspacing accepted</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable columnspacing="4em 4em 4em">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mtable rowspacing="4.0ex 4.0ex 4.0ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-3.html b/layout/reftests/mathml/tablespacing-3.html
new file mode 100644
index 0000000000..352a8a0884
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-3.html
@@ -0,0 +1,133 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Single value for rowspacing/columnspacing accepted</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable columnspacing="4em">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math>
+ <mtable rowspacing="4.0ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ <mtd>
+ <mtext>g</mtext>
+ </mtd>
+ <mtd>
+ <mtext>h</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>i</mtext>
+ </mtd>
+ <mtd>
+ <mtext>j</mtext>
+ </mtd>
+ <mtd>
+ <mtext>k</mtext>
+ </mtd>
+ <mtd>
+ <mtext>l</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>m</mtext>
+ </mtd>
+ <mtd>
+ <mtext>n</mtext>
+ </mtd>
+ <mtd>
+ <mtext>o</mtext>
+ </mtd>
+ <mtd>
+ <mtext>p</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-4-ref.html b/layout/reftests/mathml/tablespacing-4-ref.html
new file mode 100644
index 0000000000..42474859e7
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-4-ref.html
@@ -0,0 +1,95 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic tests involving adding and removing elements</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable columnspacing="5em 7em">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable columnspacing="5em">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex 4ex">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex 4ex" columnspacing="4em">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ <mtd>
+ <mn>w</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-4.html b/layout/reftests/mathml/tablespacing-4.html
new file mode 100644
index 0000000000..1a5f2a6cd9
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-4.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic tests involving adding and removing elements</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable columnspacing="5em 7em" id="mtable0a">
+ <mtr id="mtr0">
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable columnspacing="5em 7em">
+ <mtr id="mtr0a">
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ <mtd id="mtd0">
+ <mn>y</mn>
+ </mtd>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex 4ex" id="mtable0">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex 4ex" id="mtable1">
+ <mtr>
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ </mtr>
+ <mtr id="mtr1">
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable rowspacing="2ex 4ex" columnspacing="4em">
+ <mtr id="mtr2">
+ <mtd>
+ <mn>x</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>y</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>z</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <script>
+ function doTest() {
+ // Add a table cell
+ var mn0 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn");
+ mn0.innerHTML = 'z';
+ var mtd0 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd");
+ mtd0.appendChild(mn0);
+ document.getElementById("mtr0").appendChild(mtd0);
+ // Remove a table cell
+ document.getElementById("mtr0a").removeChild(document.getElementById("mtd0"));
+ // Add a table row
+ var mn1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn");
+ mn1.innerHTML = 'z';
+ var mtd1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd");
+ mtd1.appendChild(mn1);
+ var mtr1 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtr");
+ mtr1.appendChild(mtd1);
+ document.getElementById("mtable0").appendChild(mtr1);
+ // Remove a table row
+ document.getElementById("mtable1").removeChild(document.getElementById("mtr1"));
+ // Add a table cell to a table containing several rows
+ var mn2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mn");
+ mn2.innerHTML = 'w';
+ var mtd2 = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mtd");
+ mtd2.appendChild(mn2);
+ document.getElementById("mtr2").appendChild(mtd2);
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-5-ref.html b/layout/reftests/mathml/tablespacing-5-ref.html
new file mode 100644
index 0000000000..c79ccd1e88
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-5-ref.html
@@ -0,0 +1,274 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable id="mtable0" >
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable3" rowspacing="2ex 4ex">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable4" columnspacing="2em 3em" >
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable5" framespacing="2em 2ex" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable6">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-5.html b/layout/reftests/mathml/tablespacing-5.html
new file mode 100644
index 0000000000..ae212b62e0
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-5.html
@@ -0,0 +1,295 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable id="mtable0" rowspacing="2ex 3ex">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1" columnspacing="2em 3em">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" framespacing="2em 2ex" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable3" >
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable4" >
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable5" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable6" frame="none">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <script>
+ function doTest() {
+ // remove spacing attributes
+ document.getElementById("mtable0").removeAttribute("rowspacing");
+ document.getElementById("mtable1").removeAttribute("columnspacing");
+ document.getElementById("mtable2").removeAttribute("framespacing");
+
+ // add spacing attributes
+ document.getElementById("mtable3").setAttribute("rowspacing", "2ex 4ex");
+ document.getElementById("mtable4").setAttribute("columnspacing", "2em 3em");
+ document.getElementById("mtable5").setAttribute("framespacing", "2em 2ex");
+
+ // framespacing doesn't apply with frame="none"
+ document.getElementById("mtable6").setAttribute("framespacing", "2em 2ex");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-5a-ref.html b/layout/reftests/mathml/tablespacing-5a-ref.html
new file mode 100644
index 0000000000..4d0820805c
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-5a-ref.html
@@ -0,0 +1,278 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <!-- There are at present two implementations of mtable spacing behaviour,
+ one based on CSS and the other on rowspacing/columnspacing/framespacing
+ attributes which the user can select. This reftest tests that dynamic
+ transitions from one system to the other work appropriately. -->
+ <math>
+ <mtable id="mtable0" columnspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" frame="solid" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable3" rowspacing="2ex 4ex" columspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable4" columnspacing="2em 3em" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable5" framespacing="2em 2ex" frame="solid" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable6" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-5a.html b/layout/reftests/mathml/tablespacing-5a.html
new file mode 100644
index 0000000000..250557b79a
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-5a.html
@@ -0,0 +1,295 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable id="mtable0" rowspacing="2ex 3ex" columnspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1" columnspacing="2em 3em" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" framespacing="2em 2ex" frame="solid" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable3" columspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable4" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable5" frame="solid" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable6" frame="none" rowspacing="">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <script>
+ function doTest() {
+ // remove spacing attributes
+ document.getElementById("mtable0").removeAttribute("rowspacing");
+ document.getElementById("mtable1").removeAttribute("columnspacing");
+ document.getElementById("mtable2").removeAttribute("framespacing");
+
+ // add spacing attributes
+ document.getElementById("mtable3").setAttribute("rowspacing", "2ex 4ex");
+ document.getElementById("mtable4").setAttribute("columnspacing", "2em 3em");
+ document.getElementById("mtable5").setAttribute("framespacing", "2em 2ex");
+
+ // framespacing doesn't apply with frame="none"
+ document.getElementById("mtable6").setAttribute("framespacing", "2em 2ex");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-6-ref.html b/layout/reftests/mathml/tablespacing-6-ref.html
new file mode 100644
index 0000000000..a08f5a0ca5
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-6-ref.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable id="mtable0" rowspacing="3ex 7ex">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1" columnspacing="3em 7em">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" framespacing="3em 7ex" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-6.html b/layout/reftests/mathml/tablespacing-6.html
new file mode 100644
index 0000000000..c49dc4e29e
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-6.html
@@ -0,0 +1,135 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <title>Dynamic tests involving changes to row/column/framespacing</title>
+ <meta charset="utf-8"/>
+ </head>
+ <body>
+ <math>
+ <mtable id="mtable0" rowspacing="2ex 3ex">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable1" columnspacing="2em 3em">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <math>
+ <mtable id="mtable2" framespacing="2em 2ex" frame="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ <p>
+ <script>
+ function doTest() {
+
+ // modify existing spacing attributes
+ document.getElementById("mtable0").setAttribute("rowspacing", "3ex 7ex");
+ document.getElementById("mtable1").setAttribute("columnspacing", "3em 7em");
+ document.getElementById("mtable2").setAttribute("framespacing", "3em 7ex");
+
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", doTest);
+ </script>
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-7-ref.html b/layout/reftests/mathml/tablespacing-7-ref.html
new file mode 100644
index 0000000000..ad2d53b03e
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-7-ref.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Table spacing error handling</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable frame="solid" rowspacing="5.0ex 1.0ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math >
+ <mtable frame="solid" columnspacing="5em 0.8em">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ <p>
+ <math >
+ <mtable frame="solid" framespacing="0.4em 0.5ex">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-7.html b/layout/reftests/mathml/tablespacing-7.html
new file mode 100644
index 0000000000..ac816bb96c
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-7.html
@@ -0,0 +1,97 @@
+<!DOCTYPE html>
+<html>
+ <head><title>Table spacing error handling</title></head>
+ <body>
+
+ <p>
+ <math>
+ <mtable frame="solid" rowspacing="5.0ex cat">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+ </p>
+ <p>
+ <math >
+ <mtable frame="solid" columnspacing="5em cat">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ <p>
+ <math >
+ <mtable frame="solid" framespacing="0.4em cat">
+ <mtr>
+ <mtd>
+ <mtext>a</mtext>
+ </mtd>
+ <mtd>
+ <mtext>b</mtext>
+ </mtd>
+ <mtd>
+ <mtext>c</mtext>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mtext>d</mtext>
+ </mtd>
+ <mtd>
+ <mtext>e</mtext>
+ </mtd>
+ <mtd>
+ <mtext>f</mtext>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+
+ </p>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-8-ref.html b/layout/reftests/mathml/tablespacing-8-ref.html
new file mode 100644
index 0000000000..a39c15b3d6
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-8-ref.html
@@ -0,0 +1,38 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <body>
+
+ <math>
+ <mtable rowspacing="30px" columnspacing="30px">
+ <mtr>
+ <mtd>
+ <mspace width="50px" height="30px"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="50px" height="30px"></mspace>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mspace width="50px" height="30px"></mspace>
+ </mtd>
+ <mtd>
+ <mspace width="50px" height="30px"></mspace>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+ <div style="position: absolute; top: 0; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 70px; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 0px;
+ width: 60px; height: 100px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 90px;
+ width: 60px; height: 100px; background: black;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-8a.html b/layout/reftests/mathml/tablespacing-8a.html
new file mode 100644
index 0000000000..3e2b42c9e2
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-8a.html
@@ -0,0 +1,39 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <body>
+
+ <math>
+ <mtable rowspacing="30px" columnspacing="60px"
+ rowlines="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+ <div style="position: absolute; top: 0; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 70px; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 0px;
+ width: 60px; height: 100px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 90px;
+ width: 60px; height: 100px; background: black;"></div>
+
+ </body>
+</html>
diff --git a/layout/reftests/mathml/tablespacing-8b.html b/layout/reftests/mathml/tablespacing-8b.html
new file mode 100644
index 0000000000..db29f12b52
--- /dev/null
+++ b/layout/reftests/mathml/tablespacing-8b.html
@@ -0,0 +1,38 @@
+<!-- -*- mode: HTML; tab-width: 2; indent-tabs-mode: nil; -*- -->
+<!-- vim: set tabstop=2 expandtab shiftwidth=2 textwidth=80: -->
+<!DOCTYPE html>
+<html>
+ <body>
+
+ <math>
+ <mtable rowspacing="20px" columnspacing="100px"
+ columnlines="solid">
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ <mtr>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ <mtd>
+ <mn>X</mn>
+ </mtd>
+ </mtr>
+ </mtable>
+ </math>
+
+ <div style="position: absolute; top: 0; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 70px; left: 0px;
+ width: 150px; height: 40px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 0px;
+ width: 60px; height: 100px; background: black;"></div>
+ <div style="position: absolute; top: 0px; left: 90px;
+ width: 60px; height: 100px; background: black;"></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>
diff --git a/layout/reftests/mathml/whitespace-trim-1-ref.html b/layout/reftests/mathml/whitespace-trim-1-ref.html
new file mode 100644
index 0000000000..b2145dedf0
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-1-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mo minsize="10em">(</mo></math>
diff --git a/layout/reftests/mathml/whitespace-trim-1.html b/layout/reftests/mathml/whitespace-trim-1.html
new file mode 100644
index 0000000000..59aeb9af8b
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-1.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mo minsize="10em"> ( </mo></math>
diff --git a/layout/reftests/mathml/whitespace-trim-2-ref.html b/layout/reftests/mathml/whitespace-trim-2-ref.html
new file mode 100644
index 0000000000..8b8f7b8129
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-2-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mi>(</mi></math>
diff --git a/layout/reftests/mathml/whitespace-trim-2.html b/layout/reftests/mathml/whitespace-trim-2.html
new file mode 100644
index 0000000000..d1c27c698d
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-2.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mi> ( </mi></math>
diff --git a/layout/reftests/mathml/whitespace-trim-3-ref.html b/layout/reftests/mathml/whitespace-trim-3-ref.html
new file mode 100644
index 0000000000..4a9928a69f
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-3-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mi mathvariant="italic">&#x210e;</mi></math>
diff --git a/layout/reftests/mathml/whitespace-trim-3.html b/layout/reftests/mathml/whitespace-trim-3.html
new file mode 100644
index 0000000000..61f16888a1
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-3.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><mi mathvariant="italic"> &#x210e; </mi></math>
diff --git a/layout/reftests/mathml/whitespace-trim-4-ref.html b/layout/reftests/mathml/whitespace-trim-4-ref.html
new file mode 100644
index 0000000000..f5951467cb
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-4-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><ms>x</ms></math>
diff --git a/layout/reftests/mathml/whitespace-trim-4.html b/layout/reftests/mathml/whitespace-trim-4.html
new file mode 100644
index 0000000000..01120098c9
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-4.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<math><ms> x </ms></math>
diff --git a/layout/reftests/mathml/whitespace-trim-5-ref.html b/layout/reftests/mathml/whitespace-trim-5-ref.html
new file mode 100644
index 0000000000..560259c86f
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-5-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<math><mtext>|</mtext><mi>x</mi><mtext>|</mtext></math>
+<math><mtext>|</mtext><mn>x</mn><mtext>|</mtext></math>
+<math><mtext>|</mtext><mo>x</mo><mtext>|</mtext></math>
+<math><mtext>|</mtext><mtext>x</mtext><mtext>|</mtext></math>
diff --git a/layout/reftests/mathml/whitespace-trim-5.html b/layout/reftests/mathml/whitespace-trim-5.html
new file mode 100644
index 0000000000..7b06950559
--- /dev/null
+++ b/layout/reftests/mathml/whitespace-trim-5.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<math><mtext>|</mtext><mi> x </mi><mtext>|</mtext></math>
+<math><mtext>|</mtext><mn> x </mn><mtext>|</mtext></math>
+<math><mtext>|</mtext><mo> x </mo><mtext>|</mtext></math>
+<math><mtext>|</mtext><mtext> x </mtext><mtext>|</mtext></math>