summaryrefslogtreecommitdiffstats
path: root/layout/reftests/text
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layout/reftests/text-decoration/1133392-ref.html17
-rw-r--r--layout/reftests/text-decoration/1133392.html36
-rw-r--r--layout/reftests/text-decoration/1159729-offset-adjustment-notref.html19
-rw-r--r--layout/reftests/text-decoration/1159729-offset-adjustment.html21
-rw-r--r--layout/reftests/text-decoration/1415214-notref.html18
-rw-r--r--layout/reftests/text-decoration/1415214.html18
-rw-r--r--layout/reftests/text-decoration/641444-1-ref.html38
-rw-r--r--layout/reftests/text-decoration/641444-1.html38
-rw-r--r--layout/reftests/text-decoration/676538-1-ref.html23
-rw-r--r--layout/reftests/text-decoration/676538-1.html22
-rw-r--r--layout/reftests/text-decoration/complex-decoration-style-quirks-ref.html102
-rw-r--r--layout/reftests/text-decoration/complex-decoration-style-quirks.html114
-rw-r--r--layout/reftests/text-decoration/complex-decoration-style-standards-ref.html103
-rw-r--r--layout/reftests/text-decoration/complex-decoration-style-standards.html115
-rw-r--r--layout/reftests/text-decoration/decoration-color-override-quirks-ref.html5
-rw-r--r--layout/reftests/text-decoration/decoration-color-override-quirks.html5
-rw-r--r--layout/reftests/text-decoration/decoration-color-override-standards-ref.html6
-rw-r--r--layout/reftests/text-decoration/decoration-color-override-standards.html6
-rw-r--r--layout/reftests/text-decoration/decoration-color-quirks-ref.html75
-rw-r--r--layout/reftests/text-decoration/decoration-color-quirks.html84
-rw-r--r--layout/reftests/text-decoration/decoration-color-standards-ref.html77
-rw-r--r--layout/reftests/text-decoration/decoration-color-standards.html83
-rw-r--r--layout/reftests/text-decoration/decoration-css21-block-ref.html16
-rw-r--r--layout/reftests/text-decoration/decoration-css21-block.html14
-rw-r--r--layout/reftests/text-decoration/decoration-css21-ref.html30
-rw-r--r--layout/reftests/text-decoration/decoration-css21.html30
-rw-r--r--layout/reftests/text-decoration/decoration-style-quirks-ref.html54
-rw-r--r--layout/reftests/text-decoration/decoration-style-quirks.html47
-rw-r--r--layout/reftests/text-decoration/decoration-style-standards-ref.html34
-rw-r--r--layout/reftests/text-decoration/decoration-style-standards.html34
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html21
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html26
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html21
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html26
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html22
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html27
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html22
-rw-r--r--layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html27
-rw-r--r--layout/reftests/text-decoration/emphasis-style-dynamic-ref.html12
-rw-r--r--layout/reftests/text-decoration/emphasis-style-dynamic.html20
-rw-r--r--layout/reftests/text-decoration/inline-baseline-almost-standards-ref.html10
-rw-r--r--layout/reftests/text-decoration/inline-baseline-almost-standards.html10
-rw-r--r--layout/reftests/text-decoration/inline-baseline-quirks-ref.html8
-rw-r--r--layout/reftests/text-decoration/inline-baseline-quirks.html8
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-block-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/line-through-style-inline-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-block-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-block-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/overline-style-inline-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/reftest.list121
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-1-ref.html18
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-1.html15
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-2-ref.html19
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-2.html18
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-3-ref.html19
-rw-r--r--layout/reftests/text-decoration/skip-ink-cjk-3.html18
-rw-r--r--layout/reftests/text-decoration/skip-ink-multiline-position-ref.html26
-rw-r--r--layout/reftests/text-decoration/skip-ink-multiline-position.html26
-rw-r--r--layout/reftests/text-decoration/skip-ink-vertical-align-2-notref.html5
-rw-r--r--layout/reftests/text-decoration/skip-ink-vertical-align-2.html5
-rw-r--r--layout/reftests/text-decoration/skip-ink-vertical-align-ref.html20
-rw-r--r--layout/reftests/text-decoration/skip-ink-vertical-align.html19
-rw-r--r--layout/reftests/text-decoration/table-quirk-1-ref.html7
-rw-r--r--layout/reftests/text-decoration/table-quirk-1.html7
-rw-r--r--layout/reftests/text-decoration/table-quirk-2-ref.html26
-rw-r--r--layout/reftests/text-decoration/table-quirk-2.html35
-rw-r--r--layout/reftests/text-decoration/text-decoration-propagation-1-quirks-ref.html38
-rw-r--r--layout/reftests/text-decoration/text-decoration-propagation-1-quirks.html46
-rw-r--r--layout/reftests/text-decoration/text-decoration-propagation-1-standards-ref.html39
-rw-r--r--layout/reftests/text-decoration/text-decoration-propagation-1-standards.html47
-rw-r--r--layout/reftests/text-decoration/text-decoration-zorder-1-quirks.html44
-rw-r--r--layout/reftests/text-decoration/text-decoration-zorder-1-ref.html55
-rw-r--r--layout/reftests/text-decoration/text-decoration-zorder-1-standards.html46
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-2-quirks-ref.html40
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-2-quirks.html35
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html40
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-2-standards.html34
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-quirks-ref.html13
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-quirks.html13
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-standards-ref.html14
-rw-r--r--layout/reftests/text-decoration/underline-block-propagation-standards.html14
-rw-r--r--layout/reftests/text-decoration/underline-block-quirks-notref.html2
-rw-r--r--layout/reftests/text-decoration/underline-block-quirks-ref.html2
-rw-r--r--layout/reftests/text-decoration/underline-block-quirks.html2
-rw-r--r--layout/reftests/text-decoration/underline-block-standards-notref.html3
-rw-r--r--layout/reftests/text-decoration/underline-block-standards-ref.html3
-rw-r--r--layout/reftests/text-decoration/underline-block-standards.html3
-rw-r--r--layout/reftests/text-decoration/underline-button-1-ref.html9
-rw-r--r--layout/reftests/text-decoration/underline-button-1.html8
-rw-r--r--layout/reftests/text-decoration/underline-button-2-ref.html9
-rw-r--r--layout/reftests/text-decoration/underline-button-2.html8
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-quirks-notref.html2
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-quirks-ref.html2
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-quirks.html2
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-standards-notref.html3
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-standards-ref.html3
-rw-r--r--layout/reftests/text-decoration/underline-inline-block-standards.html3
-rw-r--r--layout/reftests/text-decoration/underline-select-1-ref.html9
-rw-r--r--layout/reftests/text-decoration/underline-select-1.html8
-rw-r--r--layout/reftests/text-decoration/underline-select-2-ref.html9
-rw-r--r--layout/reftests/text-decoration/underline-select-2.html8
-rw-r--r--layout/reftests/text-decoration/underline-style-block-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-block-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-block-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-block-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-block-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-block-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-block-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-dashed-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-dashed-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-dotted-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-dotted-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-double-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-double-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-quirks-ref.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-solid-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-solid-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-standards-ref.html2
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-wavy-quirks.html1
-rw-r--r--layout/reftests/text-decoration/underline-style-inline-wavy-standards.html2
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-quirks-notref.html12
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-quirks-ref.html12
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-quirks.html12
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-standards-notref.html13
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-standards-ref.html13
-rw-r--r--layout/reftests/text-decoration/underline-table-caption-standards.html13
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-quirks-notref.html11
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-quirks-ref.html11
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-quirks.html11
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-standards-notref.html12
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-standards-ref.html12
-rw-r--r--layout/reftests/text-decoration/underline-table-cell-standards.html12
-rw-r--r--layout/reftests/text-decoration/vertical-mode-decorations-1-ref.html15
-rw-r--r--layout/reftests/text-decoration/vertical-mode-decorations-1.html15
-rw-r--r--layout/reftests/text-decoration/vertical-mode-decorations-2-ref.html15
-rw-r--r--layout/reftests/text-decoration/vertical-mode-decorations-2.html15
-rw-r--r--layout/reftests/text-indent/dynamic-change-with-overflow-1-ref.html6
-rw-r--r--layout/reftests/text-indent/dynamic-change-with-overflow-1.html16
-rw-r--r--layout/reftests/text-indent/reftest.list20
-rw-r--r--layout/reftests/text-indent/text-indent-intrinsic-min-ref.html36
-rw-r--r--layout/reftests/text-indent/text-indent-intrinsic-min.html48
-rw-r--r--layout/reftests/text-indent/text-indent-intrinsic-pref-ref.html36
-rw-r--r--layout/reftests/text-indent/text-indent-intrinsic-pref.html48
-rw-r--r--layout/reftests/text-indent/text-indent-multiple-line-notref-block-margin.html16
-rw-r--r--layout/reftests/text-indent/text-indent-multiple-line-ref-float.html16
-rw-r--r--layout/reftests/text-indent/text-indent-multiple-line-ref-inline-margin.html15
-rw-r--r--layout/reftests/text-indent/text-indent-multiple-line.html16
-rw-r--r--layout/reftests/text-indent/text-indent-negative-intrinsic-min-ref.html30
-rw-r--r--layout/reftests/text-indent/text-indent-negative-intrinsic-min.html43
-rw-r--r--layout/reftests/text-indent/text-indent-negative-intrinsic-pref-ref.html30
-rw-r--r--layout/reftests/text-indent/text-indent-negative-intrinsic-pref.html43
-rw-r--r--layout/reftests/text-indent/text-indent-parent-dynamic-ref.html10
-rw-r--r--layout/reftests/text-indent/text-indent-parent-dynamic.html15
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-0.html15
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-100.html15
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-block-margin.html16
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-inline-margin.html15
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-indent-inline.html16
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-percent-ref.html14
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-percent.html18
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-ref-margin.html15
-rw-r--r--layout/reftests/text-indent/text-indent-single-line-ref-unstyled.html14
-rw-r--r--layout/reftests/text-overflow/TestEllipsisFallback.woffbin0 -> 1224 bytes
-rw-r--r--layout/reftests/text-overflow/aligned-baseline-ref.html100
-rw-r--r--layout/reftests/text-overflow/aligned-baseline.html100
-rw-r--r--layout/reftests/text-overflow/anonymous-block-ref.html66
-rw-r--r--layout/reftests/text-overflow/anonymous-block.html75
-rw-r--r--layout/reftests/text-overflow/atomic-under-marker-ref.html85
-rw-r--r--layout/reftests/text-overflow/atomic-under-marker.html85
-rw-r--r--layout/reftests/text-overflow/bidi-simple-ref.html85
-rw-r--r--layout/reftests/text-overflow/bidi-simple-scrolled-ref.html106
-rw-r--r--layout/reftests/text-overflow/bidi-simple-scrolled.html98
-rw-r--r--layout/reftests/text-overflow/bidi-simple.html81
-rw-r--r--layout/reftests/text-overflow/block-padding-ref.html83
-rw-r--r--layout/reftests/text-overflow/block-padding.html71
-rw-r--r--layout/reftests/text-overflow/clipped-elements-ref.html78
-rw-r--r--layout/reftests/text-overflow/clipped-elements.html80
-rw-r--r--layout/reftests/text-overflow/combobox-zoom-ref.html34
-rw-r--r--layout/reftests/text-overflow/combobox-zoom.html34
-rw-r--r--layout/reftests/text-overflow/dynamic-change-1-ref.html7
-rw-r--r--layout/reftests/text-overflow/dynamic-change-1.html16
-rw-r--r--layout/reftests/text-overflow/ellipsis-font-fallback-ref.html149
-rw-r--r--layout/reftests/text-overflow/ellipsis-font-fallback.html150
-rw-r--r--layout/reftests/text-overflow/false-marker-overlap-ref.html72
-rw-r--r--layout/reftests/text-overflow/false-marker-overlap.html72
-rw-r--r--layout/reftests/text-overflow/float-edges-1-ref.html71
-rw-r--r--layout/reftests/text-overflow/float-edges-1.html73
-rw-r--r--layout/reftests/text-overflow/line-clipping-ref.html28
-rw-r--r--layout/reftests/text-overflow/line-clipping.html32
-rw-r--r--layout/reftests/text-overflow/marker-basic-ref.html276
-rw-r--r--layout/reftests/text-overflow/marker-basic.html205
-rw-r--r--layout/reftests/text-overflow/marker-shadow-ref.html33
-rw-r--r--layout/reftests/text-overflow/marker-shadow.html37
-rw-r--r--layout/reftests/text-overflow/marker-string-ref.html69
-rw-r--r--layout/reftests/text-overflow/marker-string.html73
-rw-r--r--layout/reftests/text-overflow/quirks-decorations-ref.html73
-rw-r--r--layout/reftests/text-overflow/quirks-decorations.html74
-rw-r--r--layout/reftests/text-overflow/quirks-line-height-ref.html57
-rw-r--r--layout/reftests/text-overflow/quirks-line-height.html56
-rw-r--r--layout/reftests/text-overflow/reftest.list38
-rw-r--r--layout/reftests/text-overflow/scroll-rounding-ref.html85
-rw-r--r--layout/reftests/text-overflow/scroll-rounding.html86
-rw-r--r--layout/reftests/text-overflow/selection-ref.html118
-rw-r--r--layout/reftests/text-overflow/selection.html116
-rw-r--r--layout/reftests/text-overflow/single-value-ref.html106
-rw-r--r--layout/reftests/text-overflow/single-value.html99
-rw-r--r--layout/reftests/text-overflow/standards-decorations-ref.html72
-rw-r--r--layout/reftests/text-overflow/standards-decorations.html73
-rw-r--r--layout/reftests/text-overflow/standards-line-height-ref.html58
-rw-r--r--layout/reftests/text-overflow/standards-line-height.html57
-rw-r--r--layout/reftests/text-overflow/table-cell-ref.html45
-rw-r--r--layout/reftests/text-overflow/table-cell.html47
-rw-r--r--layout/reftests/text-overflow/theme-overflow-ref.html61
-rw-r--r--layout/reftests/text-overflow/theme-overflow.html62
-rw-r--r--layout/reftests/text-overflow/two-value-syntax-ref.html66
-rw-r--r--layout/reftests/text-overflow/two-value-syntax.html75
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-1-2-notref.html27
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-1-ref.html27
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-1.html27
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-2-ref.html30
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-2.html30
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-3-4-notref.html27
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-3-ref.html28
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-3.html28
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-4-ref.html30
-rw-r--r--layout/reftests/text-overflow/vertical-decorations-4.html30
-rw-r--r--layout/reftests/text-overflow/visibility-hidden-ref.html72
-rw-r--r--layout/reftests/text-overflow/visibility-hidden.html74
-rw-r--r--layout/reftests/text-overflow/xulscroll-ref.html80
-rw-r--r--layout/reftests/text-overflow/xulscroll.html104
-rw-r--r--layout/reftests/text-shadow/basic-negcoord-ref.xhtml6
-rw-r--r--layout/reftests/text-shadow/basic-negcoord.xhtml5
-rw-r--r--layout/reftests/text-shadow/basic-ref.xhtml6
-rw-r--r--layout/reftests/text-shadow/basic.xhtml5
-rw-r--r--layout/reftests/text-shadow/blur-notref.xhtml3
-rw-r--r--layout/reftests/text-shadow/blur-opacity-ref.html7
-rw-r--r--layout/reftests/text-shadow/blur-opacity.html7
-rw-r--r--layout/reftests/text-shadow/blur.xhtml3
-rw-r--r--layout/reftests/text-shadow/color-inherit-ref.xhtml6
-rw-r--r--layout/reftests/text-shadow/color-inherit.xhtml5
-rw-r--r--layout/reftests/text-shadow/multiple-noblur-ref.xhtml9
-rw-r--r--layout/reftests/text-shadow/multiple-noblur.xhtml5
-rw-r--r--layout/reftests/text-shadow/overflow-clip-ref.html13
-rw-r--r--layout/reftests/text-shadow/overflow-clip.html18
-rw-r--r--layout/reftests/text-shadow/overflow-decoration-ref.html25
-rw-r--r--layout/reftests/text-shadow/overflow-decoration.html23
-rw-r--r--layout/reftests/text-shadow/reftest.list22
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-selection-1-ref.html26
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-selection-1.html41
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-selection-2-ref.html27
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-selection-2.html43
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-space-1-ref.html16
-rw-r--r--layout/reftests/text-shadow/text-shadow-on-space-1.html17
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-1-notref.html31
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-1-ref.html33
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-1.html31
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-2-notref.html31
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-2-ref.html33
-rw-r--r--layout/reftests/text-shadow/text-shadow-selected-2.html31
-rw-r--r--layout/reftests/text-stroke/reftest.list9
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-001-ref.html16
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-001.html17
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-002-ref.html16
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-002.html17
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-003-ref.html16
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-003.html17
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-004-ref.html16
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-004.html17
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-005-ref.html16
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-005.html26
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-006-ref.html19
-rw-r--r--layout/reftests/text-stroke/webkit-text-stroke-property-006.html19
-rw-r--r--layout/reftests/text-svgglyphs/bug1320197-1-ref.html19
-rw-r--r--layout/reftests/text-svgglyphs/bug1320197-1.html21
-rw-r--r--layout/reftests/text-svgglyphs/clip-ref.html21
-rw-r--r--layout/reftests/text-svgglyphs/clip.html39
-rw-r--r--layout/reftests/text-svgglyphs/reftest.list33
-rw-r--r--layout/reftests/text-svgglyphs/resources/README61
-rw-r--r--layout/reftests/text-svgglyphs/resources/bug1320197-testFont2.ttfbin0 -> 1972 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-base.svg13
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-invalid.svg40
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-objectcolor.svg24
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-objectopacity.svg59
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-objectstroke.svg25
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-paintservers.svg28
-rw-r--r--layout/reftests/text-svgglyphs/resources/glyphs-transforms.svg67
-rw-r--r--layout/reftests/text-svgglyphs/resources/nosvg.woffbin0 -> 68044 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/rubbish.txt1
-rw-r--r--layout/reftests/text-svgglyphs/resources/rubbish.woffbin0 -> 68172 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/svg-bitmap.ttfbin0 -> 2064 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/svg-bitmap.ttx253
-rw-r--r--layout/reftests/text-svgglyphs/resources/svg-glyph-extents.otfbin0 -> 183892 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/svg-gz.ttfbin0 -> 113804 bytes
-rw-r--r--layout/reftests/text-svgglyphs/resources/svg.woffbin0 -> 70060 bytes
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-basic-disabled.svg27
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg8
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-basic.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-cachedopacity-ref.svg6
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-cachedopacity.svg20
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html13
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-compressed.html13
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-direct-ref.svg27
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-direct.svg19
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-extents-ref.html27
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-extents.html50
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-html-ref.svg11
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-html.html12
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-invalid-ids-ref.svg6
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-invalid-ids.svg22
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-invalid-ref.html18
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-invalid.html23
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-mask-ref.svg15
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-mask.svg12
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid-ref.svg4
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid.svg27
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectgradient-ref.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom-ref.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom.svg35
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectgradient.svg36
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectopacity-ref.svg30
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectopacity.svg40
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectopacity2-ref.svg30
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectopacity2.svg39
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectpattern-ref.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectpattern.svg35
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid-ref.svg6
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid.svg27
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150-ref.svg13
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150.svg21
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75-ref.svg13
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75.svg21
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue-ref.svg13
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-objectvalue.svg21
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-paint-server-ref.svg10
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-paint-server.svg21
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-paintnone-ref.svg17
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-paintnone.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-positioning-disabled.svg25
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-positioning-ref.svg21
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-positioning.svg23
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-transform-ref.svg48
-rw-r--r--layout/reftests/text-svgglyphs/svg-glyph-transform.svg48
-rw-r--r--layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1-ref.html30
-rw-r--r--layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1.html33
-rw-r--r--layout/reftests/text-transform/all-lower-ref.html1448
-rw-r--r--layout/reftests/text-transform/all-lower.html1448
-rw-r--r--layout/reftests/text-transform/all-title-ref.html1517
-rw-r--r--layout/reftests/text-transform/all-title.html1517
-rw-r--r--layout/reftests/text-transform/all-upper-ref.html1540
-rw-r--r--layout/reftests/text-transform/all-upper.html1540
-rw-r--r--layout/reftests/text-transform/capitalize-1.html11
-rw-r--r--layout/reftests/text-transform/capitalize-2.html11
-rw-r--r--layout/reftests/text-transform/capitalize-3-ref.html11
-rw-r--r--layout/reftests/text-transform/capitalize-3.html16
-rw-r--r--layout/reftests/text-transform/capitalize-4-ref.html12
-rw-r--r--layout/reftests/text-transform/capitalize-4.html12
-rw-r--r--layout/reftests/text-transform/capitalize-5-ref.html12
-rw-r--r--layout/reftests/text-transform/capitalize-5.html12
-rw-r--r--layout/reftests/text-transform/capitalize-6-ref.html11
-rw-r--r--layout/reftests/text-transform/capitalize-6.html11
-rw-r--r--layout/reftests/text-transform/capitalize-7-ref.html6
-rw-r--r--layout/reftests/text-transform/capitalize-7.html10
-rw-r--r--layout/reftests/text-transform/capitalize-7a.html11
-rw-r--r--layout/reftests/text-transform/capitalize-8-ref.html11
-rw-r--r--layout/reftests/text-transform/capitalize-8.html12
-rw-r--r--layout/reftests/text-transform/capitalize-9-ref.html11
-rw-r--r--layout/reftests/text-transform/capitalize-9.html11
-rw-r--r--layout/reftests/text-transform/capitalize-ref.html6
-rw-r--r--layout/reftests/text-transform/fake-small-caps-1-ref.html22
-rw-r--r--layout/reftests/text-transform/fake-small-caps-1.html19
-rw-r--r--layout/reftests/text-transform/fullwidth-1-ref.html9
-rw-r--r--layout/reftests/text-transform/fullwidth-1.html9
-rw-r--r--layout/reftests/text-transform/fullwidth-2-ref.html9
-rw-r--r--layout/reftests/text-transform/fullwidth-2.html9
-rw-r--r--layout/reftests/text-transform/fullwidth-all-ref.html34
-rw-r--r--layout/reftests/text-transform/fullwidth-all.html34
-rw-r--r--layout/reftests/text-transform/graphite-small-caps-1-notref.html22
-rw-r--r--layout/reftests/text-transform/graphite-small-caps-1-ref.html22
-rw-r--r--layout/reftests/text-transform/graphite-small-caps-1.html19
-rw-r--r--layout/reftests/text-transform/greek-small-caps-1-ref.html25
-rw-r--r--layout/reftests/text-transform/greek-small-caps-1.html23
-rw-r--r--layout/reftests/text-transform/greek-uppercase-1-ref.html17
-rw-r--r--layout/reftests/text-transform/greek-uppercase-1a.html22
-rw-r--r--layout/reftests/text-transform/greek-uppercase-1b.html22
-rw-r--r--layout/reftests/text-transform/greek-uppercase-2-ref.html17
-rw-r--r--layout/reftests/text-transform/greek-uppercase-2.html18
-rw-r--r--layout/reftests/text-transform/greek-uppercase-3-ref.html17
-rw-r--r--layout/reftests/text-transform/greek-uppercase-3.html18
-rw-r--r--layout/reftests/text-transform/irish-lowercase-1-ref.html226
-rw-r--r--layout/reftests/text-transform/irish-lowercase-1a.html226
-rw-r--r--layout/reftests/text-transform/irish-lowercase-1b.html226
-rw-r--r--layout/reftests/text-transform/irish-uppercase-1-ref.html120
-rw-r--r--layout/reftests/text-transform/irish-uppercase-1.html120
-rw-r--r--layout/reftests/text-transform/lowercase-1.html11
-rw-r--r--layout/reftests/text-transform/lowercase-ref.html6
-rw-r--r--layout/reftests/text-transform/lowercase-sigma-1-ref.html11
-rw-r--r--layout/reftests/text-transform/lowercase-sigma-1.html11
-rw-r--r--layout/reftests/text-transform/opentype-small-caps-1-notref.html22
-rw-r--r--layout/reftests/text-transform/opentype-small-caps-1-ref.html22
-rw-r--r--layout/reftests/text-transform/opentype-small-caps-1.html19
-rw-r--r--layout/reftests/text-transform/reftest.list49
-rw-r--r--layout/reftests/text-transform/small-caps-1-ref.html4
-rw-r--r--layout/reftests/text-transform/small-caps-1.html9
-rw-r--r--layout/reftests/text-transform/small-caps-turkish-1-notref.html24
-rw-r--r--layout/reftests/text-transform/small-caps-turkish-1.html24
-rw-r--r--layout/reftests/text-transform/smtp-lower-ref.html50
-rw-r--r--layout/reftests/text-transform/smtp-lower.html53
-rw-r--r--layout/reftests/text-transform/smtp-title-ref.html50
-rw-r--r--layout/reftests/text-transform/smtp-title.html53
-rw-r--r--layout/reftests/text-transform/smtp-upper-ref.html50
-rw-r--r--layout/reftests/text-transform/smtp-upper.html53
-rw-r--r--layout/reftests/text-transform/turkish-casing-1-ref.html27
-rw-r--r--layout/reftests/text-transform/turkish-casing-1.html27
-rw-r--r--layout/reftests/text-transform/uppercase-1.html11
-rw-r--r--layout/reftests/text-transform/uppercase-eszett-1.html5
-rw-r--r--layout/reftests/text-transform/uppercase-eszett-1a-ref.html5
-rw-r--r--layout/reftests/text-transform/uppercase-eszett-1b-ref.html5
-rw-r--r--layout/reftests/text-transform/uppercase-ref.html6
-rw-r--r--layout/reftests/text-transform/uppercase-szlig-1.html11
-rw-r--r--layout/reftests/text-transform/uppercase-szlig-ref.html6
-rw-r--r--layout/reftests/text/1170688-ref.html21
-rw-r--r--layout/reftests/text/1170688.html21
-rw-r--r--layout/reftests/text/1320665-cmap-format-13-ref.html12
-rw-r--r--layout/reftests/text/1320665-cmap-format-13.html22
-rw-r--r--layout/reftests/text/1331339-script-extensions-shaping-1-ref.html28
-rw-r--r--layout/reftests/text/1331339-script-extensions-shaping-1.html34
-rw-r--r--layout/reftests/text/1349308-1.html2
-rw-r--r--layout/reftests/text/1349308-notref.html1
-rw-r--r--layout/reftests/text/1463020-letter-spacing-text-transform-1-ref.html17
-rw-r--r--layout/reftests/text/1463020-letter-spacing-text-transform-1.html23
-rw-r--r--layout/reftests/text/1463020-letter-spacing-text-transform-2-ref.html17
-rw-r--r--layout/reftests/text/1463020-letter-spacing-text-transform-2.html23
-rw-r--r--layout/reftests/text/1507661-spurious-hyphenation-after-explicit-ref.html2
-rw-r--r--layout/reftests/text/1507661-spurious-hyphenation-after-explicit.html2
-rw-r--r--layout/reftests/text/1522857-1-ref.html2
-rw-r--r--layout/reftests/text/1522857-1.html2
-rw-r--r--layout/reftests/text/1637405-pua-shaping-1-notref.html15
-rw-r--r--layout/reftests/text/1637405-pua-shaping-1.html15
-rw-r--r--layout/reftests/text/1655364-1-ref.html2
-rw-r--r--layout/reftests/text/1655364-1.html2
-rw-r--r--layout/reftests/text/1670581-1-ref.html13
-rw-r--r--layout/reftests/text/1670581-1.html13
-rw-r--r--layout/reftests/text/1673098-1-ref.html13
-rw-r--r--layout/reftests/text/1673098-1.html13
-rw-r--r--layout/reftests/text/444656-ref.html12
-rw-r--r--layout/reftests/text/444656.html27
-rw-r--r--layout/reftests/text/449555-1-ref.html33
-rw-r--r--layout/reftests/text/449555-1.html33
-rw-r--r--layout/reftests/text/467722-ref.html10
-rw-r--r--layout/reftests/text/467722.html10
-rw-r--r--layout/reftests/text/475092-pos.html19
-rw-r--r--layout/reftests/text/475092-ref.html19
-rw-r--r--layout/reftests/text/475092-sub.html19
-rw-r--r--layout/reftests/text/476378-soft-hyphen-fallback-ref.html19
-rw-r--r--layout/reftests/text/476378-soft-hyphen-fallback.html19
-rw-r--r--layout/reftests/text/577380-ref.html13
-rw-r--r--layout/reftests/text/577380.html13
-rw-r--r--layout/reftests/text/726392-1-ref.html53
-rw-r--r--layout/reftests/text/726392-1.html66
-rw-r--r--layout/reftests/text/726392-2-ref.html53
-rw-r--r--layout/reftests/text/726392-2.html66
-rw-r--r--layout/reftests/text/726392-3-ref.html83
-rw-r--r--layout/reftests/text/726392-3.html94
-rw-r--r--layout/reftests/text/745555-1-ref.html28
-rw-r--r--layout/reftests/text/745555-1.html29
-rw-r--r--layout/reftests/text/745555-2-ref.html14
-rw-r--r--layout/reftests/text/745555-2.html19
-rw-r--r--layout/reftests/text/820255-ref.html11
-rw-r--r--layout/reftests/text/820255.html14
-rw-r--r--layout/reftests/text/arabic-fallback-1-ref.html17
-rw-r--r--layout/reftests/text/arabic-fallback-1.html17
-rw-r--r--layout/reftests/text/arabic-fallback-2-ref.html20
-rw-r--r--layout/reftests/text/arabic-fallback-2.html20
-rw-r--r--layout/reftests/text/arabic-fallback-3-ref.html17
-rw-r--r--layout/reftests/text/arabic-fallback-3.html17
-rw-r--r--layout/reftests/text/arabic-fallback-4-ref.html17
-rw-r--r--layout/reftests/text/arabic-fallback-4.html17
-rw-r--r--layout/reftests/text/arabic-final-ligature-spacing-ref.html6
-rw-r--r--layout/reftests/text/arabic-final-ligature-spacing.html9
-rw-r--r--layout/reftests/text/arabic-marks-1-ref.html42
-rw-r--r--layout/reftests/text/arabic-marks-1.html42
-rw-r--r--layout/reftests/text/arabic-shaping-1-ref.html17
-rw-r--r--layout/reftests/text/arabic-shaping-1.html17
-rw-r--r--layout/reftests/text/arial-bold-lam-alef-1-ref.html5
-rw-r--r--layout/reftests/text/arial-bold-lam-alef-1.html5
-rw-r--r--layout/reftests/text/auto-hyphenation-1-notref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-1-ref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-1.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-10-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-10.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-1a.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-2-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-2.html12
-rw-r--r--layout/reftests/text/auto-hyphenation-3-ref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-3.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-4-ref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-4.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-5-ref.html28
-rw-r--r--layout/reftests/text/auto-hyphenation-5.html28
-rw-r--r--layout/reftests/text/auto-hyphenation-6-ref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-6.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-7-ref.html9
-rw-r--r--layout/reftests/text/auto-hyphenation-7.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-8-ref.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-8.html10
-rw-r--r--layout/reftests/text/auto-hyphenation-9-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-9.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-af-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-af-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-bg-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-bg-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-bn-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-bn-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-ca-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ca-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-cy-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-cy-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-da-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-da-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-de-1901-1-ref.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-de-1901-1.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-de-1996-1-ref.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-de-1996-1.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-de-ch-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-de-ch-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-eo-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-eo-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-es-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-es-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-et-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-et-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-fi-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-fi-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-fr-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-fr-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-gl-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-gl-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-gu-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-gu-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-hi-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-hi-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-hr-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-hr-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-hsb-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-hsb-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-hu-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-hu-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ia-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ia-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-is-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-is-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-it-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-it-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-kmr-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-kmr-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-kn-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-kn-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-la-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-la-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-lt-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-lt-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ml-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-ml-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-mn-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-mn-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-nb-1-ref.html15
-rw-r--r--layout/reftests/text/auto-hyphenation-nb-1.html15
-rw-r--r--layout/reftests/text/auto-hyphenation-nl-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-nl-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-nn-1-ref.html15
-rw-r--r--layout/reftests/text/auto-hyphenation-nn-1.html15
-rw-r--r--layout/reftests/text/auto-hyphenation-pa-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-pa-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-pl-1-ref.html50
-rw-r--r--layout/reftests/text/auto-hyphenation-pl-1.html20
-rw-r--r--layout/reftests/text/auto-hyphenation-pt-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-pt-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ru-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ru-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-sh-1-ref.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-sh-1.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-sl-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-sl-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-sr-1-ref.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-sr-1.html13
-rw-r--r--layout/reftests/text/auto-hyphenation-sv-1-notref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-sv-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-sv-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-ta-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-ta-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-te-1-ref.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-te-1.html4
-rw-r--r--layout/reftests/text/auto-hyphenation-tr-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-tr-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-transformed-1-ref.html18
-rw-r--r--layout/reftests/text/auto-hyphenation-transformed-1.html18
-rw-r--r--layout/reftests/text/auto-hyphenation-uk-1-ref.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-uk-1.html11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-1.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-10.xhtml12
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-11a.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-11b.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-12a.xhtml12
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-12b.xhtml12
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-13a.xhtml13
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-13b.xhtml13
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-14a.xhtml14
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-14b.xhtml14
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-1a.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-2.xhtml13
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-3.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-4.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-5.xhtml28
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-6.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-7.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-8.xhtml11
-rw-r--r--layout/reftests/text/auto-hyphenation-xmllang-9.xhtml12
-rw-r--r--layout/reftests/text/cgj-01-ref.html21
-rw-r--r--layout/reftests/text/cgj-01.html21
-rw-r--r--layout/reftests/text/color-opacity-rtl-1-ref.html18
-rw-r--r--layout/reftests/text/color-opacity-rtl-1.html17
-rw-r--r--layout/reftests/text/color-opacity-rtl-2-ref.html19
-rw-r--r--layout/reftests/text/color-opacity-rtl-2.html17
-rw-r--r--layout/reftests/text/control-chars-01-notref.html11
-rw-r--r--layout/reftests/text/control-chars-01a.html11
-rw-r--r--layout/reftests/text/control-chars-01b.html11
-rw-r--r--layout/reftests/text/control-chars-01c.html11
-rw-r--r--layout/reftests/text/control-chars-01d.html11
-rw-r--r--layout/reftests/text/control-chars-02-notref.html6
-rw-r--r--layout/reftests/text/control-chars-02.html6
-rw-r--r--layout/reftests/text/control-chars-03-ref.html6
-rw-r--r--layout/reftests/text/control-chars-03a.html6
-rw-r--r--layout/reftests/text/control-chars-03b.html10
-rw-r--r--layout/reftests/text/control-chars-04-notref.html11
-rw-r--r--layout/reftests/text/control-chars-04a.html11
-rw-r--r--layout/reftests/text/control-chars-04b.html11
-rw-r--r--layout/reftests/text/control-chars-04c.html11
-rw-r--r--layout/reftests/text/control-chars-04d.html11
-rw-r--r--layout/reftests/text/emoji-01-notref.html19
-rw-r--r--layout/reftests/text/emoji-01.html19
-rw-r--r--layout/reftests/text/emoji-02-notref.html19
-rw-r--r--layout/reftests/text/emoji-02.html20
-rw-r--r--layout/reftests/text/emoji-03-notref.html19
-rw-r--r--layout/reftests/text/emoji-03-ref.html19
-rw-r--r--layout/reftests/text/emoji-03.html19
-rw-r--r--layout/reftests/text/emoji-04-ref.html20
-rw-r--r--layout/reftests/text/emoji-04.html20
-rw-r--r--layout/reftests/text/emoji-05-notref.html20
-rw-r--r--layout/reftests/text/emoji-05.html20
-rw-r--r--layout/reftests/text/ethiopic-wordspace-ref.html17
-rw-r--r--layout/reftests/text/ethiopic-wordspace.html17
-rw-r--r--layout/reftests/text/fallback-01-ref.xhtml19
-rw-r--r--layout/reftests/text/fallback-01.xhtml19
-rw-r--r--layout/reftests/text/fallback-mark-stacking-1-notref.html23
-rw-r--r--layout/reftests/text/fallback-mark-stacking-1.html23
-rw-r--r--layout/reftests/text/font-selection-by-lang-01-ref.html23
-rw-r--r--layout/reftests/text/font-selection-by-lang-01.html20
-rw-r--r--layout/reftests/text/font-selection-fallback-1-ref.html42
-rw-r--r--layout/reftests/text/font-selection-fallback-1.html41
-rw-r--r--layout/reftests/text/font-selection-generic-1-ref.html55
-rw-r--r--layout/reftests/text/font-selection-generic-1.html55
-rw-r--r--layout/reftests/text/font-size-adjust-01-ref.html14
-rw-r--r--layout/reftests/text/font-size-adjust-01.html16
-rw-r--r--layout/reftests/text/font-size-adjust-02-ref.html15
-rw-r--r--layout/reftests/text/font-size-adjust-02.html15
-rw-r--r--layout/reftests/text/font-size-adjust-03-ref.html14
-rw-r--r--layout/reftests/text/font-size-adjust-03.html14
-rw-r--r--layout/reftests/text/glyph-decomposition-graphite-ref.html27
-rw-r--r--layout/reftests/text/glyph-decomposition-graphite.html27
-rw-r--r--layout/reftests/text/glyph-decomposition-opentype-ref.html27
-rw-r--r--layout/reftests/text/glyph-decomposition-opentype.html27
-rw-r--r--layout/reftests/text/graphite-01-ref.html23
-rw-r--r--layout/reftests/text/graphite-01.html23
-rw-r--r--layout/reftests/text/graphite-02-ref.html23
-rw-r--r--layout/reftests/text/graphite-02.html23
-rw-r--r--layout/reftests/text/graphite-03-notref.html21
-rw-r--r--layout/reftests/text/graphite-03a.html22
-rw-r--r--layout/reftests/text/graphite-03b.html25
-rw-r--r--layout/reftests/text/graphite-04-fa.html19
-rw-r--r--layout/reftests/text/graphite-04-ref.html20
-rw-r--r--layout/reftests/text/graphite-04-sd.html19
-rw-r--r--layout/reftests/text/graphite-04-snd.html20
-rw-r--r--layout/reftests/text/graphite-04-ur.html20
-rw-r--r--layout/reftests/text/graphite-04-urd.html19
-rw-r--r--layout/reftests/text/graphite-05-badlang.html20
-rw-r--r--layout/reftests/text/graphite-05-fail.html20
-rw-r--r--layout/reftests/text/graphite-05-feat.html21
-rw-r--r--layout/reftests/text/graphite-05-lang.html21
-rw-r--r--layout/reftests/text/graphite-05-multipass.html21
-rw-r--r--layout/reftests/text/graphite-05-ot-only.html21
-rw-r--r--layout/reftests/text/graphite-05-ref.html20
-rw-r--r--layout/reftests/text/graphite-05-simple.html21
-rw-r--r--layout/reftests/text/graphite-bidi-1-ref.html24
-rw-r--r--layout/reftests/text/graphite-bidi-1.html27
-rw-r--r--layout/reftests/text/graphite-surrogate-selection-ref.html23
-rw-r--r--layout/reftests/text/graphite-surrogate-selection.html23
-rw-r--r--layout/reftests/text/hyphenation-caps-1-ref.html16
-rw-r--r--layout/reftests/text/hyphenation-caps-1.html12
-rw-r--r--layout/reftests/text/hyphenation-control-1-ref.html50
-rw-r--r--layout/reftests/text/hyphenation-control-1.html50
-rw-r--r--layout/reftests/text/hyphenation-control-2-ref.html22
-rw-r--r--layout/reftests/text/hyphenation-control-2.html27
-rw-r--r--layout/reftests/text/hyphenation-control-3-ref.html20
-rw-r--r--layout/reftests/text/hyphenation-control-3.html24
-rw-r--r--layout/reftests/text/hyphenation-control-4-ref.html25
-rw-r--r--layout/reftests/text/hyphenation-control-4.html25
-rw-r--r--layout/reftests/text/hyphenation-control-5-ref.html22
-rw-r--r--layout/reftests/text/hyphenation-control-5.html22
-rw-r--r--layout/reftests/text/hyphenation-control-6-ref.html73
-rw-r--r--layout/reftests/text/hyphenation-control-6.html21
-rw-r--r--layout/reftests/text/hyphenation-control-7-ref.html25
-rw-r--r--layout/reftests/text/hyphenation-control-7.html26
-rw-r--r--layout/reftests/text/initial-zwj-1-ref.html16
-rw-r--r--layout/reftests/text/initial-zwj-1.html16
-rw-r--r--layout/reftests/text/justification-1-ref.html11
-rw-r--r--layout/reftests/text/justification-1.html17
-rw-r--r--layout/reftests/text/justification-2-ref.html12
-rw-r--r--layout/reftests/text/justification-2a.html14
-rw-r--r--layout/reftests/text/justification-2b.html13
-rw-r--r--layout/reftests/text/justification-2c.html13
-rw-r--r--layout/reftests/text/justification-2d.html13
-rw-r--r--layout/reftests/text/justification-cjk-extension-ref.html19
-rw-r--r--layout/reftests/text/justification-cjk-extension.html19
-rw-r--r--layout/reftests/text/justification-space-diacritic-ref.html21
-rw-r--r--layout/reftests/text/justification-space-diacritic.html21
-rw-r--r--layout/reftests/text/kerning-01-notref.html25
-rw-r--r--layout/reftests/text/kerning-01.html20
-rw-r--r--layout/reftests/text/letter-spacing-nolig-1-ref.html13
-rw-r--r--layout/reftests/text/letter-spacing-nolig-1.html13
-rw-r--r--layout/reftests/text/letter-spacing-nolig-2-ref.html17
-rw-r--r--layout/reftests/text/letter-spacing-nolig-2.html17
-rw-r--r--layout/reftests/text/ligature-with-space-1.html20
-rw-r--r--layout/reftests/text/line-editing-1-ref.html17
-rw-r--r--layout/reftests/text/line-editing-1a.html27
-rw-r--r--layout/reftests/text/line-editing-1b.html25
-rw-r--r--layout/reftests/text/line-editing-1c.html25
-rw-r--r--layout/reftests/text/line-editing-1d.html26
-rw-r--r--layout/reftests/text/line-editing-1e.html24
-rw-r--r--layout/reftests/text/lineheight-metrics-1-ref.html17
-rw-r--r--layout/reftests/text/lineheight-metrics-1.html31
-rw-r--r--layout/reftests/text/lineheight-metrics-2-ref.html17
-rw-r--r--layout/reftests/text/lineheight-metrics-2a.html29
-rw-r--r--layout/reftests/text/lineheight-metrics-2b.html29
-rw-r--r--layout/reftests/text/lineheight-percentage-1-ref.html3
-rw-r--r--layout/reftests/text/lineheight-percentage-1.html6
-rw-r--r--layout/reftests/text/long-1.html9
-rw-r--r--layout/reftests/text/long-ref.html8
-rw-r--r--layout/reftests/text/negative-letter-spacing-1-ref.html13
-rw-r--r--layout/reftests/text/negative-letter-spacing-1.html18
-rw-r--r--layout/reftests/text/osx-font-smoothing-2-notref.html23
-rw-r--r--layout/reftests/text/osx-font-smoothing-2-ref.html26
-rw-r--r--layout/reftests/text/osx-font-smoothing-2.html23
-rw-r--r--layout/reftests/text/osx-font-smoothing-ref.html31
-rw-r--r--layout/reftests/text/osx-font-smoothing.html32
-rw-r--r--layout/reftests/text/overflowwrap-04.html18
-rw-r--r--layout/reftests/text/overflowwrap-05.html18
-rw-r--r--layout/reftests/text/overflowwrap-06.html38
-rw-r--r--layout/reftests/text/overflowwrap-07.html13
-rw-r--r--layout/reftests/text/overflowwrap-09.html13
-rw-r--r--layout/reftests/text/overflowwrap-10.html14
-rw-r--r--layout/reftests/text/pre-line-1-ref.html22
-rw-r--r--layout/reftests/text/pre-line-1.html48
-rw-r--r--layout/reftests/text/pre-line-2-ref.html10
-rw-r--r--layout/reftests/text/pre-line-2.html12
-rw-r--r--layout/reftests/text/pre-line-3-ref.html6
-rw-r--r--layout/reftests/text/pre-line-3.html12
-rw-r--r--layout/reftests/text/pre-line-4-ref.html7
-rw-r--r--layout/reftests/text/pre-line-4.html7
-rw-r--r--layout/reftests/text/pre-space-1-ref.html20
-rw-r--r--layout/reftests/text/pre-space-1.html20
-rw-r--r--layout/reftests/text/pre-wrap-1-ref.html27
-rw-r--r--layout/reftests/text/pre-wrap-1.html21
-rw-r--r--layout/reftests/text/reftest.list364
-rw-r--r--layout/reftests/text/rgba-text-ref.html7
-rw-r--r--layout/reftests/text/rgba-text.html12
-rw-r--r--layout/reftests/text/segment-break-transformation-1-ref.html39
-rw-r--r--layout/reftests/text/segment-break-transformation-1.html59
-rw-r--r--layout/reftests/text/soft-hyphen-in-table-1-notref.html18
-rw-r--r--layout/reftests/text/soft-hyphen-in-table-1-ref.html18
-rw-r--r--layout/reftests/text/soft-hyphen-in-table-1.html18
-rw-r--r--layout/reftests/text/soft-hyphen-in-table-2-ref.html18
-rw-r--r--layout/reftests/text/soft-hyphen-in-table-2.html18
-rw-r--r--layout/reftests/text/soft-hyphens-1-ref.html13
-rw-r--r--layout/reftests/text/soft-hyphens-1a.html13
-rw-r--r--layout/reftests/text/soft-hyphens-1b.html13
-rw-r--r--layout/reftests/text/soft-hyphens-1c.html13
-rw-r--r--layout/reftests/text/soft-hyphens-break-word-1-ref.html13
-rw-r--r--layout/reftests/text/soft-hyphens-break-word-1a.html13
-rw-r--r--layout/reftests/text/soft-hyphens-break-word-1b.html13
-rw-r--r--layout/reftests/text/soft-hyphens-break-word-1c.html13
-rw-r--r--layout/reftests/text/space-font-1-ref.html26
-rw-r--r--layout/reftests/text/space-font-1.html28
-rw-r--r--layout/reftests/text/sub-sup-and-line-height-ref.html15
-rw-r--r--layout/reftests/text/sub-sup-and-line-height.html14
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-1a.html29
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-1b.html29
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-2a.html21
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-2b.html21
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-3a.html33
-rw-r--r--layout/reftests/text/subpixel-glyphs-x-3b.html36
-rw-r--r--layout/reftests/text/subpixel-glyphs-y-1a.html30
-rw-r--r--layout/reftests/text/subpixel-glyphs-y-1b.html30
-rw-r--r--layout/reftests/text/subpixel-lineheight-1a.html52
-rw-r--r--layout/reftests/text/subpixel-lineheight-1b.html52
-rw-r--r--layout/reftests/text/swash-1-ref.html7
-rw-r--r--layout/reftests/text/swash-1.html7
-rw-r--r--layout/reftests/text/synthetic-bold-metrics-01-notref.html23
-rw-r--r--layout/reftests/text/synthetic-bold-metrics-01.html26
-rw-r--r--layout/reftests/text/synthetic-bold-papyrus-01-ref.html23
-rw-r--r--layout/reftests/text/synthetic-bold-papyrus-01.html28
-rw-r--r--layout/reftests/text/synthetic-bold-zero-width-01-ref.html35
-rw-r--r--layout/reftests/text/synthetic-bold-zero-width-01.html45
-rw-r--r--layout/reftests/text/text-align-left-in-rtl-block-iframe.html17
-rw-r--r--layout/reftests/text/text-align-left-in-rtl-block-ref.html23
-rw-r--r--layout/reftests/text/text-align-left-in-rtl-block.html25
-rw-r--r--layout/reftests/text/variation-selector-unsupported-1-ref.html20
-rw-r--r--layout/reftests/text/variation-selector-unsupported-1.html20
-rw-r--r--layout/reftests/text/webkit-text-security-1.html138
-rw-r--r--layout/reftests/text/webkit-text-security-2.html20
-rw-r--r--layout/reftests/text/webkit-text-security-3.html20
-rw-r--r--layout/reftests/text/webkit-text-security-4.html20
-rw-r--r--layout/reftests/text/webkit-text-security-5.html20
-rw-r--r--layout/reftests/text/white-space-1-ref.html64
-rw-r--r--layout/reftests/text/white-space-1a.html53
-rw-r--r--layout/reftests/text/white-space-1b.html53
-rw-r--r--layout/reftests/text/white-space-2-ref.html68
-rw-r--r--layout/reftests/text/white-space-2.html54
-rw-r--r--layout/reftests/text/white-space-3-ref.html17
-rw-r--r--layout/reftests/text/white-space-3.html19
-rw-r--r--layout/reftests/text/word-spacing-01-ref.html53
-rw-r--r--layout/reftests/text/word-spacing-01.html46
-rw-r--r--layout/reftests/text/wordbreak-1-ref.html11
-rw-r--r--layout/reftests/text/wordbreak-1.html15
-rw-r--r--layout/reftests/text/wordbreak-3-ref.html13
-rw-r--r--layout/reftests/text/wordbreak-3.html15
-rw-r--r--layout/reftests/text/wordbreak-4b-ref.html13
-rw-r--r--layout/reftests/text/wordbreak-4b.html15
-rw-r--r--layout/reftests/text/wordbreak-5-ref.html13
-rw-r--r--layout/reftests/text/wordbreak-5.html15
-rw-r--r--layout/reftests/text/wordbreak-6-ref.html13
-rw-r--r--layout/reftests/text/wordbreak-6.html15
-rw-r--r--layout/reftests/text/wordbreak-7-ref.html0
-rw-r--r--layout/reftests/text/wordbreak-7.html0
-rw-r--r--layout/reftests/text/wordbreak-7a-ref.html28
-rw-r--r--layout/reftests/text/wordbreak-7a.html30
-rw-r--r--layout/reftests/text/wordbreak-7b-ref.html30
-rw-r--r--layout/reftests/text/wordbreak-7b.html32
-rw-r--r--layout/reftests/text/wordbreak-8-ref.html17
-rw-r--r--layout/reftests/text/wordbreak-8.html19
-rw-r--r--layout/reftests/text/wordbreak-9-ref.html29
-rw-r--r--layout/reftests/text/wordbreak-9.html33
-rw-r--r--layout/reftests/text/wordbreak-dynamic-1-ref.html18
-rw-r--r--layout/reftests/text/wordbreak-dynamic-1.html25
-rw-r--r--layout/reftests/text/wordwrap-01-ref.html19
-rw-r--r--layout/reftests/text/wordwrap-01.html13
-rw-r--r--layout/reftests/text/wordwrap-02-ref.html30
-rw-r--r--layout/reftests/text/wordwrap-02.html23
-rw-r--r--layout/reftests/text/wordwrap-03-ref.html20
-rw-r--r--layout/reftests/text/wordwrap-03.html15
-rw-r--r--layout/reftests/text/wordwrap-04-ref.html10
-rw-r--r--layout/reftests/text/wordwrap-04.html18
-rw-r--r--layout/reftests/text/wordwrap-05-ref.html10
-rw-r--r--layout/reftests/text/wordwrap-05.html18
-rw-r--r--layout/reftests/text/wordwrap-06-ref.html35
-rw-r--r--layout/reftests/text/wordwrap-06.html38
-rw-r--r--layout/reftests/text/wordwrap-07-ref.html10
-rw-r--r--layout/reftests/text/wordwrap-07.html13
-rw-r--r--layout/reftests/text/wordwrap-08-ref.html13
-rw-r--r--layout/reftests/text/wordwrap-08.html13
-rw-r--r--layout/reftests/text/wordwrap-09-ref.html15
-rw-r--r--layout/reftests/text/wordwrap-09.html13
-rw-r--r--layout/reftests/text/wordwrap-10-ref.html14
-rw-r--r--layout/reftests/text/wordwrap-10.html14
-rw-r--r--layout/reftests/text/zwnj-01-notref.html21
-rw-r--r--layout/reftests/text/zwnj-01-ref.html24
-rw-r--r--layout/reftests/text/zwnj-01-ref.xhtml36
-rw-r--r--layout/reftests/text/zwnj-01.html21
-rw-r--r--layout/reftests/text/zwnj-01.xhtml33
-rw-r--r--layout/reftests/text/zwnj-02-ref.xhtml32
-rw-r--r--layout/reftests/text/zwnj-02.xhtml33
928 files changed, 30931 insertions, 0 deletions
diff --git a/layout/reftests/text-decoration/1133392-ref.html b/layout/reftests/text-decoration/1133392-ref.html
new file mode 100644
index 0000000000..ad933fb177
--- /dev/null
+++ b/layout/reftests/text-decoration/1133392-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<title>reftest, bug 1133392</title>
+<style>
+
+p > span {
+ text-decoration: underline;
+}
+
+p > span > span {
+ vertical-align: -2em;
+}
+
+</style>
+
+<p class="state-one"><span>This text<br>
+has <span>an underline</span>.</span></p>
diff --git a/layout/reftests/text-decoration/1133392.html b/layout/reftests/text-decoration/1133392.html
new file mode 100644
index 0000000000..46983a1bd8
--- /dev/null
+++ b/layout/reftests/text-decoration/1133392.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<title>reftest, bug 1133392</title>
+<style>
+
+ p:not(.state-one) > span {
+ text-decoration: underline;
+ }
+
+ p > span > span {
+ vertical-align: -2em;
+ }
+
+ p:not(.state-three) > span > span {
+ visibility: hidden;
+ }
+
+</style>
+
+<p class="state-one"><span>This text<br>
+has <span>an underline</span>.</span></p>
+
+<script>
+
+ var p = document.getElementsByTagName("p")[0];
+ p.offsetLeft; // flush layout
+ document.getElementsByTagName('p')[0].className = 'state-two';
+
+ document.addEventListener("MozReftestInvalidate", step_three);
+ function step_three(event) {
+ document.getElementsByTagName('p')[0].className = 'state-three';
+ document.documentElement.classList.remove("reftest-wait");
+ }
+
+</script>
+
diff --git a/layout/reftests/text-decoration/1159729-offset-adjustment-notref.html b/layout/reftests/text-decoration/1159729-offset-adjustment-notref.html
new file mode 100644
index 0000000000..90431b9a82
--- /dev/null
+++ b/layout/reftests/text-decoration/1159729-offset-adjustment-notref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p {
+ font: 12px Impact, Times, serif;
+}
+span {
+ background: black;
+}
+</style>
+</head>
+<body>
+<p>
+<span>abcxyz</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/1159729-offset-adjustment.html b/layout/reftests/text-decoration/1159729-offset-adjustment.html
new file mode 100644
index 0000000000..cf05dd1880
--- /dev/null
+++ b/layout/reftests/text-decoration/1159729-offset-adjustment.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p {
+ font: 12px Impact, Times, serif;
+}
+span {
+ background: black;
+ text-decoration: overline;
+ text-decoration-style: wavy;
+}
+</style>
+</head>
+<body>
+<p>
+<span>abcxyz</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/1415214-notref.html b/layout/reftests/text-decoration/1415214-notref.html
new file mode 100644
index 0000000000..0e59f2b663
--- /dev/null
+++ b/layout/reftests/text-decoration/1415214-notref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>clip-rect-correctness-ref</title>
+ <style>
+ p {
+ font-size: 4px;
+ }
+ </style>
+ </head>
+ <body>
+ <p style="position: fixed; bottom: 0; margin: 0">
+ <span>link1</span>
+ <span>link2</span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/1415214.html b/layout/reftests/text-decoration/1415214.html
new file mode 100644
index 0000000000..90f9b2dbcb
--- /dev/null
+++ b/layout/reftests/text-decoration/1415214.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <title>clip-rect-correctness</title>
+ <style>
+ p {
+ font-size: 4px;
+ }
+ </style>
+ </head>
+ <body>
+ <p style="position: fixed; bottom: 0; margin: 0">
+ <span style="text-decoration: underline overline line-through">link1</span>
+ <span style="text-decoration: underline overline line-through">link2</span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/641444-1-ref.html b/layout/reftests/text-decoration/641444-1-ref.html
new file mode 100644
index 0000000000..798e49638d
--- /dev/null
+++ b/layout/reftests/text-decoration/641444-1-ref.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Mozilla text-decoration bug if direction:rtl and text-indent &gt; 0</title>
+ <style type="text/css">
+ p { text-decoration: underline; }
+ </style>
+ </head>
+ <body>
+ <div dir="ltr">
+ <p style="margin-left:-1em">text-indent:-1em</p>
+ <p style="margin-left: 0em">text-indent: 0em</p>
+ <p style="margin-left: 1em">text-indent: 1em</p>
+ <p style="margin-left: 2em">text-indent: 2em</p>
+ <p style="margin-left: 3em">text-indent: 3em</p>
+ <p style="margin-left: 4em">text-indent: 4em</p>
+ <p style="margin-left: 5em">text-indent: 5em</p>
+ <p style="margin-left: 6em">text-indent: 6em</p>
+ <p style="margin-left: 7em">text-indent: 7em</p>
+ <p style="margin-left: 8em">text-indent: 8em</p>
+ <p style="margin-left: 9em">text-indent: 9em</p>
+ </div>
+ <div dir="rtl">
+ <p style="margin-right:-1em">text-indent:-1em</p>
+ <p style="margin-right: 0em">text-indent: 0em</p>
+ <p style="margin-right: 1em">text-indent: 1em</p>
+ <p style="margin-right: 2em">text-indent: 2em</p>
+ <p style="margin-right: 3em">text-indent: 3em</p>
+ <p style="margin-right: 4em">text-indent: 4em</p>
+ <p style="margin-right: 5em">text-indent: 5em</p>
+ <p style="margin-right: 6em">text-indent: 6em</p>
+ <p style="margin-right: 7em">text-indent: 7em</p>
+ <p style="margin-right: 8em">text-indent: 8em</p>
+ <p style="margin-right: 9em">text-indent: 9em</p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/641444-1.html b/layout/reftests/text-decoration/641444-1.html
new file mode 100644
index 0000000000..5c5d148ad8
--- /dev/null
+++ b/layout/reftests/text-decoration/641444-1.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Mozilla text-decoration bug if direction:rtl and text-indent &gt; 0</title>
+ <style type="text/css">
+ p { text-decoration: underline; }
+ </style>
+ </head>
+ <body>
+ <div dir="ltr">
+ <p style="text-indent:-1em">text-indent:-1em</p>
+ <p style="text-indent: 0em">text-indent: 0em</p>
+ <p style="text-indent: 1em">text-indent: 1em</p>
+ <p style="text-indent: 2em">text-indent: 2em</p>
+ <p style="text-indent: 3em">text-indent: 3em</p>
+ <p style="text-indent: 4em">text-indent: 4em</p>
+ <p style="text-indent: 5em">text-indent: 5em</p>
+ <p style="text-indent: 6em">text-indent: 6em</p>
+ <p style="text-indent: 7em">text-indent: 7em</p>
+ <p style="text-indent: 8em">text-indent: 8em</p>
+ <p style="text-indent: 9em">text-indent: 9em</p>
+ </div>
+ <div dir="rtl">
+ <p style="text-indent:-1em">text-indent:-1em</p>
+ <p style="text-indent: 0em">text-indent: 0em</p>
+ <p style="text-indent: 1em">text-indent: 1em</p>
+ <p style="text-indent: 2em">text-indent: 2em</p>
+ <p style="text-indent: 3em">text-indent: 3em</p>
+ <p style="text-indent: 4em">text-indent: 4em</p>
+ <p style="text-indent: 5em">text-indent: 5em</p>
+ <p style="text-indent: 6em">text-indent: 6em</p>
+ <p style="text-indent: 7em">text-indent: 7em</p>
+ <p style="text-indent: 8em">text-indent: 8em</p>
+ <p style="text-indent: 9em">text-indent: 9em</p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/676538-1-ref.html b/layout/reftests/text-decoration/676538-1-ref.html
new file mode 100644
index 0000000000..5eb1de74ef
--- /dev/null
+++ b/layout/reftests/text-decoration/676538-1-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+<title>text-decoration alignment</title>
+<meta charset=UTF-8>
+<style>
+
+span.block { position: absolute; top: 0; left: 0; }
+span.dec { text-decoration: underline }
+span.hide { color: transparent }
+
+</style>
+</head>
+<body>
+
+<p style="position: relative">
+ <span class="block" style="margin-top: 16px"><span class="hide"></span><span class="dec" style="color:black ">x<span class="hide">xx</span></span></span>
+ <span class="block" style="margin-top: 08px"><span class="hide">x</span><span class="dec" style="color:fuchsia">x<span class="hide">x</span></span></span>
+ <span class="block" style="margin-top: 00px"><span class="hide">xx</span><span class="dec" style="color:aqua ">x<span class="hide"></span></span></span>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/676538-1.html b/layout/reftests/text-decoration/676538-1.html
new file mode 100644
index 0000000000..837f99abfa
--- /dev/null
+++ b/layout/reftests/text-decoration/676538-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en-US">
+<head>
+<title>text-decoration alignment</title>
+<meta charset=UTF-8>
+<style>
+
+p, span { text-decoration: underline }
+span { vertical-align: 8px }
+p > span { color: fuchsia }
+p > span > span { color: aqua }
+
+em { font-style: normal; font-size: 5em }
+
+</style>
+</head>
+<body>
+
+<p>x<span>x<span>x</span></span></p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/complex-decoration-style-quirks-ref.html b/layout/reftests/text-decoration/complex-decoration-style-quirks-ref.html
new file mode 100644
index 0000000000..fbf2c4bfef
--- /dev/null
+++ b/layout/reftests/text-decoration/complex-decoration-style-quirks-ref.html
@@ -0,0 +1,102 @@
+<style type="text/css">
+p {
+ margin-left: 11px;
+ padding-left: 11px;
+}
+p.dotted span {
+ text-decoration-style: dotted;
+}
+p.dashed span {
+ text-decoration-style: dashed;
+}
+p.wavy span {
+ text-decoration-style: wavy;
+}
+span {
+ text-decoration: underline line-through overline;
+}
+p.relative {
+ margin-left: 24px;
+}
+p.shadow span {
+ position: relative;
+ left: 1em;
+ top: 0.5em;
+}
+</style>
+<div style="font-size: 16px;">
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+</div>
+<div style="font-size: 32px;">
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+</div>
diff --git a/layout/reftests/text-decoration/complex-decoration-style-quirks.html b/layout/reftests/text-decoration/complex-decoration-style-quirks.html
new file mode 100644
index 0000000000..6b2583afe7
--- /dev/null
+++ b/layout/reftests/text-decoration/complex-decoration-style-quirks.html
@@ -0,0 +1,114 @@
+<style type="text/css">
+p {
+ margin-left: 11px;
+ padding-left: 11px;
+}
+p.dotted span {
+ text-decoration-style: dotted;
+}
+p.dashed span {
+ text-decoration-style: dashed;
+}
+p.wavy span {
+ text-decoration-style: wavy;
+}
+span {
+ text-decoration: underline line-through overline;
+}
+p.relative span {
+ position: relative;
+ left: 13px;
+}
+
+p.relative2 > span {
+ position: relative;
+ left: 13px;
+ text-decoration: none;
+}
+
+p.relative2 span span {
+ position: relative;
+ left: -13px;
+}
+
+p.shadow {
+ color: transparent;
+ text-shadow: 1em 0.5em black;
+}
+</style>
+<div style="font-size: 16px;">
+<p class="dotted">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dashed relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="wavy relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+</div>
+<div style="font-size: 32px;">
+<p class="dotted">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dashed relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="wavy relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+</div>
diff --git a/layout/reftests/text-decoration/complex-decoration-style-standards-ref.html b/layout/reftests/text-decoration/complex-decoration-style-standards-ref.html
new file mode 100644
index 0000000000..45ad85d18d
--- /dev/null
+++ b/layout/reftests/text-decoration/complex-decoration-style-standards-ref.html
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<style type="text/css">
+p {
+ margin-left: 11px;
+ padding-left: 11px;
+}
+p.dotted span {
+ text-decoration-style: dotted;
+}
+p.dashed span {
+ text-decoration-style: dashed;
+}
+p.wavy span {
+ text-decoration-style: wavy;
+}
+span {
+ text-decoration: underline line-through overline;
+}
+p.relative {
+ margin-left: 24px;
+}
+p.shadow span {
+ position: relative;
+ left: 1em;
+ top: 0.5em;
+}
+</style>
+<div style="font-size: 16px;">
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+</div>
+<div style="font-size: 32px;">
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;&nbsp;&nbsp;&nbsp;</span>
+</p>
+</div>
diff --git a/layout/reftests/text-decoration/complex-decoration-style-standards.html b/layout/reftests/text-decoration/complex-decoration-style-standards.html
new file mode 100644
index 0000000000..8c7f7fa1f2
--- /dev/null
+++ b/layout/reftests/text-decoration/complex-decoration-style-standards.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<style type="text/css">
+p {
+ margin-left: 11px;
+ padding-left: 11px;
+}
+p.dotted span {
+ text-decoration-style: dotted;
+}
+p.dashed span {
+ text-decoration-style: dashed;
+}
+p.wavy span {
+ text-decoration-style: wavy;
+}
+span {
+ text-decoration: underline line-through overline;
+}
+p.relative span {
+ position: relative;
+ left: 13px;
+}
+
+p.relative2 > span {
+ position: relative;
+ left: 13px;
+ text-decoration: none;
+}
+
+p.relative2 span span {
+ position: relative;
+ left: -13px;
+}
+
+p.shadow {
+ color: transparent;
+ text-shadow: 1em 0.5em black;
+}
+</style>
+<div style="font-size: 16px;">
+<p class="dotted">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dashed relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="wavy relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+</div>
+<div style="font-size: 32px;">
+<p class="dotted">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy relative">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dotted relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dashed relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="wavy relative2">
+<span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span></span>
+</p>
+<p class="dotted shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="dashed shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+<p class="wavy shadow">
+<span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span><span>&nbsp;</span>
+</p>
+</div>
diff --git a/layout/reftests/text-decoration/decoration-color-override-quirks-ref.html b/layout/reftests/text-decoration/decoration-color-override-quirks-ref.html
new file mode 100644
index 0000000000..5b8481674e
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-override-quirks-ref.html
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ <u>hello</u><img src="../backgrounds/red-128-alpha-32x32.png"><font color="purple"><u>hello</u></font>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-color-override-quirks.html b/layout/reftests/text-decoration/decoration-color-override-quirks.html
new file mode 100644
index 0000000000..67e1346b94
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-override-quirks.html
@@ -0,0 +1,5 @@
+<html>
+ <body>
+ <u>hello<img src="../backgrounds/red-128-alpha-32x32.png"><font color="purple">hello</font></u>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-color-override-standards-ref.html b/layout/reftests/text-decoration/decoration-color-override-standards-ref.html
new file mode 100644
index 0000000000..4420e6fc35
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-override-standards-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+ <body>
+ <u>hello<img src="../backgrounds/red-128-alpha-32x32.png"><span style="color: purple;">hello</span></u>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-color-override-standards.html b/layout/reftests/text-decoration/decoration-color-override-standards.html
new file mode 100644
index 0000000000..2be52e67de
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-override-standards.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+ <body>
+ <u>hello<img src="../backgrounds/red-128-alpha-32x32.png"><font color="purple">hello</font></u>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-color-quirks-ref.html b/layout/reftests/text-decoration/decoration-color-quirks-ref.html
new file mode 100644
index 0000000000..0366b7ddba
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-quirks-ref.html
@@ -0,0 +1,75 @@
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p style="color: #008000;
+ text-decoration: underline line-through overline;">
+ <span style="color: #0000FF;">This blue text has green decoration lines</span>
+</p>
+<p style="color: yellow;
+ text-decoration: underline line-through overline;">
+ <span style="color: red;">This red text has yellow decoration lines</span>
+</p>
+<p style="color: red; text-decoration: underline line-through overline;">
+ <span style="color: #0000FF">This blue text has red lines</span>
+</p>
+<p style="color: orange;">
+ This orange text has transparent lines
+</p>
+<p>
+ Here is no decoration lines, but
+ <span style="font-size: 2em;
+ color: green;
+ text-decoration: underline line-through overline;">
+ <span style="color: blue;">
+ this blue text has green decoration lines</span></span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: red;">
+ This is red paragraph and here is no decoration lines, but
+ <span style="font-size: 2em;
+ color: green;
+ text-decoration: underline line-through overline;">
+ <span style="color: red;">here are green decoration lines</span></span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: purple;
+ text-decoration: underline line-through overline;">
+ This is purple paragraph and here are decoration lines of current color, but
+ <span style="font-size: 2em;
+ color: red;
+ text-decoration: underline line-through overline;">
+ <span style="color: purple;">here are red decoration lines</span></span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: green;
+ text-decoration: underline line-through overline;">
+ This is green paragraph and here are decoration lines of current color, and
+ <span style="font-size: 2em;">
+ here is specified red decoration color but has current color lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: red;">
+ here is red text with red decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph and decoration color is specified as green,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ here is red text with green decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration: underline line-through overline;">
+ Here has blue decoration lines even though its color is specified as red
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-color-quirks.html b/layout/reftests/text-decoration/decoration-color-quirks.html
new file mode 100644
index 0000000000..17a93c6d6a
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-quirks.html
@@ -0,0 +1,84 @@
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p style="color: blue;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ This blue text has green decoration lines
+</p>
+<p style="color: #ff0000;
+ text-decoration: underline line-through overline;
+ text-decoration-color: #ffff00;">
+ This red text has yellow decoration lines
+</p>
+<p style="color: rgb(0%, 0%, 100%);
+ text-decoration: underline line-through overline;
+ text-decoration-color: rgb(100%, 0%, 0%);">
+ This blue text has red lines
+</p>
+<p style="color: orange;
+ text-decoration: underline line-through overline;
+ text-decoration-color: transparent;">
+ This orange text has transparent lines
+</p>
+<p>
+ Here is no decoration lines, but
+ <span style="font-size: 2em;
+ color: blue;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ this blue text has green decoration lines</span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: red;">
+ This is red paragraph and here is no decoration lines, but
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ here are green decoration lines</span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: purple;
+ text-decoration: underline line-through overline;">
+ This is purple paragraph and here are decoration lines of current color, but
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-color: red;">
+ here are red decoration lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: green;
+ text-decoration: underline line-through overline;">
+ This is green paragraph and here are decoration lines of current color, and
+ <span style="font-size: 2em;
+ text-decoration-color: red;">
+ here is specified red decoration color but has current color lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: inherit;">
+ here is red text with red decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration-color: green;">
+ This is blue paragraph and decoration color is specified as green,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: inherit;">
+ here is red text with green decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration-color: red;
+ text-decoration: underline line-through overline;">
+ Here has blue decoration lines even though its color is specified as red
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-color-standards-ref.html b/layout/reftests/text-decoration/decoration-color-standards-ref.html
new file mode 100644
index 0000000000..f478fb5083
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-standards-ref.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p style="color: #008000;
+ text-decoration: underline line-through overline;">
+ <span style="color: #0000FF;">This blue text has green decoration lines</span>
+</p>
+<p style="color: yellow;
+ text-decoration: underline line-through overline;">
+ <span style="color: red;">This red text has yellow decoration lines</span>
+</p>
+<p style="color: red;
+ text-decoration: underline line-through overline;">
+ <span style="color: #0000FF">This blue text has red lines</span>
+</p>
+<p style="color: orange;">
+ This orange text has transparent lines
+</p>
+<p>
+ Here is no decoration lines, but
+ <span style="font-size: 2em;
+ color: green;
+ text-decoration: underline line-through overline;">
+ <span style="color: blue;">
+ this blue text has green decoration lines</span></span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: red;">
+ This is red paragraph and here is no decoration lines, but
+ <span style="font-size: 2em;
+ color: green;
+ text-decoration: underline line-through overline;">
+ <span style="color: red;">here are green decoration lines</span></span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: purple;
+ text-decoration: underline line-through overline;">
+ This is purple paragraph and here are decoration lines of current color, but
+ <span style="font-size: 2em;
+ color: red;
+ text-decoration: underline line-through overline;">
+ <span style="color: purple;">here are red decoration lines</span></span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: green;
+ text-decoration: underline line-through overline;">
+ This is green paragraph and here are decoration lines of current color, and
+ <span style="font-size: 2em;">
+ here is specified red decoration color but has current color lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: red;">
+ here is red text with red decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph and decoration color is specified as green,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ here is red text with green decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration: underline line-through overline;">
+ Here has blue decoration lines even though its color is specified as red
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-color-standards.html b/layout/reftests/text-decoration/decoration-color-standards.html
new file mode 100644
index 0000000000..3f8c5938e4
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-color-standards.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p style="color: blue;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ This blue text has green decoration lines
+</p>
+<p style="color: #ff0000;
+ text-decoration: underline line-through overline;
+ text-decoration-color: #ffff00;">
+ This red text has yellow decoration lines
+</p>
+<p style="color: rgb(0%, 0%, 100%);
+ text-decoration: underline line-through overline;
+ text-decoration-color: rgb(100%, 0%, 0%);">
+ This blue text has red lines
+</p>
+<p style="color: orange;
+ text-decoration: underline line-through overline;
+ text-decoration-color: transparent;">
+ This orange text has transparent lines
+</p>
+<p>
+ Here is no decoration lines, but
+ <span style="font-size: 2em; color: blue;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ this blue text has green decoration lines</span>,
+ and here is no decoration lines too.
+</p>
+<p style="color: red;">
+ This is red paragraph and here is no decoration lines, but
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-color: green;">
+ here are green decoration lines</span>,
+ and here is no decoration lines too.</p>
+<p style="color: purple;
+ text-decoration: underline line-through overline;">
+ This is purple paragraph and here are decoration lines of current color, but
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-color: red;">
+ here are red decoration lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: green;
+ text-decoration: underline line-through overline;">
+ This is green paragraph and here are decoration lines of current color, and
+ <span style="font-size: 2em;
+ text-decoration-color: red;">
+ here is specified red decoration color but has current color lines</span>,
+ and here are current color decoration lines.
+</p>
+<p style="color: blue;">
+ This is blue paragraph,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: inherit;">
+ here is red text with red decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration-color: green;">
+ This is blue paragraph and decoration color is specified as green,
+ <span style="font-size:2em;
+ color: red;
+ text-decoration: underline line-through overline;
+ text-decoration-color: inherit;">
+ here is red text with green decoration lines</span>,
+ and here is blue text without decoration lines.
+</p>
+<p style="color: blue;
+ text-decoration-color: red;
+ text-decoration: underline line-through overline;">
+ Here has blue decoration lines even though its color is specified as red
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-css21-block-ref.html b/layout/reftests/text-decoration/decoration-css21-block-ref.html
new file mode 100644
index 0000000000..740f73323e
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-css21-block-ref.html
@@ -0,0 +1,16 @@
+<html>
+ <head>
+ <style>
+ .high {vertical-align: 5em;}
+ .invisible {color: transparent;}
+ </style>
+ </head>
+ <body>
+ <div>
+ <span style="text-decoration: underline;">
+ underline<span class="invisible">continued<span class="invisible">continued</span></span></span>
+ <span class="invisible high">offset<span class="invisible high">offset</span></span>
+ </div>
+ <span style="text-decoration: underline;">also underlined</span>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text-decoration/decoration-css21-block.html b/layout/reftests/text-decoration/decoration-css21-block.html
new file mode 100644
index 0000000000..761fc6a94d
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-css21-block.html
@@ -0,0 +1,14 @@
+<html>
+ <head>
+ <style>
+ .high {vertical-align: 5em;}
+ .invisible {color: transparent;}
+ </style>
+ </head>
+ <body>
+ <div style="text-decoration: underline;">
+ underline<span class="invisible high">continued<span class="invisible high">continued</span></span><br>
+ also underlined
+ </div>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text-decoration/decoration-css21-ref.html b/layout/reftests/text-decoration/decoration-css21-ref.html
new file mode 100644
index 0000000000..14b5844ad6
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-css21-ref.html
@@ -0,0 +1,30 @@
+<html>
+ <head>
+ <style>
+ .sup {vertical-align: super;}
+ .transparent {color: transparent;}
+ .alllines {text-decoration:line-through overline underline; color: purple;}
+ .highRel {position: relative; top: -4em;}
+ .lowRel {position: relative; top: 4em;}
+ .lowVert {vertical-align: -4em;}
+ .highVert {vertical-align: 4em;}
+ * { text-decoration-skip-ink: none;}
+ </style>
+ </head>
+ <body>
+ <p>
+ <span style="text-decoration: underline">Underlined <span class="transparent">still underlined</span></span>
+ <span style="text-decoration: underline">Underlined <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+ <span class="sup transparent">Offset</span>
+ </p>
+ <p>
+ <span class="alllines">
+ Before<span class="transparent">highlow</span>After</span>
+ </span>
+ <span class="highVert transparent">Offset</span><span class="lowVert transparent">text</span>
+ </p>
+ <p>
+ <span class="alllines">Before</span><span class="highRel alllines">high</span><span class="lowRel alllines">low</span><span class="alllines">After</span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-css21.html b/layout/reftests/text-decoration/decoration-css21.html
new file mode 100644
index 0000000000..faaa1af362
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-css21.html
@@ -0,0 +1,30 @@
+<html>
+ <head>
+ <style>
+ .sup {vertical-align: super;}
+ .transparent {color: transparent;}
+ .alllines {text-decoration:line-through overline underline; color: purple;}
+ .highRel {position: relative; top: -4em;}
+ .lowRel {position: relative; top: 4em;}
+ .lowVert {vertical-align: -4em;}
+ .highVert {vertical-align: 4em;}
+ * { text-decoration-skip-ink: none;}
+ </style>
+ </head>
+ <body>
+ <p>
+ <span style="text-decoration: underline">Underlined <span class="sup transparent">still underlined</span></span>
+ <span style="text-decoration: underline">Underlined <span class="sup">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>
+ </p>
+ <p>
+ <span class="alllines">
+ Before<span class="highVert transparent">high</span><span class="lowVert transparent">low</span>After
+ </span>
+ </p>
+ <p>
+ <span class="alllines">
+ Before<span class="highRel">high</span><span class="lowRel">low</span>After</span>
+ </span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/decoration-style-quirks-ref.html b/layout/reftests/text-decoration/decoration-style-quirks-ref.html
new file mode 100644
index 0000000000..cc2ee3df07
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-style-quirks-ref.html
@@ -0,0 +1,54 @@
+<style>
+ p{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p>
+ Here is specified the decoration style as dotted but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: solid;">
+ here has solid decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p>
+ Here is specified the decoration style as dashed but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: dashed;">
+ here has inherited decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p>
+ <span style="text-decoration: underline line-through overline;
+ text-decoration-style: dotted;">
+ Here has dotted decoration lines,
+ </span><span style="text-decoration: underline line-through overline;
+ text-decoration-style: dotted">
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: wavy;">
+ here has wavy decoration
+ lines</span></span><span style="text-decoration: underline line-through overline;
+ text-decoration-style: dotted;">,
+ and here has dotted decoration lines.</span>
+</p>
+<p>
+ <span style="text-decoration: underline line-through overline;
+ text-decoration-style: double;">
+ Here has double decoration lines,
+ <span style="font-size: 2em;">
+ here is specified as dashed decoration lines but should be
+ ignored</span><span style="text-decoration: underline line-through overline;
+ text-decoration-style: double;">,
+ and here has double decoration lines.</span></span>
+</p>
+<p>
+ Here is specified the decoration style as -moz-none.
+</p>
+<p style="text-decoration: underline line-through overline;">
+ Here has solid decoration lines even if its style is specified as dotted
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-style-quirks.html b/layout/reftests/text-decoration/decoration-style-quirks.html
new file mode 100644
index 0000000000..a2c9bf6e62
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-style-quirks.html
@@ -0,0 +1,47 @@
+<style>
+ p{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<p style="text-decoration-style: dotted;">
+ Here is specified the decoration style as dotted but no decoration lines, however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;">
+ here has solid decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p style="text-decoration-style: dashed;">
+ Here is specified the decoration style as dashed but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: inherit;">
+ here has inherited decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: dotted;">
+ Here has dotted decoration lines,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: wavy;">
+ here has wavy decoration lines</span>,
+ and here has dotted decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: double;">
+ Here has double decoration lines,
+ <span style="font-size: 2em;
+ text-decoration-style: dashed;">
+ here is specified as dashed decoration lines but should be ignored</span>,
+ and here has double decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: -moz-none;">
+ Here is specified the decoration style as -moz-none.
+</p>
+<p style="text-decoration-style: dotted;
+ text-decoration: underline line-through overline;">
+ Here has solid decoration lines even if its style is specified as dotted
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-style-standards-ref.html b/layout/reftests/text-decoration/decoration-style-standards-ref.html
new file mode 100644
index 0000000000..28d5c11754
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-style-standards-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<p>
+ Here is specified the decoration style as dotted but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: solid;">
+ here has solid decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p>
+ Here is specified the decoration style as dashed but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: dashed;">
+ here has inherited decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: double;">
+ Here has double decoration lines,
+ <span style="font-size: 2em;
+ text-decoration: none;">
+ here is specified as dashed decoration lines but should be ignored</span>,
+ and here has double decoration lines.
+</p>
+<p>
+ Here is specified the decoration style as -moz-none.
+</p>
+<p style="text-decoration: underline line-through overline;">
+ Here has solid decoration lines even if its style is specified as dotted
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/decoration-style-standards.html b/layout/reftests/text-decoration/decoration-style-standards.html
new file mode 100644
index 0000000000..4ad687e126
--- /dev/null
+++ b/layout/reftests/text-decoration/decoration-style-standards.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<p style="text-decoration-style: dotted;">
+ Here is specified the decoration style as dotted but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;">
+ here has solid decoration lines</span>, and here has no decoration lines.
+</p>
+<p style="text-decoration-style: dashed;">
+ Here is specified the decoration style as dashed but no decoration lines,
+ however,
+ <span style="font-size: 2em;
+ text-decoration: underline line-through overline;
+ text-decoration-style: inherit;">
+ here has inherited decoration lines</span>,
+ and here has no decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: double;">
+ Here has double decoration lines,
+ <span style="font-size: 2em;
+ text-decoration-style: dashed;">
+ here is specified as dashed decoration lines but should be ignored</span>,
+ and here has double decoration lines.
+</p>
+<p style="text-decoration: underline line-through overline;
+ text-decoration-style: -moz-none;">
+ Here is specified the decoration style as -moz-none.
+</p>
+<p style="text-decoration-style: dotted;
+ text-decoration: underline line-through overline;">
+ Here has solid decoration lines even if its style is specified as dotted
+ before text-decoration.
+</p>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html
new file mode 100644
index 0000000000..915f3a7bb8
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1-ref.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+<style>
+.underline {
+ text-decoration: underline;
+}
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p class="underline">
+<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
+<span class="align-top">This</span> line has a top vertical align span.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html
new file mode 100644
index 0000000000..da84798e41
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-1.html
@@ -0,0 +1,26 @@
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function addUnderline() {
+ var element = document.getElementById("dynamicUnderline");
+ element.style.textDecoration = "underline";
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener('MozReftestInvalidate', addUnderline);
+</script>
+<style>
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p id="dynamicUnderline">
+<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
+<span class="align-top">This</span> line has a top vertical align span.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html
new file mode 100644
index 0000000000..7a1ba472fe
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2-ref.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+<style>
+.underline {
+ text-decoration: underline;
+}
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p class="underline">
+<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
+<span class="align-top">This line has a top vertical align span.</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html
new file mode 100644
index 0000000000..9f0ca070a7
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-quirks-2.html
@@ -0,0 +1,26 @@
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function addUnderline() {
+ var element = document.getElementById("dynamicUnderline");
+ element.style.textDecoration = "underline";
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener('MozReftestInvalidate', addUnderline);
+</script>
+<style>
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p id="dynamicUnderline">
+<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
+<span class="align-top">This line has a top vertical align span.</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html
new file mode 100644
index 0000000000..01ba4d9b6c
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.underline {
+ text-decoration: underline;
+}
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p class="underline">
+<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
+<span class="align-top">This</span> line has a top vertical align span.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html
new file mode 100644
index 0000000000..64ca1f1252
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function addUnderline() {
+ var element = document.getElementById("dynamicUnderline");
+ element.style.textDecoration = "underline";
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener('MozReftestInvalidate', addUnderline);
+</script>
+<style>
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p id="dynamicUnderline">
+<span class="align-bottom">This</span> line has a bottom vertical align span. <br />
+<span class="align-top">This</span> line has a top vertical align span.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html
new file mode 100644
index 0000000000..fb465cce22
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+.underline {
+ text-decoration: underline;
+}
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p class="underline">
+<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
+<span class="align-top">This line has a top vertical align span.</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html
new file mode 100644
index 0000000000..d9b23e33fd
--- /dev/null
+++ b/layout/reftests/text-decoration/dynamic-underline-vertical-align-standards-2.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function addUnderline() {
+ var element = document.getElementById("dynamicUnderline");
+ element.style.textDecoration = "underline";
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener('MozReftestInvalidate', addUnderline);
+</script>
+<style>
+.align-bottom {
+ vertical-align: bottom;
+}
+.align-top {
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<p id="dynamicUnderline">
+<span class="align-bottom">This line has only a bottom vertical align span.</span> <br />
+<span class="align-top">This line has a top vertical align span.</span>
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/emphasis-style-dynamic-ref.html b/layout/reftests/text-decoration/emphasis-style-dynamic-ref.html
new file mode 100644
index 0000000000..786be94023
--- /dev/null
+++ b/layout/reftests/text-decoration/emphasis-style-dynamic-ref.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<html lang="ja">
+<meta charset="UTF-8">
+<title>Bug 1229278 - Dynamic change to text-emphasis-style</title>
+<style>
+ div {
+ line-height: 5;
+ text-emphasis-style: filled triangle;
+ }
+</style>
+<div>テスト</div>
+</html>
diff --git a/layout/reftests/text-decoration/emphasis-style-dynamic.html b/layout/reftests/text-decoration/emphasis-style-dynamic.html
new file mode 100644
index 0000000000..3e9b920eb0
--- /dev/null
+++ b/layout/reftests/text-decoration/emphasis-style-dynamic.html
@@ -0,0 +1,20 @@
+<!doctype html>
+<html lang="ja" class="reftest-wait">
+<meta charset="UTF-8">
+<title>Bug 1229278 - Dynamic change to text-emphasis-style</title>
+<style>
+ div {
+ line-height: 5;
+ text-emphasis-style: filled triangle;
+ }
+ .reftest-wait div {
+ text-emphasis-style: filled circle;
+ }
+</style>
+<div>テスト</div>
+<script>
+ document.addEventListener("MozReftestInvalidate", function() {
+ document.documentElement.className = "";
+ });
+</script>
+</html>
diff --git a/layout/reftests/text-decoration/inline-baseline-almost-standards-ref.html b/layout/reftests/text-decoration/inline-baseline-almost-standards-ref.html
new file mode 100644
index 0000000000..4d193d6c99
--- /dev/null
+++ b/layout/reftests/text-decoration/inline-baseline-almost-standards-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <title>test for bug 223764 (Almost-standards)</title>
+ <body>
+ <p style="overflow: hidden; padding-bottom: 20px;">
+ <span style="font-size: 100px;"><span style="font-size: 20px">hello</span></span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/inline-baseline-almost-standards.html b/layout/reftests/text-decoration/inline-baseline-almost-standards.html
new file mode 100644
index 0000000000..71bdfc14b8
--- /dev/null
+++ b/layout/reftests/text-decoration/inline-baseline-almost-standards.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+ <title>test for bug 223764 (Almost-standards)</title>
+ <body>
+ <p style="overflow: hidden; padding-bottom: 20px;">
+ <span style="font-size: 100px; text-decoration:underline"><span style="font-size: 20px">hello</span></span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/inline-baseline-quirks-ref.html b/layout/reftests/text-decoration/inline-baseline-quirks-ref.html
new file mode 100644
index 0000000000..a1f2bd5aea
--- /dev/null
+++ b/layout/reftests/text-decoration/inline-baseline-quirks-ref.html
@@ -0,0 +1,8 @@
+<html>
+ <title>test for bug 223764 (Quirks)</title>
+ <body>
+ <p style="overflow: hidden; padding-bottom: 20px;">
+ <span style="font-size: 100px;"><span style="font-size: 20px">hello</span></span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/inline-baseline-quirks.html b/layout/reftests/text-decoration/inline-baseline-quirks.html
new file mode 100644
index 0000000000..599b1e8da0
--- /dev/null
+++ b/layout/reftests/text-decoration/inline-baseline-quirks.html
@@ -0,0 +1,8 @@
+<html>
+ <title>test for bug 223764 (Quirks)</title>
+ <body>
+ <p style="overflow: hidden; padding-bottom: 20px;">
+ <span style="font-size: 100px; text-decoration:underline"><span style="font-size: 20px">hello</span></span>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/line-through-style-block-dashed-quirks.html b/layout/reftests/text-decoration/line-through-style-block-dashed-quirks.html
new file mode 100644
index 0000000000..77503d4669
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-dashed-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through; text-decoration-style: dashed;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-dashed-standards.html b/layout/reftests/text-decoration/line-through-style-block-dashed-standards.html
new file mode 100644
index 0000000000..782a237cb8
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through; text-decoration-style: dashed;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-dotted-quirks.html b/layout/reftests/text-decoration/line-through-style-block-dotted-quirks.html
new file mode 100644
index 0000000000..6e6741ccf6
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-dotted-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through; text-decoration-style: dotted;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-dotted-standards.html b/layout/reftests/text-decoration/line-through-style-block-dotted-standards.html
new file mode 100644
index 0000000000..6151a80eed
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through; text-decoration-style: dotted;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-double-quirks.html b/layout/reftests/text-decoration/line-through-style-block-double-quirks.html
new file mode 100644
index 0000000000..47ea921443
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-double-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through; text-decoration-style: double;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-double-standards.html b/layout/reftests/text-decoration/line-through-style-block-double-standards.html
new file mode 100644
index 0000000000..1439dcb791
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through; text-decoration-style: double;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-quirks-ref.html b/layout/reftests/text-decoration/line-through-style-block-quirks-ref.html
new file mode 100644
index 0000000000..53c4a2fd4a
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-quirks-ref.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-solid-quirks.html b/layout/reftests/text-decoration/line-through-style-block-solid-quirks.html
new file mode 100644
index 0000000000..0ff5cc0028
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-solid-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through; text-decoration-style: solid;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-solid-standards.html b/layout/reftests/text-decoration/line-through-style-block-solid-standards.html
new file mode 100644
index 0000000000..9d49671152
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through; text-decoration-style: solid;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-standards-ref.html b/layout/reftests/text-decoration/line-through-style-block-standards-ref.html
new file mode 100644
index 0000000000..cea0d3718b
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-wavy-quirks.html b/layout/reftests/text-decoration/line-through-style-block-wavy-quirks.html
new file mode 100644
index 0000000000..437b2c3348
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-wavy-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: line-through; text-decoration-style: wavy;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-block-wavy-standards.html b/layout/reftests/text-decoration/line-through-style-block-wavy-standards.html
new file mode 100644
index 0000000000..f00c7a48f8
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-block-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: line-through; text-decoration-style: wavy;">This paragraph has line-through</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-dashed-quirks.html b/layout/reftests/text-decoration/line-through-style-inline-dashed-quirks.html
new file mode 100644
index 0000000000..ae0e01e6d5
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-dashed-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: dashed;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-dashed-standards.html b/layout/reftests/text-decoration/line-through-style-inline-dashed-standards.html
new file mode 100644
index 0000000000..588f85e2d8
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: dashed;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-dotted-quirks.html b/layout/reftests/text-decoration/line-through-style-inline-dotted-quirks.html
new file mode 100644
index 0000000000..f47816e564
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-dotted-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: dotted;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-dotted-standards.html b/layout/reftests/text-decoration/line-through-style-inline-dotted-standards.html
new file mode 100644
index 0000000000..1096674d40
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: dotted;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-double-quirks.html b/layout/reftests/text-decoration/line-through-style-inline-double-quirks.html
new file mode 100644
index 0000000000..9daf8458c1
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-double-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: double;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-double-standards.html b/layout/reftests/text-decoration/line-through-style-inline-double-standards.html
new file mode 100644
index 0000000000..2db67bd36d
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: double;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-quirks-ref.html b/layout/reftests/text-decoration/line-through-style-inline-quirks-ref.html
new file mode 100644
index 0000000000..789426b018
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-quirks-ref.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-solid-quirks.html b/layout/reftests/text-decoration/line-through-style-inline-solid-quirks.html
new file mode 100644
index 0000000000..746f67ce15
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-solid-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: solid;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-solid-standards.html b/layout/reftests/text-decoration/line-through-style-inline-solid-standards.html
new file mode 100644
index 0000000000..a59ba91fb4
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: solid;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-standards-ref.html b/layout/reftests/text-decoration/line-through-style-inline-standards-ref.html
new file mode 100644
index 0000000000..8b401685f8
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-wavy-quirks.html b/layout/reftests/text-decoration/line-through-style-inline-wavy-quirks.html
new file mode 100644
index 0000000000..1f89c11ef4
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-wavy-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: wavy;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/line-through-style-inline-wavy-standards.html b/layout/reftests/text-decoration/line-through-style-inline-wavy-standards.html
new file mode 100644
index 0000000000..6914b74542
--- /dev/null
+++ b/layout/reftests/text-decoration/line-through-style-inline-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: line-through; text-decoration-style: wavy;">here has line-through</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-dashed-quirks.html b/layout/reftests/text-decoration/overline-style-block-dashed-quirks.html
new file mode 100644
index 0000000000..09b78f7117
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-dashed-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline; text-decoration-style: dashed;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-dashed-standards.html b/layout/reftests/text-decoration/overline-style-block-dashed-standards.html
new file mode 100644
index 0000000000..9204157cfb
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline; text-decoration-style: dashed;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-dotted-quirks.html b/layout/reftests/text-decoration/overline-style-block-dotted-quirks.html
new file mode 100644
index 0000000000..5f8d676e88
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-dotted-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline; text-decoration-style: dotted;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-dotted-standards.html b/layout/reftests/text-decoration/overline-style-block-dotted-standards.html
new file mode 100644
index 0000000000..b653753b42
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline; text-decoration-style: dotted;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-double-quirks.html b/layout/reftests/text-decoration/overline-style-block-double-quirks.html
new file mode 100644
index 0000000000..37bb368007
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-double-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline; text-decoration-style: double;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-double-standards.html b/layout/reftests/text-decoration/overline-style-block-double-standards.html
new file mode 100644
index 0000000000..2bce4cc1d7
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline; text-decoration-style: double;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-quirks-ref.html b/layout/reftests/text-decoration/overline-style-block-quirks-ref.html
new file mode 100644
index 0000000000..07353927d9
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-quirks-ref.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-solid-quirks.html b/layout/reftests/text-decoration/overline-style-block-solid-quirks.html
new file mode 100644
index 0000000000..b8d6f30c97
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-solid-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline; text-decoration-style: solid;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-solid-standards.html b/layout/reftests/text-decoration/overline-style-block-solid-standards.html
new file mode 100644
index 0000000000..e795637836
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline; text-decoration-style: solid;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-standards-ref.html b/layout/reftests/text-decoration/overline-style-block-standards-ref.html
new file mode 100644
index 0000000000..c349ca362f
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-wavy-quirks.html b/layout/reftests/text-decoration/overline-style-block-wavy-quirks.html
new file mode 100644
index 0000000000..b3e159e320
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-wavy-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: overline; text-decoration-style: wavy;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-block-wavy-standards.html b/layout/reftests/text-decoration/overline-style-block-wavy-standards.html
new file mode 100644
index 0000000000..ac34fc5ac1
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-block-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: overline; text-decoration-style: wavy;">This paragraph has overline</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-dashed-quirks.html b/layout/reftests/text-decoration/overline-style-inline-dashed-quirks.html
new file mode 100644
index 0000000000..bed18d95a6
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-dashed-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: dashed;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-dashed-standards.html b/layout/reftests/text-decoration/overline-style-inline-dashed-standards.html
new file mode 100644
index 0000000000..a5ce662f38
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: dashed;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-dotted-quirks.html b/layout/reftests/text-decoration/overline-style-inline-dotted-quirks.html
new file mode 100644
index 0000000000..fd8bcf88ad
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-dotted-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: dotted;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-dotted-standards.html b/layout/reftests/text-decoration/overline-style-inline-dotted-standards.html
new file mode 100644
index 0000000000..be2f98c755
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: dotted;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-double-quirks.html b/layout/reftests/text-decoration/overline-style-inline-double-quirks.html
new file mode 100644
index 0000000000..a481122aee
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-double-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: double;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-double-standards.html b/layout/reftests/text-decoration/overline-style-inline-double-standards.html
new file mode 100644
index 0000000000..b305725016
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: double;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-quirks-ref.html b/layout/reftests/text-decoration/overline-style-inline-quirks-ref.html
new file mode 100644
index 0000000000..a0a2c6c3f7
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-quirks-ref.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-solid-quirks.html b/layout/reftests/text-decoration/overline-style-inline-solid-quirks.html
new file mode 100644
index 0000000000..fb9b72332f
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-solid-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: solid;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-solid-standards.html b/layout/reftests/text-decoration/overline-style-inline-solid-standards.html
new file mode 100644
index 0000000000..d02f2021e2
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: solid;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-standards-ref.html b/layout/reftests/text-decoration/overline-style-inline-standards-ref.html
new file mode 100644
index 0000000000..c4890983a8
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-wavy-quirks.html b/layout/reftests/text-decoration/overline-style-inline-wavy-quirks.html
new file mode 100644
index 0000000000..6b1829c7d9
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-wavy-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: wavy;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/overline-style-inline-wavy-standards.html b/layout/reftests/text-decoration/overline-style-inline-wavy-standards.html
new file mode 100644
index 0000000000..bd8e24268a
--- /dev/null
+++ b/layout/reftests/text-decoration/overline-style-inline-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: overline; text-decoration-style: wavy;">here has overline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/reftest.list b/layout/reftests/text-decoration/reftest.list
new file mode 100644
index 0000000000..7abaaa3275
--- /dev/null
+++ b/layout/reftests/text-decoration/reftest.list
@@ -0,0 +1,121 @@
+fuzzy-if(gtkWidget,0-208,0-12) == complex-decoration-style-quirks.html complex-decoration-style-quirks-ref.html
+fuzzy-if(gtkWidget,0-208,0-12) == complex-decoration-style-standards.html complex-decoration-style-standards-ref.html
+== decoration-color-quirks.html decoration-color-quirks-ref.html
+== decoration-color-standards.html decoration-color-standards-ref.html
+== decoration-style-quirks.html decoration-style-quirks-ref.html
+== decoration-style-standards.html decoration-style-standards-ref.html
+== dynamic-underline-vertical-align-quirks-1.html dynamic-underline-vertical-align-quirks-1-ref.html
+== dynamic-underline-vertical-align-standards-1.html dynamic-underline-vertical-align-standards-1-ref.html
+== dynamic-underline-vertical-align-quirks-2.html dynamic-underline-vertical-align-quirks-2-ref.html
+== dynamic-underline-vertical-align-standards-2.html dynamic-underline-vertical-align-standards-2-ref.html
+== line-through-style-block-solid-quirks.html line-through-style-block-quirks-ref.html
+!= line-through-style-block-dotted-quirks.html line-through-style-block-quirks-ref.html
+!= line-through-style-block-dashed-quirks.html line-through-style-block-quirks-ref.html
+!= line-through-style-block-double-quirks.html line-through-style-block-quirks-ref.html
+!= line-through-style-block-wavy-quirks.html line-through-style-block-quirks-ref.html
+== line-through-style-inline-solid-quirks.html line-through-style-inline-quirks-ref.html
+!= line-through-style-inline-dotted-quirks.html line-through-style-inline-quirks-ref.html
+!= line-through-style-inline-dashed-quirks.html line-through-style-inline-quirks-ref.html
+!= line-through-style-inline-double-quirks.html line-through-style-inline-quirks-ref.html
+!= line-through-style-inline-wavy-quirks.html line-through-style-inline-quirks-ref.html
+== line-through-style-block-solid-standards.html line-through-style-block-standards-ref.html
+!= line-through-style-block-dotted-standards.html line-through-style-block-standards-ref.html
+!= line-through-style-block-dashed-standards.html line-through-style-block-standards-ref.html
+!= line-through-style-block-double-standards.html line-through-style-block-standards-ref.html
+!= line-through-style-block-wavy-standards.html line-through-style-block-standards-ref.html
+== line-through-style-inline-solid-standards.html line-through-style-inline-standards-ref.html
+!= line-through-style-inline-dotted-standards.html line-through-style-inline-standards-ref.html
+!= line-through-style-inline-dashed-standards.html line-through-style-inline-standards-ref.html
+!= line-through-style-inline-double-standards.html line-through-style-inline-standards-ref.html
+!= line-through-style-inline-wavy-standards.html line-through-style-inline-standards-ref.html
+== overline-style-block-solid-quirks.html overline-style-block-quirks-ref.html
+!= overline-style-block-dotted-quirks.html overline-style-block-quirks-ref.html
+!= overline-style-block-dashed-quirks.html overline-style-block-quirks-ref.html
+!= overline-style-block-double-quirks.html overline-style-block-quirks-ref.html
+!= overline-style-block-wavy-quirks.html overline-style-block-quirks-ref.html
+== overline-style-inline-solid-quirks.html overline-style-inline-quirks-ref.html
+!= overline-style-inline-dotted-quirks.html overline-style-inline-quirks-ref.html
+!= overline-style-inline-dashed-quirks.html overline-style-inline-quirks-ref.html
+!= overline-style-inline-double-quirks.html overline-style-inline-quirks-ref.html
+!= overline-style-inline-wavy-quirks.html overline-style-inline-quirks-ref.html
+== overline-style-block-solid-standards.html overline-style-block-standards-ref.html
+!= overline-style-block-dotted-standards.html overline-style-block-standards-ref.html
+!= overline-style-block-dashed-standards.html overline-style-block-standards-ref.html
+!= overline-style-block-double-standards.html overline-style-block-standards-ref.html
+!= overline-style-block-wavy-standards.html overline-style-block-standards-ref.html
+== overline-style-inline-solid-standards.html overline-style-inline-standards-ref.html
+!= overline-style-inline-dotted-standards.html overline-style-inline-standards-ref.html
+!= overline-style-inline-dashed-standards.html overline-style-inline-standards-ref.html
+!= overline-style-inline-double-standards.html overline-style-inline-standards-ref.html
+!= overline-style-inline-wavy-standards.html overline-style-inline-standards-ref.html
+== underline-style-block-solid-quirks.html underline-style-block-quirks-ref.html
+!= underline-style-block-dotted-quirks.html underline-style-block-quirks-ref.html
+!= underline-style-block-dashed-quirks.html underline-style-block-quirks-ref.html
+!= underline-style-block-double-quirks.html underline-style-block-quirks-ref.html
+!= underline-style-block-wavy-quirks.html underline-style-block-quirks-ref.html
+== underline-style-inline-solid-quirks.html underline-style-inline-quirks-ref.html
+!= underline-style-inline-dotted-quirks.html underline-style-inline-quirks-ref.html
+!= underline-style-inline-dashed-quirks.html underline-style-inline-quirks-ref.html
+!= underline-style-inline-double-quirks.html underline-style-inline-quirks-ref.html
+!= underline-style-inline-wavy-quirks.html underline-style-inline-quirks-ref.html
+== underline-style-block-solid-standards.html underline-style-block-standards-ref.html
+!= underline-style-block-dotted-standards.html underline-style-block-standards-ref.html
+!= underline-style-block-dashed-standards.html underline-style-block-standards-ref.html
+!= underline-style-block-double-standards.html underline-style-block-standards-ref.html
+!= underline-style-block-wavy-standards.html underline-style-block-standards-ref.html
+== underline-style-inline-solid-standards.html underline-style-inline-standards-ref.html
+!= underline-style-inline-dotted-standards.html underline-style-inline-standards-ref.html
+!= underline-style-inline-dashed-standards.html underline-style-inline-standards-ref.html
+!= underline-style-inline-double-standards.html underline-style-inline-standards-ref.html
+!= underline-style-inline-wavy-standards.html underline-style-inline-standards-ref.html
+== underline-block-quirks.html underline-block-quirks-ref.html
+!= underline-block-quirks.html underline-block-quirks-notref.html
+== underline-inline-block-quirks.html underline-inline-block-quirks-ref.html
+!= underline-inline-block-quirks.html underline-inline-block-quirks-notref.html
+== underline-table-caption-quirks.html underline-table-caption-quirks-ref.html
+!= underline-table-caption-quirks.html underline-table-caption-quirks-notref.html
+== underline-table-cell-quirks.html underline-table-cell-quirks-ref.html
+!= underline-table-cell-quirks.html underline-table-cell-quirks-notref.html
+== underline-block-propagation-quirks.html underline-block-propagation-quirks-ref.html
+== underline-block-propagation-2-quirks.html underline-block-propagation-2-quirks-ref.html
+== underline-block-standards.html underline-block-standards-ref.html
+!= underline-block-standards.html underline-block-standards-notref.html
+== underline-inline-block-standards.html underline-inline-block-standards-ref.html
+!= underline-inline-block-standards.html underline-inline-block-standards-notref.html
+== underline-table-caption-standards.html underline-table-caption-standards-ref.html
+!= underline-table-caption-standards.html underline-table-caption-standards-notref.html
+== underline-table-cell-standards.html underline-table-cell-standards-ref.html
+!= underline-table-cell-standards.html underline-table-cell-standards-notref.html
+== underline-block-propagation-standards.html underline-block-propagation-standards-ref.html
+== underline-block-propagation-2-standards.html underline-block-propagation-2-standards-ref.html
+== text-decoration-zorder-1-standards.html text-decoration-zorder-1-ref.html
+== text-decoration-zorder-1-quirks.html text-decoration-zorder-1-ref.html
+== table-quirk-1.html table-quirk-1-ref.html
+== table-quirk-2.html table-quirk-2-ref.html
+== text-decoration-propagation-1-quirks.html text-decoration-propagation-1-quirks-ref.html
+== text-decoration-propagation-1-standards.html text-decoration-propagation-1-standards-ref.html
+== 641444-1.html 641444-1-ref.html
+== decoration-css21.html decoration-css21-ref.html
+fuzzy-if(cocoaWidget,0-1,0-5) == decoration-color-override-quirks.html decoration-color-override-quirks-ref.html
+== decoration-color-override-standards.html decoration-color-override-standards-ref.html
+!= decoration-color-override-standards-ref.html decoration-color-override-quirks-ref.html
+== decoration-css21-block.html decoration-css21-block-ref.html
+!= inline-baseline-almost-standards.html inline-baseline-almost-standards-ref.html
+!= inline-baseline-quirks.html inline-baseline-quirks-ref.html
+== 676538-1.html 676538-1-ref.html
+== underline-button-1.html underline-button-1-ref.html
+== underline-button-2.html underline-button-2-ref.html
+fuzzy(0-4,0-2) == underline-select-1.html underline-select-1-ref.html
+== underline-select-2.html underline-select-2-ref.html
+== 1133392.html 1133392-ref.html
+!= 1159729-offset-adjustment.html 1159729-offset-adjustment-notref.html
+== emphasis-style-dynamic.html emphasis-style-dynamic-ref.html
+== vertical-mode-decorations-1.html vertical-mode-decorations-1-ref.html
+fuzzy-if(Android,0-238,0-36) == vertical-mode-decorations-2.html vertical-mode-decorations-2-ref.html
+!= 1415214.html 1415214-notref.html
+== skip-ink-multiline-position.html skip-ink-multiline-position-ref.html
+== skip-ink-vertical-align.html skip-ink-vertical-align-ref.html
+!= skip-ink-vertical-align-2.html skip-ink-vertical-align-2-notref.html
+fuzzy(0-94,0-4) == skip-ink-cjk-1.html skip-ink-cjk-1-ref.html
+== skip-ink-cjk-2.html skip-ink-cjk-2-ref.html
+== skip-ink-cjk-3.html skip-ink-cjk-3-ref.html
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-1-ref.html b/layout/reftests/text-decoration/skip-ink-cjk-1-ref.html
new file mode 100644
index 0000000000..fd0a816f01
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="ja">
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: 1px;
+}
+span {
+ text-decoration-skip-ink: none;
+}
+</style>
+<div>The underline should skip descenders on the English but not the Japanese:</div>
+<div class=test>skipping <span>土砂災害警戒情報</span> skipping</div>
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-1.html b/layout/reftests/text-decoration/skip-ink-cjk-1.html
new file mode 100644
index 0000000000..3dbe2c7f6b
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html lang="ja">
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: 1px;
+}
+</style>
+<div>The underline should skip descenders on the English but not the Japanese:</div>
+<div class=test>skipping 土砂災害警戒情報 skipping</div>
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-2-ref.html b/layout/reftests/text-decoration/skip-ink-cjk-2-ref.html
new file mode 100644
index 0000000000..2e28752e15
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="ja">
+<!-- lang=ja will cause the default japanese font to be used throughout -->
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: -1px; /* make underline clash with digits etc */
+ text-decoration-skip-ink: none;
+}
+</style>
+<div>The underline should not skip-ink in Japanese runs, even on embedded "common" characters:</div>
+<div class=test>黄砂情報 実況図 / 予測図</div>
+<div class=test>気象衛星 10分ごと / 2.5分ごと</div>
+<div class=test>レーダー•ナウキャスト(降水•雷•竜巻)</div>
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-2.html b/layout/reftests/text-decoration/skip-ink-cjk-2.html
new file mode 100644
index 0000000000..5d180d57c3
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="ja">
+<!-- lang=ja will cause the default japanese font to be used throughout -->
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: -1px; /* make underline clash with digits etc */
+}
+</style>
+<div>The underline should not skip-ink in Japanese runs, even on embedded "common" characters:</div>
+<div class=test>黄砂情報 実況図 / 予測図</div>
+<div class=test>気象衛星 10分ごと / 2.5分ごと</div>
+<div class=test>レーダー•ナウキャスト(降水•雷•竜巻)</div>
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-3-ref.html b/layout/reftests/text-decoration/skip-ink-cjk-3-ref.html
new file mode 100644
index 0000000000..49829ffb6a
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-3-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en">
+<!-- lang=en will result in a mix of western and japanese fonts -->
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: -1px; /* make underline clash with digits etc */
+ text-decoration-skip-ink: none;
+}
+</style>
+<div>The underline should not skip-ink in Japanese runs, even on embedded "common" characters:</div>
+<div class=test>黄砂情報 実況図 / 予測図</div>
+<div class=test>気象衛星 10分ごと / 2.5分ごと</div>
+<div class=test>レーダー•ナウキャスト(降水•雷•竜巻)</div>
diff --git a/layout/reftests/text-decoration/skip-ink-cjk-3.html b/layout/reftests/text-decoration/skip-ink-cjk-3.html
new file mode 100644
index 0000000000..7782f74929
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-cjk-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="en">
+<!-- lang=en will result in a mix of western and japanese fonts -->
+<meta charset="utf-8">
+<style>
+body {
+ font: 16px/2 sans-serif;
+}
+.test {
+ font: 32px sans-serif;
+ text-decoration: 2px red underline;
+ text-underline-offset: -1px; /* make underline clash with digits etc */
+}
+</style>
+<div>The underline should not skip-ink in Japanese runs, even on embedded "common" characters:</div>
+<div class=test>黄砂情報 実況図 / 予測図</div>
+<div class=test>気象衛星 10分ごと / 2.5分ごと</div>
+<div class=test>レーダー•ナウキャスト(降水•雷•竜巻)</div>
diff --git a/layout/reftests/text-decoration/skip-ink-multiline-position-ref.html b/layout/reftests/text-decoration/skip-ink-multiline-position-ref.html
new file mode 100644
index 0000000000..5d264244ad
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-multiline-position-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Reference case for text-decoration-skip-ink: text on the second line should not change the position of the first line's underline</title>
+ <style>
+ @font-face {
+ font-family: awami;
+ src: url("../fonts/AwamiNastaliq-Regular.woff");
+ }
+ div{
+ font: 36px/2 awami, sans-serif;
+ unicode-bidi:bidi-override;
+ width: 70px;
+ height: 70px;
+ overflow: hidden;
+ text-decoration: red underline;
+ text-underline-offset: -0.5em;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Adding more characters on the second line should not affect the position of the underline on line one. <br>See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1572302"> Bug 1572302</a> </p>
+ <div dir="rtl">fی sعلي</div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/skip-ink-multiline-position.html b/layout/reftests/text-decoration/skip-ink-multiline-position.html
new file mode 100644
index 0000000000..ab7dcefa62
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-multiline-position.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Test case for text-decoration-skip-ink: text on the second line should not change the position of the first line's underline</title>
+ <style>
+ @font-face {
+ font-family: awami;
+ src: url("../fonts/AwamiNastaliq-Regular.woff");
+ }
+ div{
+ font: 36px/2 awami, sans-serif;
+ unicode-bidi:bidi-override;
+ width: 70px;
+ height: 70px;
+ overflow: hidden;
+ text-decoration: red underline;
+ text-underline-offset: -0.5em;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Adding more characters on the second line should not affect the position of the underline on line one. <br>See <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1572302"> Bug 1572302</a> </p>
+ <div dir="rtl">fی علي</div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/skip-ink-vertical-align-2-notref.html b/layout/reftests/text-decoration/skip-ink-vertical-align-2-notref.html
new file mode 100644
index 0000000000..191490ca5c
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-vertical-align-2-notref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<p>Underline should skip over the subscripted 'x'</p>
+<div style="font:36px serif; color:rgba(0,0,255,0.5);">
+ <u style="text-decoration-color:red;text-decoration-skip-ink:none;">xx<sub>x</sub>xx</u></div>
diff --git a/layout/reftests/text-decoration/skip-ink-vertical-align-2.html b/layout/reftests/text-decoration/skip-ink-vertical-align-2.html
new file mode 100644
index 0000000000..0ee9582700
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-vertical-align-2.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<p>Underline should skip over the subscripted 'x'</p>
+<div style="font:36px serif; color:rgba(0,0,255,0.5);">
+ <u style="text-decoration-color:red;">xx<sub>x</sub>xx</u></div>
diff --git a/layout/reftests/text-decoration/skip-ink-vertical-align-ref.html b/layout/reftests/text-decoration/skip-ink-vertical-align-ref.html
new file mode 100644
index 0000000000..ea4952ab29
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-vertical-align-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Reference case for text-decoration-skip-ink: skip-ink should detect and work with vertical-align</title>
+ <style>
+ div{
+ font: 48px/2 Times;
+ text-decoration: purple underline;
+ text-decoration-skip-ink: none;
+ }
+ span{
+ vertical-align: super;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Ink should not be skipped when vertical-align moves text away from the underline</p>
+ <div>test <span>pgqy</span> test</div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/skip-ink-vertical-align.html b/layout/reftests/text-decoration/skip-ink-vertical-align.html
new file mode 100644
index 0000000000..72932f95ef
--- /dev/null
+++ b/layout/reftests/text-decoration/skip-ink-vertical-align.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+ <head>
+ <title>Test case for text-decoration-skip-ink: skip-ink should detect and work with vertical-align</title>
+ <style>
+ div{
+ font: 48px/2 Times;
+ text-decoration: purple underline;
+ }
+ span{
+ vertical-align: super;
+ }
+ </style>
+ </head>
+ <body>
+ <p>Ink should not be skipped when vertical-align moves text away from the underline</p>
+ <div>test <span>pgqy</span> test</div>
+ </body>
+</html>
diff --git a/layout/reftests/text-decoration/table-quirk-1-ref.html b/layout/reftests/text-decoration/table-quirk-1-ref.html
new file mode 100644
index 0000000000..844ec63e85
--- /dev/null
+++ b/layout/reftests/text-decoration/table-quirk-1-ref.html
@@ -0,0 +1,7 @@
+<title>text-decoration quirk on tables (Bug 572713)</title>
+
+<div><table><tbody><tr><td>text-decoration on container of table</td></tr></tbody></table></div>
+<div><table><tbody><tr><td style="text-decoration: underline">text-decoration on table</td></tr></tbody></table></div>
+<div><table><tbody><tr><td style="text-decoration: underline">text-decoration on tbody</td></tr></tbody></table></div>
+<div><table><tbody><tr><td style="text-decoration: underline">text-decoration on tr</td></tr></tbody></table></div>
+<div><table><tbody><tr><td style="text-decoration: underline">text-decoration on td</td></tr></tbody></table></div>
diff --git a/layout/reftests/text-decoration/table-quirk-1.html b/layout/reftests/text-decoration/table-quirk-1.html
new file mode 100644
index 0000000000..98375f44da
--- /dev/null
+++ b/layout/reftests/text-decoration/table-quirk-1.html
@@ -0,0 +1,7 @@
+<title>text-decoration quirk on tables (Bug 572713)</title>
+
+<div style="text-decoration: underline"><table><tbody><tr><td>text-decoration on container of table</td></tr></tbody></table></div>
+<div><table style="text-decoration: underline"><tbody><tr><td>text-decoration on table</td></tr></tbody></table></div>
+<div><table><tbody style="text-decoration: underline"><tr><td>text-decoration on tbody</td></tr></tbody></table></div>
+<div><table><tbody><tr style="text-decoration: underline"><td>text-decoration on tr</td></tr></tbody></table></div>
+<div><table><tbody><tr><td style="text-decoration: underline">text-decoration on td</td></tr></tbody></table></div>
diff --git a/layout/reftests/text-decoration/table-quirk-2-ref.html b/layout/reftests/text-decoration/table-quirk-2-ref.html
new file mode 100644
index 0000000000..49786fa6e6
--- /dev/null
+++ b/layout/reftests/text-decoration/table-quirk-2-ref.html
@@ -0,0 +1,26 @@
+<title>text-decoration quirk on tables (Bug 572713)</title>
+
+<h1>text-decoration on a block</h1>
+
+<u>text in the block</u>
+
+<div><u>text in a block in the block</u></div>
+
+<table><tbody><tr><td>an HTML table</td></tr></tbody></table>
+
+<table style="display:block"><tbody style="display:block"><tr style="display:block"><td style="display:block">an HTML table that's not table-display</td></tr></tbody></table>
+
+<div style="display: table"><div style="display: table-row-group"><div style="display: table-row"><div style="display: table-cell"><u>a div with table display types</u></div></div></div></div>
+
+<h1>text-decoration on an inline</h1>
+
+<u>text in the block</u>
+
+<div><u>text in a block in the block</u></div>
+
+<table><tbody><tr><td>an HTML table</td></tr></tbody></table>
+
+<table style="display:block"><tbody style="display:block"><tr style="display:block"><td style="display:block">an HTML table that's not table-display</td></tr></tbody></table>
+
+<div style="display: table"><div style="display: table-row-group"><div style="display: table-row"><div style="display: table-cell"><u>a div with table display types</u></div></div></div></div>
+
diff --git a/layout/reftests/text-decoration/table-quirk-2.html b/layout/reftests/text-decoration/table-quirk-2.html
new file mode 100644
index 0000000000..b02c95ab1a
--- /dev/null
+++ b/layout/reftests/text-decoration/table-quirk-2.html
@@ -0,0 +1,35 @@
+<title>text-decoration quirk on tables (Bug 572713)</title>
+
+<h1>text-decoration on a block</h1>
+
+<div style="text-decoration: underline">
+
+text in the block
+
+<div>text in a block in the block</div>
+
+<table><tbody><tr><td>an HTML table</td></tr></tbody></table>
+
+<table style="display:block"><tbody style="display:block"><tr style="display:block"><td style="display:block">an HTML table that's not table-display</td></tr></tbody></table>
+
+<div style="display: table"><div style="display: table-row-group"><div style="display: table-row"><div style="display: table-cell">a div with table display types</div></div></div></div>
+
+
+</div>
+
+<h1>text-decoration on an inline</h1>
+
+<div style="text-decoration: underline; display: inline">
+
+text in the block
+
+<div>text in a block in the block</div>
+
+<table><tbody><tr><td>an HTML table</td></tr></tbody></table>
+
+<table style="display:block"><tbody style="display:block"><tr style="display:block"><td style="display:block">an HTML table that's not table-display</td></tr></tbody></table>
+
+<div style="display: table"><div style="display: table-row-group"><div style="display: table-row"><div style="display: table-cell">a div with table display types</div></div></div></div>
+
+
+</div>
diff --git a/layout/reftests/text-decoration/text-decoration-propagation-1-quirks-ref.html b/layout/reftests/text-decoration/text-decoration-propagation-1-quirks-ref.html
new file mode 100644
index 0000000000..91130e61cd
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-propagation-1-quirks-ref.html
@@ -0,0 +1,38 @@
+<title>text-decoration</title>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<h1>text-decoration on a block</h1>
+
+ <u>text directly in parent</u>
+
+ <div><u>text in block</u></div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div><u>
+ </u><div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+<h1>text-decoration on an inline</h1>
+
+ <u>text directly in parent</u>
+
+ <div><u>text in block</u></div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div><u>
+ </u><div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
diff --git a/layout/reftests/text-decoration/text-decoration-propagation-1-quirks.html b/layout/reftests/text-decoration/text-decoration-propagation-1-quirks.html
new file mode 100644
index 0000000000..18b0e893ab
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-propagation-1-quirks.html
@@ -0,0 +1,46 @@
+<title>text-decoration</title>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<h1>text-decoration on a block</h1>
+
+<div style="text-decoration: underline">
+
+ text directly in parent
+
+ <div>text in block</div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div>
+ <div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+</div>
+
+<h1>text-decoration on an inline</h1>
+
+<div style="text-decoration: underline; display: inline">
+
+ text directly in parent
+
+ <div>text in block</div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div>
+ <div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+</div>
+
diff --git a/layout/reftests/text-decoration/text-decoration-propagation-1-standards-ref.html b/layout/reftests/text-decoration/text-decoration-propagation-1-standards-ref.html
new file mode 100644
index 0000000000..a5c67cc425
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-propagation-1-standards-ref.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML>
+<title>text-decoration</title>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<h1>text-decoration on a block</h1>
+
+ <u>text directly in parent</u>
+
+ <div><u>text in block</u></div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div><u>
+ </u><div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+<h1>text-decoration on an inline</h1>
+
+ <u>text directly in parent</u>
+
+ <div><u>text in block</u></div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div><u>
+ </u><div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
diff --git a/layout/reftests/text-decoration/text-decoration-propagation-1-standards.html b/layout/reftests/text-decoration/text-decoration-propagation-1-standards.html
new file mode 100644
index 0000000000..ff37d5db41
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-propagation-1-standards.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>text-decoration</title>
+<style>
+ *{
+ text-decoration-skip-ink: none;
+ }
+</style>
+<h1>text-decoration on a block</h1>
+
+<div style="text-decoration: underline">
+
+ text directly in parent
+
+ <div>text in block</div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div>
+ <div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+</div>
+
+<h1>text-decoration on an inline</h1>
+
+<div style="text-decoration: underline; display: inline">
+
+ text directly in parent
+
+ <div>text in block</div>
+
+ <div style="float:left; clear: left">text in float</div>
+ <div style="clear:left"></div>
+
+ <div style="display:inline-block">text in<br>inline-block</div>
+ <div style="display:inline-table">text in<br>inline-table</div>
+
+ <div style="height: 2em">
+ <div style="position: absolute">text in abs-pos</div>
+ </div>
+
+</div>
+
diff --git a/layout/reftests/text-decoration/text-decoration-zorder-1-quirks.html b/layout/reftests/text-decoration/text-decoration-zorder-1-quirks.html
new file mode 100644
index 0000000000..18eaeba0d8
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-zorder-1-quirks.html
@@ -0,0 +1,44 @@
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { background: white; }
+
+ p.serif { font-family: serif; left: 20px; }
+ p.sans { font-family: sans-serif; left: 220px; }
+
+ p {
+ margin: 0;
+ position: absolute;
+ font-weight: bold;
+ font-size: 50px;
+ color: fuchsia;
+ }
+
+ span { color: blue; }
+
+ p.under { text-decoration: underline; top: 25px; }
+ p.over { text-decoration: overline; top: 125px; }
+ p.through { text-decoration: line-through; top: 225px; }
+
+ </style>
+</head>
+<body>
+
+<p class="serif under"><span>&Aacute;p|/</span></p>
+
+<p class="serif over"><span>&Aacute;p|/</span></p>
+
+<p class="serif through"><span>&Aacute;p|/</span></p>
+
+<p class="sans under"><span>&Aacute;p|/</span></p>
+
+<p class="sans over"><span>&Aacute;p|/</span></p>
+
+<p class="sans through"><span>&Aacute;p|/</span></p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/text-decoration-zorder-1-ref.html b/layout/reftests/text-decoration/text-decoration-zorder-1-ref.html
new file mode 100644
index 0000000000..e125987307
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-zorder-1-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { background: white; }
+
+ p.serif { font-family: serif; left: 20px; }
+ p.sans { font-family: sans-serif; left: 220px; }
+
+ p {
+ margin: 0;
+ position: absolute;
+ font-weight: bold;
+ font-size: 50px;
+ }
+
+ p.under { text-decoration: underline; top: 25px; }
+ p.over { text-decoration: overline; top: 125px; }
+ p.through { text-decoration: line-through; top: 225px; }
+
+ p.text { text-decoration: none ! important; }
+ p.line span { color: transparent; }
+
+ p.text { color: blue; }
+ p.line { color: fuchsia; }
+
+ </style>
+</head>
+<body>
+
+<p class="serif line under"><span>&Aacute;p|/</span></p>
+<p class="serif text under"><span>&Aacute;p|/</span></p>
+
+<p class="serif line over"><span>&Aacute;p|/</span></p>
+<p class="serif text over"><span>&Aacute;p|/</span></p>
+
+<p class="serif text through"><span>&Aacute;p|/</span></p>
+<p class="serif line through"><span>&Aacute;p|/</span></p>
+
+<p class="sans line under"><span>&Aacute;p|/</span></p>
+<p class="sans text under"><span>&Aacute;p|/</span></p>
+
+<p class="sans line over"><span>&Aacute;p|/</span></p>
+<p class="sans text over"><span>&Aacute;p|/</span></p>
+
+<p class="sans text through"><span>&Aacute;p|/</span></p>
+<p class="sans line through"><span>&Aacute;p|/</span></p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/text-decoration-zorder-1-standards.html b/layout/reftests/text-decoration/text-decoration-zorder-1-standards.html
new file mode 100644
index 0000000000..38d377f8b8
--- /dev/null
+++ b/layout/reftests/text-decoration/text-decoration-zorder-1-standards.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+
+ body { background: white; }
+
+ p.serif { font-family: serif; left: 20px; }
+ p.sans { font-family: sans-serif; left: 220px; }
+
+ p {
+ margin: 0;
+ position: absolute;
+ font-weight: bold;
+ font-size: 50px;
+ color: fuchsia;
+ }
+
+ span { color: blue; }
+
+ p.under { text-decoration: underline; top: 25px; }
+ p.over { text-decoration: overline; top: 125px; }
+ p.through { text-decoration: line-through; top: 225px; }
+
+ </style>
+</head>
+<body>
+
+<p class="serif under"><span>&Aacute;p|/</span></p>
+
+<p class="serif over"><span>&Aacute;p|/</span></p>
+
+<p class="serif through"><span>&Aacute;p|/</span></p>
+
+<p class="sans under"><span>&Aacute;p|/</span></p>
+
+<p class="sans over"><span>&Aacute;p|/</span></p>
+
+<p class="sans through"><span>&Aacute;p|/</span></p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-2-quirks-ref.html b/layout/reftests/text-decoration/underline-block-propagation-2-quirks-ref.html
new file mode 100644
index 0000000000..6f4bc8ecd2
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-2-quirks-ref.html
@@ -0,0 +1,40 @@
+<html><head>
+<title>More tests of propagation of text-decoration</title>
+<style>
+textarea { -moz-appearance: none }
+textarea + textarea { margin-left: 10px }
+</style>
+</head>
+<body>
+<!-- t-d should not propagate to the content of a form control -->
+<form>
+<span style="text-decoration:underline">This text should be underlined.</span><br>
+<textarea rows="2" cols="40">This text should not be underlined.</textarea
+><textarea rows="2" cols="40" style="text-decoration:line-through"
+>This text should be struck out.</textarea>
+<p style="text-decoration:underline">This text should also be underlined.</p>
+</form>
+<!-- t-d should propagate from parent elements to table-cells, except
+ not through a table element in quirks mode, per
+ https://quirks.spec.whatwg.org/#the-text-decoration-doesn't-propagate-into-tables-quirk
+ -->
+<div>
+ <table>
+ <tr>
+ <td>
+ <span style="text-decoration:overline">
+ <span style="text-decoration:line-through">
+ overlined, and struck out
+ </span></span>
+ </td>
+ </tr>
+ </table>
+</div>
+<!-- t-d on a float itself should apply -->
+<div>
+ <p style="text-decoration:underline">This text should be underlined.</p>
+ <p style="float:left; text-decoration:overline"
+ >This text should be overlined (only).</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-2-quirks.html b/layout/reftests/text-decoration/underline-block-propagation-2-quirks.html
new file mode 100644
index 0000000000..7e32b7581f
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-2-quirks.html
@@ -0,0 +1,35 @@
+<html><head>
+<title>More tests of propagation of text-decoration</title>
+<style>
+textarea { -moz-appearance: none }
+textarea + textarea { margin-left: 10px }
+</style>
+</head>
+<body>
+<!-- t-d should not propagate to the content of a form control -->
+<form style="text-decoration:underline">
+This text should be underlined.<br>
+<textarea rows="2" cols="40">This text should not be underlined.</textarea
+><textarea rows="2" cols="40" style="text-decoration:line-through"
+>This text should be struck out.</textarea>
+<p>This text should also be underlined.</p>
+</form>
+<!-- t-d should propagate from parent elements to table-cells, except
+ not through a table element in quirks mode, per
+ https://quirks.spec.whatwg.org/#the-text-decoration-doesn't-propagate-into-tables-quirk
+ -->
+<div style="text-decoration:underline">
+ <table style="text-decoration:overline">
+ <tr style="text-decoration:line-through">
+ <td>overlined, and struck out</td>
+ </tr>
+ </table>
+</div>
+<!-- t-d on a float itself should apply -->
+<div style="text-decoration:underline">
+ <p>This text should be underlined.</p>
+ <p style="float:left; text-decoration:overline"
+ >This text should be overlined (only).</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html b/layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html
new file mode 100644
index 0000000000..eb7c3273cd
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-2-standards-ref.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html><head>
+<title>More tests of propagation of text-decoration</title>
+<style>
+textarea { -moz-appearance: none }
+textarea + textarea { margin-left: 10px }
+* { text-decoration-skip-ink: none }
+</style>
+</head>
+<body>
+<!-- t-d should not propagate to the content of a form control -->
+<form>
+<span style="text-decoration:underline">This text should be underlined.</span><br>
+<textarea rows="2" cols="40">This text should not be underlined.</textarea
+><textarea rows="2" cols="40" style="text-decoration:line-through"
+>This text should be struck out.</textarea>
+<p style="text-decoration:underline">This text should also be underlined.</p>
+</form>
+<!-- t-d should propagate from parent elements to table-cells -->
+<div>
+ <table>
+ <tr>
+ <td>
+ <span style="text-decoration:underline">
+ <span style="text-decoration:overline">
+ <span style="text-decoration:line-through">
+ underlined, overlined, and struck out
+ </span></span></span>
+ </td>
+ </tr>
+ </table>
+</div>
+<!-- t-d on a float itself should apply -->
+<div>
+ <p style="text-decoration:underline">This text should be underlined.</p>
+ <p style="float:left; text-decoration:overline"
+ >This text should be overlined (only).</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-2-standards.html b/layout/reftests/text-decoration/underline-block-propagation-2-standards.html
new file mode 100644
index 0000000000..5a9997e365
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-2-standards.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML>
+<html><head>
+<title>More tests of propagation of text-decoration</title>
+<style>
+textarea { -moz-appearance: none }
+textarea + textarea { margin-left: 10px }
+* { text-decoration-skip-ink: none }
+</style>
+</head>
+<body>
+<!-- t-d should not propagate to the content of a form control -->
+<form style="text-decoration:underline">
+This text should be underlined.<br>
+<textarea rows="2" cols="40">This text should not be underlined.</textarea
+><textarea rows="2" cols="40" style="text-decoration:line-through"
+>This text should be struck out.</textarea>
+<p>This text should also be underlined.</p>
+</form>
+<!-- t-d should propagate from parent elements to table-cells -->
+<div style="text-decoration:underline">
+ <table style="text-decoration:overline">
+ <tr style="text-decoration:line-through">
+ <td>underlined, overlined, and struck out</td>
+ </tr>
+ </table>
+</div>
+<!-- t-d on a float itself should apply -->
+<div style="text-decoration:underline">
+ <p>This text should be underlined.</p>
+ <p style="float:left; text-decoration:overline"
+ >This text should be overlined (only).</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-quirks-ref.html b/layout/reftests/text-decoration/underline-block-propagation-quirks-ref.html
new file mode 100644
index 0000000000..73d8fe301f
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-quirks-ref.html
@@ -0,0 +1,13 @@
+<title>text-decoration: underline test</title>
+<div>
+<span style="text-decoration:underline">This text should be underlined.</span>
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px"><span style="text-decoration:underline">This text should be underlined.</span></div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<div><span style="text-decoration:underline">This should be underlined but </span><span style="display:inline-block">this should not<br>be underlined<br>on any line</span><span style="text-decoration:underline">.</span></div>
+
+<div><span style="text-decoration:underline">This should be underlined but </span><span style="display:inline-table">this should not<br>be underlined<br>on any line</span><span style="text-decoration:underline">.</span></div>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-quirks.html b/layout/reftests/text-decoration/underline-block-propagation-quirks.html
new file mode 100644
index 0000000000..ef3e255377
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-quirks.html
@@ -0,0 +1,13 @@
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">
+This text should be underlined.
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px">This text should be underlined.</div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<div>This should be underlined but <span style="display:inline-block">this should not<br>be underlined<br>on any line</span>.</div>
+
+<div>This should be underlined but <span style="display:inline-table">this should not<br>be underlined<br>on any line</span>.</div>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-standards-ref.html b/layout/reftests/text-decoration/underline-block-propagation-standards-ref.html
new file mode 100644
index 0000000000..d7ce633de6
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-standards-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div>
+<span style="text-decoration:underline">This text should be underlined.</span>
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px"><span style="text-decoration:underline">This text should be underlined.</span></div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<div><span style="text-decoration:underline">This should be underlined but </span><span style="display:inline-block">this should not<br>be underlined<br>on any line</span><span style="text-decoration:underline">.</span></div>
+
+<div><span style="text-decoration:underline">This should be underlined but </span><span style="display:inline-table">this should not<br>be underlined<br>on any line</span><span style="text-decoration:underline">.</span></div>
diff --git a/layout/reftests/text-decoration/underline-block-propagation-standards.html b/layout/reftests/text-decoration/underline-block-propagation-standards.html
new file mode 100644
index 0000000000..a010e93a74
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-propagation-standards.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">
+This text should be underlined.
+
+<div style="float:left;width:10em">This text should not be underlined.</div>
+
+<div style="clear:both; margin: 1px 2px 3px 4px; border: medium solid; padding: 6px 8px 10px 12px">This text should be underlined.</div>
+
+<div style="position:absolute; top: 400px;left:400px">This should not be underlined.</div>
+
+<div>This should be underlined but <span style="display:inline-block">this should not<br>be underlined<br>on any line</span>.</div>
+
+<div>This should be underlined but <span style="display:inline-table">this should not<br>be underlined<br>on any line</span>.</div>
diff --git a/layout/reftests/text-decoration/underline-block-quirks-notref.html b/layout/reftests/text-decoration/underline-block-quirks-notref.html
new file mode 100644
index 0000000000..141a199518
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks-notref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div>This text should be underlined.</div>
diff --git a/layout/reftests/text-decoration/underline-block-quirks-ref.html b/layout/reftests/text-decoration/underline-block-quirks-ref.html
new file mode 100644
index 0000000000..8f70b8e28c
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks-ref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div><span style="text-decoration:underline">This text should be underlined.</span></div>
diff --git a/layout/reftests/text-decoration/underline-block-quirks.html b/layout/reftests/text-decoration/underline-block-quirks.html
new file mode 100644
index 0000000000..6860b3aee6
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-quirks.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">This text should be underlined.</div>
diff --git a/layout/reftests/text-decoration/underline-block-standards-notref.html b/layout/reftests/text-decoration/underline-block-standards-notref.html
new file mode 100644
index 0000000000..ed47f3becc
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards-notref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div>This text should be underlined.</div>
diff --git a/layout/reftests/text-decoration/underline-block-standards-ref.html b/layout/reftests/text-decoration/underline-block-standards-ref.html
new file mode 100644
index 0000000000..ea53cd446b
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div><span style="text-decoration:underline">This text should be underlined.</span></div>
diff --git a/layout/reftests/text-decoration/underline-block-standards.html b/layout/reftests/text-decoration/underline-block-standards.html
new file mode 100644
index 0000000000..b9b527d7a5
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-block-standards.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<div style="text-decoration:underline">This text should be underlined.</div>
diff --git a/layout/reftests/text-decoration/underline-button-1-ref.html b/layout/reftests/text-decoration/underline-button-1-ref.html
new file mode 100644
index 0000000000..c5b84e1c2d
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-button-1-ref.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some</span><button>text</button><span
+ style="text-decoration: underline">and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-button-1.html b/layout/reftests/text-decoration/underline-button-1.html
new file mode 100644
index 0000000000..4c40e8bdfd
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-button-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some<button>text</button>and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-button-2-ref.html b/layout/reftests/text-decoration/underline-button-2-ref.html
new file mode 100644
index 0000000000..f003bae646
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-button-2-ref.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline; font: 16px sans-serif">
+ Some</span><button style="text-decoration: underline; color: black; font: 16px sans-serif">text</button><span
+ style="text-decoration: underline; font: 16px sans-serif">and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-button-2.html b/layout/reftests/text-decoration/underline-button-2.html
new file mode 100644
index 0000000000..c61afd2a18
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-button-2.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline; font: 16px sans-serif">
+ Some<button style="display: inline; color: black; font: 16px sans-serif">text</button>and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-inline-block-quirks-notref.html b/layout/reftests/text-decoration/underline-inline-block-quirks-notref.html
new file mode 100644
index 0000000000..17b221274e
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks-notref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block">inline<br>block</span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-inline-block-quirks-ref.html b/layout/reftests/text-decoration/underline-inline-block-quirks-ref.html
new file mode 100644
index 0000000000..27c474675e
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks-ref.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block"><span style="text-decoration:underline">inline</span><br><span style="text-decoration:underline">block</span></span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-inline-block-quirks.html b/layout/reftests/text-decoration/underline-inline-block-quirks.html
new file mode 100644
index 0000000000..b75286d7dd
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-quirks.html
@@ -0,0 +1,2 @@
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block;text-decoration:underline">inline<br>block</span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-inline-block-standards-notref.html b/layout/reftests/text-decoration/underline-inline-block-standards-notref.html
new file mode 100644
index 0000000000..f2325dfe11
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards-notref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block">inline<br>block</span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-inline-block-standards-ref.html b/layout/reftests/text-decoration/underline-inline-block-standards-ref.html
new file mode 100644
index 0000000000..6b23d0f4f5
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block"><span style="text-decoration:underline">inline</span><br><span style="text-decoration:underline">block</span></span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-inline-block-standards.html b/layout/reftests/text-decoration/underline-inline-block-standards.html
new file mode 100644
index 0000000000..24b519ebe3
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-inline-block-standards.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<p>This has an <span style="display:inline-block;text-decoration:underline">inline<br>block</span> in it.</p>
diff --git a/layout/reftests/text-decoration/underline-select-1-ref.html b/layout/reftests/text-decoration/underline-select-1-ref.html
new file mode 100644
index 0000000000..e10ebe9783
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-select-1-ref.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some</span><select><option>text</option></select><span
+ style="text-decoration: underline">and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-select-1.html b/layout/reftests/text-decoration/underline-select-1.html
new file mode 100644
index 0000000000..84c74d5f76
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-select-1.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some<select><option>text</option></select>and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-select-2-ref.html b/layout/reftests/text-decoration/underline-select-2-ref.html
new file mode 100644
index 0000000000..3c032949d1
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-select-2-ref.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some</span><select size="5"><option>text</option></select><span
+ style="text-decoration: underline">and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-select-2.html b/layout/reftests/text-decoration/underline-select-2.html
new file mode 100644
index 0000000000..e2b014eb47
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-select-2.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body>
+ <span style="text-decoration: underline">
+ Some<select size="5"><option>text</option></select>and a button
+ </span>
+</body>
+</html>
diff --git a/layout/reftests/text-decoration/underline-style-block-dashed-quirks.html b/layout/reftests/text-decoration/underline-style-block-dashed-quirks.html
new file mode 100644
index 0000000000..5e8beec1ec
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-dashed-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline; text-decoration-style: dashed;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-dashed-standards.html b/layout/reftests/text-decoration/underline-style-block-dashed-standards.html
new file mode 100644
index 0000000000..237f3d0981
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline; text-decoration-style: dashed;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-dotted-quirks.html b/layout/reftests/text-decoration/underline-style-block-dotted-quirks.html
new file mode 100644
index 0000000000..909e1761db
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-dotted-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline; text-decoration-style: dotted;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-dotted-standards.html b/layout/reftests/text-decoration/underline-style-block-dotted-standards.html
new file mode 100644
index 0000000000..994681c12f
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline; text-decoration-style: dotted;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-double-quirks.html b/layout/reftests/text-decoration/underline-style-block-double-quirks.html
new file mode 100644
index 0000000000..8047c47f1f
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-double-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline; text-decoration-style: double;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-double-standards.html b/layout/reftests/text-decoration/underline-style-block-double-standards.html
new file mode 100644
index 0000000000..69dbb4a56d
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline; text-decoration-style: double;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-quirks-ref.html b/layout/reftests/text-decoration/underline-style-block-quirks-ref.html
new file mode 100644
index 0000000000..65d66622f1
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-quirks-ref.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-solid-quirks.html b/layout/reftests/text-decoration/underline-style-block-solid-quirks.html
new file mode 100644
index 0000000000..d0637957d6
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-solid-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline; text-decoration-style: solid;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-solid-standards.html b/layout/reftests/text-decoration/underline-style-block-solid-standards.html
new file mode 100644
index 0000000000..fdf75e6a1e
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline; text-decoration-style: solid;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-standards-ref.html b/layout/reftests/text-decoration/underline-style-block-standards-ref.html
new file mode 100644
index 0000000000..4e03e4f07b
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-wavy-quirks.html b/layout/reftests/text-decoration/underline-style-block-wavy-quirks.html
new file mode 100644
index 0000000000..abf208a844
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-wavy-quirks.html
@@ -0,0 +1 @@
+<p style="text-decoration: underline; text-decoration-style: wavy;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-block-wavy-standards.html b/layout/reftests/text-decoration/underline-style-block-wavy-standards.html
new file mode 100644
index 0000000000..ae1a6ed72c
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-block-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p style="text-decoration: underline; text-decoration-style: wavy;">This paragraph has underline</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-dashed-quirks.html b/layout/reftests/text-decoration/underline-style-inline-dashed-quirks.html
new file mode 100644
index 0000000000..7a2a15ccd0
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-dashed-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: dashed;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-dashed-standards.html b/layout/reftests/text-decoration/underline-style-inline-dashed-standards.html
new file mode 100644
index 0000000000..8afb04e396
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-dashed-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: dashed;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-dotted-quirks.html b/layout/reftests/text-decoration/underline-style-inline-dotted-quirks.html
new file mode 100644
index 0000000000..30da0a460e
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-dotted-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: dotted;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-dotted-standards.html b/layout/reftests/text-decoration/underline-style-inline-dotted-standards.html
new file mode 100644
index 0000000000..f83d30766b
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-dotted-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: dotted;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-double-quirks.html b/layout/reftests/text-decoration/underline-style-inline-double-quirks.html
new file mode 100644
index 0000000000..a0f5c9e287
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-double-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: double;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-double-standards.html b/layout/reftests/text-decoration/underline-style-inline-double-standards.html
new file mode 100644
index 0000000000..239bd9e067
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-double-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: double;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-quirks-ref.html b/layout/reftests/text-decoration/underline-style-inline-quirks-ref.html
new file mode 100644
index 0000000000..d8a1b40b86
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-quirks-ref.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-solid-quirks.html b/layout/reftests/text-decoration/underline-style-inline-solid-quirks.html
new file mode 100644
index 0000000000..6f415d16f7
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-solid-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: solid;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-solid-standards.html b/layout/reftests/text-decoration/underline-style-inline-solid-standards.html
new file mode 100644
index 0000000000..88268b2662
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-solid-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: solid;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-standards-ref.html b/layout/reftests/text-decoration/underline-style-inline-standards-ref.html
new file mode 100644
index 0000000000..7cc4eec7e2
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-standards-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-wavy-quirks.html b/layout/reftests/text-decoration/underline-style-inline-wavy-quirks.html
new file mode 100644
index 0000000000..57b8c5e06f
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-wavy-quirks.html
@@ -0,0 +1 @@
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: wavy;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-style-inline-wavy-standards.html b/layout/reftests/text-decoration/underline-style-inline-wavy-standards.html
new file mode 100644
index 0000000000..d078e70683
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-style-inline-wavy-standards.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<p>This paragraph has no decoration lines, but <span style="text-decoration: underline; text-decoration-style: wavy;">here has underline</span>, and here has no decoration lines.</p>
diff --git a/layout/reftests/text-decoration/underline-table-caption-quirks-notref.html b/layout/reftests/text-decoration/underline-table-caption-quirks-notref.html
new file mode 100644
index 0000000000..26c6189387
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks-notref.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption>This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-caption-quirks-ref.html b/layout/reftests/text-decoration/underline-table-caption-quirks-ref.html
new file mode 100644
index 0000000000..926acf820a
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks-ref.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption><span style="text-decoration: underline">This is the table caption</span></caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-caption-quirks.html b/layout/reftests/text-decoration/underline-table-caption-quirks.html
new file mode 100644
index 0000000000..0fbeba1066
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-quirks.html
@@ -0,0 +1,12 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <caption style="text-decoration: underline">This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-caption-standards-notref.html b/layout/reftests/text-decoration/underline-table-caption-standards-notref.html
new file mode 100644
index 0000000000..00cd35b6c6
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards-notref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption>This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-caption-standards-ref.html b/layout/reftests/text-decoration/underline-table-caption-standards-ref.html
new file mode 100644
index 0000000000..c99bff74b5
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption><span style="text-decoration: underline">This is the table caption</span></caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-caption-standards.html b/layout/reftests/text-decoration/underline-table-caption-standards.html
new file mode 100644
index 0000000000..f9af71bdef
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-caption-standards.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <caption style="text-decoration: underline">This is the table caption</caption>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-quirks-notref.html b/layout/reftests/text-decoration/underline-table-cell-quirks-notref.html
new file mode 100644
index 0000000000..0d77eb061d
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks-notref.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-quirks-ref.html b/layout/reftests/text-decoration/underline-table-cell-quirks-ref.html
new file mode 100644
index 0000000000..d44cc08cc3
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks-ref.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td><span style="text-decoration: underline">Row 1, Cell 1</span></td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-quirks.html b/layout/reftests/text-decoration/underline-table-cell-quirks.html
new file mode 100644
index 0000000000..5c11e7e5dc
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-quirks.html
@@ -0,0 +1,11 @@
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td style="text-decoration: underline">Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-standards-notref.html b/layout/reftests/text-decoration/underline-table-cell-standards-notref.html
new file mode 100644
index 0000000000..712d5a16d2
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards-notref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td>Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-standards-ref.html b/layout/reftests/text-decoration/underline-table-cell-standards-ref.html
new file mode 100644
index 0000000000..45de37dbba
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td><span style="text-decoration: underline">Row 1, Cell 1</span></td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/underline-table-cell-standards.html b/layout/reftests/text-decoration/underline-table-cell-standards.html
new file mode 100644
index 0000000000..cfaf01e25a
--- /dev/null
+++ b/layout/reftests/text-decoration/underline-table-cell-standards.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<title>text-decoration: underline test</title>
+<table border>
+ <tr>
+ <td style="text-decoration: underline">Row 1, Cell 1</td>
+ <td>Row 1, Cell 2</td>
+ </tr>
+ <tr>
+ <td>Row 2, Cell 1</td>
+ <td>Row 2, Cell 2</td>
+ </tr>
+</table>
diff --git a/layout/reftests/text-decoration/vertical-mode-decorations-1-ref.html b/layout/reftests/text-decoration/vertical-mode-decorations-1-ref.html
new file mode 100644
index 0000000000..e2078fdc39
--- /dev/null
+++ b/layout/reftests/text-decoration/vertical-mode-decorations-1-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+body { font: 32px Arial, sans-serif; margin: 20px; color: transparent; }
+div { block-size: 10em; inline-size: 10em; margin: 0; padding: 10px;
+ text-align: center; background: #eee; }
+.a { text-decoration: blue solid underline line-through overline; }
+.c { text-decoration: green double underline line-through overline; }
+</style>
+</head>
+<body>
+<div style="transform: rotate(90deg);">
+ hello <span class=a>hello</span> <span class=c>hello</span>
+</div>
diff --git a/layout/reftests/text-decoration/vertical-mode-decorations-1.html b/layout/reftests/text-decoration/vertical-mode-decorations-1.html
new file mode 100644
index 0000000000..2c14b80b13
--- /dev/null
+++ b/layout/reftests/text-decoration/vertical-mode-decorations-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+body { font: 32px Arial, sans-serif; margin: 20px; color: transparent; }
+div { block-size: 10em; inline-size: 10em; margin: 0; padding: 10px;
+ text-align: center; background: #eee; }
+.a { text-decoration: blue solid underline line-through overline; }
+.c { text-decoration: green double underline line-through overline; }
+</style>
+</head>
+<body>
+<div style="writing-mode:sideways-rl;">
+ hello <span class=a>hello</span> <span class=c>hello</span>
+</div>
diff --git a/layout/reftests/text-decoration/vertical-mode-decorations-2-ref.html b/layout/reftests/text-decoration/vertical-mode-decorations-2-ref.html
new file mode 100644
index 0000000000..a410fa3bc6
--- /dev/null
+++ b/layout/reftests/text-decoration/vertical-mode-decorations-2-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+body { font: 32px Arial, sans-serif; margin: 20px; color: transparent; }
+div { block-size: 10em; inline-size: 10em; margin: 0; padding: 10px;
+ text-align: center; background: #eee; }
+.a { text-decoration: blue solid underline line-through overline; }
+.c { text-decoration: green double underline line-through overline; }
+</style>
+</head>
+<body>
+<div style="transform: rotate(-90deg);">
+ hello <span class=a>hello</span> <span class=c>hello</span>
+</div>
diff --git a/layout/reftests/text-decoration/vertical-mode-decorations-2.html b/layout/reftests/text-decoration/vertical-mode-decorations-2.html
new file mode 100644
index 0000000000..72bdfca999
--- /dev/null
+++ b/layout/reftests/text-decoration/vertical-mode-decorations-2.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+body { font: 32px Arial, sans-serif; margin: 20px; color: transparent; }
+div { block-size: 10em; inline-size: 10em; margin: 0; padding: 10px;
+ text-align: center; background: #eee; }
+.a { text-decoration: blue solid underline line-through overline; }
+.c { text-decoration: green double underline line-through overline; }
+</style>
+</head>
+<body>
+<div style="writing-mode:sideways-lr;">
+ hello <span class=a>hello</span> <span class=c>hello</span>
+</div>
diff --git a/layout/reftests/text-indent/dynamic-change-with-overflow-1-ref.html b/layout/reftests/text-indent/dynamic-change-with-overflow-1-ref.html
new file mode 100644
index 0000000000..8de8673c25
--- /dev/null
+++ b/layout/reftests/text-indent/dynamic-change-with-overflow-1-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <div style="overflow: hidden; text-indent: 50px">
+ Some text.
+ </div>
+</html>
diff --git a/layout/reftests/text-indent/dynamic-change-with-overflow-1.html b/layout/reftests/text-indent/dynamic-change-with-overflow-1.html
new file mode 100644
index 0000000000..97d6c69f70
--- /dev/null
+++ b/layout/reftests/text-indent/dynamic-change-with-overflow-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <div style="overflow: hidden;">
+ Some text.
+ </div>
+
+ <script>
+ onload = function() {
+ var div = document.querySelector("div");
+ // Make sure layout has happened.
+ window.width = div.offsetWidth;
+ div.style.textIndent = "50px";
+ document.documentElement.className = "";
+ }
+ </script>
+</html>
diff --git a/layout/reftests/text-indent/reftest.list b/layout/reftests/text-indent/reftest.list
new file mode 100644
index 0000000000..2a9cfed416
--- /dev/null
+++ b/layout/reftests/text-indent/reftest.list
@@ -0,0 +1,20 @@
+# XXX Need to repeat these tests for RTL. (Note that != tests can't use
+# same file.)
+
+# Also need to test intrinsic widths (bug 368155).
+
+!= text-indent-single-line-100.html text-indent-single-line-0.html
+== text-indent-single-line-100.html text-indent-single-line-ref-margin.html
+== text-indent-single-line-0.html text-indent-single-line-ref-unstyled.html
+== text-indent-single-line-percent.html text-indent-single-line-percent-ref.html
+== text-indent-single-line-indent-inline.html text-indent-single-line-indent-inline-ref-block-margin.html
+== text-indent-single-line-indent-inline.html text-indent-single-line-indent-inline-ref-inline-margin.html
+== text-indent-multiple-line.html text-indent-multiple-line-ref-inline-margin.html
+== text-indent-multiple-line.html text-indent-multiple-line-ref-float.html
+!= text-indent-multiple-line.html text-indent-multiple-line-notref-block-margin.html
+== text-indent-intrinsic-pref.html text-indent-intrinsic-pref-ref.html
+== text-indent-intrinsic-min.html text-indent-intrinsic-min-ref.html
+== text-indent-negative-intrinsic-pref.html text-indent-negative-intrinsic-pref-ref.html
+== text-indent-negative-intrinsic-min.html text-indent-negative-intrinsic-min-ref.html
+== text-indent-parent-dynamic.html text-indent-parent-dynamic-ref.html
+== dynamic-change-with-overflow-1.html dynamic-change-with-overflow-1-ref.html
diff --git a/layout/reftests/text-indent/text-indent-intrinsic-min-ref.html b/layout/reftests/text-indent/text-indent-intrinsic-min-ref.html
new file mode 100644
index 0000000000..8fb6f977e7
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-intrinsic-min-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test for intrinsic widths and text-indent</title>
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+</style>
+</head>
+<body>
+
+<!-- test against inline margin -->
+<div><span style="margin-left: 3em">X</span></div>
+
+<!-- test against block padding -->
+<div style="padding-left: 3em;">X</div>
+
+<!-- test against block width -->
+<div style="width: 4em;"></div>
+
+<div style="width: 4em;"></div>
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-intrinsic-min.html b/layout/reftests/text-indent/text-indent-intrinsic-min.html
new file mode 100644
index 0000000000..1672b9778b
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-intrinsic-min.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>CSS 2.1 Test Suite: Test for intrinsic widths and text-indent</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+
+body { font-size: 12px; width: 1px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+span {
+ display: inline-block;
+ height: 1em;
+ width: 1em;
+}
+
+</style>
+</head>
+<body>
+
+<!-- test against inline margin -->
+<div style="text-indent: 3em;">X</div>
+
+<!-- test against block padding -->
+<div style="text-indent: 3em;">X</div>
+
+<!-- test against block width -->
+<div style="text-indent: 3em;"><span></span></div>
+
+<div style="text-indent: 3em"><span style="width: 1em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span>&#x200b;<span style="width: 2em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span>&#x200b;<span style="width: 6em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span><br><span style="width: 2em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span><br><span style="width: 6em"></span></div>
+<pre style="text-indent: 3em"><span style="width: 1em"></span>
+<span style="width: 2em"></span></pre>
+<pre style="text-indent: 3em"><span style="width: 1em"></span>
+<span style="width: 6em"></span></pre>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-intrinsic-pref-ref.html b/layout/reftests/text-indent/text-indent-intrinsic-pref-ref.html
new file mode 100644
index 0000000000..e31a87e7f6
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-intrinsic-pref-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test for intrinsic widths and text-indent</title>
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+</style>
+</head>
+<body>
+
+<!-- test against inline margin -->
+<div><span style="margin-left: 3em">X</span></div>
+
+<!-- test against block padding -->
+<div style="padding-left: 3em;">X</div>
+
+<!-- test against block width -->
+<div style="width: 4em;"></div>
+
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+<div style="width: 10em;"></div>
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+<div style="width: 4em;"></div>
+<div style="width: 6em;"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-intrinsic-pref.html b/layout/reftests/text-indent/text-indent-intrinsic-pref.html
new file mode 100644
index 0000000000..7f90ed4fbc
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-intrinsic-pref.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>CSS 2.1 Test Suite: Test for intrinsic widths and text-indent</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+span {
+ display: inline-block;
+ height: 1em;
+ width: 1em;
+}
+
+</style>
+</head>
+<body>
+
+<!-- test against inline margin -->
+<div style="text-indent: 3em;">X</div>
+
+<!-- test against block padding -->
+<div style="text-indent: 3em;">X</div>
+
+<!-- test against block width -->
+<div style="text-indent: 3em;"><span></span></div>
+
+<div style="text-indent: 3em"><span style="width: 1em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span>&#x200b;<span style="width: 2em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span>&#x200b;<span style="width: 6em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span><br><span style="width: 2em"></span></div>
+<div style="text-indent: 3em"><span style="width: 1em"></span><br><span style="width: 6em"></span></div>
+<pre style="text-indent: 3em"><span style="width: 1em"></span>
+<span style="width: 2em"></span></pre>
+<pre style="text-indent: 3em"><span style="width: 1em"></span>
+<span style="width: 6em"></span></pre>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-multiple-line-notref-block-margin.html b/layout/reftests/text-indent/text-indent-multiple-line-notref-block-margin.html
new file mode 100644
index 0000000000..6ab611947d
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-multiple-line-notref-block-margin.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { margin-left: 100px }
+span { background: yellow }
+</style>
+</head>
+<body>
+<p><span>This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines.</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-multiple-line-ref-float.html b/layout/reftests/text-indent/text-indent-multiple-line-ref-float.html
new file mode 100644
index 0000000000..1166653475
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-multiple-line-ref-float.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+i { float: left; height: 0.3em; width: 100px; }
+span { background: yellow }
+</style>
+</head>
+<body>
+<p><i></i><span>This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines.</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-multiple-line-ref-inline-margin.html b/layout/reftests/text-indent/text-indent-multiple-line-ref-inline-margin.html
new file mode 100644
index 0000000000..a2c2634f61
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-multiple-line-ref-inline-margin.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+span { background: yellow; margin-left: 100px }
+</style>
+</head>
+<body>
+<p><span>This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines.</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-multiple-line.html b/layout/reftests/text-indent/text-indent-multiple-line.html
new file mode 100644
index 0000000000..faac92a3e2
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-multiple-line.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { text-indent: 100px }
+span { background: yellow }
+</style>
+</head>
+<body>
+<p><span>This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines. This is a long piece of text that will wrap to multiple lines.</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-negative-intrinsic-min-ref.html b/layout/reftests/text-indent/text-indent-negative-intrinsic-min-ref.html
new file mode 100644
index 0000000000..b5bd6204ce
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-negative-intrinsic-min-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test for intrinsic widths and text-indent</title>
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+</style>
+</head>
+<body>
+
+<div style="width: 0"></div>
+<div style="width: 2em"></div>
+<div style="width: 0"></div>
+<div style="width: 1em"></div>
+<div style="width: 3em"></div>
+<div style="width: 3em"></div>
+<div style="width: 1em"></div>
+<div style="width: 2em"></div>
+<div style="width: 5em"></div>
+<div style="width: 2em"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-negative-intrinsic-min.html b/layout/reftests/text-indent/text-indent-negative-intrinsic-min.html
new file mode 100644
index 0000000000..7139987bef
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-negative-intrinsic-min.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>CSS 2.1 Test Suite: Test for intrinsic widths and negative text-indent</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+span {
+ display: inline-block;
+ height: 1em;
+ width: 1em;
+}
+
+</style>
+</head>
+<body style="width: 1px">
+
+<div style="text-indent: -3em;"><span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 5em"></span></div>
+
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 3em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 4em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span><br><span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 5em"></span><br><span style="width: 1em"></span></div>
+<pre style="text-indent: -3em"><span style="width: 1em"></span>
+<span style="width: 5em"></span></pre>
+<pre style="text-indent: -3em"><span style="width: 5em"></span>
+<span style="width: 1em"></span></pre>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-negative-intrinsic-pref-ref.html b/layout/reftests/text-indent/text-indent-negative-intrinsic-pref-ref.html
new file mode 100644
index 0000000000..b8f26095ed
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-negative-intrinsic-pref-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test for intrinsic widths and text-indent</title>
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+</style>
+</head>
+<body>
+
+<div style="width: 0"></div>
+<div style="width: 2em"></div>
+<div style="width: 0"></div>
+<div style="width: 1em"></div>
+<div style="width: 4em"></div>
+<div style="width: 4em"></div>
+<div style="width: 1em"></div>
+<div style="width: 2em"></div>
+<div style="width: 5em"></div>
+<div style="width: 2em"></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-negative-intrinsic-pref.html b/layout/reftests/text-indent/text-indent-negative-intrinsic-pref.html
new file mode 100644
index 0000000000..d9f8e12f26
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-negative-intrinsic-pref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>CSS 2.1 Test Suite: Test for intrinsic widths and negative text-indent</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+
+body { font-size: 12px; }
+
+body > div, body > pre {
+ float: left; clear: left; margin: 1px; height: 2em;
+ border: medium solid;
+}
+
+span {
+ display: inline-block;
+ height: 1em;
+ width: 1em;
+}
+
+</style>
+</head>
+<body>
+
+<div style="text-indent: -3em;"><span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 5em"></span></div>
+
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span>&#x200b;<span style="width: 3em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 4em"></span>&#x200b;<span style="width: 3em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 1em"></span><br><span style="width: 1em"></span></div>
+<div style="text-indent: -3em;"><span style="width: 5em"></span><br><span style="width: 1em"></span></div>
+<pre style="text-indent: -3em"><span style="width: 1em"></span>
+<span style="width: 5em"></span></pre>
+<pre style="text-indent: -3em"><span style="width: 5em"></span>
+<span style="width: 1em"></span></pre>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-parent-dynamic-ref.html b/layout/reftests/text-indent/text-indent-parent-dynamic-ref.html
new file mode 100644
index 0000000000..8109f19e59
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-parent-dynamic-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+<div id="x" style="background: lightgreen; height: 3em; width: 500px; padding: 4px;">
+ <div style="text-indent: 80px; width: 200px; background: yellow;">X</div>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-parent-dynamic.html b/layout/reftests/text-indent/text-indent-parent-dynamic.html
new file mode 100644
index 0000000000..2bc8767d23
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-parent-dynamic.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+<div id="x" style="background: lightgreen; height: 3em; width: 400px; padding: 4px;">
+ <div style="text-indent: 40%; width: 200px; background: yellow;">X</div>
+</div>
+
+<script>
+var x = document.getElementById('x');
+x.offsetWidth;
+x.style.width = '500px';
+</script>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-0.html b/layout/reftests/text-indent/text-indent-single-line-0.html
new file mode 100644
index 0000000000..0cb6ab4d4d
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-0.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { text-indent: 0px }
+</style>
+</head>
+<body>
+<p>text</p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-100.html b/layout/reftests/text-indent/text-indent-single-line-100.html
new file mode 100644
index 0000000000..0df429a239
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-100.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { text-indent: 100px }
+</style>
+</head>
+<body>
+<p>text</p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-block-margin.html b/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-block-margin.html
new file mode 100644
index 0000000000..7eb28cd930
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-block-margin.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { margin-left: 100px }
+span { background: yellow }
+</style>
+</head>
+<body>
+<p><span>text</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-inline-margin.html b/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-inline-margin.html
new file mode 100644
index 0000000000..62a8f86fcb
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-indent-inline-ref-inline-margin.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+span { background: yellow; margin-left: 100px }
+</style>
+</head>
+<body>
+<p><span>text</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-indent-inline.html b/layout/reftests/text-indent/text-indent-single-line-indent-inline.html
new file mode 100644
index 0000000000..7c520427dd
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-indent-inline.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { text-indent: 100px }
+span { background: yellow }
+</style>
+</head>
+<body>
+<p><span>text</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-percent-ref.html b/layout/reftests/text-indent/text-indent-single-line-percent-ref.html
new file mode 100644
index 0000000000..0eafe7c97c
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-percent-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<head>
+<title>text-indent test</title>
+<style type="text/css">
+div { width: 500px; }
+p { width: 300px; text-indent: 30px; }
+</style>
+</head>
+<body>
+<div>
+<p>text</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-percent.html b/layout/reftests/text-indent/text-indent-single-line-percent.html
new file mode 100644
index 0000000000..aeb4ae5f74
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-percent.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+div { width: 500px; }
+p { width: 300px; text-indent: 10%; }
+</style>
+</head>
+<body>
+<div>
+<p>text</p>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-ref-margin.html b/layout/reftests/text-indent/text-indent-single-line-ref-margin.html
new file mode 100644
index 0000000000..7fb1be9993
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-ref-margin.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+p { margin-left: 100px }
+</style>
+</head>
+<body>
+<p>text</p>
+</body>
+</html>
diff --git a/layout/reftests/text-indent/text-indent-single-line-ref-unstyled.html b/layout/reftests/text-indent/text-indent-single-line-ref-unstyled.html
new file mode 100644
index 0000000000..5863a40c7b
--- /dev/null
+++ b/layout/reftests/text-indent/text-indent-single-line-ref-unstyled.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<head>
+<title>CSS 2.1 Test Suite: text-indent test</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/" />
+<link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+<link rel="help" href="http://www.w3.org/TR/CSS21/text.html#indentation-prop" />
+<meta name="flags" content="" />
+<style type="text/css">
+</style>
+</head>
+<body>
+<p>text</p>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/TestEllipsisFallback.woff b/layout/reftests/text-overflow/TestEllipsisFallback.woff
new file mode 100644
index 0000000000..4de40fbbb2
--- /dev/null
+++ b/layout/reftests/text-overflow/TestEllipsisFallback.woff
Binary files differ
diff --git a/layout/reftests/text-overflow/aligned-baseline-ref.html b/layout/reftests/text-overflow/aligned-baseline-ref.html
new file mode 100644
index 0000000000..458731f88d
--- /dev/null
+++ b/layout/reftests/text-overflow/aligned-baseline-ref.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Testcase for bug 668919</title>
+
+<style>
+.tab-title {
+ overflow:hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 5em;
+ height:25px;
+}
+
+.c1 { font-size: 14px; }
+.c2 { font-size: 15px; }
+.c3 { font-size: 16px; }
+.c4 { font-size: 17px; }
+.c5 { font-size: 18px; }
+.c6 { font-size: 19px; }
+.c7 { font-size: 20px; }
+.c8 { font-size: 24px; }
+.c9 { font-size: 28px; }
+.c10 { font-size: 32px; }
+.c11 { font-size: 36px; }
+
+.p0 { padding-top:0; }
+.p1 { padding-top:0px; }
+.p2 { padding-top:0px; }
+
+.col2 .tab-title { text-shadow: 1px 1px 1px blue; }
+</style>
+ </head>
+<body>
+
+<div style="position:absolute; top: 0px;">
+<div class="tab-title c1 p0">CSS is awesome</div>
+<div class="tab-title c1 p2">CSS is awesome</div>
+<div class="tab-title c1 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 100px;">
+<div class="tab-title c2 p0">CSS is awesome</div>
+<div class="tab-title c2 p2">CSS is awesome</div>
+<div class="tab-title c2 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 200px;">
+<div class="tab-title c3 p0">CSS is awesome</div>
+<div class="tab-title c3 p2">CSS is awesome</div>
+<div class="tab-title c3 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 300px;">
+<div class="tab-title c4 p0">CSS is awesome</div>
+<div class="tab-title c4 p2">CSS is awesome</div>
+<div class="tab-title c4 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 400px;">
+<div class="tab-title c5 p0">CSS is awesome</div>
+<div class="tab-title c5 p2">CSS is awesome</div>
+<div class="tab-title c5 p3">CSS is awesome</div>
+</div>
+
+<div class="col2" style="position:absolute; top: 0px; left:8em;">
+<div style="position:absolute; top: 0px;">
+<div class="tab-title c1 p0">CSS is awesome</div>
+<div class="tab-title c1 p2">CSS is awesome</div>
+<div class="tab-title c1 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 100px;">
+<div class="tab-title c2 p0">CSS is awesome</div>
+<div class="tab-title c2 p2">CSS is awesome</div>
+<div class="tab-title c2 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 200px;">
+<div class="tab-title c3 p0">CSS is awesome</div>
+<div class="tab-title c3 p2">CSS is awesome</div>
+<div class="tab-title c3 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 300px;">
+<div class="tab-title c4 p0">CSS is awesome</div>
+<div class="tab-title c4 p2">CSS is awesome</div>
+<div class="tab-title c4 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 400px;">
+<div class="tab-title c5 p0">CSS is awesome</div>
+<div class="tab-title c5 p2">CSS is awesome</div>
+<div class="tab-title c5 p3">CSS is awesome</div>
+</div>
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/aligned-baseline.html b/layout/reftests/text-overflow/aligned-baseline.html
new file mode 100644
index 0000000000..0703403032
--- /dev/null
+++ b/layout/reftests/text-overflow/aligned-baseline.html
@@ -0,0 +1,100 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>Testcase for bug 668919</title>
+
+<style>
+.tab-title {
+ overflow:hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ width: 5em;
+ height:25px;
+}
+
+.c1 { font-size: 14px; }
+.c2 { font-size: 15px; }
+.c3 { font-size: 16px; }
+.c4 { font-size: 17px; }
+.c5 { font-size: 18px; }
+.c6 { font-size: 19px; }
+.c7 { font-size: 20px; }
+.c8 { font-size: 24px; }
+.c9 { font-size: 28px; }
+.c10 { font-size: 32px; }
+.c11 { font-size: 36px; }
+
+.p0 { padding-top:0; }
+.p1 { padding-top:0.1px; }
+.p2 { padding-top:0.2px; }
+
+.col2 .tab-title { text-shadow: 1px 1px 1px blue; }
+</style>
+ </head>
+<body>
+
+<div style="position:absolute; top: 0px;">
+<div class="tab-title c1 p0">CSS is awesome</div>
+<div class="tab-title c1 p2">CSS is awesome</div>
+<div class="tab-title c1 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 100px;">
+<div class="tab-title c2 p0">CSS is awesome</div>
+<div class="tab-title c2 p2">CSS is awesome</div>
+<div class="tab-title c2 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 200px;">
+<div class="tab-title c3 p0">CSS is awesome</div>
+<div class="tab-title c3 p2">CSS is awesome</div>
+<div class="tab-title c3 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 300px;">
+<div class="tab-title c4 p0">CSS is awesome</div>
+<div class="tab-title c4 p2">CSS is awesome</div>
+<div class="tab-title c4 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 400px;">
+<div class="tab-title c5 p0">CSS is awesome</div>
+<div class="tab-title c5 p2">CSS is awesome</div>
+<div class="tab-title c5 p3">CSS is awesome</div>
+</div>
+
+<div class="col2" style="position:absolute; top: 0px; left:8em;">
+<div style="position:absolute; top: 0px;">
+<div class="tab-title c1 p0">CSS is awesome</div>
+<div class="tab-title c1 p2">CSS is awesome</div>
+<div class="tab-title c1 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 100px;">
+<div class="tab-title c2 p0">CSS is awesome</div>
+<div class="tab-title c2 p2">CSS is awesome</div>
+<div class="tab-title c2 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 200px;">
+<div class="tab-title c3 p0">CSS is awesome</div>
+<div class="tab-title c3 p2">CSS is awesome</div>
+<div class="tab-title c3 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 300px;">
+<div class="tab-title c4 p0">CSS is awesome</div>
+<div class="tab-title c4 p2">CSS is awesome</div>
+<div class="tab-title c4 p3">CSS is awesome</div>
+</div>
+
+<div style="position:absolute; top: 400px;">
+<div class="tab-title c5 p0">CSS is awesome</div>
+<div class="tab-title c5 p2">CSS is awesome</div>
+<div class="tab-title c5 p3">CSS is awesome</div>
+</div>
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/anonymous-block-ref.html b/layout/reftests/text-overflow/anonymous-block-ref.html
new file mode 100644
index 0000000000..441d79c82d
--- /dev/null
+++ b/layout/reftests/text-overflow/anonymous-block-ref.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: anonymous block</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:50%;
+ height:10em;
+
+ border:1px solid black;
+ white-space:pre;
+ margin-left:2em;
+ margin-bottom:2em;
+ line-height:1.5em;
+}
+i {
+ display:inline-block;
+ height: 3em;
+ width: 5em;
+ background: blue;
+ font-style:normal;
+}
+span {
+ position:relative;
+ background:pink;
+ top:40px;
+ left:16em;
+}
+
+.t1 {width:6em;}
+.t2 {width:2em;}
+.t3 {width:25em;}
+.t4 {width:17.5em;}
+
+input { font-family:DejaVuSansMono; }
+
+</style>
+
+</head><body>
+
+
+<div class="test t1"><x>Some ove<m>&#x2026;</m><span><i style="display:block;">anonymous<br>block</i>and</span> unin<m>&#x2026;</m></x></div>
+<div class="test t2"><x>So<m>&#x2026;</m><i style="display:block;">anonymous<br>block</i>an<m>&#x2026;</m></x></div>
+<div style="position:absolute;"><div class="test t3" style="border-style:none;padding:1px"><x>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<m style="padding-left:16em">&#x2026;</m></div></div>
+<div class="test t3"><x>Some overly <span>l&nbsp;&nbsp;&nbsp;</span><span><i style="display:block;">anonymous<br>block</i>and</span> uninformative sentence</x></div>
+<div class="test t4"><x>Some overly <m>&#x2026;</m><span>long<i style="display:block;">anonymous<br>block</i>a&nbsp;&nbsp;</span> uninformative sentence</x></div>
+
+<input size="4" placeholder="pla&#x2026;">
+<input size="4" dir="rtl" placeholder="der&#x2026;">
+<input size="4" placeholder="plaX">
+<input size="4" dir="rtl" placeholder="Xder">
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/anonymous-block.html b/layout/reftests/text-overflow/anonymous-block.html
new file mode 100644
index 0000000000..e61ffd4bd9
--- /dev/null
+++ b/layout/reftests/text-overflow/anonymous-block.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: overflowing anonymous block should not have marker
+-->
+<html><head>
+<title>text-overflow: anonymous block</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ text-overflow:ellipsis;
+ overflow:hidden;
+ width:50%;
+ height:10em;
+
+ border:1px solid black;
+ white-space:pre;
+ margin-left:2em;
+ margin-bottom:2em;
+ line-height:1.5em;
+}
+i {
+ display:inline-block;
+ height: 3em;
+ width: 5em;
+ background: blue;
+ font-style:normal;
+}
+span {
+ position:relative;
+ background:pink;
+ top:40px;
+ left:16em;
+}
+
+.t1 {width:6em;}
+.t2 {width:2em;}
+.t3 {width:25em;}
+.t4 {width:17.5em;}
+
+input { font-family:DejaVuSansMono; }
+input::placeholder {
+ overflow:hidden;
+ text-overflow:ellipsis;
+}
+input.t5::placeholder {
+ text-overflow:"X";
+}
+
+</style>
+
+</head><body>
+
+
+<div class="test t1"><x>Some overly <span>long<i style="display:block;">anonymous<br>block</i>and</span> uninformative sentence</x></div>
+<div class="test t2"><x>Some overly long<i style="display:block;">anonymous<br>block</i>and uninformative sentence</x></div>
+<div class="test t3"><x>Some overly <span>long<i style="display:block;">anonymous<br>block</i>and</span> uninformative sentence</x></div>
+<div class="test t4"><x>Some overly <span>long<i style="display:block;">anonymous<br>block</i>and</span> uninformative sentence</x></div>
+
+<input size="4" placeholder="placeholder">
+<input size="4" dir="rtl" placeholder="placeholder">
+<input size="4" class="t5" placeholder="placeholder">
+<input size="4" class="t5" dir="rtl" placeholder="placeholder">
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/atomic-under-marker-ref.html b/layout/reftests/text-overflow/atomic-under-marker-ref.html
new file mode 100644
index 0000000000..fd118943ff
--- /dev/null
+++ b/layout/reftests/text-overflow/atomic-under-marker-ref.html
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow with overflow where introducing a marker would cause
+ the line to have no visible text or atomic inline-level content --
+ then we should either suppress or clip the marker
+-->
+<html><head>
+<title>text-overflow: suppress or clip the marker when it hides all content</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:100px;
+ white-space:nowrap;
+ margin:0 100px;
+}
+span {
+ width:97px;
+ display:inline-block;
+}
+s {
+ width:3px;
+ height:10px;
+ margin-left:-2px;
+ display:inline-block;
+ background:blue;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 { }
+.t2 { }
+.t3 { margin-left:98px; padding-left:3px; }
+
+i {
+ display:inline-block;
+ width:2px;
+ height:10px;
+ background:blue;
+}
+
+</style>
+
+</head><body>
+
+<div style="float:left;">
+<div class="test t1"><span>!</span>&#x2026;</div> <!-- atomic under marker -->
+<div class="test t1"><span>!</span>&#x2026;</div> <!-- atomic in padding -->
+<div class="test t1"><span>!</span>&#x2026;</div> <!-- atomic under marker and in padding -->
+<div class="test t2"><span>!</span>&#x2026;</div> <!-- atomic under marker -->
+<div class="test t2"><span>!</span>&#x2026;</div> <!-- atomic in padding -->
+<div class="test t2"><span>!</span>&#x2026;</div> <!-- atomic under marker and in padding -->
+
+<div class="test rtl t1"><span>!</span>&#x2026;</div> <!-- atomic under marker -->
+<div class="test rtl t1"><span>!</span>&#x2026;</div> <!-- atomic in padding -->
+<div class="test rtl t1"><span>!</span>&#x2026;</div> <!-- atomic under marker and in padding -->
+<div class="test t2"><x style="margin-left:3px">.|</style></div> <!-- atomic under marker -->
+<div class="test t3">g<i></i></div> <!-- atomic in padding -->
+<div class="test t2"><s style="margin-left:1px;"></s><i style="width:17px"></i></div> <!-- atomic under marker and in padding -->
+
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/atomic-under-marker.html b/layout/reftests/text-overflow/atomic-under-marker.html
new file mode 100644
index 0000000000..db37d05e0a
--- /dev/null
+++ b/layout/reftests/text-overflow/atomic-under-marker.html
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow with overflow where introducing a marker would cause
+ the line to have no visible text or atomic inline-level content --
+ then we should either suppress or clip the marker
+-->
+<html><head>
+<title>text-overflow: suppress or clip the marker when it hides all content</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:100px;
+ white-space:nowrap;
+ padding:0 100px;
+}
+span {
+ width:97px;
+ display:inline-block;
+}
+s {
+ width:3px;
+ height:10px;
+ margin-left:-2px;
+ display:inline-block;
+ background:blue;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 { text-overflow:ellipsis; }
+.t2 { text-overflow:"." ellipsis; }
+.t3 { text-overflow:"long" ellipsis; }
+
+i {
+ display:inline-block;
+ width:2px;
+ height:10px;
+ background:blue;
+}
+
+</style>
+
+</head><body>
+
+<div style="float:left;">
+<div class="test t1"><span>!</span><i></i>||</div> <!-- atomic under marker -->
+<div class="test t1"><span>!</span>||<i></i></div> <!-- atomic in padding -->
+<div class="test t1"><span>!</span><i style="width:20px"></i></div> <!-- atomic under marker and in padding -->
+<div class="test t2"><span>!</span><i></i>||</div> <!-- atomic under marker -->
+<div class="test t2"><span>!</span>||<i></i></div> <!-- atomic in padding -->
+<div class="test t2"><span>!</span><i style="width:20px"></i></div> <!-- atomic under marker and in padding -->
+
+<div class="test rtl t1"><span>!</span><i></i>||</div> <!-- atomic under marker -->
+<div class="test rtl t1"><span>!</span>||<i></i></div> <!-- atomic in padding -->
+<div class="test rtl t1"><span>!</span><i style="width:20px"></i></div> <!-- atomic under marker and in padding -->
+<div class="test t2"><s></s><i></i>||</div> <!-- atomic under marker -->
+<div class="test t3"><s></s>|<i></i></div> <!-- atomic in padding -->
+<div class="test t2"><s></s><i style="width:20px"></i></div> <!-- atomic under marker and in padding -->
+
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/bidi-simple-ref.html b/layout/reftests/text-overflow/bidi-simple-ref.html
new file mode 100644
index 0000000000..3a28b6df0a
--- /dev/null
+++ b/layout/reftests/text-overflow/bidi-simple-ref.html
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: simple mixed-bidi cases</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ white-space:nowrap;
+ width: 4.4em;
+ position:relative;
+ margin-top:1em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.7em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+r {
+ position:absolute;
+ top:0; right:0;
+}
+l {
+ position:absolute;
+ top:0; left:0;
+}
+</style>
+
+</head><body>
+
+
+<!-- LTR overflow:scroll -->
+<div class="test"><r>&#x2026</r>AxxxxB&nbsp;&nbsp;<span class="rlo">HelloWor</span>Axxxx<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><r>&#x2026</r><span class="rlo">He&nbsp;&nbsp;oWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><r>&#x2026</r><span class="rlo">He&nbsp;&nbsp;oWorld</span></div>
+
+
+<!-- LTR overflow:hidden -->
+<div class="test hidden">AxxxxB<m>&#x2026</m><span class="rlo">HelloWorl&nbsp;</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">H&nbsp;&nbsp;<m>&#x2026</m>oWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">H&nbsp;&nbsp;<m>&#x2026</m>oWorld</span></div>
+
+<!-- RTL overflow:scroll -->
+<div class="test rtl"><l>&#x2026</l>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloW&nbsp;&nbsp;ld</span></div>
+
+<div class="test rtl"><l>&#x2026</l><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloW&nbsp;&nbsp;ld</span></div>
+
+<div class="test rtl"><l>&#x2026</l><span class="rlo">HelloW&nbsp;&nbsp;ld</span></div>
+
+
+<!-- RTL overflow:hidden -->
+<div class="test rtl hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloW<m>&#x2026</m>&nbsp;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloW<m>&#x2026</m>&nbsp;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloW<m>&#x2026</m>&nbsp;&nbsp;&nbsp;</span></div>
+
+
+
+
+</body></html>
diff --git a/layout/reftests/text-overflow/bidi-simple-scrolled-ref.html b/layout/reftests/text-overflow/bidi-simple-scrolled-ref.html
new file mode 100644
index 0000000000..65eff80bce
--- /dev/null
+++ b/layout/reftests/text-overflow/bidi-simple-scrolled-ref.html
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: simple mixed-bidi cases</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ white-space:nowrap;
+ width: 4.4em;
+ margin-bottom:1em;
+ position:relative;
+ line-height:2em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.7em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+rr {
+ position:absolute;
+ bottom:0; right:8px;
+}
+r {
+ position:absolute;
+ bottom:0; right:-8px;
+}
+ll {
+ position:absolute;
+ bottom:0; left:8px;
+}
+l {
+ position:absolute;
+ bottom:0; left:-8px;
+}
+
+</style>
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ if (window.getComputedStyle(divs[i]).direction == 'ltr')
+ divs[i].scrollLeft = 8;
+ else
+ divs[i].scrollLeft = -8;
+ }
+ document.documentElement.removeAttribute('class');
+}
+</script>
+
+</head><body onload="scrolldivs()">
+
+<!-- LTR block -->
+
+<div class="test"><ll>&#x2026;</ll><r>&#x2026;</r>&nbsp;&nbsp;xxB&nbsp;<span class="rlo">&#x2026;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;xxxx<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><ll>&#x2026;</ll><r>&#x2026;</r><span class="rlo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wor&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;B<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><ll>&#x2026;</ll><r>&#x2026;</r><span class="rlo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wor&nbsp;&nbsp;</span></div>
+
+<!-- RTL block -->
+<div class="test rtl"><rr>&#x2026;</rr><l>&#x2026;</l>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">&nbsp;&nbsp;llo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl"><rr>&#x2026;</rr><l>&#x2026;</l><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">&nbsp;&nbsp;llo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl"><rr>&#x2026;</rr><l>&#x2026;</l><span class="rlo">&nbsp;&nbsp;llo&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div>
+
+
+<div class="test rtl hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">&nbsp;&#x2026;lloWo&#x2026;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">&nbsp;&#x2026;lloWo&#x2026;&nbsp;&nbsp;</span></div>
+
+<div class="test rtl hidden"><span class="rlo">&nbsp;&#x2026;lloWo&#x2026;&nbsp;&nbsp;</span></div>
+
+
+<div class="test hidden">&nbsp;&#x2026;xxxB<span class="rlo">Hello&nbsp;&nbsp;&nbsp;&#x2026;d</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">&nbsp;&nbsp;&#x2026;loWor&#x2026;&nbsp;</span>&nbsp;xxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">&nbsp;&nbsp;&#x2026;loWor&#x2026;&nbsp;</span></div>
+
+<span style="position:absolute; top:0; left:6em; height:6em; overflow:hidden;">
+<div class="test rtl"><br><br><rr>&#x2026;</rr><l>&#x2026;</l><span class="rlo">&nbsp;&nbsp;lloW&nbsp;&nbsp;&nbsp;&nbsp;HelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorld</span></div>
+</span>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/bidi-simple-scrolled.html b/layout/reftests/text-overflow/bidi-simple-scrolled.html
new file mode 100644
index 0000000000..489535ab83
--- /dev/null
+++ b/layout/reftests/text-overflow/bidi-simple-scrolled.html
@@ -0,0 +1,98 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Simple bidi cases, scrolled a bit from the start position
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: simple mixed-bidi cases, scrolled a bit from the start position</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+.test {
+ overflow:auto;
+ text-overflow:ellipsis ellipsis;
+ white-space:nowrap;
+ width: 4.4em;
+ margin-bottom:1em;
+ position:relative;
+ line-height:2em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.7em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+</style>
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ if (window.getComputedStyle(divs[i]).direction == 'ltr')
+ divs[i].scrollLeft = 8;
+ else
+ divs[i].scrollLeft = -8;
+ }
+ document.documentElement.removeAttribute('class');
+}
+</script>
+
+</head><body onload="scrolldivs()">
+
+<!-- LTR block -->
+
+<div class="test ltr">AxxxB&nbsp;<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test ltr"><span class="rlo">Hell&nbsp;World</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test ltr"><span class="rlo">Hell&nbsp;World</span></div>
+
+
+<!-- RTL block -->
+<div class="test rtl">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">Hello&nbsp;orld</span></div>
+
+<div class="test rtl"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">Hello&nbsp;orld</span></div>
+
+<div class="test rtl"><span class="rlo">Hello&nbsp;orld</span></div>
+
+
+<div class="test rtl hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span></div>
+
+<!-- LTR block -->
+
+
+<div class="test ltr hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test ltr hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test ltr hidden"><span class="rlo">HelloWorld</span></div>
+
+<span style="position:absolute; top:0; left:6em; height:6em; overflow:hidden;">
+<div class="test rtl"><br><br><span class="rlo">HelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorldHelloWorld</span></div>
+</span>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/bidi-simple.html b/layout/reftests/text-overflow/bidi-simple.html
new file mode 100644
index 0000000000..82dcdfb5ce
--- /dev/null
+++ b/layout/reftests/text-overflow/bidi-simple.html
@@ -0,0 +1,81 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Simple bidi cases
+-->
+<html><head>
+<title>text-overflow: simple mixed-bidi cases</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ text-overflow:ellipsis;
+ white-space:nowrap;
+ width: 4.4em;
+ position:relative;
+ margin-top:1em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.7em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+
+</style>
+
+</head><body>
+
+<!-- LTR overflow:scroll -->
+
+<div class="test">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test"><span class="rlo">HelloWorld</span></div>
+
+<!-- LTR overflow:hidden -->
+<div class="test hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test hidden"><span class="rlo">HelloWorld</span></div>
+
+<!-- RTL overflow:scroll -->
+
+<div class="test rtl">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl"><span class="rlo">HelloWorld</span></div>
+
+
+<!-- RTL overflow:hidden -->
+<div class="test rtl hidden">AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span>AxxxxB<span class="rlo">HelloWorld</span></div>
+
+<div class="test rtl hidden"><span class="rlo">HelloWorld</span></div>
+
+
+
+
+</body></html>
diff --git a/layout/reftests/text-overflow/block-padding-ref.html b/layout/reftests/text-overflow/block-padding-ref.html
new file mode 100644
index 0000000000..7e6539e4d8
--- /dev/null
+++ b/layout/reftests/text-overflow/block-padding-ref.html
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<!DOCTYPE HTML>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<title>text-overflow: text-overflow block padding </title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono; text-decoration-skip-ink: none;
+}
+body { width:24ch; overflow:hidden; }
+
+.test {
+ overflow: hidden;
+ white-space: nowrap;
+ padding-left: 1ch;
+ padding-right: 3ch;
+ height: 3em;
+ margin-bottom:1em;
+}
+.s {
+ overflow: auto; position:relative;
+ text-decoration: line-through;
+}
+.rel { position:relative; }
+span {
+ text-decoration: underline overline;
+ background:yellow;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo span {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro span {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.overlay {
+ position:absolute;
+ border-color:transparent;
+ text-decoration: line-through;
+ z-index:1;
+}
+y { background:yellow;}
+m { background:yellow; position:absolute; right:0; padding-right:3ch; z-index:2;}
+mr { background:yellow; position:absolute; left:0;padding-left:1ch; z-index:2;}
+</style>
+</head><body>
+
+<!-- LTR / LTR -->
+<div class="test ltr overlay"><r>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</r></div>
+<div class="test ltr"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|</span><y>&#x2026;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</y></div>
+
+<div class="test ltr s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><m>&#x2026;</m></div>
+
+<!-- RTL / LTR -->
+<div class="test rtl rel"><span><div class="overlay"><r>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</r></div>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|</span><y style="padding-left:3ch">&#x2026;</y></div>
+
+<div class="test rtl s"><mr>&#x2026;</mr><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+<!-- LTR / RTL -->
+<div class="test ltr rlo overlay"><r>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</r></div>
+<div class="test ltr rlo" ><span>&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span><y style="padding-right:3ch">&#x2026;</y></div>
+
+<div class="test ltr rlo s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span><m>&#x2026;</m></div>
+
+<!-- RTL / RTL -->
+<div class="test rtl rlo rel"><span><div class="overlay"><r>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</r></div>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|</span><y>&#x2026;&nbsp;</y></div>
+
+<div class="test rtl rlo s"><mr>&#x2026;</mr><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/block-padding.html b/layout/reftests/text-overflow/block-padding.html
new file mode 100644
index 0000000000..eda4217464
--- /dev/null
+++ b/layout/reftests/text-overflow/block-padding.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: test marker trigger point and alignment in a block with padding
+-->
+<!DOCTYPE HTML>
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<title>text-overflow: text-overflow block padding </title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono; text-decoration-skip-ink: none;
+}
+body { width:24ch; overflow:hidden; }
+
+.test {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis;
+ text-decoration: line-through;
+ padding-left: 1ch;
+ padding-right: 3ch;
+ height: 3em;
+ margin-bottom:1em;
+}
+.s {
+ overflow: auto;
+}
+span {
+ text-decoration: underline overline;
+ background:yellow;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo span {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro span {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+</style>
+
+</head><body>
+
+<!-- LTR / LTR -->
+<div class="test ltr" ><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+<div class="test ltr s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+<!-- RTL / LTR -->
+<div class="test rtl" ><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+<div class="test rtl s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+<!-- LTR / RTL -->
+<div class="test ltr rlo" ><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+<div class="test ltr rlo s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+<!-- RTL / RTL -->
+<div class="test rtl rlo" ><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+<div class="test rtl rlo s"><span>|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;|&nbsp;</span></div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/clipped-elements-ref.html b/layout/reftests/text-overflow/clipped-elements-ref.html
new file mode 100644
index 0000000000..393283f858
--- /dev/null
+++ b/layout/reftests/text-overflow/clipped-elements-ref.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html><html>
+<head><style>
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+}
+.test {
+ overflow: hidden;
+ text-align:right;
+ width: 50px;
+ margin-bottom:1em;
+ height: 20px;
+ white-space:nowrap;
+/*border:1px solid red;width: 500px;*/
+}
+.rel { position:relative; text-align:left;}
+input,select,fieldset,textarea,hr,span {
+ border:1px solid black;
+ background: white;
+ color: black;
+ padding:0 40px;
+}
+iframe,img { width: 80px; height:10px; }
+select[size="4"],iframe,textarea,hr { height:10px; margin:0; }
+</style></head>
+<body>
+
+<div style="position:absolute; top:0; left:0;">
+ <div class="test"><fieldset style="display:inline;"></fieldset></div>
+ <div class="test"><fieldset style="display:inline-block;"></fieldset></div>
+ <div class="test"><fieldset style="display:block;"></fieldset></div>
+
+ <div class="test"><input type="button"></div>
+ <div class="test"><input type="button" style="display:inline-block;"></div>
+ <div class="test"><input type="button" style="display:list-item;"></div>
+ <div class="test"><input type="button" style="display:block;"></div>
+
+ <div class="test"><input type="text"></div>
+ <div class="test"><input type="text" style="display:inline-block;"></div>
+ <div class="test"><input type="text" style="display:block;"></div>
+
+ <div class="test"><textarea></textarea></div>
+ <div class="test"><textarea style="display:inline-block;"></textarea></div>
+ <div class="test"><textarea style="display:block;"></textarea></div>
+
+ <div class="test"><select size="1" style=""><option>&nbsp;<option>&nbsp;</select></div>
+ <div class="test"><select size="1" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+
+ <div class="test"><select size="4" style=""><option>&nbsp;<option>&nbsp;</select></div>
+ <div class="test"><select size="4" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+</div>
+
+<div style="position:absolute; top:0; left:100px;">
+ <div class="test"><iframe src="about:blank" style=""></iframe></div>
+ <div class="test"><iframe src="about:blank" style="display:block"></iframe></div>
+
+ <div class="test" style="text-align:left">&nbsp;&#x2026;</div>
+ <div class="test" style="text-align:left">&nbsp;&#x2026;</div>
+ <div class="test"><img style="display:block;" src="../image/big.png"></div>
+
+ <div class="test"><x style="display:inline-block; height:100px; width:100%; background:lime">&#x2026;</x></div>
+ <div class="test"><hr style="display:inline-block;vertical-align:top"></div>
+ <div class="test"><hr style="display:block;"></div>
+
+ <div class="test">&#x2026;</div>
+ <div class="test"><span style="display:inline-block;"></span></div>
+ <div class="test"><span style="display:inline-table;"></span></div>
+ <div class="test"><span style="display:list-item;"></span></div>
+ <div class="test"><span style="display:block;"></span></div>
+ <div class="test rel">1<span style="position:relative;"></span></div>
+ <div class="test rel">2<span style="position:absolute;"></span></div>
+ <div class="test rel">3</div>
+ <div class="test rel">4</div>
+ <div class="test"><span style="float:left"></span></div>
+ <div class="test"><span style="float:left; margin-left:-10px"></span></div>
+ <div class="test"><span style="float:right; margin-right:-10px"></span></div>
+</div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/clipped-elements.html b/layout/reftests/text-overflow/clipped-elements.html
new file mode 100644
index 0000000000..ab4292ee64
--- /dev/null
+++ b/layout/reftests/text-overflow/clipped-elements.html
@@ -0,0 +1,80 @@
+<!DOCTYPE html><html>
+<head><style>
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+}
+.test {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ width: 50px;
+ margin-bottom:1em;
+ height: 20px;
+ white-space:nowrap;
+/*border:1px solid red;width: 500px;*/
+}
+.rel { position:relative;}
+input,select,fieldset,textarea,hr,span {
+ border:1px solid black;
+ background: white;
+ color: black;
+ padding:0 40px;
+}
+iframe,img { width: 80px; height:10px; }
+select[size="4"],iframe,textarea,hr { height:10px; margin:0; }
+
+x {visibility:hidden;display:inline-block;margin-left:-10px;width:1000px;}
+</style></head>
+<body>
+
+<div style="position:absolute; top:0; left:0;">
+ <div class="test"><fieldset style="display:inline;"></fieldset></div>
+ <div class="test"><fieldset style="display:inline-block;"></fieldset></div>
+ <div class="test"><fieldset style="display:block;"></fieldset></div>
+
+ <div class="test"><input type="button"></div>
+ <div class="test"><input type="button" style="display:inline-block;"></div>
+ <div class="test"><input type="button" style="display:list-item;"></div>
+ <div class="test"><input type="button" style="display:block;"></div>
+
+ <div class="test"><input type="text"></div>
+ <div class="test"><input type="text" style="display:inline-block;"></div>
+ <div class="test"><input type="text" style="display:block;"></div>
+
+ <div class="test"><textarea></textarea></div>
+ <div class="test"><textarea style="display:inline-block;"></textarea></div>
+ <div class="test"><textarea style="display:block;"></textarea></div>
+
+ <div class="test"><select size="1" style=""><option>&nbsp;<option>&nbsp;</select></div>
+ <div class="test"><select size="1" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+
+ <div class="test"><select size="4" style=""><option>&nbsp;<option>&nbsp;</select></div>
+ <div class="test"><select size="4" style="display:block;"><option>&nbsp;<option>&nbsp;</select></div>
+</div>
+
+<div style="position:absolute; top:0; left:100px;">
+ <div class="test"><iframe src="about:blank" style=""></iframe></div>
+ <div class="test"><iframe src="about:blank" style="display:block"></iframe></div>
+
+ <div class="test">&nbsp;<img src="../image/big.png"></div>
+ <div class="test">&nbsp;<img style="display:inline-block;" src="../image/big.png"></div>
+ <div class="test"><img style="display:block;" src="../image/big.png"></div>
+
+ <div class="test"><hr style="display:inline;background:lime;vertical-align:top;padding-top:100px;padding-bottom:100px; border-width:0"></div>
+ <div class="test"><hr style="display:inline-block;vertical-align:top"></div>
+ <div class="test"><hr style="display:block;"></div>
+
+ <div class="test"><span style="border-width:0"></span></div>
+ <div class="test"><span style="display:inline-block;"></span></div>
+ <div class="test"><span style="display:inline-table;"></span></div>
+ <div class="test"><span style="display:list-item;"></span></div>
+ <div class="test"><span style="display:block;"></span></div>
+ <div class="test rel">1<span style="position:relative;"></span></div>
+ <div class="test rel">2<span style="position:absolute"></span></div>
+ <div class="test rel">3<span style="position:absolute; left:60px"></span></div>
+ <div class="test rel">4<x></x><span style="position:absolute;">abs4</span></div>
+ <div class="test"><span style="float:left"></span></div>
+ <div class="test"><span style="float:left; margin-left:-10px"></span></div>
+ <div class="test"><span style="float:right; margin-right:-10px"></span></div>
+</div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/combobox-zoom-ref.html b/layout/reftests/text-overflow/combobox-zoom-ref.html
new file mode 100644
index 0000000000..35b97ea247
--- /dev/null
+++ b/layout/reftests/text-overflow/combobox-zoom-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+ -->
+<html reftest-zoom="1.5">
+<head>
+<style>
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; padding:0; margin:0;
+}
+* {
+ font-family:DejaVuSansMono!important;
+ font-size:16px!important;
+}
+select {
+ width: 200px;
+ padding-right: 8px;
+
+ -moz-appearance: none;
+}
+</style>
+</head>
+<body>
+<select></select><br>
+
+<select><option>long string long s</option></select>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/combobox-zoom.html b/layout/reftests/text-overflow/combobox-zoom.html
new file mode 100644
index 0000000000..e45ed6d3fa
--- /dev/null
+++ b/layout/reftests/text-overflow/combobox-zoom.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+ -->
+<html reftest-zoom="1.5">
+<head>
+<style>
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; padding:0; margin:0;
+}
+* {
+ font-family:DejaVuSansMono!important;
+ font-size:16px!important;
+}
+select {
+ width: 200px;
+ padding-right: 8px;
+ text-overflow: " ";
+ -moz-appearance: none;
+}
+</style>
+</head>
+<body>
+<select></select><br>
+
+<select><option>long string long string long string long string long string long string long string</option></select>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/dynamic-change-1-ref.html b/layout/reftests/text-overflow/dynamic-change-1-ref.html
new file mode 100644
index 0000000000..2a1560e07f
--- /dev/null
+++ b/layout/reftests/text-overflow/dynamic-change-1-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <div style="overflow: hidden; width: 130px; white-space: nowrap;
+ text-overflow: ellipsis">
+ Some long text that cannot possibly fit in 130 px, because it just can't.
+ </div>
+</html>
diff --git a/layout/reftests/text-overflow/dynamic-change-1.html b/layout/reftests/text-overflow/dynamic-change-1.html
new file mode 100644
index 0000000000..d2c6c3a9e2
--- /dev/null
+++ b/layout/reftests/text-overflow/dynamic-change-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <div style="overflow: hidden; width: 130px; white-space: nowrap">
+ Some long text that cannot possibly fit in 130 px, because it just can't.
+ </div>
+
+ <script>
+ onload = function() {
+ var div = document.querySelector("div");
+ // Make sure layout has happened.
+ window.width = div.offsetWidth;
+ div.style.textOverflow = "ellipsis";
+ document.documentElement.className = "";
+ }
+ </script>
+</html>
diff --git a/layout/reftests/text-overflow/ellipsis-font-fallback-ref.html b/layout/reftests/text-overflow/ellipsis-font-fallback-ref.html
new file mode 100644
index 0000000000..e6a47e8640
--- /dev/null
+++ b/layout/reftests/text-overflow/ellipsis-font-fallback-ref.html
@@ -0,0 +1,149 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: fallback to three ASCII periods when ellipsis is unavailable in the font
+-->
+<html><head>
+ <title>text-overflow: ellipsis fallback</title>
+ <style type="text/css">
+@font-face {
+ /* This font has glyphs for ASCII period, upper-case X and space. */
+ font-family: TestEllipsisFallback;
+ src: url(TestEllipsisFallback.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family: TestEllipsisFallback;
+}
+
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+m {
+ color:blue;
+}
+.o span {
+ color:black;
+}
+
+.s {
+ width:10em;
+}
+.s2 {
+ width:10em;
+}
+.s3 {
+ width:6em;
+}
+.s4 {
+ width:8em;
+}
+.s5 {
+ width:5em;
+}
+.s6 {
+ width:1em;
+}
+.s7 {
+ width:6em;
+}
+.p {
+ overflow: hidden;
+ white-space:nowrap;
+}
+.r {
+ text-align:right;
+}
+
+.c {
+ margin-left:-0.5em;
+ margin-right:-0.5em;
+}
+
+
+#test1a { top:0em; left:0; position:absolute; }
+#test1b { top:2em; left:0; position:absolute; }
+#test1c { top:4em; left:0; position:absolute; }
+#test1d { top:6em; left:0; position:absolute; }
+
+#test2a { top:0em; left:15em; position:absolute; }
+#test2b { top:2em; left:15em; position:absolute; }
+#test2c { top:4em; left:15em; position:absolute; }
+#test2d { top:6em; left:15em; position:absolute; }
+
+#test3a { top: 8em; left:0; position:absolute; }
+#test3b { top:10em; left:0; position:absolute; }
+#test3c { top:12em; left:0; position:absolute; }
+#test3d { top:14em; left:0; position:absolute; }
+
+#test4a { top: 8em; left:15em; position:absolute; }
+#test4b { top:10em; left:15em; position:absolute; }
+#test4c { top:12em; left:15em; position:absolute; }
+#test4d { top:14em; left:15em; position:absolute; }
+
+#test5a { top:16em; left:0; position:absolute; }
+#test5b { top:18em; left:0; position:absolute; }
+#test5c { top:20em; left:0; position:absolute; }
+#test5d { top:22em; left:0; position:absolute; }
+
+#test6a { top:16em; left:15em; position:absolute; }
+#test6b { top:18em; left:15em; position:absolute; }
+#test6c { top:20em; left:15em; position:absolute; }
+#test6d { top:22em; left:15em; position:absolute; }
+
+#test7a { top:24em; left:0; position:absolute; }
+#test7b { top:26em; left:0; position:absolute; }
+#test7c { top:28em; left:0; position:absolute; }
+#test7d { top:30em; left:0; position:absolute; }
+
+
+ </style>
+</head>
+<body>
+<div style="position: absolute; top:20px; left:50px;">
+
+<!-- start + end marker -->
+<div id="test1a"><div class="s ltr"><div class="p o"><span class="c lro">&nbsp;<m>...</m>X<m>...</m>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></div></div>
+<div id="test1b"><div class="s rtl"><div class="p o"><span class="c lro">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<m>...</m>X<m>...</m>&nbsp;</span></div></div></div>
+<div id="test1c"><div class="s ltr"><div class="p o"><span class="c rlo">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<m>...</m>X<m>...</m>&nbsp;</span></div></div></div>
+<div id="test1d"><div class="s rtl"><div class="p o"><span class="c rlo">&nbsp;<m>...</m>X<m>...</m>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></div></div>
+
+<!-- end marker -->
+<div id="test2a"><div class="s2 ltr"><div class="p o"><span class="lro">XXXXX<m>...</m>&nbsp;</span></div></div></div>
+<div id="test2b"><div class="s2 rtl"><div class="p o"><span class="lro">&nbsp;<m>...</m>XXXXX</span></div></div></div>
+<div id="test2c"><div class="s2 ltr"><div class="p o"><span class="rlo">&nbsp;<m>...</m>XXXXX</span></div></div></div>
+<div id="test2d"><div class="s2 rtl"><div class="p o"><span class="rlo">XXXXX<m>...</m>&nbsp;</span></div></div></div>
+
+<!-- start marker -->
+<div id="test3a"><div class="s3 ltr"><div class="p o"><span class="c lro">&nbsp;X<m>...</m></span></div></div></div>
+<div id="test3b"><div class="s3 rtl"><div class="p o"><span class="c lro"><m>...</m>X&nbsp;</span></div></div></div>
+<div id="test3c"><div class="s3 ltr"><div class="p o"><span class="c rlo"><m>...</m>X&nbsp;</span></div></div></div>
+<div id="test3d"><div class="s3 rtl"><div class="p o"><span class="c rlo">&nbsp;X<m>...</m></span></div></div></div>
+
+<!-- start + end marker, no characters fit, marker is clipped -->
+<div id="test6a"><div class="s6 ltr"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6b"><div class="s6 rtl"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6c"><div class="s6 ltr"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6d"><div class="s6 rtl"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+
+<!-- start marker, all characters overlapped by marker -->
+<div id="test7a"><div class="s7 ltr"><div class="p o"><span class="c lro">XXX</span></div></div></div>
+<div id="test7b"><div class="s7 rtl"><div class="p o"><span class="c lro">XXX</span></div></div></div>
+<div id="test7c"><div class="s7 ltr"><div class="p o"><span class="c rlo">XXX</span></div></div></div>
+<div id="test7d"><div class="s7 rtl"><div class="p o"><span class="c rlo">XXX</span></div></div></div>
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/ellipsis-font-fallback.html b/layout/reftests/text-overflow/ellipsis-font-fallback.html
new file mode 100644
index 0000000000..f02d569d0a
--- /dev/null
+++ b/layout/reftests/text-overflow/ellipsis-font-fallback.html
@@ -0,0 +1,150 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: fallback to three ASCII periods when ellipsis is unavailable in the font
+-->
+<html><head>
+ <title>text-overflow: ellipsis fallback</title>
+ <style type="text/css">
+@font-face {
+ /* This font has glyphs for ASCII period, upper-case X and space. */
+ font-family: TestEllipsisFallback;
+ src: url(TestEllipsisFallback.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family: TestEllipsisFallback;
+}
+
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+.o {
+ text-overflow: ellipsis ellipsis;
+ color:blue;
+}
+.o span {
+ color:black;
+}
+
+.s {
+ width:10em;
+}
+.s2 {
+ width:10em;
+}
+.s3 {
+ width:6em;
+}
+.s4 {
+ width:8em;
+}
+.s5 {
+ width:5em;
+}
+.s6 {
+ width:1em;
+}
+.s7 {
+ width:6em;
+}
+.p {
+ overflow: hidden;
+ white-space:nowrap;
+}
+.r {
+ text-align:right;
+}
+
+.c {
+ margin-left:-0.5em;
+ margin-right:-0.5em;
+}
+
+
+#test1a { top:0em; left:0; position:absolute; }
+#test1b { top:2em; left:0; position:absolute; }
+#test1c { top:4em; left:0; position:absolute; }
+#test1d { top:6em; left:0; position:absolute; }
+
+#test2a { top:0em; left:15em; position:absolute; }
+#test2b { top:2em; left:15em; position:absolute; }
+#test2c { top:4em; left:15em; position:absolute; }
+#test2d { top:6em; left:15em; position:absolute; }
+
+#test3a { top: 8em; left:0; position:absolute; }
+#test3b { top:10em; left:0; position:absolute; }
+#test3c { top:12em; left:0; position:absolute; }
+#test3d { top:14em; left:0; position:absolute; }
+
+#test4a { top: 8em; left:15em; position:absolute; }
+#test4b { top:10em; left:15em; position:absolute; }
+#test4c { top:12em; left:15em; position:absolute; }
+#test4d { top:14em; left:15em; position:absolute; }
+
+#test5a { top:16em; left:0; position:absolute; }
+#test5b { top:18em; left:0; position:absolute; }
+#test5c { top:20em; left:0; position:absolute; }
+#test5d { top:22em; left:0; position:absolute; }
+
+#test6a { top:16em; left:15em; position:absolute; }
+#test6b { top:18em; left:15em; position:absolute; }
+#test6c { top:20em; left:15em; position:absolute; }
+#test6d { top:22em; left:15em; position:absolute; }
+
+#test7a { top:24em; left:0; position:absolute; }
+#test7b { top:26em; left:0; position:absolute; }
+#test7c { top:28em; left:0; position:absolute; }
+#test7d { top:30em; left:0; position:absolute; }
+
+ </style>
+</head>
+<body>
+<div style="position: absolute; top:20px; left:50px;">
+
+<!-- start + end marker -->
+<div id="test1a"><div class="s ltr"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test1b"><div class="s rtl"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test1c"><div class="s ltr"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+<div id="test1d"><div class="s rtl"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+
+<!-- end marker -->
+<div id="test2a"><div class="s2 ltr"><div class="p o"><span class="lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test2b"><div class="s2 rtl"><div class="p o"><span class="lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test2c"><div class="s2 ltr"><div class="p o"><span class="rlo">XXXXXXXXXXXX</span></div></div></div>
+<div id="test2d"><div class="s2 rtl"><div class="p o"><span class="rlo">XXXXXXXXXXXX</span></div></div></div>
+
+<!-- start marker -->
+<div id="test3a"><div class="s3 ltr"><div class="p o"><span class="c lro">XXXXXX</span></div></div></div>
+<div id="test3b"><div class="s3 rtl"><div class="p o"><span class="c lro">XXXXXX</span></div></div></div>
+<div id="test3c"><div class="s3 ltr"><div class="p o"><span class="c rlo">XXXXXX</span></div></div></div>
+<div id="test3d"><div class="s3 rtl"><div class="p o"><span class="c rlo">XXXXXX</span></div></div></div>
+
+<!-- start + end marker, no characters fit, marker is clipped -->
+<div id="test6a"><div class="s6 ltr"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6b"><div class="s6 rtl"><div class="p o"><span class="c lro">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6c"><div class="s6 ltr"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+<div id="test6d"><div class="s6 rtl"><div class="p o"><span class="c rlo">XXXXXXXXXXXX</span></div></div></div>
+
+<!-- start marker, all characters overlapped by marker -->
+<div id="test7a"><div class="s7 ltr"><div class="p o"><span class="c lro">XXX</span></div></div></div>
+<div id="test7b"><div class="s7 rtl"><div class="p o"><span class="c lro">XXX</span></div></div></div>
+<div id="test7c"><div class="s7 ltr"><div class="p o"><span class="c rlo">XXX</span></div></div></div>
+<div id="test7d"><div class="s7 rtl"><div class="p o"><span class="c rlo">XXX</span></div></div></div>
+
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/false-marker-overlap-ref.html b/layout/reftests/text-overflow/false-marker-overlap-ref.html
new file mode 100644
index 0000000000..0a6ed9d0ef
--- /dev/null
+++ b/layout/reftests/text-overflow/false-marker-overlap-ref.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: false marker overlap
+-->
+<html><head>
+<title>text-overflow: form control elements</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow: hidden;
+ white-space: nowrap;
+ color: black;
+ height: 6em;
+ width: 32.5em;
+ margin-bottom: 1em;
+}
+
+i {
+ display:inline-block;
+ height: 3em;
+ width: 3em;
+ border:1px solid blue;
+ text-shadow: none;
+ visibility: hidden;
+}
+.rtl {
+ direction:rtl;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+s {
+ float:right;
+ width:3em;
+ height:3em;
+ margin-right:-0.6em;
+ border:1px solid red;
+}
+.rtl s {
+ float:left;
+ margin-left:-0.6em;
+ margin-right:0;
+}
+.overlap {margin-left:-0.6em;}
+.rtl .overlap {margin-right:-0.6em;margin-left:0;}
+.n {padding-left:0.6em;}
+.rtl .n {padding-right:0.6em;padding-left:0;}
+</style>
+
+</head><body>
+
+<div class="test"><font class="overlap"><s></s>&nbsp;<m>&#x2026;</m>| | | | | | | | | | | | | | | | | | | | | | &#x2026;<i class="n"></i></font></div>
+<div class="test"><font><s></s>| | | | | | | | | | | | | | | | | | | | | | | &#x2026;<i></i></font></div>
+<div class="test rtl"><font class="overlap"><s></s>&nbsp;<m>&#x2026;</m>| | | | | | | | | | | | | | | | | | | | | | &#x2026;<i class="n"></i></font></div>
+<div class="test rtl"><font><s></s>| | | | | | | | | | | | | | | | | | | | | | | &#x2026;<i></i></font></div>
+
+
+</body></html>
diff --git a/layout/reftests/text-overflow/false-marker-overlap.html b/layout/reftests/text-overflow/false-marker-overlap.html
new file mode 100644
index 0000000000..28720226c0
--- /dev/null
+++ b/layout/reftests/text-overflow/false-marker-overlap.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: false marker overlap
+-->
+<html><head>
+<title>text-overflow: false marker overlap</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: ellipsis ellipsis;
+ color: black;
+ height: 6em;
+ width: 32.5em;
+ margin-bottom: 1em;
+}
+
+i {
+ display:inline-block;
+ height: 3em;
+ width: 3em;
+ border:1px solid blue;
+ text-shadow: none;
+}
+.rtl {
+ direction:rtl;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+s {
+ float:right;
+ width:3em;
+ height:3em;
+ margin-right:-0.6em;
+ border:1px solid red;
+}
+.rtl s {
+ float:left;
+ margin-left:-0.6em;
+ margin-right:0;
+}
+.overlap {margin-left:-0.6em;}
+.rtl .overlap {margin-right:-0.6em;margin-left:0;}
+.n {padding-left:0.6em;}
+.rtl .n {padding-right:0.6em;padding-left:0;}
+</style>
+
+</head><body>
+
+<div class="test"><font class="overlap"><s></s>| | | | | | | | | | | | | | | | | | | | | | | <i class="n"></i></font></div>
+<div class="test"><font><s></s>| | | | | | | | | | | | | | | | | | | | | | | <i></i></font></div>
+<div class="test rtl"><font class="overlap"><s></s>| | | | | | | | | | | | | | | | | | | | | | | <i class="n"></i></font></div>
+<div class="test rtl"><font><s></s>| | | | | | | | | | | | | | | | | | | | | | | <i></i></font></div>
+
+
+</body></html>
diff --git a/layout/reftests/text-overflow/float-edges-1-ref.html b/layout/reftests/text-overflow/float-edges-1-ref.html
new file mode 100644
index 0000000000..b56b4da8ff
--- /dev/null
+++ b/layout/reftests/text-overflow/float-edges-1-ref.html
@@ -0,0 +1,71 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Reference: Testcase for bug 944200</title>
+ <style type="text/css">
+html,body {
+ color:black; background-color:white; font:20px/1 Courier New, Courier, monospace; padding:0; margin:0;
+}
+
+.container {
+ border: 1px solid black;
+ width: 150px;
+ overflow: hidden;
+ white-space: nowrap;
+}
+
+.float {
+ float: right;
+ background: yellow;
+ width: 50px;
+ text-indent: 0;
+}
+.left { float: left; }
+.h { height: 3.5em; }
+ </style>
+</head>
+<body>
+
+<div style="float:left">
+<div class="container"><div class="float">FF</div>aaaaaaa&#x2026;</div>
+<div class="container"><div class="float">FF</div>aaaaaaa&#x2026;</div>
+<div class="container"><div class="float">FF</div>aaaaaaa&#x2026;<br>aaaaaaaaaaa&#x2026;</div>
+<div class="container"><div class="float">FF</div>aaaaaaa&#x2026;<br>aaaaaaaaaa</div>
+
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>&nbsp;&nbsp;&#x2026;aa</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>&nbsp;&nbsp;&#x2026;aa<br>aaaaaaaaaaa&#x2026;</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>&nbsp;&nbsp;&#x2026;aa<br>aaaaaaaaaa</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>&nbsp;&nbsp;&#x2026;aa<br><span style="margin-left:-20px">&nbsp;&nbsp;&#x2026;aaaaaaa</span></div>
+</div>
+
+
+<div style="float:right">
+<div class="container">
+aaaaaaaaaa<br>
+aaaaaaaaaaa&#x2026;<br><div class="float h">FF</div>
+aaaaaaa&#x2026;<br>
+aaaaaaa<br>
+aaaaaaa&#x2026;<br>
+aaaaaaa&#x2026;<br>
+aaaaaaaaaa<br>
+aaaaaaaaaaa&#x2026;<br>
+</div>
+
+<div class="container" style="text-indent:-20px">
+&nbsp;&nbsp;&#x2026;aaaaaaa<br>
+aaaaaaaaaaa&#x2026;<br><div class="float left h">FF</div>
+<span style="margin-left:-20px">&nbsp;&nbsp;&#x2026;aaaaaa&#x2026;</span><br>
+aaaaaaa&#x2026;<br>
+aaaa<br>
+<span style="margin-left:-20px">&nbsp;&nbsp;&#x2026;aaaaaaa</span><br>
+aaaaaaaaaa<br>
+aaaaaaaaaaa&#x2026;<br>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/float-edges-1.html b/layout/reftests/text-overflow/float-edges-1.html
new file mode 100644
index 0000000000..985f44b6bc
--- /dev/null
+++ b/layout/reftests/text-overflow/float-edges-1.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 944200</title>
+ <style type="text/css">
+html,body {
+ color:black; background-color:white; font:20px/1 Courier New, Courier, monospace; padding:0; margin:0;
+}
+
+.container {
+ border: 1px solid black;
+ width: 150px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ text-overflow: ellipsis ellipsis;
+ white-space: nowrap;
+}
+
+.float {
+ float: right;
+ background: yellow;
+ width: 50px;
+ text-indent: 0;
+}
+.left { float: left; }
+.h { height: 3.5em; }
+ </style>
+</head>
+<body>
+
+<div style="float:left">
+<div class="container"><div class="float">FF</div>aaaaaaaaaaaaaaaaaaaaaa</div>
+<div class="container"><div class="float">FF</div>aaaaaaaaaa</div>
+<div class="container"><div class="float">FF</div>aaaaaaaaaaaaaaaaaaaaaa<br>aaaaaaaaaaaaaaaaaaaaaa</div>
+<div class="container"><div class="float">FF</div>aaaaaaaaaaaaaaaaaaaaaa<br>aaaaaaaaaa</div>
+
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>aaaaa</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>aaaaa<br>aaaaaaaaaaaaaaaaaaaaaa</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>aaaaa<br>aaaaaaaaaa</div>
+<div class="container" style="text-indent:-20px"><div class="float left">FF</div>aaaaa<br><span style="margin-left:-20px">aaaaaaaaaa</span></div>
+</div>
+
+
+<div style="float:right">
+<div class="container">
+aaaaaaaaaa<br>
+aaaaaaaaaaaaaaaaaaaaaa<br><div class="float h">FF</div>
+aaaaaaaaaaaaaaaaaaaaaa<br>
+aaaaaaa<br>
+aaaaaaaaaa<br>
+aaaaaaaaaaaaaaaaaaaaaa<br>
+aaaaaaaaaa<br>
+aaaaaaaaaaaaaaaaaaaaaa<br>
+</div>
+
+<div class="container" style="text-indent:-20px">
+aaaaaaaaaa<br>
+aaaaaaaaaaaaaaaaaaaaaa<br><div class="float left h">FF</div>
+<span style="margin-left:-20px">aaaaaaaaaaaaaaaaaaaaaa</span><br>
+aaaaaaaaaaaaaaaaaaaaaa<br>
+aaaa<br>
+<span style="margin-left:-20px">aaaaaaaaaa</span><br>
+aaaaaaaaaa<br>
+aaaaaaaaaaaaaaaaaaaaaa<br>
+</div>
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/line-clipping-ref.html b/layout/reftests/text-overflow/line-clipping-ref.html
new file mode 100644
index 0000000000..083d42aad6
--- /dev/null
+++ b/layout/reftests/text-overflow/line-clipping-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html>
+<head>
+<title>Reference for bug 886313</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+.test {
+ font: 16px DejaVuSansMono;
+ overflow: hidden;
+ width:55px;
+ border: 1px solid black;
+ margin-bottom: 2px;
+}
+</style>
+</head>
+<body>
+ <div class="test">well, hello world</div>
+ <div class="test">well, hello worl&#x2026;</div>
+ <div class="test">well, hell&#x2026; world</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/line-clipping.html b/layout/reftests/text-overflow/line-clipping.html
new file mode 100644
index 0000000000..edf914d6c6
--- /dev/null
+++ b/layout/reftests/text-overflow/line-clipping.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: When we have multiple lines of text with "text-overflow: ellipsis",
+ an ellipsis on one line shouldn't affect the other lines.
+-->
+<html>
+<head>
+<title>Testcase for bug 886313</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+.test {
+ font: 16px DejaVuSansMono;
+ text-overflow:ellipsis;
+ overflow: hidden;
+ width:55px;
+ border: 1px solid black;
+ margin-bottom: 2px;
+}
+</style>
+</head>
+<body>
+ <div class="test">well, hello world</div>
+ <div class="test">well, hello world!</div>
+ <div class="test">well, helloo world</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-basic-ref.html b/layout/reftests/text-overflow/marker-basic-ref.html
new file mode 100644
index 0000000000..c452323f91
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-basic-ref.html
@@ -0,0 +1,276 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+ <title>text-overflow: basic marker position tests</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+.rel {
+ position: relative;
+ height:2em;
+}
+.abs0 {
+ position: absolute;
+ top:0; left:0;
+}
+.abs0r {
+ position: absolute;
+ top:0; right:0;
+}
+
+.s {
+ width:4em;
+}
+.p {
+ overflow: hidden;
+ white-space:nowrap;
+ font-size:16px;
+}
+.a {
+ font-size:20px;
+}
+.r {
+ text-align:right;
+}
+.l {
+ text-align:left;
+}
+
+i {
+ display:inline-block;
+ width: 1.5em;
+ height: 1em;
+ font-style:normal;
+ color:lime;
+ border: 1px solid magenta;
+ text-decoration:overline;
+}
+.cl {
+ margin-left:-1em;
+ color: black;
+}
+.cr {
+ margin-right:-1em;
+ color: black;
+}
+.c5 {
+ margin-left:-0.5em;
+ margin-right:-0.5em;
+ color: black;
+}
+.outside {
+ width:1px; height:1px;
+}
+.overlap1 {
+ width:1.5em; height:1px;
+}
+.ins1 {
+ width:1em; height:1px;
+}
+.ins2 { margin-right: 0.8em; margin-left: -1em; }
+.overlap2 {
+ width:1000px; height:1px;
+}
+.e { padding: 0 0.8em; }
+
+x1 { display:inline-block; position:relative;}
+x1 m { position:absolute; right:0; font-size:16px; }
+
+#test1a { top:0; left:0; position:absolute; }
+#test1b { top:0; left:100px; position:absolute; }
+#test1c { top:0; left:200px; position:absolute; }
+#test1d { top:0; left:300px; position:absolute; }
+#test2a { top:40px; left:0; position:absolute; }
+#test2b { top:40px; left:100px; position:absolute; }
+#test2c { top:40px; left:200px; position:absolute; }
+#test2d { top:40px; left:300px; position:absolute; }
+#test3a { top:80px; left:0; position:absolute; }
+#test3b { top:80px; left:100px; position:absolute; }
+#test3c { top:80px; left:200px; position:absolute; }
+#test3d { top:80px; left:300px; position:absolute; }
+#test4a { top:120px; left:0; position:absolute; }
+#test4b { top:120px; left:100px; position:absolute; }
+#test4c { top:120px; left:200px; position:absolute; }
+#test4d { top:120px; left:300px; position:absolute; }
+#test5a { top:160px; left:0; position:absolute; }
+#test5b { top:160px; left:100px; position:absolute; }
+#test5c { top:160px; left:200px; position:absolute; }
+#test5d { top:160px; left:300px; position:absolute; }
+#test6a { top:200px; left:0; position:absolute; }
+#test6b { top:200px; left:100px; position:absolute; }
+#test6c { top:200px; left:200px; position:absolute; }
+#test6d { top:200px; left:300px; position:absolute; }
+#test7a { top:240px; left:0; position:absolute; }
+#test7b { top:240px; left:100px; position:absolute; }
+#test7c { top:240px; left:200px; position:absolute; }
+#test7d { top:240px; left:300px; position:absolute; }
+#test8a { top:280px; left:0; position:absolute; }
+#test8b { top:280px; left:100px; position:absolute; }
+#test8c { top:280px; left:200px; position:absolute; }
+#test8d { top:280px; left:300px; position:absolute; }
+#test9a { top:320px; left:0; position:absolute; border:1px solid black; }
+#test9b { top:320px; left:100px; position:absolute; border:1px solid black; }
+#test9c { top:320px; left:200px; position:absolute; border:1px solid black; }
+#test9d { top:320px; left:300px; position:absolute; border:1px solid black; }
+#test10a { top:360px; left:0; position:absolute; }
+#test10b { top:360px; left:100px; position:absolute; }
+
+ </style>
+</head>
+<body>
+<div style="position: absolute; top:20px; left:50px;">
+
+<div id="test1a">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><span class="cl a">&nbsp;&nbsp;&nbsp;||||</span><m>&#x2026;</m></div>
+<div class="abs0" style="text-align:left"><span class="cl a">&nbsp;&nbsp;&nbsp;<m style="position:absolute; right:0; bottom:0;"><m0 style=" font-size:16px">&#x2026;</m0></m></span></div>
+</div></div>
+</div>
+<div id="test1b">
+<div class="s a rtl"><div class="p rel">
+<div class="abs0r"><span class="cr a rlo">&nbsp;&nbsp;&nbsp;||||</span><m>&#x2026;</m></div>
+<div class="abs0r"><span class="cr a rlo">&nbsp;&nbsp;&nbsp;<m style="position:absolute; left:0; bottom:0;"><m0 style=" font-size:16px">&#x2026;</m0></m></span></span></div>
+</div></div>
+</div>
+<div id="test1c">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><span class="cl a">&nbsp;&nbsp;&nbsp;||||</span><m>&#x2026;</m></div>
+<div class="abs0" style="text-align:left"><span class="cl a">&nbsp;&nbsp;&nbsp;<m style="position:absolute; right:0; bottom:0;"><m0 style=" font-size:16px">&#x2026;</m0></m></span></div>
+</div></div>
+</div>
+<div id="test1d">
+<div class="s a rtl"><div class="p rel">
+<div class="abs0r"><span class="cr a rlo">&nbsp;&nbsp;&nbsp;||||</span><m>&#x2026;</m></div>
+<div class="abs0r"><span class="cr a rlo">&nbsp;&nbsp;&nbsp;<m style="position:absolute; left:0; bottom:0;"><m0 style=" font-size:16px">&#x2026;</m0></m></span></span></div>
+</div></div>
+</div>
+
+<div id="test2a">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><m>&#x2026;</m><span class="cl a">&nbsp;</span></div>
+</div></div>
+</div>
+<div id="test2b">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><m>&#x2026;</m><span class="cl a">&nbsp;</span></div>
+</div></div>
+</div>
+<div id="test2c">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; left:auto; right:0;"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><m>&#x2026;</m></div>
+</div></div>
+</div>
+<div id="test2d">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; left:auto; right:0;"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><m>&#x2026;</m></div>
+</div></div>
+</div>
+
+<div id="test3a">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><m>&#x2026;</m><span class="cl a">&nbsp;</span></div>
+</div></div>
+</div>
+<div id="test3b">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:left"><m>&#x2026;</m><span class="cl a">&nbsp;</span></div>
+</div></div>
+</div>
+<div id="test3c">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; left:auto; right:0;"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><m>&#x2026;</m></div>
+</div></div>
+</div>
+<div id="test3d">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; left:auto; right:0;"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><m>&#x2026;</m></div>
+</div></div>
+</div>
+
+<!-- start marker, marker partly overlaps image, nothing to align with -->
+<div id="test4a"><div class="s a"><div class="p o ltr"><span class="cl a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4b"><div class="s a"><div class="p o rtl l"><span class="cl a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4c"><div class="s a"><div class="p o ltr r"><span class="cr a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4d"><div class="s a"><div class="p o rtl"><span class="cr a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+
+<!-- start marker + end, marker partly overlaps image, nothing to align with -->
+<div id="test5a"><div class="s a"><div class="p o ltr"><span class="cl a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5b"><div class="s a"><div class="p o rtl l"><span class="cl a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5c"><div class="s a"><div class="p o ltr r"><span class="cr a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5d"><div class="s a"><div class="p o rtl"><span class="cr a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+
+<div id="test6a">
+<div class="s a"><div class="p rel">
+<div class="abs0"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><img class="a overlap1" src="../image/big.png"></div>
+<div class="abs0"><span class="cr a">&nbsp;&nbsp;&nbsp;<m style="position:absolute; right:0; bottom:0;"><m0 style="font-size:16px">&#x2026;</m0></m></span></span></div>
+</div></div>
+</div>
+<div id="test6b">
+<div class="s a"><div class="p rel">
+<div class="abs0"><span class="cr a">&nbsp;&nbsp;&nbsp;</span><img class="a overlap1" src="../image/big.png"></div>
+<div class="abs0"><span class="cr a">&nbsp;&nbsp;&nbsp;<m style="position:absolute; right:0; bottom:0;"><m0 style="font-size:16px">&#x2026;</m0></m></span></span></div>
+</div></div>
+</div>
+<div id="test6c">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; right:0; "><span class="cr a"><img class="overlap1" src="../image/big.png">&nbsp;&nbsp;&nbsp;</span></div>
+<div class="abs0" style="text-align:right; right:0; "><span class="cr a"><img class="overlap1" src="../image/big.png"><m style="position:absolute; bottom:0;"><m0 style="font-size:16px">&#x2026;</m0></m>&nbsp;&nbsp;&nbsp;</span></div>
+</div></div>
+</div>
+<div id="test6d">
+<div class="s a"><div class="p rel">
+<div class="abs0" style="text-align:right; right:0; "><span class="cr a"><img class="overlap1" src="../image/big.png">&nbsp;&nbsp;&nbsp;</span></div>
+<div class="abs0" style="text-align:right; right:0; "><span class="cr a"><img class="overlap1" src="../image/big.png"><m style="position:absolute; bottom:0;"><m0 style="font-size:16px">&#x2026;</m0></m>&nbsp;&nbsp;&nbsp;</span></div>
+</div></div>
+</div>
+
+<div id="test7a">
+<div class="s a"><div class="p ltr"><span class="c5 a">|<x style="display:inline-block;width:0.8em;text-align:right"><m style="font-size:16px;">&#x2026;</m></x><img class="ins1" src="../image/big.png"></span></div></div>
+</div>
+
+<div id="test7b"><div class="s a"><div class="p ltr r"><img class="a ins1" src="../image/big.png"><x class="a" style="display:inline-block;width:0.8em;text-align:left"><m style="font-size:16px;">&#x2026;</m></x><span class="c5 a" style="margin-right:0">&nbsp;</span></div></div></div>
+
+<div id="test7c">
+<div class="s a"><div class="p ltr"><span class="c5 a">|<x style="display:inline-block;width:0.8em;text-align:right"><m style="font-size:16px;">&#x2026;</m></x><img class="ins1" src="../image/big.png"></span></div></div>
+</div>
+
+<div id="test7d"><div class="s a"><div class="p ltr r"><img class="a ins1" src="../image/big.png"><x class="a" style="display:inline-block;width:0.8em;text-align:left"><m style="font-size:16px;">&#x2026;</m></x><span class="c5 a" style="margin-right:0">&nbsp;</span></div></div></div>
+
+
+<div id="test8a"><div class="s a"><div class="a p ltr"><span class="c5 a"></span><span class="e"></span><span style="margin-right:-0.5em">&#x2026;</span><span>&#x200c;</span></div></div></div>
+<div id="test8d"><div class="s a"><div class="a p rtl"><span class="c5 a"></span><span class="e"></span><span style="margin-left:-0.5em">&#x2026;</span><span>&#x200c;</span></div></div></div>
+
+<div id="test9a"><div class="s a"><div class="p ltr"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><m>&#x2026;</m><span class="e a"></span></div></div></div>
+<div id="test9b"><div class="s a"><div class="p rtl"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><m>&#x2026;</m><span class="e a"></span></div></div></div>
+<div id="test9c"><div class="s a"><div class="p ltr"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><m>&#x2026;</m><span class="e a"></span></div></div></div>
+<div id="test9d"><div class="s a"><div class="p rtl"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><m>&#x2026;</m><span class="e a"></span></div></div></div>
+
+<!-- no marker for overflow:auto that doesn't trigger scrollbar -->
+<div id="test10a"><div class="s a"><div class="p o ltr"><span style="margin-left:-5px" >||||||</span></div></div></div>
+<div id="test10b"><div class="s a"><div class="p o rtl"><span style="margin-right:-5px">||||||</span></div></div></div>
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-basic.html b/layout/reftests/text-overflow/marker-basic.html
new file mode 100644
index 0000000000..4f4afb667c
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-basic.html
@@ -0,0 +1,205 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: basic marker position tests
+-->
+<html><head>
+ <title>text-overflow: basic marker position tests</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+
+.o {
+ text-overflow: ellipsis ellipsis;
+}
+
+.rel {
+ position: relative;
+ height:2em;
+}
+.abs0 {
+ position: absolute;
+ top:0; left:0;
+}
+
+.s {
+ width:4em;
+}
+.p {
+ overflow: hidden;
+ white-space:nowrap;
+ font-size:16px;
+}
+.auto {
+ overflow: auto;
+}
+.r {
+ text-align:right;
+}
+.a {
+ font-size:20px;
+}
+.l {
+ text-align:left;
+}
+i {
+ display:inline-block;
+ width: 1.5em;
+ height: 1em;
+ font-style:normal;
+ color:lime;
+ border: 1px solid magenta;
+ text-decoration:overline;
+}
+
+.c {
+ margin-left:-1em;
+ margin-right:-1em;
+ color: black;
+}
+.c5 {
+ margin-left:-0.5em;
+ margin-right:-0.5em;
+ color: black;
+}
+.outside {
+ width:1px; height:1px;
+}
+.overlap1 {
+ width:1.5em; height:1px;
+}
+.ins1 {
+ width:1em; height:1px;
+ margin: 0 0.8em;
+}
+.overlap2 {
+ width:1000px; height:1px;
+}
+.e { padding: 0 0.8em; }
+
+
+#test1a { top:0; left:0; position:absolute; }
+#test1b { top:0; left:100px; position:absolute; }
+#test1c { top:0; left:200px; position:absolute; }
+#test1d { top:0; left:300px; position:absolute; }
+#test2a { top:40px; left:0; position:absolute; }
+#test2b { top:40px; left:100px; position:absolute; }
+#test2c { top:40px; left:200px; position:absolute; }
+#test2d { top:40px; left:300px; position:absolute; }
+#test3a { top:80px; left:0; position:absolute; }
+#test3b { top:80px; left:100px; position:absolute; }
+#test3c { top:80px; left:200px; position:absolute; }
+#test3d { top:80px; left:300px; position:absolute; }
+#test4a { top:120px; left:0; position:absolute; }
+#test4b { top:120px; left:100px; position:absolute; }
+#test4c { top:120px; left:200px; position:absolute; }
+#test4d { top:120px; left:300px; position:absolute; }
+#test5a { top:160px; left:0; position:absolute; }
+#test5b { top:160px; left:100px; position:absolute; }
+#test5c { top:160px; left:200px; position:absolute; }
+#test5d { top:160px; left:300px; position:absolute; }
+#test6a { top:200px; left:0; position:absolute; }
+#test6b { top:200px; left:100px; position:absolute; }
+#test6c { top:200px; left:200px; position:absolute; }
+#test6d { top:200px; left:300px; position:absolute; }
+#test7a { top:240px; left:0; position:absolute; }
+#test7b { top:240px; left:100px; position:absolute; }
+#test7c { top:240px; left:200px; position:absolute; }
+#test7d { top:240px; left:300px; position:absolute; }
+#test8a { top:280px; left:0; position:absolute; }
+#test8b { top:280px; left:100px; position:absolute; }
+#test8c { top:280px; left:200px; position:absolute; }
+#test8d { top:280px; left:300px; position:absolute; }
+#test9a { top:320px; left:0; position:absolute; border:1px solid black; }
+#test9b { top:320px; left:100px; position:absolute; border:1px solid black; }
+#test9c { top:320px; left:200px; position:absolute; border:1px solid black; }
+#test9d { top:320px; left:300px; position:absolute; border:1px solid black; }
+#test10a { top:360px; left:0; position:absolute; }
+#test10b { top:360px; left:100px; position:absolute; }
+
+
+ </style>
+</head>
+<body>
+<div style="position: absolute; top:20px; left:50px;">
+
+<!-- start + end marker, aligned to text -->
+<div id="test1a"><div class="s a ltr"><div class="p o"><span class="c a lro">||||||||||</span></div></div></div>
+<div id="test1b"><div class="s a rtl"><div class="p o"><span class="c a lro">||||||||||</span></div></div></div>
+<div id="test1c"><div class="s a ltr"><div class="p o"><span class="c a rlo">||||||||||</span></div></div></div>
+<div id="test1d"><div class="s a rtl"><div class="p o"><span class="c a rlo">||||||||||</span></div></div></div>
+
+<!-- start marker, text outside marker edge, nothing to align with -->
+<div id="test2a"><div class="s a"><div class="p o ltr"><span class="c a">x</span></div></div></div>
+<div id="test2b"><div class="s a"><div class="p o rtl l"><span class="c a">x</span></div></div></div>
+<div id="test2c"><div class="s a"><div class="p o ltr r"><span class="c a">x</span></div></div></div>
+<div id="test2d"><div class="s a"><div class="p o rtl"><span class="c a">x</span></div></div></div>
+
+<!-- start marker, image outside marker edge, nothing to align with -->
+<div id="test3a"><div class="s a"><div class="p o ltr"><span class="c a"><img class="outside" src="../image/big.png"></span></div></div></div>
+<div id="test3b"><div class="s a"><div class="p o rtl l"><span class="c a"><img class="outside" src="../image/big.png"></span></div></div></div>
+<div id="test3c"><div class="s a"><div class="p o ltr r"><span class="c a"><img class="outside" src="../image/big.png"></span></div></div></div>
+<div id="test3d"><div class="s a"><div class="p o rtl"><span class="c a"><img class="outside" src="../image/big.png"></span></div></div></div>
+
+<!-- start marker, marker partly overlaps image, nothing to align with -->
+<div id="test4a"><div class="s a"><div class="p o ltr"><span class="c a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4b"><div class="s a"><div class="p o rtl l"><span class="c a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4c"><div class="s a"><div class="p o ltr r"><span class="c a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test4d"><div class="s a"><div class="p o rtl"><span class="c a"><img class="overlap1" src="../image/big.png"></span></div></div></div>
+
+<!-- start marker + end, marker partly overlaps image, nothing to align with -->
+<div id="test5a"><div class="s a"><div class="p o ltr"><span class="c a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5b"><div class="s a"><div class="p o rtl l"><span class="c a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5c"><div class="s a"><div class="p o ltr r"><span class="c a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+<div id="test5d"><div class="s a"><div class="p o rtl"><span class="c a"><img class="overlap2" src="../image/big.png"></span></div></div></div>
+
+<!-- start marker, marker clips text, aligns to image -->
+<div id="test6a"><div class="s a"><div class="p o ltr"><span class="c a">|||<img class="overlap1" src="../image/big.png"></span></div></div></div>
+<div id="test6b"><div class="s a"><div class="p o rtl l"><span class="c a"><img class="overlap1" src="../image/big.png">|||</span></div></div></div>
+<div id="test6c"><div class="s a"><div class="p o ltr r"><span class="c a"><img class="overlap1" src="../image/big.png">|||</span></div></div></div>
+<div id="test6d"><div class="s a"><div class="p o rtl"><span class="c a">|||<img class="overlap1" src="../image/big.png"></span></div></div></div>
+
+<!-- start marker, marker aligns to image -->
+<div id="test7a"><div class="s a"><div class="p o ltr"><span class="c5 a">|<img class="ins1" src="../image/big.png"></span></div></div></div>
+<div id="test7b"><div class="s a"><div class="p o rtl"><span class="c5 a">|<img class="ins1" src="../image/big.png"></span></div></div></div>
+<!-- end marker, marker aligns to image -->
+<div id="test7c"><div class="s a"><div class="p o rtl l"><span class="c5 a"><img class="ins1" src="../image/big.png">|</span></div></div></div>
+<div id="test7d"><div class="s a"><div class="p o ltr r"><span class="c5 a"><img class="ins1" src="../image/big.png">|</span></div></div></div>
+
+<!-- start marker, marker aligns to empty element -->
+<div id="test8a"><div class="s a"><div class="a p o ltr"><span class="c5 a">|</span><span class="e"></span><span>&#x200c;</span></div></div></div>
+<div id="test8d"><div class="s a"><div class="a p o rtl"><span class="c5 a">|</span><span class="e"></span><span>&#x200c;</span></div></div></div>
+
+<!-- end marker, marker aligns to inline block with overflow -->
+<div id="test9a"><div class="s a"><div class="p o ltr"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><span class="e"></span><span class="c5 a">|||</span></div></div></div>
+<div id="test9b"><div class="s a"><div class="p o rtl"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><span class="e"></span><span class="c5 a">|||</span></div></div></div>
+<div id="test9c"><div class="s a"><div class="p o ltr"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><span class="e"></span><span class="c5 a">|||</span></div></div></div>
+<div id="test9d"><div class="s a"><div class="p o rtl"><span class="e"></span><i>&nbsp;&nbsp;&nbsp;&nbsp;</i><span class="e"></span><span class="c5 a">|||</span></div></div></div>
+
+<!-- no marker for overflow:auto that doesn't trigger scrollbar -->
+<div id="test10a"><div class="s a"><div class="p o ltr auto"><span style="margin-left:-5px" >||||||</span></div></div></div>
+<div id="test10b"><div class="s a"><div class="p o rtl auto"><span style="margin-right:-5px">||||||</span></div></div></div>
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-shadow-ref.html b/layout/reftests/text-overflow/marker-shadow-ref.html
new file mode 100644
index 0000000000..12889142d7
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-shadow-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+
+div {
+ font-family: DejaVuSansMono;
+ padding-left: 1em;
+}
+
+/* We put the text and marker into separate spans, because
+ overflow markers (and their shadows) are drawn separately
+ from the text frame. */
+span {
+ text-shadow: -0.5em 3px 2px red;
+}
+</style>
+</head>
+<body>
+
+<div><span>Hello</span><span>...</span></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-shadow.html b/layout/reftests/text-overflow/marker-shadow.html
new file mode 100644
index 0000000000..4f93475650
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-shadow.html
@@ -0,0 +1,37 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Marker should have text-shadow applied to it
+-->
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+
+/* overflow:hidden will clip off some of our text-shadow too.
+ Give us some padding, so we can put the shadow to the left and bottom
+ and beat the overflow clipping. */
+div {
+ font-family: DejaVuSansMono;
+ width: 5em;
+ padding-left: 1em;
+ padding-bottom: 1em;
+ overflow: hidden;
+ white-space: nowrap;
+ text-overflow: "...";
+ text-shadow: -0.5em 3px 2px red;
+}
+</style>
+</head>
+<body>
+
+<div>HelloKitty</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-string-ref.html b/layout/reftests/text-overflow/marker-string-ref.html
new file mode 100644
index 0000000000..ba4b9f4c37
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-string-ref.html
@@ -0,0 +1,69 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow:<string>
+-->
+<html><head>
+<title>text-overflow: text-overflow:&lt;string&gt;</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:20ch;
+ height:3em;
+ white-space:nowrap;
+ margin-left:2em;
+ position:relative;
+}
+span {
+ margin: 0 -0.5ch;
+}
+m {
+ margin: 0;
+ position:relative;
+}
+mr {
+ position:absolute;
+ right:0;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 m { margin: 0 -0.5ch; }
+
+</style>
+
+</head><body>
+
+
+<div class="test t1"><m>&nbsp;x</m></div>
+<div class="test rtl t1"><m>&nbsp;x</m></div>
+<div class="test t2"><span>xx</span></div>
+<div class="test rtl t2"><span>xx</span></div>
+
+<div class="test t2" style="width:3ch"><span>xx</span></div>
+<div class="test rtl t2" style="width:3ch"><span>xx</span></div>
+<div class="test"><m>X</m><mr>X</mr></div>
+<div class="test"><m>X</m><mr>X</mr></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/marker-string.html b/layout/reftests/text-overflow/marker-string.html
new file mode 100644
index 0000000000..356ae14c2f
--- /dev/null
+++ b/layout/reftests/text-overflow/marker-string.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow:<string>
+-->
+<html><head>
+<title>text-overflow: text-overflow:&lt;string&gt;</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:20ch;
+ height:3em;
+ white-space:nowrap;
+ margin-left:2em;
+ position:relative;
+}
+span {
+ margin: 0 -0.5ch;
+}
+s {
+ margin: 0 -0.5ch;
+ padding: 0 11ch;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 { text-overflow:"" ""; }
+.t2 { text-overflow:"Hello World" "Hello World"; }
+.t3 { text-overflow:"X" "X"; }
+
+</style>
+
+</head><body>
+
+
+<!-- Empty marker clips text -->
+<div class="test t1"><span>xx</span></div>
+<div class="test rtl t1"><span>xx</span></div>
+<!-- big marker clips all text -->
+<div class="test t2"><span>xx</span></div>
+<div class="test rtl t2"><span>xx</span></div>
+
+<!-- start marker that doesn't fit -->
+<div class="test t2" style="width:3ch"><span>xx</span></div>
+<div class="test rtl t2" style="width:3ch"><span>xx</span></div>
+
+<!-- start + end marker, nothing to align to -->
+<div class="test t3"><s></s></div>
+<div class="test rtl t3"><s></s></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/quirks-decorations-ref.html b/layout/reftests/text-overflow/quirks-decorations-ref.html
new file mode 100644
index 0000000000..d2e297ded9
--- /dev/null
+++ b/layout/reftests/text-overflow/quirks-decorations-ref.html
@@ -0,0 +1,73 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: Quirks mode text-decorations</title>
+<style type="text/css">
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ float:left;
+ height:2em;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:20px;
+ color:blue;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.xspan {
+ text-shadow:0px 1em 2px blue;
+ text-decoration: line-through;
+}
+.rtl .xspan {
+ text-shadow:0 1em 0px blue;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:7.3em; }
+.t2 { width:20px;}
+.t3 { width:22px;}
+.t4 { width:1px; font-family:Ahem; }
+.t3 span {margin-left:14px; }
+
+m { font-size:20px; color:blue; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span><span class="xspan">0123&nbsp;56789012</span><m>&#x2026;</m></span></div>
+<div class="test rtl t1"><span><span class="xspan">1&nbsp;56789012345</span><m>&#x2026;</m></span></div>
+<div class="test t2"><span class="xspan">xxxx<m>x</m></span></div>
+<div class="test t3"><span class="xspan">x<m>x</m></span></div>
+<div class="test t4"><span class="xspan">x<m>x</m></span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/quirks-decorations.html b/layout/reftests/text-overflow/quirks-decorations.html
new file mode 100644
index 0000000000..945dfb63a9
--- /dev/null
+++ b/layout/reftests/text-overflow/quirks-decorations.html
@@ -0,0 +1,74 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Quirks mode text-decorations
+-->
+<html><head>
+<title>text-overflow: Quirks mode text-decorations</title>
+<style type="text/css">
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ text-overflow:ellipsis;
+ float:left;
+ height:2em;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:20px;
+ color:blue;
+}
+span {
+ text-shadow:0px 1em 2px blue;
+ text-decoration: line-through;
+ font-size:16px;
+ color:black;
+}
+.rtl span {
+ text-shadow:0 1em 0px blue;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:7.3em;}
+.t2 { width:20px;}
+.t3 { width:22px; }
+.t4 { width:1px; font-family:Ahem; }
+.t3 span {margin-left:14px; }
+
+m { font-size:20px; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123&nbsp;567890123456789</span><m>x</m></div>
+<div class="test rtl t1"><m>x</m><span>0321&nbsp;56789012345</span></div>
+<div class="test t2"><span>xxxx<m>x</m></span></div>
+<div class="test t3"><span>x<m>x</m></span></div>
+<div class="test t4"><span>x<m>x</m></span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/quirks-line-height-ref.html b/layout/reftests/text-overflow/quirks-line-height-ref.html
new file mode 100644
index 0000000000..e05dc88d53
--- /dev/null
+++ b/layout/reftests/text-overflow/quirks-line-height-ref.html
@@ -0,0 +1,57 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: Quirks mode line height</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+
+ float:left;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:24px;
+ color:blue;
+ border:1px solid black;
+ position:relative;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:4em; }
+
+m { font-size:24px; color:blue; line-height:8px; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123456|</span><m>&#x2026;</m></div>
+<div class="test rtl rlo t1"><span>0123456|</span><m>&#x2026;</m></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/quirks-line-height.html b/layout/reftests/text-overflow/quirks-line-height.html
new file mode 100644
index 0000000000..fe9b1747a9
--- /dev/null
+++ b/layout/reftests/text-overflow/quirks-line-height.html
@@ -0,0 +1,56 @@
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Quirks mode line height should not be affected by marker
+-->
+<html><head>
+<title>text-overflow: Quirks mode line height</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ text-overflow:ellipsis;
+ float:left;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:24px;
+ color:blue;
+ border:1px solid black;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:4em; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123456|890123456789</span></div>
+<div class="test rtl rlo t1"><span>0123456|89012345</span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/reftest.list b/layout/reftests/text-overflow/reftest.list
new file mode 100644
index 0000000000..d5496b7a03
--- /dev/null
+++ b/layout/reftests/text-overflow/reftest.list
@@ -0,0 +1,38 @@
+== ellipsis-font-fallback.html ellipsis-font-fallback-ref.html
+== line-clipping.html line-clipping-ref.html
+fuzzy(0-47,0-6) == marker-basic.html marker-basic-ref.html # Bug 1128229
+== marker-string.html marker-string-ref.html
+fuzzy(0-47,0-18) == bidi-simple.html bidi-simple-ref.html
+skip-if(!gtkWidget) fuzzy-if(gtkWidget,0-124,0-289) == bidi-simple-scrolled.html bidi-simple-scrolled-ref.html # Fails on Windows and OSX due to anti-aliasing
+fuzzy-if(Android,0-24,0-4000) fuzzy-if(cocoaWidget,0-1,0-40) fuzzy-if(asyncPan&&!layersGPUAccelerated,0-149,0-1836) == scroll-rounding.html scroll-rounding-ref.html # bug 760264
+fuzzy(0-16,0-454) fails-if(gtkWidget) fuzzy-if(winWidget,25-85,406-499) fuzzy-if(cocoaWidget,0-7,0-265) fuzzy-if(Android,0-3,0-466) == anonymous-block.html anonymous-block-ref.html # gtkWidget:bug 1309103, fuzzy: subpixel aa
+fuzzy(0-47,0-3) == false-marker-overlap.html false-marker-overlap-ref.html
+== visibility-hidden.html visibility-hidden-ref.html
+fuzzy(0-47,0-24) == block-padding.html block-padding-ref.html
+fuzzy(0-155,0-825) == quirks-decorations.html quirks-decorations-ref.html
+== quirks-line-height.html quirks-line-height-ref.html
+== standards-decorations.html standards-decorations-ref.html
+== standards-line-height.html standards-line-height-ref.html
+fuzzy(0-47,0-6) == selection.html selection-ref.html
+fuzzy(0-8,0-509) == marker-shadow.html marker-shadow-ref.html
+fuzzy(0-3,0-25) == aligned-baseline.html aligned-baseline-ref.html
+fuzzy(0-1,0-5) == clipped-elements.html clipped-elements-ref.html
+== theme-overflow.html theme-overflow-ref.html
+== table-cell.html table-cell-ref.html
+fuzzy(0-47,0-18) == two-value-syntax.html two-value-syntax-ref.html
+== single-value.html single-value-ref.html
+fuzzy-if(gtkWidget,0-10,0-2) == atomic-under-marker.html atomic-under-marker-ref.html
+skip == chrome://reftest/content/text-overflow/xulscroll.html chrome://reftest/content/text-overflow/xulscroll-ref.html # bug 1789123 makes it work like regular flexbox, need to probably fix the test
+== combobox-zoom.html combobox-zoom-ref.html
+== dynamic-change-1.html dynamic-change-1-ref.html
+== float-edges-1.html float-edges-1-ref.html
+
+# The vertical-text pref setting can be removed after bug 1138384 lands
+== vertical-decorations-1.html vertical-decorations-1-ref.html
+== vertical-decorations-2.html vertical-decorations-2-ref.html
+!= vertical-decorations-1.html vertical-decorations-1-2-notref.html
+!= vertical-decorations-2.html vertical-decorations-1-2-notref.html
+== vertical-decorations-3.html vertical-decorations-3-ref.html
+== vertical-decorations-4.html vertical-decorations-4-ref.html
+!= vertical-decorations-3.html vertical-decorations-3-4-notref.html
+!= vertical-decorations-4.html vertical-decorations-3-4-notref.html
diff --git a/layout/reftests/text-overflow/scroll-rounding-ref.html b/layout/reftests/text-overflow/scroll-rounding-ref.html
new file mode 100644
index 0000000000..333240f82e
--- /dev/null
+++ b/layout/reftests/text-overflow/scroll-rounding-ref.html
@@ -0,0 +1,85 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: 1px scroll rounding at the end position
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: scroll rounding</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ width:100px;
+ height:50px;
+ border:1px solid black;
+ white-space:pre;
+ margin-left:90px;
+ margin-bottom:20px;
+}
+
+.rtl {
+ direction:rtl; margin-left:0;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 {width:100.1px;}
+.t2 {width:100.2px;}
+.t4 {width:100.4px;}
+
+s {position:absolute; background:black; z-index:1; }
+#mask1 {top:0; left:60px; width:70px; height:100%; }
+#mask2 {top:30px; left:0; width:100%; height:30px; }
+#mask3 {top:100px; left:0; width:100%; height:30px; }
+#mask4 {top:170px; left:0; width:100%; height:30px; }
+#mask5 {top:240px; left:0; width:100%; height:30px; }
+#mask6 {top:320px; left:0; width:100%; height:30px; }
+#mask7 {top:390px; left:0; width:100%; height:30px; }
+#mask8 {top:460px; left:0; width:100%; height:30px; }
+#mask9 {top:530px; left:0; width:100%; height:30px; }
+</style>
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ if (window.getComputedStyle(divs[i]).direction == 'ltr')
+ divs[i].scrollLeft = 99999999;
+ else
+ divs[i].scrollLeft = -99999999;
+ }
+ document.documentElement.removeAttribute('class');
+}
+</script>
+
+</head><body onload="scrolldivs()">
+
+<s id="mask1"></s>
+<s id="mask2"></s>
+<s id="mask3"></s>
+<s id="mask4"></s>
+<s id="mask5"></s>
+<s id="mask6"></s>
+<s id="mask7"></s>
+<s id="mask8"></s>
+<s id="mask9"></s>
+
+<div class="test">HelloKittyוסוכנויות</div>
+<div class="test rtl">HelloKittyוסוכנויות</div>
+<div class="test t1">HelloKittyוסוכנויות</div>
+<div class="test rtl t1">HelloKittyוסוכנויות</div>
+<div class="test t2">HelloKittyוסוכנויות</div>
+<div class="test rtl t2">HelloKittyוסוכנויות</div>
+<div class="test t4">HelloKittyוסוכנויות</div>
+<div class="test rtl t4">HelloKittyוסוכנויות</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/scroll-rounding.html b/layout/reftests/text-overflow/scroll-rounding.html
new file mode 100644
index 0000000000..9957a5e7ab
--- /dev/null
+++ b/layout/reftests/text-overflow/scroll-rounding.html
@@ -0,0 +1,86 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: 1px scroll rounding at the end position
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: scroll rounding</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ text-overflow:ellipsis;
+ overflow:auto;
+ width:100px;
+ height:50px;
+ border:1px solid black;
+ white-space:pre;
+ margin-left:90px;
+ margin-bottom:20px;
+}
+
+.rtl {
+ direction:rtl; margin-left:0;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 {width:100.1px;}
+.t2 {width:100.2px;}
+.t4 {width:100.4px;}
+
+s {position:absolute; background:black; z-index:1; }
+#mask1 {top:0; left:60px; width:70px; height:100%; }
+#mask2 {top:30px; left:0; width:100%; height:30px; }
+#mask3 {top:100px; left:0; width:100%; height:30px; }
+#mask4 {top:170px; left:0; width:100%; height:30px; }
+#mask5 {top:240px; left:0; width:100%; height:30px; }
+#mask6 {top:320px; left:0; width:100%; height:30px; }
+#mask7 {top:390px; left:0; width:100%; height:30px; }
+#mask8 {top:460px; left:0; width:100%; height:30px; }
+#mask9 {top:530px; left:0; width:100%; height:30px; }
+</style>
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ if (window.getComputedStyle(divs[i]).direction == 'ltr')
+ divs[i].scrollLeft = 99999999;
+ else
+ divs[i].scrollLeft = -99999999;
+ }
+ document.documentElement.removeAttribute('class');
+}
+</script>
+
+</head><body onload="scrolldivs()">
+
+<s id="mask1"></s>
+<s id="mask2"></s>
+<s id="mask3"></s>
+<s id="mask4"></s>
+<s id="mask5"></s>
+<s id="mask6"></s>
+<s id="mask7"></s>
+<s id="mask8"></s>
+<s id="mask9"></s>
+
+<div class="test">HelloKittyוסוכנויות</div>
+<div class="test rtl">HelloKittyוסוכנויות</div>
+<div class="test t1">HelloKittyוסוכנויות</div>
+<div class="test rtl t1">HelloKittyוסוכנויות</div>
+<div class="test t2">HelloKittyוסוכנויות</div>
+<div class="test rtl t2">HelloKittyוסוכנויות</div>
+<div class="test t4">HelloKittyוסוכנויות</div>
+<div class="test rtl t4">HelloKittyוסוכנויות</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/selection-ref.html b/layout/reftests/text-overflow/selection-ref.html
new file mode 100644
index 0000000000..aaeaef5d12
--- /dev/null
+++ b/layout/reftests/text-overflow/selection-ref.html
@@ -0,0 +1,118 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: Selected text, background, decorations</title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+@font-face {
+ font-family: TestEllipsisFallback;
+ src: url(TestEllipsisFallback.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ white-space:nowrap;
+ width: 5em;
+ position:relative;
+ margin-top:1em;
+ padding-left: 0.9em;
+ padding-right: 1.3em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.4em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+i { display:none; }
+x {font-family:DejaVuSansMono;}
+</style>
+<script>
+function getTextNode(elm) {
+ if (elm.nodeType != 3)
+ return getTextNode(elm.firstChild);
+ return elm;
+}
+function addRange(elm) {
+try {
+ var sel = window.getSelection();
+ var range = document.createRange();
+ var startNode = elm.getAttribute('startNode');
+ if (startNode == null)
+ startNode = getTextNode(elm);
+ else
+ startNode = getTextNode(elm.childNodes[startNode])
+ var start = elm.getAttribute('start');
+ if (start == null) start = 2;
+ var endNode = elm.getAttribute('endNode');
+ if (endNode == null)
+ endNode = startNode;
+ else
+ endNode = getTextNode(elm.childNodes[endNode])
+ var end = elm.getAttribute('end');
+ if (end == null) end = endNode.textContent.length;
+ if (startNode==endNode && start > end) return;
+ if (startNode==null) return;
+ range.setStart(startNode, start);
+ range.setEnd(endNode, end);
+ sel.addRange(range);
+} catch (e) {
+alert(e+'\n'+elm.id+'\n'+t)
+}
+}
+function selectText() {
+ // For putting selection ranges to multiple editing hosts, we need to put
+ // a range outside all editable elements first, then, selection's ancestor
+ // limiter won't be set to an editing host.
+ getSelection().collapse(document.body, document.body.childNodes.length);
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ addRange(divs[i]);
+ }
+ var t1 = document.getElementById('t1');
+ addRange(t1.firstChild);
+ var t2 = document.getElementById('t2');
+ addRange(t2.firstChild);
+ document.body.offsetHeight;
+ setTimeout(function(){document.documentElement.removeAttribute('class')},2000);
+}
+</script>
+</head><body onload="selectText();">
+
+<!-- LTR overflow:hidden -->
+<div contenteditable="true" spellcheck="true" class="test ltr hidden" end=6>Mispe|&#x2026;</div>
+<span style="display:block;width:15em"><div contenteditable="true" spellcheck="true" class="test ltr hidden" style="width:auto; float:right; font-family:TestEllipsisFallback; text-align:right; width:9em;" start=0 end=0>...<x><i>z</i>d word</x></div></span><br clear="all">
+
+<div id="t1" contenteditable="true" spellcheck="true" class="test ltr hidden"><span class="rlo" endNode="1" start="0" end="6"><i>z</i>d word</span>&#x2026;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+<div id="t2" contenteditable="true" spellcheck="true" class="test ltr hidden" ><span class="rlo" endNode="2" start="1" end="1">&#x2026;<i>z</i>d word</span></div>
+<div contenteditable="true" spellcheck="true" class="test ltr hidden"><span class="rlo">&#x2026;<i>z</i>d word</div>
+<div contenteditable="true" spellcheck="true" class="test ltr hidden" endNode="1" start="2" end="3" style="text-indent:-0.2em"><span>&nbsp;&#x2026;s</span><span>pe|</span>&#x2026;<span></span></div>
+
+<!-- RTL overflow:hidden -->
+<div contenteditable="true" spellcheck="true" class="test rtl hidden" endNode="2" start="8" end="6">Misp&nbsp;&nbsp;&nbsp;&#x2026;<i>z</i>d word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden" end="2"><span class="lro">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#x2026;<i>z</i>d word</span></div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden" endNode="1" end=0 start=1><span class="lro">&#x2026;<i>z</i>d</span><span class="rlo"> word</span></div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo">Mis</span><span class="rlo">pel&#x2026;&nbsp;&nbsp;&nbsp; word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo">Mis</span><span class="rlo">pel&#x2026;&nbsp;&nbsp;&nbsp; word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo" style="margin-right:-0.2em">&nbsp;&#x2026;s</span><span class="rlo">pel&#x2026;&nbsp;&nbsp;&nbsp;</span><span class="rlo"> word</span></div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/selection.html b/layout/reftests/text-overflow/selection.html
new file mode 100644
index 0000000000..9727d12881
--- /dev/null
+++ b/layout/reftests/text-overflow/selection.html
@@ -0,0 +1,116 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Selected text, background, decorations
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: Selected text, background, decorations</title>
+<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+@font-face {
+ font-family: TestEllipsisFallback;
+ src: url(TestEllipsisFallback.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:auto;
+ text-overflow:ellipsis ellipsis;
+ white-space:nowrap;
+ width: 5em;
+ position:relative;
+ margin-top:1em;
+ padding-left: 0.9em;
+ padding-right: 1.3em;
+}
+
+.hidden {
+ overflow:hidden;
+ width: 4.4em;
+}
+
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+.lro {
+ unicode-bidi: bidi-override; direction: ltr;
+}
+.rtl {
+ direction:rtl;
+}
+x {font-family:DejaVuSansMono;}
+</style>
+<script>
+function getTextNode(elm) {
+ if (elm.nodeType != 3)
+ return getTextNode(elm.firstChild);
+ return elm;
+}
+function addRange(elm) {
+try {
+ var sel = window.getSelection();
+ var range = document.createRange();
+ var startNode = elm.getAttribute('startNode');
+ if (startNode == null)
+ startNode = getTextNode(elm);
+ else
+ startNode = getTextNode(elm.childNodes[startNode])
+ var start = elm.getAttribute('start');
+ if (start == null) start = 2;
+ var endNode = elm.getAttribute('endNode');
+ if (endNode == null)
+ endNode = startNode;
+ else
+ endNode = getTextNode(elm.childNodes[endNode])
+ var end = elm.getAttribute('end');
+ if (end == null) end = endNode.textContent.length;
+ if (startNode==endNode && start > end) return;
+ if (startNode==null) return;
+ range.setStart(startNode, start);
+ range.setEnd(endNode, end);
+ sel.addRange(range);
+} catch (e) {
+alert(e+'\n'+elm.id+'\n'+t)
+}
+}
+function selectText() {
+ // For putting selection ranges to multiple editing hosts, we need to put
+ // a range outside all editable elements first, then, selection's ancestor
+ // limiter won't be set to an editing host.
+ getSelection().collapse(document.body, document.body.childNodes.length);
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ addRange(divs[i]);
+ }
+ document.body.offsetHeight;
+ setTimeout(function(){document.documentElement.removeAttribute('class')},2000);
+}
+</script>
+</head><body onload="selectText();">
+
+
+<!-- LTR overflow:hidden -->
+<div contenteditable="true" spellcheck="true" class="test ltr hidden">Mispe|led word</div>
+<span style="display:block;width:15em"><div contenteditable="true" spellcheck="true" class="test ltr hidden" style="width:auto; float:right; font-family:TestEllipsisFallback; text-indent:-1em; " start=0 end=9><x>M ispeled word</x></div></span><br clear="all">
+<div contenteditable="true" spellcheck="true" class="test ltr hidden"><span class="rlo">Mispelled word</span></div>
+<div contenteditable="true" spellcheck="true" class="test ltr hidden"><span class="rlo">Mispelled</span><span class="rlo"> word</span></div>
+<div contenteditable="true" spellcheck="true" class="test ltr hidden"><span class="rlo">Mis</span><span class="rlo">pelled word</div>
+<div contenteditable="true" spellcheck="true" class="test ltr hidden" endNode="1" style="text-indent:-0.2em"><span>Mis</span><span>pe|led</span><span> word</span></div>
+
+<!-- RTL overflow:hidden -->
+<div contenteditable="true" spellcheck="true" class="test rtl hidden">Mispelled word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden" end="2"><span class="lro">Mispelled word</span></div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="lro">Mispelled</span><span class="rlo"> word</span></div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo">Mis</span><span class="rlo">pelled word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo">Mis</span><span class="rlo">pelled word</div>
+<div contenteditable="true" spellcheck="true" class="test rtl hidden"><span class="rlo" style="margin-right:-0.2em">Mis</span><span class="rlo">pelled</span><span class="rlo"> word</span></div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/single-value-ref.html b/layout/reftests/text-overflow/single-value-ref.html
new file mode 100644
index 0000000000..38f498cb94
--- /dev/null
+++ b/layout/reftests/text-overflow/single-value-ref.html
@@ -0,0 +1,106 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow: <single value>, scrolled and non-scrolled tests, (bug 684266)
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: &lt;single value&gt;, scrolled and non-scrolled tests, (bug 684266)</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+body {padding:10px 40px;}
+
+div {
+ width:100px;
+ white-space:nowrap;
+}
+.hidden {overflow:hidden}
+.auto {overflow:auto}
+.autolong {overflow:auto; width:100%;}
+.scroll {overflow:scroll}
+
+.ltr { direction:ltr; unicode-bidi: bidi-override; }
+.rtl { direction:rtl; unicode-bidi: bidi-override; }
+
+.ltr.p { text-indent: -5px; padding-left: 40px; } /* overflow into padding, but not outside the padding edge */
+.rtl.p { text-indent: -5px; padding-right: 40px; } /* overflow into padding, but not outside the padding edge */
+
+.s { text-indent: -5px; } /* overflow start edge outside the padding edge */
+
+div.ltr {
+ text-overflow: clip ellipsis;
+}
+div.rtl {
+ text-overflow: ellipsis clip;
+}
+
+</style>
+
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ var elm = divs[i];
+ if (elm.hasAttribute('scroll')) {
+ if (window.getComputedStyle(elm).direction == 'ltr')
+ elm.scrollLeft = 8;
+ else
+ elm.scrollLeft = -8;
+ }
+ }
+ document.documentElement.removeAttribute('class');
+}
+window.addEventListener("MozReftestInvalidate", scrolldivs);
+</script>
+</head>
+<body>
+
+ <div class="ltr start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="ltr start p auto">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start p autolong">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div class="ltr start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="ltr start s auto">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start s autolong">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start s scroll">A long line that does not break (overflow:scroll)</div>
+
+ <div scroll class="ltr start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="ltr start p auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start p autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div scroll class="ltr start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="ltr start s auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start s autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start s scroll">A long line that does not break (overflow:scroll)</div>
+
+<div class="rtl" style="float:right">
+ <div class="rtl start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="rtl start p auto">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start p autolong">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div class="rtl start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="rtl start s auto">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start s autolong">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start s scroll">A long line that does not break (overflow:scroll)</div>
+
+ <div scroll class="rtl start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="rtl start p auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start p autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div scroll class="rtl start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="rtl start s auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start s autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start s scroll">A long line that does not break (overflow:scroll)</div>
+</div>
+
+
+</body>
+</hml>
diff --git a/layout/reftests/text-overflow/single-value.html b/layout/reftests/text-overflow/single-value.html
new file mode 100644
index 0000000000..c903c71c45
--- /dev/null
+++ b/layout/reftests/text-overflow/single-value.html
@@ -0,0 +1,99 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow: <single value>, scrolled and non-scrolled tests, (bug 684266)
+-->
+<html class="reftest-wait"><head>
+<title>text-overflow: &lt;single value&gt;, scrolled and non-scrolled tests, (bug 684266)</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+body {padding:10px 40px;}
+
+div {
+ text-overflow: ellipsis;
+ width:100px;
+ white-space:nowrap;
+}
+.hidden {overflow:hidden}
+.auto {overflow:auto}
+.autolong {overflow:auto; width:100%;}
+.scroll {overflow:scroll}
+
+.ltr { direction:ltr; unicode-bidi: bidi-override; }
+.rtl { direction:rtl; unicode-bidi: bidi-override; }
+
+.ltr.p { text-indent: -5px; padding-left: 40px; } /* overflow into padding, but not outside the padding edge */
+.rtl.p { text-indent: -5px; padding-right: 40px; } /* overflow into padding, but not outside the padding edge */
+
+.s { text-indent: -5px; } /* overflow start edge outside the padding edge */
+</style>
+
+<script>
+function scrolldivs() {
+ var divs = document.getElementsByTagName('div');
+ for (i = 0; i < divs.length; ++i) {
+ var elm = divs[i];
+ if (elm.hasAttribute('scroll')) {
+ if (window.getComputedStyle(elm).direction == 'ltr')
+ elm.scrollLeft = 8;
+ else
+ elm.scrollLeft = -8;
+ }
+ }
+ document.documentElement.removeAttribute('class');
+}
+window.addEventListener("MozReftestInvalidate", scrolldivs);
+</script>
+</head>
+<body>
+
+ <div class="ltr start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="ltr start p auto">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start p autolong">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div class="ltr start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="ltr start s auto">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start s autolong">A long line that does not break (overflow:auto)</div>
+ <div class="ltr start s scroll">A long line that does not break (overflow:scroll)</div>
+
+ <div scroll class="ltr start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="ltr start p auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start p autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div scroll class="ltr start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="ltr start s auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start s autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="ltr start s scroll">A long line that does not break (overflow:scroll)</div>
+
+<div class="rtl" style="float:right">
+ <div class="rtl start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="rtl start p auto">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start p autolong">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div class="rtl start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div class="rtl start s auto">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start s autolong">A long line that does not break (overflow:auto)</div>
+ <div class="rtl start s scroll">A long line that does not break (overflow:scroll)</div>
+
+ <div scroll class="rtl start p hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="rtl start p auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start p autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start p scroll">A long line that does not break (overflow:scroll)</div>
+ <div scroll class="rtl start s hidden">A long line that does not break (overflow:hidden)</div>
+ <div scroll class="rtl start s auto">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start s autolong">A long line that does not break (overflow:auto)</div>
+ <div scroll class="rtl start s scroll">A long line that does not break (overflow:scroll)</div>
+</div>
+
+
+</body>
+</hml>
diff --git a/layout/reftests/text-overflow/standards-decorations-ref.html b/layout/reftests/text-overflow/standards-decorations-ref.html
new file mode 100644
index 0000000000..14e5268b96
--- /dev/null
+++ b/layout/reftests/text-overflow/standards-decorations-ref.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: Standards mode text-decorations</title>
+<style type="text/css">
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ float:left;
+ height:2em;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:20px;
+ color:blue;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.xspan {
+ text-decoration: line-through;
+}
+.t1 .xspan {
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:7.3em;}
+.t2 { width:20px;}
+.t3 { width:22px;}
+.t4 { width:1px; font-family:Ahem; }
+.t3 span {margin-left:14px; }
+
+m { font-size:20px; color:blue; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span><span class="xspan">0123&nbsp;56789012</span><m>&#x2026;</m></span></div>
+<div class="test rtl t1"><span><span class="xspan">1&nbsp;56789012345</span><m>&#x2026;</m></span></div>
+<div class="test t2" style="color:black"><span class="xspan">xxxx</span></div>
+<div class="test t3"><span class="xspan">x</span></div>
+<div class="test t4"><span class="xspan">x</span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/standards-decorations.html b/layout/reftests/text-overflow/standards-decorations.html
new file mode 100644
index 0000000000..04c2b84d09
--- /dev/null
+++ b/layout/reftests/text-overflow/standards-decorations.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Standards mode text-decorations
+-->
+<html><head>
+<title>text-overflow: Standards mode text-decorations</title>
+<style type="text/css">
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ text-overflow:ellipsis;
+ float:left;
+ height:2em;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:20px;
+ color:blue;
+}
+span {
+ text-decoration: line-through;
+ font-size:16px;
+ color:black;
+}
+.t1 span {
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:7.3em;}
+.t2 { width:20px;}
+.t3 { width:22px;}
+.t4 { width:1px; font-family:Ahem; }
+.t3 span {margin-left:14px; }
+
+m { font-size:20px; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123&nbsp;567890123456789</span></div>
+<div class="test rtl t1"><span>0321&nbsp;56789012345</span></div>
+<div class="test t2" style="color:black"><span>xxxx</span></div>
+<div class="test t3"><span>x</span></div>
+<div class="test t4"><span>x</span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/standards-line-height-ref.html b/layout/reftests/text-overflow/standards-line-height-ref.html
new file mode 100644
index 0000000000..ffab81e821
--- /dev/null
+++ b/layout/reftests/text-overflow/standards-line-height-ref.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: Standards mode line height</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+
+ float:left;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:24px;
+ color:blue;
+ border:1px solid black;
+ position:relative;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:4em; }
+
+m { font-size:24px; color:blue; line-height:8px; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123456|</span><m>&#x2026;</m></div>
+<div class="test rtl rlo t1"><span>0123456|</span><m>&#x2026;</m></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/standards-line-height.html b/layout/reftests/text-overflow/standards-line-height.html
new file mode 100644
index 0000000000..aa8b655dd8
--- /dev/null
+++ b/layout/reftests/text-overflow/standards-line-height.html
@@ -0,0 +1,57 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: Standards mode line height should not be affected by marker
+-->
+<html><head>
+<title>text-overflow: Standards mode line height</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ text-overflow:ellipsis;
+ float:left;
+ white-space:pre;
+ margin-left:1em;
+ margin-bottom:1em;
+ font-size:24px;
+ color:blue;
+ border:1px solid black;
+}
+span {
+ font-size:16px;
+ color:black;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+.t1 { width:4em; }
+
+</style>
+
+</head><body>
+
+<div class="test t1"><span>0123456|890123456789</span></div>
+<div class="test rtl rlo t1"><span>0123456|89012345</span></div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/table-cell-ref.html b/layout/reftests/text-overflow/table-cell-ref.html
new file mode 100644
index 0000000000..9e905cf64e
--- /dev/null
+++ b/layout/reftests/text-overflow/table-cell-ref.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test text-overflow:ellipsis on table-cell</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+
+ .table {
+ color: black;
+ display: table;
+ table-layout: fixed;
+ height: 5em;
+ width: 5em;
+ }
+ .row {
+ display: table-row;
+ }
+ .cell {
+ display: table-cell;
+ white-space: nowrap;
+ overflow: hidden;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="table">
+ <div class="row">
+ <div class="cell">|||||||&#x2026;</div>
+ </div>
+ <div class="row">
+ <div class="cell"><span>|||||||&#x2026;</span></div>
+ </div>
+ </div>
+</body></html>
diff --git a/layout/reftests/text-overflow/table-cell.html b/layout/reftests/text-overflow/table-cell.html
new file mode 100644
index 0000000000..6cb661f037
--- /dev/null
+++ b/layout/reftests/text-overflow/table-cell.html
@@ -0,0 +1,47 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow:ellipsis on table-cell
+-->
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test text-overflow:ellipsis on table-cell</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+ .table {
+ color: black;
+ display: table;
+ table-layout: fixed;
+ height: 5em;
+ width: 5em;
+ }
+ .row {
+ display: table-row;
+ }
+ .cell {
+ display: table-cell;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ }
+ </style>
+ </head>
+ <body>
+ <div class="table">
+ <div class="row">
+ <div class="cell">||||||||||||||</div>
+ </div>
+ <div class="row">
+ <div class="cell"><span>||||||||||||||</span></div>
+ </div>
+ </div>
+</body></html>
diff --git a/layout/reftests/text-overflow/theme-overflow-ref.html b/layout/reftests/text-overflow/theme-overflow-ref.html
new file mode 100644
index 0000000000..be271aa263
--- /dev/null
+++ b/layout/reftests/text-overflow/theme-overflow-ref.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Testcase for bug 669284</title>
+
+ <style type="text/css">
+ p {
+ overflow: hidden;
+ width: 200px;
+ }
+ .r {
+ direction:rtl;
+ }
+
+.x0 { margin:0px;}
+.x1 { margin:1px;}
+.x2 { margin:2px;}
+.x3 { margin:3px;}
+.x4 { margin-left:-1px; }
+.r .x4 { margin-right:-1px;}
+
+f { float:left; width:1px; height:1px; margin-left:-100px; }
+.r f { float:right; width:1px; height:1px; margin-right:-100px; }
+ </style>
+</head>
+<body>
+<p>
+ <input type="checkbox" class="x0"> 0<f></f><br>
+ <input type="checkbox" class="x1"> 1<f></f><br>
+ <input type="checkbox" class="x2"> 2<f></f><br>
+ <input type="checkbox" class="x3"> 3<f></f><br>
+ <input type="checkbox" class="x4"><f></f><br>
+</p>
+
+<p>
+ <input type="radio" class="x0"> 0<f></f><br>
+ <input type="radio" class="x1"> 1<f></f><br>
+ <input type="radio" class="x2"> 2<f></f><br>
+ <input type="radio" class="x3"> 3<f></f><br>
+ <input type="radio" class="x4"><f></f><br>
+</p>
+
+<p class="r">
+ <input type="checkbox" class="x0"> 0<f></f><br>
+ <input type="checkbox" class="x1"> 1<f></f><br>
+ <input type="checkbox" class="x2"> 2<f></f><br>
+ <input type="checkbox" class="x3"> 3<f></f><br>
+ <input type="checkbox" class="x4"><f></f><br>
+</p>
+
+<p class="r">
+ <input type="radio" class="x0"> 0<f></f><br>
+ <input type="radio" class="x1"> 1<f></f><br>
+ <input type="radio" class="x2"> 2<f></f><br>
+ <input type="radio" class="x3"> 3<f></f><br>
+ <input type="radio" class="x4"><f></f><br>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/theme-overflow.html b/layout/reftests/text-overflow/theme-overflow.html
new file mode 100644
index 0000000000..77f9019f59
--- /dev/null
+++ b/layout/reftests/text-overflow/theme-overflow.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Testcase for bug 669284</title>
+
+ <style type="text/css">
+ p {
+ overflow: hidden;
+ text-overflow: ellipsis ellipsis;
+ width: 200px;
+ }
+ .r {
+ direction:rtl;
+ }
+
+.x0 { margin:0px;}
+.x1 { margin:1px;}
+.x2 { margin:2px;}
+.x3 { margin:3px;}
+.x4 { margin-left:-1px;}
+.r .x4 { margin-right:-1px;}
+
+f { float:left; width:1px; height:1px; margin-left:-100px; }
+.r f { float:right; width:1px; height:1px; margin-right:-100px; }
+ </style>
+</head>
+<body>
+<p>
+ <input type="checkbox" class="x0"> 0<f></f><br>
+ <input type="checkbox" class="x1"> 1<f></f><br>
+ <input type="checkbox" class="x2"> 2<f></f><br>
+ <input type="checkbox" class="x3"> 3<f></f><br>
+ <input type="checkbox" class="x4"><f></f><br>
+</p>
+
+<p>
+ <input type="radio" class="x0"> 0<f></f><br>
+ <input type="radio" class="x1"> 1<f></f><br>
+ <input type="radio" class="x2"> 2<f></f><br>
+ <input type="radio" class="x3"> 3<f></f><br>
+ <input type="radio" class="x4"><f></f><br>
+</p>
+
+<p class="r">
+ <input type="checkbox" class="x0"> 0<f></f><br>
+ <input type="checkbox" class="x1"> 1<f></f><br>
+ <input type="checkbox" class="x2"> 2<f></f><br>
+ <input type="checkbox" class="x3"> 3<f></f><br>
+ <input type="checkbox" class="x4"><f></f><br>
+</p>
+
+<p class="r">
+ <input type="radio" class="x0"> 0<f></f><br>
+ <input type="radio" class="x1"> 1<f></f><br>
+ <input type="radio" class="x2"> 2<f></f><br>
+ <input type="radio" class="x3"> 3<f></f><br>
+ <input type="radio" class="x4"><f></f><br>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/two-value-syntax-ref.html b/layout/reftests/text-overflow/two-value-syntax-ref.html
new file mode 100644
index 0000000000..98a7de1e82
--- /dev/null
+++ b/layout/reftests/text-overflow/two-value-syntax-ref.html
@@ -0,0 +1,66 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow:<left> <right>
+-->
+<html><head>
+<title>text-overflow: text-overflow:&lt;left&gt; &lt;right&gt;</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:100%;
+ white-space:nowrap;
+}
+span {
+ margin: 0 -2px;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+</style>
+
+</head><body>
+
+<div style="float:left;">
+|||||
+<div class="test t1"><span>&nbsp;&#x2026;||&#x2026;</span></div>
+<div class="test rtl t1"><span>&nbsp;&#x2026;||&#x2026;</span></div>
+<div class="test t2"><span>&nbsp;&#x2026;||||</span></div>
+<div class="test rtl t2"><span>||||&#x2026;</span></div>
+<div class="test t3"><span>||||&#x2026;</span></div>
+<div class="test rtl t3"><span>&nbsp;&#x2026;||||</span></div>
+<div class="test t4"><span>||||.</span></div>
+<div class="test rtl t4"><span>&nbsp;.||||</span></div>
+<div class="test t5"><span>&nbsp;.||||</span></div>
+<div class="test rtl t5"><span>||||.</span></div>
+<div class="test t6"><span>&nbsp;.||,</span></div>
+<div class="test rtl t6"><span>&nbsp;,||.</span></div>
+<div class="test t7"><span>&nbsp;&#x2026;||,</span></div>
+<div class="test rtl t7"><span>&nbsp;,||&#x2026;</span></div>
+<div class="test t8"><span>&nbsp;.||&#x2026;</span></div>
+<div class="test rtl t8"><span>&nbsp;&#x2026;||.</span></div>
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/two-value-syntax.html b/layout/reftests/text-overflow/two-value-syntax.html
new file mode 100644
index 0000000000..9360c08fcc
--- /dev/null
+++ b/layout/reftests/text-overflow/two-value-syntax.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: text-overflow:<left> <right>
+-->
+<html><head>
+<title>text-overflow: text-overflow:&lt;left&gt; &lt;right&gt;</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ overflow:hidden;
+ width:100%;
+ white-space:nowrap;
+}
+span {
+ margin: 0 -2px;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction:rtl;
+}
+.lro {
+ unicode-bidi: bidi-override;
+}
+.rtl {
+ direction:rtl;
+}
+.ltr {
+ direction:ltr;
+}
+
+.t1 { text-overflow:ellipsis ellipsis; }
+.t2 { text-overflow:ellipsis clip; }
+.t3 { text-overflow:clip ellipsis; }
+.t4 { text-overflow:clip "."; }
+.t5 { text-overflow:"." clip; }
+.t6 { text-overflow:"." ","; }
+.t7 { text-overflow:ellipsis ","; }
+.t8 { text-overflow:"." ellipsis; }
+
+</style>
+
+</head><body>
+
+<div style="float:left;">
+|||||
+<div class="test t1"><span>||||||</span></div>
+<div class="test rtl t1"><span>||||||</span></div>
+<div class="test t2"><span>||||||</span></div>
+<div class="test rtl t2"><span>||||||</span></div>
+<div class="test t3"><span>||||||</span></div>
+<div class="test rtl t3"><span>||||||</span></div>
+<div class="test t4"><span>||||||</span></div>
+<div class="test rtl t4"><span>||||||</span></div>
+<div class="test t5"><span>||||||</span></div>
+<div class="test rtl t5"><span>||||||</span></div>
+<div class="test t6"><span>||||||</span></div>
+<div class="test rtl t6"><span>||||||</span></div>
+<div class="test t7"><span>||||||</span></div>
+<div class="test rtl t7"><span>||||||</span></div>
+<div class="test t8"><span>||||||</span></div>
+<div class="test rtl t8"><span>||||||</span></div>
+</div>
+
+
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-1-2-notref.html b/layout/reftests/text-overflow/vertical-decorations-1-2-notref.html
new file mode 100644
index 0000000000..638552e77e
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-1-2-notref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+.vlr {
+ writing-mode: vertical-lr;
+ text-orientation: sideways-right;
+ height: 10ch;
+}
+</style>
+</head>
+
+<body>
+<div class="vlr">abcdefghijklm</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-1-ref.html b/layout/reftests/text-overflow/vertical-decorations-1-ref.html
new file mode 100644
index 0000000000..dfbae42bb6
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-1-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+.vlr {
+ writing-mode: vertical-lr;
+ text-orientation: sideways-right;
+ height: 10ch;
+}
+</style>
+</head>
+
+<body>
+<div class="vlr"><u>abcdefghi</u>…</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-1.html b/layout/reftests/text-overflow/vertical-decorations-1.html
new file mode 100644
index 0000000000..e26a2a28fc
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+.vlr {
+ writing-mode: vertical-lr;
+ text-orientation: sideways-right;
+ height: 10ch;
+}
+</style>
+</head>
+
+<body>
+<div class="vlr"><u>abcdefghijklm</u></div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-2-ref.html b/layout/reftests/text-overflow/vertical-decorations-2-ref.html
new file mode 100644
index 0000000000..a393aedd85
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-2-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+span {
+ text-decoration: overline;
+}
+.vlr {
+ writing-mode: vertical-lr;
+ text-orientation: sideways-right;
+ height: 10ch;
+}
+</style>
+</head>
+
+<body>
+<div class="vlr"><span>abcdefghi</span>…</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-2.html b/layout/reftests/text-overflow/vertical-decorations-2.html
new file mode 100644
index 0000000000..c5e6e6fd9f
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-2.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+span {
+ text-decoration: overline;
+}
+.vlr {
+ writing-mode: vertical-lr;
+ text-orientation: sideways-right;
+ height: 10ch;
+}
+</style>
+</head>
+
+<body>
+<div class="vlr"><span>abcdefghijklm</span></div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-3-4-notref.html b/layout/reftests/text-overflow/vertical-decorations-3-4-notref.html
new file mode 100644
index 0000000000..dead7a03e4
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-3-4-notref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+.vrl {
+ writing-mode: vertical-rl;
+ text-orientation: upright;
+ height: 6em;
+}
+</style>
+</head>
+
+<body>
+<div class="vrl">你好吗?我很好!</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-3-ref.html b/layout/reftests/text-overflow/vertical-decorations-3-ref.html
new file mode 100644
index 0000000000..743ea37a00
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-3-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+ text-decoration-skip-ink: none;
+}
+.vrl {
+ writing-mode: vertical-rl;
+ text-orientation: upright;
+ height: 6em;
+}
+</style>
+</head>
+
+<body>
+<div class="vrl"><u>你好吗?我</u>…</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-3.html b/layout/reftests/text-overflow/vertical-decorations-3.html
new file mode 100644
index 0000000000..e30d962c50
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-3.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+ text-decoration-skip-ink:none;
+}
+.vrl {
+ writing-mode: vertical-rl;
+ text-orientation: upright;
+ height: 6em;
+}
+</style>
+</head>
+
+<body>
+<div class="vrl"><u>你好吗?我很好!</u></div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-4-ref.html b/layout/reftests/text-overflow/vertical-decorations-4-ref.html
new file mode 100644
index 0000000000..27e66e9652
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-4-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+span {
+ text-decoration: overline;
+}
+.vrl {
+ writing-mode: vertical-rl;
+ text-orientation: upright;
+ height: 6em;
+}
+</style>
+</head>
+
+<body>
+<div class="vrl"><span>你好吗?我</span>…</div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/vertical-decorations-4.html b/layout/reftests/text-overflow/vertical-decorations-4.html
new file mode 100644
index 0000000000..20283e5a65
--- /dev/null
+++ b/layout/reftests/text-overflow/vertical-decorations-4.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+div {
+ font: 25px monospace;
+ white-space: pre;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ border: 1px solid gray;
+ padding: 5px;
+ display: inline-block;
+ vertical-align: top;
+}
+span {
+ text-decoration: overline;
+}
+.vrl {
+ writing-mode: vertical-rl;
+ text-orientation: upright;
+ height: 6em;
+}
+</style>
+</head>
+
+<body>
+<div class="vrl"><span>你好吗?我很好!</span></div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/visibility-hidden-ref.html b/layout/reftests/text-overflow/visibility-hidden-ref.html
new file mode 100644
index 0000000000..ba05d4f6dd
--- /dev/null
+++ b/layout/reftests/text-overflow/visibility-hidden-ref.html
@@ -0,0 +1,72 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+-->
+<html><head>
+<title>text-overflow: visibility:hidden</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+
+ overflow: hidden;
+ white-space: nowrap;
+ background:lime;
+ color: black;
+ width: 50%;
+}
+
+.rtl {
+ direction:rtl;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+u {
+ visibility:hidden;
+ padding-left: 3em;
+ background: cyan;
+}
+.rtl u {padding-right: 3em; padding-left:0;}
+s {
+ visibility:visible;
+}
+
+.t1 {width:10em;}
+.t2 {width:14em;}
+.t3 {width:13.5em;}
+.t3 u { padding-right:1em; }
+.t3.rtl u {padding-left:1em; padding-right: 3em; }
+.t4 {width:12.5em;}
+</style>
+
+</head><body>
+
+<div class="test t2">
+CSS is awesome<u></u><br>
+CSS is awesome<u>&nbsp;<s>x</s>&nbsp;</u>
+</div>
+<div class="test t1">CSS is awesome<u></u><br></div>
+<div class="test t2">CSS is awesome<u>&nbsp;<s>x</s>&nbsp;</u></div>
+<div class="test t3">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+<div class="test t4">CSS is awesome<m>&#x2026;</m><u>&nbsp;<s></s></u></div>
+
+<div class="rtl">
+<div class="test rtl rlo t2">
+CSS is awesome<u></u><br>
+CSS is awesome<u>&nbsp;<s>x</s></u>
+</div>
+<div class="test rtl rlo t1">CSS is awesome<u></u><br></div>
+<div class="test rtl rlo t2">CSS is awesome<u>&nbsp;<s>x</s>&nbsp;</u></div>
+<div class="test rtl rlo t3">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+<div class="test rtl rlo t4">CSS is awesome<m>&#x2026;</m><u>&nbsp;<s></s></u></div>
+</div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/visibility-hidden.html b/layout/reftests/text-overflow/visibility-hidden.html
new file mode 100644
index 0000000000..18b917616e
--- /dev/null
+++ b/layout/reftests/text-overflow/visibility-hidden.html
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/licenses/publicdomain/
+
+ Test: visibility:hidden should not trigger text-overflow markers
+-->
+<html><head>
+<title>text-overflow: visibility:hidden</title>
+<style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+.test {
+ text-overflow:ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ background:lime;
+ color: black;
+ width: 50%;
+}
+
+.rtl {
+ direction:rtl;
+}
+.rlo {
+ unicode-bidi: bidi-override; direction: rtl;
+}
+u {
+ visibility:hidden;
+ padding-left: 3em;
+ background: cyan;
+}
+.rtl u {padding-right: 3em; padding-left:0;}
+s {
+ visibility:visible;
+}
+
+.t1 {width:10em;}
+.t2 {width:14em;}
+.t3 {width:13.5em;}
+.t3 u { padding-right:1em; }
+.t3.rtl u {padding-left:1em; padding-right: 3em; }
+.t4 {width:12.5em;}
+</style>
+
+</head><body>
+
+<div class="test t2">
+CSS is awesome<u></u><br>
+CSS is awesome<u>&nbsp;<s>x</s>&nbsp;&nbsp;&nbsp;</u>
+</div>
+<div class="test t1">CSS is awesome<u></u><br></div>
+<div class="test t2">CSS is awesome<u>&nbsp;<s>x</s>&nbsp;&nbsp;&nbsp;</u></div>
+<div class="test t3">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+<div class="test t4">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+
+<div class="rtl">
+<div class="test rtl rlo t2">
+CSS is awesome<u></u><br>
+CSS is awesome<u>&nbsp;<s>x</s></u>
+</div>
+<div class="test rtl rlo t1">CSS is awesome<u></u><br></div>
+<div class="test rtl rlo t2">CSS is awesome<u>&nbsp;<s>x</s>&nbsp;&nbsp;&nbsp;</u></div>
+<div class="test rtl rlo t3">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+<div class="test rtl rlo t4">CSS is awesome<u>&nbsp;<s>x</s></u></div>
+</div>
+
+</body></html>
diff --git a/layout/reftests/text-overflow/xulscroll-ref.html b/layout/reftests/text-overflow/xulscroll-ref.html
new file mode 100644
index 0000000000..7b478e293c
--- /dev/null
+++ b/layout/reftests/text-overflow/xulscroll-ref.html
@@ -0,0 +1,80 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug 672944</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+ .bacon {
+ white-space: nowrap;
+ text-overflow: clip;
+ overflow: hidden;
+ width: 30ch;
+ display: -moz-box;
+ background: lime;
+ margin-bottom: 1em;
+ }
+
+ .auto {
+ overflow-x: auto;
+ width: 29.5ch;
+ padding-bottom: 2ch;
+ }
+ .scroll {
+ overflow: auto;
+ padding: 2ch;
+ border: 3px solid black;
+ }
+ .scroll2 {
+ overflow: auto;
+ padding: 3ch;
+ }
+ .scroll3 {
+ overflow: auto;
+ padding: 2ch;
+ text-indent: -3ch;
+ }
+ .scroll4 {
+ overflow: auto;
+ padding: 2ch 0.2ch;
+ }
+span { background-color:white; position: relative; }
+ml3 {position: absolute; left:29ch; }
+
+#block-hover {
+ position:fixed;
+ top:0;left:0;width:100%;height:100%;
+}
+ </style>
+</head>
+<body>
+
+<div style="float:right;" dir="rtl">
+ <div class="bacon"><span>1Beef hamburger bacon tri-tip&#x2026; jowl biltong tail ribeye ham</span></div><br>
+ <div class="bacon auto"><span>2Beef hamburger bacon tri-&nbsp;ipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll"><span>3Beef hamburger bacon tri&nbsp;&nbsp;&nbsp;pJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll2"><span>4Beef hamburger bacon tr&nbsp;&nbsp;&nbsp;&nbsp;pJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll3"><span>5Beef hamburger bacon&nbsp;&nbsp;&nbsp;&nbsp;-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll4"><span>6Beef hamburger bacon tri-&nbsp;&nbsp;pJOWLBILTONG tail ribeye ham</span></div><br>
+</div>
+
+<div>
+ <div class="bacon"><span>1Beef hamburger bacon tri-tip&#x2026; jowl biltong tail ribeye ham</span></div><br>
+ <div class="bacon auto"><span>2Beef hamburger bacon tri-tip&nbsp;OWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll"><span>3Beef hamburger bacon tri-tipJ WLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll2"><span>4Beef hamburger bacon tri-tipJO LBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll3"><span>5Beef hamburger bacon tri-tipJOWL ILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll4"><span>6Beef hamburger bacon tri-ti JOWLBILTONG tail ribeye ham</span></div><br>
+</div>
+
+<div id="block-hover"></div>
+</body>
+</html>
diff --git a/layout/reftests/text-overflow/xulscroll.html b/layout/reftests/text-overflow/xulscroll.html
new file mode 100644
index 0000000000..c43f951232
--- /dev/null
+++ b/layout/reftests/text-overflow/xulscroll.html
@@ -0,0 +1,104 @@
+<!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<!DOCTYPE HTML>
+<html class="reftest-wait"><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug 672944</title>
+ <style type="text/css">
+@font-face {
+ font-family: DejaVuSansMono;
+ src: url(../fonts/DejaVuSansMono.woff),url(DejaVuSansMono.woff);
+}
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0; font-family:DejaVuSansMono;
+}
+
+ .bacon {
+ white-space: nowrap;
+ text-overflow: ellipsis ellipsis;
+ overflow: hidden;
+ width: 30ch;
+ display: -moz-box;
+ background: lime;
+ margin-bottom: 1em;
+ }
+
+ .auto {
+ overflow-x: auto;
+ padding-bottom: 2ch;
+ width: 29.5ch;
+ text-overflow: "" "";
+ }
+ .scroll {
+ overflow: auto;
+ padding: 2ch;
+ border: 3px solid black;
+ text-overflow: "" "";
+ }
+ .scroll2 {
+ overflow: auto;
+ padding: 3ch;
+ text-overflow: "" "";
+ }
+ .scroll3 {
+ overflow: auto;
+ padding: 2ch;
+ text-indent: -3ch;
+ text-overflow: "" "";
+ }
+ .scroll4 {
+ overflow: auto;
+ padding: 2ch 0.2ch;
+ text-overflow: "" "";
+ }
+span { background-color:white; }
+
+#block-hover {
+ position:fixed;
+ top:0;left:0;width:100%;height:100%;
+}
+ </style>
+ <script type="text/javascript">
+function init() {
+
+ // The behaviour of this test may be subtly different when this code runs
+ // before the first paint vs after the first paint. If you encounter
+ // intermittent failures in this reftest, you might have luck turning it into
+ // a reliable failure by wrapping this function body in a
+ // requestAnimationFrame callback to force it to run after the first paint.
+ // Alternatively you might need to force it to run before the first paint,
+ // perhaps by running it inline (not as an onload handler) or something.
+
+ // workaround bug 936936
+ document.body.style.display = "block";
+ document.body.getBoundingClientRect();
+
+ document.getElementById('rtl_auto').scrollLeft=999999;
+
+ document.documentElement.removeAttribute('class');
+}
+ </script>
+</head>
+<body onload="init();" style="display: inline;">
+
+<div style="float:right;" dir="rtl">
+ <div class="bacon"><span>1Beef hamburger bacon tri-tip, jowl biltong tail ribeye ham</span></div><br>
+ <div id="rtl_auto" class="bacon auto"><span>2Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll"><span>3Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll2"><span>4Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll3"><span>5Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll4"><span>6Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+</div>
+
+<div>
+ <div class="bacon"><span>1Beef hamburger bacon tri-tip, jowl biltong tail ribeye ham</span></div><br>
+ <div class="bacon auto"><span>2Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll"><span>3Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll2"><span>4Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll3"><span>5Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+ <div class="bacon scroll4"><span>6Beef hamburger bacon tri-tipJOWLBILTONG tail ribeye ham</span></div><br>
+</div>
+
+<div id="block-hover"></div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/basic-negcoord-ref.xhtml b/layout/reftests/text-shadow/basic-negcoord-ref.xhtml
new file mode 100644
index 0000000000..84826fc0ac
--- /dev/null
+++ b/layout/reftests/text-shadow/basic-negcoord-ref.xhtml
@@ -0,0 +1,6 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 20px; margin-left: 20px; color: green;" value="Hello!"/>
+ <label style="margin-top: 24px; margin-left: 24px; color: black;" value="Hello!"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/basic-negcoord.xhtml b/layout/reftests/text-shadow/basic-negcoord.xhtml
new file mode 100644
index 0000000000..699de53224
--- /dev/null
+++ b/layout/reftests/text-shadow/basic-negcoord.xhtml
@@ -0,0 +1,5 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 24px; margin-left: 24px; color: black; text-shadow: green -4px -4px" value="Hello!"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/basic-ref.xhtml b/layout/reftests/text-shadow/basic-ref.xhtml
new file mode 100644
index 0000000000..520fe17a48
--- /dev/null
+++ b/layout/reftests/text-shadow/basic-ref.xhtml
@@ -0,0 +1,6 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 33px; margin-left: 33px; color: grey;" value="Hello"/>
+ <label style="margin-top: 30px; margin-left: 30px; color: green;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/basic.xhtml b/layout/reftests/text-shadow/basic.xhtml
new file mode 100644
index 0000000000..f57ff366bb
--- /dev/null
+++ b/layout/reftests/text-shadow/basic.xhtml
@@ -0,0 +1,5 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 30px; margin-left: 30px; color: green; text-shadow: grey 3px 3px;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/blur-notref.xhtml b/layout/reftests/text-shadow/blur-notref.xhtml
new file mode 100644
index 0000000000..09704014b2
--- /dev/null
+++ b/layout/reftests/text-shadow/blur-notref.xhtml
@@ -0,0 +1,3 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <label style="text-shadow: blue 4px 4px" value="The shadow should be blurred"/>
+</box>
diff --git a/layout/reftests/text-shadow/blur-opacity-ref.html b/layout/reftests/text-shadow/blur-opacity-ref.html
new file mode 100644
index 0000000000..0637cd5f0d
--- /dev/null
+++ b/layout/reftests/text-shadow/blur-opacity-ref.html
@@ -0,0 +1,7 @@
+<style>
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+</style>
+<div style="position: absolute; clip: rect(20px, 100px, 100px, 20px); font: 128px Ahem; color: #7f7f7f">a</div>
diff --git a/layout/reftests/text-shadow/blur-opacity.html b/layout/reftests/text-shadow/blur-opacity.html
new file mode 100644
index 0000000000..176bd8f29f
--- /dev/null
+++ b/layout/reftests/text-shadow/blur-opacity.html
@@ -0,0 +1,7 @@
+<style>
+@font-face {
+ font-family: Ahem;
+ src: url(../fonts/Ahem.ttf);
+}
+</style>
+<div style="position: absolute; clip: rect(20px, 100px, 100px, 20px); font: 128px Ahem; color: transparent; text-shadow: rgba(0, 0, 0, 0.5) 0px 0px 1px">a</div>
diff --git a/layout/reftests/text-shadow/blur.xhtml b/layout/reftests/text-shadow/blur.xhtml
new file mode 100644
index 0000000000..d285c82024
--- /dev/null
+++ b/layout/reftests/text-shadow/blur.xhtml
@@ -0,0 +1,3 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <label style="text-shadow: blue 4px 4px 2px" value="The shadow should be blurred"/>
+</box>
diff --git a/layout/reftests/text-shadow/color-inherit-ref.xhtml b/layout/reftests/text-shadow/color-inherit-ref.xhtml
new file mode 100644
index 0000000000..6efca568fc
--- /dev/null
+++ b/layout/reftests/text-shadow/color-inherit-ref.xhtml
@@ -0,0 +1,6 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 27px; margin-left: 27px; color: blue;" value="Hello"/>
+ <label style="margin-top: 24px; margin-left: 24px; color: blue;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/color-inherit.xhtml b/layout/reftests/text-shadow/color-inherit.xhtml
new file mode 100644
index 0000000000..fe3162aa69
--- /dev/null
+++ b/layout/reftests/text-shadow/color-inherit.xhtml
@@ -0,0 +1,5 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 24px; margin-left: 24px; color: blue; text-shadow: 3px 3px;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/multiple-noblur-ref.xhtml b/layout/reftests/text-shadow/multiple-noblur-ref.xhtml
new file mode 100644
index 0000000000..7b4c18ec86
--- /dev/null
+++ b/layout/reftests/text-shadow/multiple-noblur-ref.xhtml
@@ -0,0 +1,9 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 33px; margin-left: 33px; color: grey;" value="Hello"/>
+ <label style="margin-top: 30px; margin-left: 30px; color: green;" value="Hello"/>
+ <label style="margin-top: 27px; margin-left: 27px; color: red;" value="Hello"/>
+ <label style="margin-top: 24px; margin-left: 24px; color: purple;" value="Hello"/>
+ <label style="margin-top: 20px; margin-left: 20px; color: black;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/multiple-noblur.xhtml b/layout/reftests/text-shadow/multiple-noblur.xhtml
new file mode 100644
index 0000000000..ef0dad6518
--- /dev/null
+++ b/layout/reftests/text-shadow/multiple-noblur.xhtml
@@ -0,0 +1,5 @@
+<box xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+ <stack style="align-items: start; justify-items: left;">
+ <label style="margin-top: 20px; margin-left: 20px; color: black; text-shadow: purple 4px 4px, red 7px 7px, green 10px 10px, grey 13px 13px;" value="Hello"/>
+ </stack>
+</box>
diff --git a/layout/reftests/text-shadow/overflow-clip-ref.html b/layout/reftests/text-shadow/overflow-clip-ref.html
new file mode 100644
index 0000000000..88f1ba2d31
--- /dev/null
+++ b/layout/reftests/text-shadow/overflow-clip-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body>
+ <div style="
+ width: 3em;
+ text-overflow: clip;
+ overflow: hidden;
+ white-space: nowrap;
+ color: red;">MMMMMM
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/overflow-clip.html b/layout/reftests/text-shadow/overflow-clip.html
new file mode 100644
index 0000000000..399bc4311f
--- /dev/null
+++ b/layout/reftests/text-shadow/overflow-clip.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<!--
+checks that unblurred text-shadows are
+actually clipped by text-overflow: clip
+-->
+<html>
+<head></head>
+<body>
+ <div style="
+ width: 3em;
+ text-overflow: clip;
+ overflow: hidden;
+ text-shadow: 3em 0px black;
+ white-space: nowrap;
+ color: red;">MMMMMM
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/overflow-decoration-ref.html b/layout/reftests/text-shadow/overflow-decoration-ref.html
new file mode 100644
index 0000000000..a488585442
--- /dev/null
+++ b/layout/reftests/text-shadow/overflow-decoration-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+ .outer {
+ text-decoration: underline;
+ position: absolute;
+ }
+ .outer+.outer {
+ color: green;
+ }
+ .inner {
+ vertical-align: 1em;
+ }
+ .outer+.outer>.inner {
+ position: relative;
+ top: 1em;
+ }
+</style>
+</head>
+<body>
+ <span class="outer"><span class="inner">x</span></span>
+ <span class="outer"><span class="inner">x</span></span>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/overflow-decoration.html b/layout/reftests/text-shadow/overflow-decoration.html
new file mode 100644
index 0000000000..e545adbe75
--- /dev/null
+++ b/layout/reftests/text-shadow/overflow-decoration.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<style>
+ .outer { text-decoration: underline; }
+ .inner {
+ vertical-align: 1em;
+ text-shadow: 0 1em green;
+ }
+ .reftest-wait .inner {
+ text-shadow: 0 1em red;
+ }
+</style>
+</head>
+<body>
+ <span class="outer"><span class="inner">x</span></span>
+ <script>
+ document.addEventListener("MozReftestInvalidate", () => {
+ document.documentElement.removeAttribute('class');
+ });
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/reftest.list b/layout/reftests/text-shadow/reftest.list
new file mode 100644
index 0000000000..c5b0a70004
--- /dev/null
+++ b/layout/reftests/text-shadow/reftest.list
@@ -0,0 +1,22 @@
+== chrome://reftest/content/text-shadow/basic.xhtml chrome://reftest/content/text-shadow/basic-ref.xhtml
+random-if(Android) == chrome://reftest/content/text-shadow/basic-negcoord.xhtml chrome://reftest/content/text-shadow/basic-negcoord-ref.xhtml
+!= chrome://reftest/content/text-shadow/blur.xhtml chrome://reftest/content/text-shadow/blur-notref.xhtml
+== chrome://reftest/content/text-shadow/color-inherit.xhtml chrome://reftest/content/text-shadow/color-inherit-ref.xhtml
+== chrome://reftest/content/text-shadow/multiple-noblur.xhtml chrome://reftest/content/text-shadow/multiple-noblur-ref.xhtml
+fuzzy(0-2,0-6400) random-if(useDrawSnapshot) == blur-opacity.html blur-opacity-ref.html
+
+fuzzy-if(cocoaWidget,0-27,0-2) fuzzy-if(winWidget,0-47,0-2) == overflow-clip.html overflow-clip-ref.html
+
+needs-focus != text-shadow-selected-1.html text-shadow-selected-1-notref.html
+fuzzy(0-1,0-1000) needs-focus == text-shadow-selected-1.html text-shadow-selected-1-ref.html
+needs-focus != text-shadow-selected-2.html text-shadow-selected-2-notref.html
+fuzzy(0-1,0-1400) needs-focus == text-shadow-selected-2.html text-shadow-selected-2-ref.html
+
+# bug 692744
+fuzzy(0-19,0-2872) == text-shadow-on-space-1.html text-shadow-on-space-1-ref.html
+
+# bug 721750
+needs-focus == text-shadow-on-selection-1.html text-shadow-on-selection-1-ref.html
+needs-focus == text-shadow-on-selection-2.html text-shadow-on-selection-2-ref.html
+
+== overflow-decoration.html overflow-decoration-ref.html
diff --git a/layout/reftests/text-shadow/text-shadow-on-selection-1-ref.html b/layout/reftests/text-shadow/text-shadow-on-selection-1-ref.html
new file mode 100644
index 0000000000..ece0e6de0f
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-selection-1-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+body {
+ background: white;
+ color: black;
+ font-size: 24px;
+}
+div {
+ background: white;
+ color: blue;
+ text-shadow: red 2px 2px 0px;
+}
+span {
+ background: yellow;
+ color: white;
+}
+</style>
+</head>
+<body>
+<div>
+hello <span>selected</span> world
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-on-selection-1.html b/layout/reftests/text-shadow/text-shadow-on-selection-1.html
new file mode 100644
index 0000000000..a0c29c321b
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-selection-1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function onload() {
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+ window.focus();
+}
+function disableReftestWait() {
+ document.documentElement.className = '';
+}
+</script>
+<style type="text/css">
+body {
+ background: white;
+ font-size: 24px;
+}
+div {
+ color: blue;
+ text-shadow: red 2px 2px 0px;
+}
+::-moz-selection {
+ background: yellow;
+ color: white;
+}
+::selection {
+ background: yellow;
+ color: white;
+}
+</style>
+</head>
+<body onload="onload()" onfocus="disableReftestWait()">
+<div>
+hello <span id="selectMe">selected</span> world
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-on-selection-2-ref.html b/layout/reftests/text-shadow/text-shadow-on-selection-2-ref.html
new file mode 100644
index 0000000000..09d9e4063a
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-selection-2-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+body {
+ background: white;
+ color: black;
+ font-size: 24px;
+}
+div {
+ background: white;
+ color: blue;
+ text-shadow: red 2px 2px 0px;
+}
+span {
+ background: yellow;
+ color: white;
+ text-shadow: none;
+}
+</style>
+</head>
+<body>
+<div>
+hello <span>selected</span> world
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-on-selection-2.html b/layout/reftests/text-shadow/text-shadow-on-selection-2.html
new file mode 100644
index 0000000000..1791f1b9fb
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-selection-2.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script type="text/javascript">
+function onload() {
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+ window.focus();
+}
+function disableReftestWait() {
+ document.documentElement.className = '';
+}
+</script>
+<style type="text/css">
+body {
+ background: white;
+ font-size: 24px;
+}
+div {
+ color: blue;
+ text-shadow: red 2px 2px 0px;
+}
+::-moz-selection {
+ background: yellow;
+ color: white;
+ text-shadow: none;
+}
+::selection {
+ background: yellow;
+ color: white;
+ text-shadow: none;
+}
+</style>
+</head>
+<body onload="onload()" onfocus="disableReftestWait()">
+<div>
+hello <span id="selectMe">selected</span> world
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-on-space-1-ref.html b/layout/reftests/text-shadow/text-shadow-on-space-1-ref.html
new file mode 100644
index 0000000000..447a49f094
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-space-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+div {
+ font: 24px serif;
+ text-shadow: 2px 2px 1px red;
+}
+</style>
+</head>
+<body>
+<div>
+The spaces should not have shadows!
+</div>
+</body>
+
diff --git a/layout/reftests/text-shadow/text-shadow-on-space-1.html b/layout/reftests/text-shadow/text-shadow-on-space-1.html
new file mode 100644
index 0000000000..7433dad35e
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-on-space-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+div {
+ font: 24px serif;
+ text-shadow: 2px 2px 1px red;
+}
+</style>
+</head>
+<body>
+<div>
+The spaces should not have shadows!
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
+</div>
+</body>
+
diff --git a/layout/reftests/text-shadow/text-shadow-selected-1-notref.html b/layout/reftests/text-shadow/text-shadow-selected-1-notref.html
new file mode 100644
index 0000000000..4ecfb69fd8
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-1-notref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- NOTREF case has selected text but the shadow is missing -->
+<body onload="onload()">
+<div id="selectMe">selected shadowed text</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-selected-1-ref.html b/layout/reftests/text-shadow/text-shadow-selected-1-ref.html
new file mode 100644
index 0000000000..e0fdcd82d9
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-1-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- REF case renders the selection first, using &nbsp; to avoid any show-through of glyph edges,
+ then the shadowed text on top of that -->
+<body onload="onload()">
+<div id="selectMe">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+<div style="text-shadow:1px 1px 1px red;">selected shadowed text</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-selected-1.html b/layout/reftests/text-shadow/text-shadow-selected-1.html
new file mode 100644
index 0000000000..669aee9766
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- test for bug 692752 - paint text shadow on top of selection highlight -->
+<body onload="onload()">
+<div style="text-shadow:1px 1px 1px red;" id="selectMe">selected shadowed text</div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-selected-2-notref.html b/layout/reftests/text-shadow/text-shadow-selected-2-notref.html
new file mode 100644
index 0000000000..a74a11fe50
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-2-notref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- NOTREF case has selected text but the shadow is missing -->
+<body onload="onload()">
+<div id="selectMe"><bdo dir="rtl">selected shadowed rtl text</bdo></div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-selected-2-ref.html b/layout/reftests/text-shadow/text-shadow-selected-2-ref.html
new file mode 100644
index 0000000000..3af90e9bfb
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-2-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- REF case renders the selection first, using &nbsp; to avoid any show-through of glyph edges,
+ then the shadowed text on top of that -->
+<body onload="onload()">
+<div id="selectMe">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div>
+<div style="text-shadow:1px 1px 1px red;"><bdo dir="rtl">selected shadowed rtl text</bdo></div>
+</body>
+</html>
diff --git a/layout/reftests/text-shadow/text-shadow-selected-2.html b/layout/reftests/text-shadow/text-shadow-selected-2.html
new file mode 100644
index 0000000000..d11b528b0b
--- /dev/null
+++ b/layout/reftests/text-shadow/text-shadow-selected-2.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script type="text/javascript">
+function onload() {
+ window.focus();
+ var range = document.createRange();
+ range.selectNodeContents(document.getElementById("selectMe"));
+ var sel = window.getSelection();
+ sel.removeAllRanges();
+ sel.addRange(range);
+}
+</script>
+<style type="text/css">
+body {
+ background: lightGray;
+}
+div {
+ position: absolute;
+ top: 10px;
+ left: 10px;
+ font: 36px monospace;
+ color: white;
+}
+</style>
+</head>
+<!-- test for bug 692752 - paint text shadow on top of selection highlight -->
+<body onload="onload()">
+<div style="text-shadow:1px 1px 1px red;" id="selectMe"><bdo dir="rtl">selected shadowed rtl text</bdo></div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/reftest.list b/layout/reftests/text-stroke/reftest.list
new file mode 100644
index 0000000000..356e49e35c
--- /dev/null
+++ b/layout/reftests/text-stroke/reftest.list
@@ -0,0 +1,9 @@
+# basic tests for webkit-text-stroke
+# fuzzy is needed here for platform dependent backends
+# These fail on Linux without webrender due to lack of antialiasing of the HTML text stroke
+fuzzy(0-64,0-776) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-80,0-2822) == webkit-text-stroke-property-001.html webkit-text-stroke-property-001-ref.html
+fuzzy(0-4,0-27) fuzzy-if(geckoview,0-4,0-1476) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-125,0-3725) == webkit-text-stroke-property-002.html webkit-text-stroke-property-002-ref.html
+fuzzy(0-64,0-528) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-74,0-2596) == webkit-text-stroke-property-003.html webkit-text-stroke-property-003-ref.html
+fuzzy(0-64,0-575) fuzzy-if(geckoview&&device,0-64,0-599) fuzzy-if(geckoview&&emulator,96-96,58-58) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-85,0-2147) == webkit-text-stroke-property-004.html webkit-text-stroke-property-004-ref.html
+fuzzy(0-64,0-860) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-80,0-2822) == webkit-text-stroke-property-005.html webkit-text-stroke-property-005-ref.html
+fuzzy(0-71,0-10) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)&&(/^aarch64-msvc/.test(xulRuntime.XPCOMABI)||(winWidget&&!layersGPUAccelerated)),0-48,0-351) == webkit-text-stroke-property-006.html webkit-text-stroke-property-006-ref.html
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-001-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-001-ref.html
new file mode 100644
index 0000000000..cb23f16d0c
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-001-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<body>
+<div style="width: 500px; height: 200px;">
+<!-- set overflow to visible so that stroking near boundary won't be hidden -->
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; overflow: visible;">
+<text x="0" y="100" font-size="64px" fill="transparent" stroke="green"
+ stroke-width="2px" stroke-linejoin="round">TEXT stroke</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-001.html b/layout/reftests/text-stroke/webkit-text-stroke-property-001.html
new file mode 100644
index 0000000000..ed482d95bf
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-001.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: 2px green</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
+<meta name="assert" content="The webkit-text-stroke of texts should take effect">
+<link rel="match" href="webkit-text-stroke-property-001-ref.html">
+<body>
+<div style="width: 500px; height: 200px;">
+<text style="padding-left: 0px; color: transparent; font-size: 64px; -webkit-text-stroke: 2px green;">TEXT stroke</text>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:100px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-002-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-002-ref.html
new file mode 100644
index 0000000000..e088ffd389
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-002-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<body>
+<div style="width: 500px; height: 200px;">
+<!-- set overflow to visible so that stroking near boundary won't be hidden -->
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; overflow: visible;">
+<text x="0" y="100" font-size="64px" fill="transparent" stroke="black"
+ stroke-width="1px" stroke-linejoin="round">TEXT stroke</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-002.html b/layout/reftests/text-stroke/webkit-text-stroke-property-002.html
new file mode 100644
index 0000000000..b9eeac2014
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-002.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: thin black</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
+<meta name="assert" content="thin keyword should take effect for webkit-text-stroke-width">
+<link rel="match" href="webkit-text-stroke-property-002-ref.html">
+<body>
+<div style="width: 500px; height: 200px;">
+<text style="padding-left: 0px; color: transparent; font-size: 64px; -webkit-text-stroke: thin black;">TEXT stroke</text>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:100px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-003-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-003-ref.html
new file mode 100644
index 0000000000..5eb85d938c
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-003-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<body>
+<div style="width: 500px; height: 200px;">
+<!-- set overflow to visible so that stroking near boundary won't be hidden -->
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; overflow: visible;">
+<text x="0" y="100" font-size="64px" fill="transparent" stroke="black"
+ stroke-width="3px" stroke-linejoin="round">TEXT stroke</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-003.html b/layout/reftests/text-stroke/webkit-text-stroke-property-003.html
new file mode 100644
index 0000000000..ec4354cb34
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-003.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: medium black</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
+<meta name="assert" content="medium keyword should take effect for webkit-text-stroke-width">
+<link rel="match" href="webkit-text-stroke-property-003-ref.html">
+<body>
+<div style="width: 500px; height: 200px;">
+<text style="padding-left: 0px; color: transparent; font-size: 64px; -webkit-text-stroke: medium black;">TEXT stroke</text>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:100px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-004-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-004-ref.html
new file mode 100644
index 0000000000..8aa61e0b87
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-004-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<body>
+<div style="width: 500px; height: 200px;">
+<!-- set overflow to visible so that stroking near boundary won't be hidden -->
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; overflow: visible;">
+<text x="0" y="100" font-size="64px" fill="transparent" stroke="black"
+ stroke-width="5px" stroke-linejoin="round">TEXT stroke</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-004.html b/layout/reftests/text-stroke/webkit-text-stroke-property-004.html
new file mode 100644
index 0000000000..18b239c3dc
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-004.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: thick black</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
+<meta name="assert" content="thick keyword should take effect for webkit-text-stroke-width">
+<link rel="match" href="webkit-text-stroke-property-004-ref.html">
+<body>
+<div style="width: 500px; height: 200px;">
+<text style="padding-left: 0px; color: transparent; font-size: 64px; -webkit-text-stroke: thick black;">TEXT stroke</text>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:100px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-005-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-005-ref.html
new file mode 100644
index 0000000000..cb23f16d0c
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-005-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<body>
+<div style="width: 500px; height: 200px;">
+<!-- set overflow to visible so that stroking near boundary won't be hidden -->
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%; overflow: visible;">
+<text x="0" y="100" font-size="64px" fill="transparent" stroke="green"
+ stroke-width="2px" stroke-linejoin="round">TEXT stroke</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-005.html b/layout/reftests/text-stroke/webkit-text-stroke-property-005.html
new file mode 100644
index 0000000000..306abb6789
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-005.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: 2px green</title>
+<link rel="author" title="Jeremy Chen" href="jeremychen@mozilla.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<link rel="help" href="https://compat.spec.whatwg.org/#the-webkit-text-stroke">
+<meta name="assert" content="webkit-text-stroke-color should take effect">
+<link rel="match" href="webkit-text-stroke-property-005-ref.html">
+<style>
+text {
+ padding-left: 0px;
+ color: red;
+ font-size: 64px;
+ -webkit-text-fill-color: transparent;
+ -webkit-text-stroke: 2px green;
+}
+</style>
+<body>
+<div style="width: 500px; height: 200px;">
+<text>TEXT stroke</text>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:100px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-006-ref.html b/layout/reftests/text-stroke/webkit-text-stroke-property-006-ref.html
new file mode 100644
index 0000000000..c1dbb774f3
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-006-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: SVG text reference</title>
+<link rel="author" title="Jonathan Kew" href="jfkthame@gmail.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style>
+@font-face { font-family: test; src: url(../fonts/sil/CharisSIL-R.ttf); }
+body { font-family: test; }
+</style>
+<body>
+<div style="width: 500px; height: 400px;">
+<svg xmlns="http://www.w3.org/2000/svg" style="width: 100%; height: 100%;">
+<text x="50" y="200" font-size="64px" stroke="green"
+ stroke-width="10px" stroke-linejoin="round">g&#x324;&#x326;&#x308;&#x302;</text>
+</svg>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-stroke/webkit-text-stroke-property-006.html b/layout/reftests/text-stroke/webkit-text-stroke-property-006.html
new file mode 100644
index 0000000000..4c5224b1d5
--- /dev/null
+++ b/layout/reftests/text-stroke/webkit-text-stroke-property-006.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<title>webkit-text-stroke: fat stroke should not be clipped</title>
+<link rel="author" title="Jonathan Kew" href="jfkthame@gmail.com">
+<link rel="author" title="Mozilla" href="https://www.mozilla.org">
+<style>
+@font-face { font-family: test; src: url(../fonts/sil/CharisSIL-R.ttf); }
+body { font-family: test; }
+</style>
+<body>
+<div style="width: 500px; height: 400px;">
+<span style="margin-left: 50px; font-size: 64px;
+ -webkit-text-stroke: 10px green;">g&#x324;&#x326;&#x308;&#x302;</span>
+<!-- need this inline-block to make sure text is rendered at the same position as the SVG reference -->
+<div style="display:inline-block; width:0px; height:200px;"/>
+</div>
+<body>
+<html>
diff --git a/layout/reftests/text-svgglyphs/bug1320197-1-ref.html b/layout/reftests/text-svgglyphs/bug1320197-1-ref.html
new file mode 100644
index 0000000000..b6dd5db7f1
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/bug1320197-1-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url("resources/bug1320197-testFont2.ttf");
+}
+div {
+ font: 600px/1 test;
+ width: 1em;
+ height: 1em;
+ border: 10px solid silver;
+ position: absolute;
+}
+</style>
+
+<p>There should be no purple visible at any of the edges of the black square.</p>
+
+<div>&#xe001;</div>
diff --git a/layout/reftests/text-svgglyphs/bug1320197-1.html b/layout/reftests/text-svgglyphs/bug1320197-1.html
new file mode 100644
index 0000000000..d9fcd1cbf5
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/bug1320197-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url("resources/bug1320197-testFont2.ttf");
+}
+div {
+ font: 600px/1 test;
+ width: 1em;
+ height: 1em;
+ border: 10px solid silver;
+ position: absolute;
+}
+</style>
+
+<p>There should be no purple visible at any of the edges of the black square.</p>
+
+<div>&#xe000;</div>
+
+<div>&#xe001;</div>
diff --git a/layout/reftests/text-svgglyphs/clip-ref.html b/layout/reftests/text-svgglyphs/clip-ref.html
new file mode 100644
index 0000000000..c310bfb86c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/clip-ref.html
@@ -0,0 +1,21 @@
+<html>
+ <head>
+ <style type="text/css">
+ @font-face {
+ font-family : svgttf;
+ src : url(resources/svg.woff);
+ }
+
+ body {
+ font-family : svgttf;
+ font-size : 200px;
+ color : palevioletred;
+ }
+ </style>
+ </head>
+ <body>
+ <div>
+O<br>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/clip.html b/layout/reftests/text-svgglyphs/clip.html
new file mode 100644
index 0000000000..4f91ff10c3
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/clip.html
@@ -0,0 +1,39 @@
+<html class="reftest-wait">
+ <!--
+ This test makes sure that the glyph extents are being extended to
+ the bounds of the SVG glyph by placing an SVG glyph in a div outside
+ the truetype extents but inside the SVG extents
+ -->
+ <head>
+ <style type="text/css">
+ @font-face {
+ font-family : svgttf;
+ src : url(resources/svg.woff);
+ }
+
+ body {
+ font-family : svgttf;
+ font-size : 200px;
+ color : palevioletred;
+ }
+
+ div {
+ width : 160px;
+ overflow : hidden;
+ }
+ </style>
+ <script type="text/javascript">
+ function expand() {
+ var div = document.getElementById("thediv");
+ div.style.width = "200px";
+ document.documentElement.removeAttribute("class");
+ }
+ window.addEventListener("MozReftestInvalidate", expand);
+ </script>
+ </head>
+ <body>
+ <div id="thediv">
+O<br>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/reftest.list b/layout/reftests/text-svgglyphs/reftest.list
new file mode 100644
index 0000000000..bf606ff350
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/reftest.list
@@ -0,0 +1,33 @@
+defaults pref(gfx.font_rendering.opentype_svg.enabled,true)
+
+pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-basic-disabled.svg svg-glyph-basic-ref.svg
+fuzzy(0-1,0-200) == svg-glyph-basic.svg svg-glyph-basic-ref.svg
+== svg-glyph-invalid-ids.svg svg-glyph-invalid-ids-ref.svg
+pref(gfx.font_rendering.opentype_svg.enabled,false) != svg-glyph-positioning-disabled.svg svg-glyph-positioning-ref.svg
+fuzzy(0-2,0-350) == svg-glyph-positioning.svg svg-glyph-positioning-ref.svg
+== svg-glyph-html.html svg-glyph-html-ref.svg
+== svg-glyph-direct.svg svg-glyph-direct-ref.svg
+== svg-glyph-invalid.html svg-glyph-invalid-ref.html
+== svg-glyph-objectfill-solid.svg svg-glyph-objectfill-solid-ref.svg
+fuzzy(0-2,0-200) == svg-glyph-objectstroke-solid.svg svg-glyph-objectstroke-solid-ref.svg
+fuzzy(0-1,0-300) == svg-glyph-objectgradient.svg svg-glyph-objectgradient-ref.svg # see bug 871961#c5
+fuzzy(0-1,0-250) == svg-glyph-objectgradient-zoom.svg svg-glyph-objectgradient-zoom-ref.svg
+fuzzy(0-14,0-13000) == svg-glyph-objectpattern.svg svg-glyph-objectpattern-ref.svg
+== clip.html clip-ref.html
+fuzzy(0-1,0-350) == svg-glyph-objectopacity.svg svg-glyph-objectopacity-ref.svg # see bug 871961#c5
+fuzzy(0-8,0-13000) == svg-glyph-objectopacity2.svg svg-glyph-objectopacity2-ref.svg
+fuzzy(0-2,0-200) == svg-glyph-paintnone.svg svg-glyph-paintnone-ref.svg
+fuzzy(0-2,0-200) == svg-glyph-cachedopacity.svg svg-glyph-cachedopacity-ref.svg
+== svg-glyph-objectvalue.svg svg-glyph-objectvalue-ref.svg
+fails-if(useDrawSnapshot) != svg-glyph-objectvalue.svg svg-glyph-objectvalue-75.svg
+== svg-glyph-objectvalue-75.svg svg-glyph-objectvalue-75-ref.svg
+== svg-glyph-objectvalue-150.svg svg-glyph-objectvalue-150-ref.svg
+fuzzy(0-15,0-152) == svg-glyph-mask.svg svg-glyph-mask-ref.svg
+== svg-glyph-paint-server.svg svg-glyph-paint-server-ref.svg
+== svg-glyph-transform.svg svg-glyph-transform-ref.svg
+== svg-glyph-extents.html svg-glyph-extents-ref.html
+== svg-glyph-compressed.html svg-glyph-compressed-ref.html
+fuzzy-if(cocoaWidget,0-1,0-33) == bug1320197-1.html bug1320197-1-ref.html
+fuzzy-if(winWidget,0-137,0-198) fuzzy-if(Android,0-81,0-96) == svg-in-ot-bitmap-1.html svg-in-ot-bitmap-1-ref.html
+
+defaults
diff --git a/layout/reftests/text-svgglyphs/resources/README b/layout/reftests/text-svgglyphs/resources/README
new file mode 100644
index 0000000000..852e5e4206
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/README
@@ -0,0 +1,61 @@
+.woff files for SVG-in-OpenType testing
+=======================================
+
+There are three .woff files in this directory:
+ * nosvg.woff
+ * svg.woff
+ * rubbish.woff
+
+nosvg.woff
+----------
+This font is FiraSansOT-Regular, with its metrics hacked so that its ascent
+is 1000 and descent is 0. Its unitsPerEm value is 1000.
+
+It contains no 'SVG ' table.
+
+svg.woff
+--------
+This font is the same as nosvg.woff above, but with the glyphs-*.svg SVG
+documents from this directory embedded in it using the tools described below.
+
+rubbish.woff
+------------
+This font is the same as nosvg.woff above, but with the addition of an 'SVG '
+table with the contents of rubbish.txt. Its purpose is to test that SVG tables
+without valid XML are ignored.
+
+Creating the Fonts
+------------------
+The tools used here are insertsvg.py from [1] and sfnt2woff from [2].
+
+svg.woff can be recreated with:
+
+woff2sfnt nosvg.woff > nosvg.ttf
+insertsvg.py nosvg.ttf svg.ttf glyphs-*.svg
+sfnt2woff svg.ttf
+
+[1] https://github.com/edf825/SVG-OpenType-Utils
+[2] http://people.mozilla.com/~jkew/woff/
+
+
+
+Additional test fonts:
+======================
+
+svg-glyph-extents.otf
+---------------------
+
+This is a copy of Fira Sans with a simple SVG table added using the tool from
+https://github.com/rocallahan/svg-opentype-workshop. The SVG table defines four
+glyphs, corresponding to 'A' through 'D':
+
+ <svg xmlns='http://www.w3.org/2000/svg'>
+ <rect id='glyph36' x='0' y='-1000' width='1000' height='1500' fill='red'/>
+ <rect id='glyph37' x='0' y='-1000' width='1000' height='1500' fill='green' transform='scale(2)'/>
+ <g id='glyph38'>
+ <rect x='0' y='-1000' width='1000' height='1500' fill='red'/>
+ </g>
+ <g id='glyph39'>
+ <rect x='0' y='-1000' width='1000' height='1500' fill='green' transform='scale(2)'/>
+ </g>
+ </svg>
diff --git a/layout/reftests/text-svgglyphs/resources/bug1320197-testFont2.ttf b/layout/reftests/text-svgglyphs/resources/bug1320197-testFont2.ttf
new file mode 100644
index 0000000000..8ef2e89edf
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/bug1320197-testFont2.ttf
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-base.svg b/layout/reftests/text-svgglyphs/resources/glyphs-base.svg
new file mode 100644
index 0000000000..51c32135c0
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-base.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ Basic test SVG glyphs
+ Covers glyph ID 47
+-->
+ <!-- char = L -->
+ <g id="glyph47">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ stroke="black" fill="red"/>
+ <rect x="100" y="-1000" width="100" height="100" stroke="none"
+ fill="turquoise" />
+ </g>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-invalid.svg b/layout/reftests/text-svgglyphs/resources/glyphs-invalid.svg
new file mode 100644
index 0000000000..4740b4ff3b
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-invalid.svg
@@ -0,0 +1,40 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ Test handling of invalid ids
+-->
+ <!-- not valid: leading space not allowed -->
+ <g id="glyph 48">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+ <!-- not valid: leading zero not allowed -->
+ <g id="glyph048">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+ <!-- not valid: trailing garbage not allowed -->
+ <g id="glyph48xxx">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+ <!-- not valid: trailing space not allowed -->
+ <g id="glyph48 ">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+ <!-- not valid: floating point not allowed -->
+ <g id="glyph48.0">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+ <!-- char = M -->
+ <g id="glyph48">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="lime"/>
+ </g>
+ <!-- Ensure first glyph48 is picked -->
+ <g id="glyph48">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="red"/>
+ </g>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-objectcolor.svg b/layout/reftests/text-svgglyphs/resources/glyphs-objectcolor.svg
new file mode 100644
index 0000000000..cf738d0cc1
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-objectcolor.svg
@@ -0,0 +1,24 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ Test SVG glyphs for text object pattern inheritance
+ Covers glyph ID range 49 (N) to 52 (Q)
+-->
+<!-- context-fill, no stroke -->
+ <!-- N -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ stroke="none" fill="context-fill" id="glyph49"/>
+
+ <!-- O -->
+ <rect x="50" y="-950" width="900" height="900" stroke-width="100"
+ fill="context-fill" stroke="none" id="glyph50"/>
+
+<!-- context-stroke -->
+ <!-- P -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ stroke="context-stroke" fill="burlywood" id="glyph51"/>
+
+<!-- both context-stroke and context-fill (but note swapped usage!) -->
+ <!-- Q -->
+ <rect x="50" y="-950" width="900" height="900" stroke-width="100"
+ fill="context-stroke" stroke="context-fill" id="glyph52"/>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-objectopacity.svg b/layout/reftests/text-svgglyphs/resources/glyphs-objectopacity.svg
new file mode 100644
index 0000000000..7fc479e22b
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-objectopacity.svg
@@ -0,0 +1,59 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ Test SVG glyphs for text object opacity inheritance
+ Covers glyph ID range 53 (R) to 60 (Y)
+-->
+ <!-- R -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="context-fill" stroke="context-stroke"
+ fill-opacity="context-fill-opacity"
+ stroke-opacity="context-stroke-opacity" id="glyph53"/>
+
+ <!-- S -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="context-fill" stroke="context-stroke"
+ fill-opacity="context-stroke-opacity"
+ stroke-opacity="context-fill-opacity" id="glyph54"/>
+
+ <!-- T -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="context-stroke" stroke="context-fill"
+ fill-opacity="context-fill-opacity"
+ stroke-opacity="context-stroke-opacity" id="glyph55"/>
+
+ <!-- U -->
+ <!-- Test for bug where explicit `inherit' would fail for
+ *-opacity="objectStrokeOpacity" or "objectFillOpacity" -->
+ <g style="fill-opacity : context-stroke-opacity; stroke-opacity : context-fill-opacity">
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="context-stroke" stroke="context-fill"
+ fill-opacity="inherit" stroke-opacity="inherit" id="glyph56"/>
+ </g>
+
+ <!-- W -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="darkorchid" stroke="goldenrod"
+ fill-opacity="context-fill-opacity"
+ stroke-opacity="context-stroke-opacity" id="glyph58"/>
+
+ <!-- X -->
+ <rect x="100" y="-900" width="800" height="800" stroke-width="50"
+ fill="darkorchid" stroke="goldenrod"
+ fill-opacity="context-stroke-opacity"
+ stroke-opacity="context-fill-opacity" id="glyph59"/>
+
+ <style type="text/css"><![CDATA[
+ #glyph60 {
+ fill-opacity : context-fill-opacity;
+ stroke-opacity : context-stroke-opacity;
+ }
+ #ychild {
+ color-interpolation : sRGB;
+ }
+ ]]></style>
+ <!-- Y -->
+ <g id="glyph60">
+ <rect x="100" y="-900" width="800" height="300" stroke="red" stroke-width="50"/>
+ <rect x="100" y="-400" width="800" height="300" stroke="red" stroke-width="50" id="ychild" />
+ </g>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-objectstroke.svg b/layout/reftests/text-svgglyphs/resources/glyphs-objectstroke.svg
new file mode 100644
index 0000000000..44afb2f600
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-objectstroke.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ Test SVG glyphs for text object stroke value inheritance
+ Covers glyph ID range 68 (a) to 71 (d)
+-->
+ <!-- a -->
+ <rect x="100" y="-900" width="800" height="800" stroke="powderblue"
+ stroke-width="50" stroke-dashoffset="35"
+ stroke-dasharray="50 50" id="glyph68" />
+
+ <!-- b -->
+ <rect x="100" y="-900" width="800" height="800" stroke="chartreuse"
+ stroke-width="50" stroke-dashoffset="35"
+ stroke-dasharray="context-value" id="glyph69" />
+
+ <!-- c -->
+ <rect x="100" y="-900" width="800" height="800" stroke="sienna"
+ stroke-width="50" stroke-dasharray="50 50"
+ stroke-dashoffset="context-value" id="glyph70" />
+
+ <!-- d -->
+ <rect x="100" y="-900" width="800" height="800" stroke="olivedrab"
+ stroke-width="context-value" stroke-dasharray="context-value"
+ stroke-dashoffset="context-value" id="glyph71" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-paintservers.svg b/layout/reftests/text-svgglyphs/resources/glyphs-paintservers.svg
new file mode 100644
index 0000000000..7f5a95ac09
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-paintservers.svg
@@ -0,0 +1,28 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+<!--
+ SVG test glyphs for paint servers within SVG glyphs
+ e: tests that we can refer to paint servers within the SVG glyph doc
+ (i.e. fill="url(#grad)" works)
+ f: tests that stop-color="context-{fill,stroke}" uses the context fill/stroke
+ fallback color
+-->
+ <defs>
+ <linearGradient id="grad">
+ <stop offset="0%" stop-color="papayawhip" />
+ <stop offset="100%" stop-color="plum" />
+ </linearGradient>
+
+ <linearGradient id="grad2">
+ <stop offset="0%" stop-color="context-fill" />
+ <stop offset="100%" stop-color="context-stroke" />
+ </linearGradient>
+ </defs>
+
+ <!-- char 'e' -->
+ <rect id="glyph72" x="250" y="-750" width="500" height="500"
+ fill="url(#grad)" />
+
+ <!-- char 'f' -->
+ <rect id="glyph73" x="250" y="-750" width="500" height="500"
+ fill="url(#grad2)" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/glyphs-transforms.svg b/layout/reftests/text-svgglyphs/resources/glyphs-transforms.svg
new file mode 100644
index 0000000000..ff3d9ffb76
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/glyphs-transforms.svg
@@ -0,0 +1,67 @@
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+<!--
+ SVG test glyphs for transforms within SVG glyphs
+ 'g': simple red square used as a reference
+ 'h': a smaller square, with a transform that should make it match the 'g'
+ 'i': similar, applying a transform to the referenced element
+ 'j': has a large blue square that should be transformed such that it is
+ completely hidden by the red
+ 'k': tests the accumulation of several transforms
+ 'l': checks that a transform from outside the glyph element is NOT applied
+ 'm', 'n', 'o', 'p': all render the same <rect> but only 'm' and 'n' should be
+ transformed; 'o' and 'p' should match 'q'
+ 'q': the unscaled small square, reference for 'o' and 'p' above
+-->
+
+ <defs>
+ <!-- this rect will need to be scaled 5x to match the reference glyph 'g' -->
+ <rect id="small" x="50" y="-150" width="100" height="100" fill="red" />
+ </defs>
+
+ <!-- char 'g' -->
+ <rect id="glyph74" x="250" y="-750" width="500" height="500" fill="red" />
+
+ <!-- char 'h' -->
+ <rect id="glyph75" x="25" y="-75" width="50" height="50" transform="scale(10)" fill="red" />
+
+ <!-- char 'i' -->
+ <g id="glyph76">
+ <use xlink:href="#small" transform="scale(5)" />
+ </g>
+
+ <!-- char 'j' -->
+ <g id="glyph77">
+ <g transform="translate(300,-300) scale(0.4)">
+ <rect x="0" y="-1000" width="1000" height="1000" fill="blue" />
+ </g>
+ <g transform="scale(5)">
+ <use xlink:href="#small" />
+ </g>
+ </g>
+
+ <!-- char 'k' -->
+ <g id="glyph78" transform="scale(0.5)">
+ <g transform="scale(0.5)">
+ <use xlink:href="#small" transform="scale(20)" />
+ </g>
+ </g>
+
+ <!-- char 'l' -->
+ <g transform="scale(2)">
+ <g id="glyph79">
+ <use xlink:href="#small" transform="scale(5)" />
+ </g>
+ </g>
+
+ <g id="glyph80"> <!-- char 'm' -->
+ <g id="glyph81" transform="scale(5)"> <!-- char 'n' -->
+ <g id="glyph82"> <!-- char 'o' -->
+ <use id="glyph83" xlink:href="#small" /> <!-- char 'p' -->
+ </g>
+ </g>
+ </g>
+
+ <!-- char 'q' -->
+ <use id="glyph84" xlink:href="#small" />
+
+</svg>
diff --git a/layout/reftests/text-svgglyphs/resources/nosvg.woff b/layout/reftests/text-svgglyphs/resources/nosvg.woff
new file mode 100644
index 0000000000..ad53341871
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/nosvg.woff
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/rubbish.txt b/layout/reftests/text-svgglyphs/resources/rubbish.txt
new file mode 100644
index 0000000000..1ad1631812
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/rubbish.txt
@@ -0,0 +1 @@
+This is the text contained in the rubbish.ttf 'SVG ' table. It is obviously not XML, and should thus be ignored.
diff --git a/layout/reftests/text-svgglyphs/resources/rubbish.woff b/layout/reftests/text-svgglyphs/resources/rubbish.woff
new file mode 100644
index 0000000000..3c83e02a30
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/rubbish.woff
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttf b/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttf
new file mode 100644
index 0000000000..cb0e3bd95d
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttf
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttx b/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttx
new file mode 100644
index 0000000000..cd3e9f4c5c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/svg-bitmap.ttx
@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="4.16">
+
+ <GlyphOrder>
+ <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
+ <GlyphID id="0" name=".notdef"/>
+ <GlyphID id="1" name="uni0000"/>
+ <GlyphID id="2" name="uni000D"/>
+ <GlyphID id="3" name="space"/>
+ <GlyphID id="4" name="A"/>
+ <GlyphID id="5" name="B"/>
+ <GlyphID id="6" name="C"/>
+ </GlyphOrder>
+
+ <head>
+ <!-- Most of this table will be recalculated by the compiler -->
+ <tableVersion value="1.0"/>
+ <fontRevision value="1.0"/>
+ <checkSumAdjustment value="0xcbb705e8"/>
+ <magicNumber value="0x5f0f3cf5"/>
+ <flags value="00000000 00000011"/>
+ <unitsPerEm value="1000"/>
+ <created value="Tue Mar 1 20:28:26 2022"/>
+ <modified value="Tue Mar 1 20:28:26 2022"/>
+ <xMin value="0"/>
+ <yMin value="-250"/>
+ <xMax value="1000"/>
+ <yMax value="750"/>
+ <macStyle value="00000000 00000000"/>
+ <lowestRecPPEM value="3"/>
+ <fontDirectionHint value="2"/>
+ <indexToLocFormat value="0"/>
+ <glyphDataFormat value="0"/>
+ </head>
+
+ <hhea>
+ <tableVersion value="0x00010000"/>
+ <ascent value="750"/>
+ <descent value="-250"/>
+ <lineGap value="0"/>
+ <advanceWidthMax value="1000"/>
+ <minLeftSideBearing value="0"/>
+ <minRightSideBearing value="0"/>
+ <xMaxExtent value="1000"/>
+ <caretSlopeRise value="1"/>
+ <caretSlopeRun value="0"/>
+ <caretOffset value="0"/>
+ <reserved0 value="0"/>
+ <reserved1 value="0"/>
+ <reserved2 value="0"/>
+ <reserved3 value="0"/>
+ <metricDataFormat value="0"/>
+ <numberOfHMetrics value="4"/>
+ </hhea>
+
+ <maxp>
+ <!-- Most of this table will be recalculated by the compiler -->
+ <tableVersion value="0x10000"/>
+ <numGlyphs value="7"/>
+ <maxPoints value="2"/>
+ <maxContours value="2"/>
+ <maxCompositePoints value="0"/>
+ <maxCompositeContours value="0"/>
+ <maxZones value="2"/>
+ <maxTwilightPoints value="0"/>
+ <maxStorage value="0"/>
+ <maxFunctionDefs value="0"/>
+ <maxInstructionDefs value="0"/>
+ <maxStackElements value="512"/>
+ <maxSizeOfInstructions value="0"/>
+ <maxComponentElements value="0"/>
+ <maxComponentDepth value="0"/>
+ </maxp>
+
+ <OS_2>
+ <!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
+ will be recalculated by the compiler -->
+ <version value="4"/>
+ <xAvgCharWidth value="1000"/>
+ <usWeightClass value="400"/>
+ <usWidthClass value="5"/>
+ <fsType value="00000000 00000000"/>
+ <ySubscriptXSize value="650"/>
+ <ySubscriptYSize value="699"/>
+ <ySubscriptXOffset value="0"/>
+ <ySubscriptYOffset value="140"/>
+ <ySuperscriptXSize value="650"/>
+ <ySuperscriptYSize value="699"/>
+ <ySuperscriptXOffset value="0"/>
+ <ySuperscriptYOffset value="479"/>
+ <yStrikeoutSize value="49"/>
+ <yStrikeoutPosition value="258"/>
+ <sFamilyClass value="0"/>
+ <panose>
+ <bFamilyType value="0"/>
+ <bSerifStyle value="0"/>
+ <bWeight value="0"/>
+ <bProportion value="0"/>
+ <bContrast value="0"/>
+ <bStrokeVariation value="0"/>
+ <bArmStyle value="0"/>
+ <bLetterForm value="0"/>
+ <bMidline value="0"/>
+ <bXHeight value="0"/>
+ </panose>
+ <ulUnicodeRange1 value="00000000 00000000 00000000 00000111"/>
+ <ulUnicodeRange2 value="00000000 00000000 00000000 00000000"/>
+ <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
+ <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
+ <achVendID value="XXXX"/>
+ <fsSelection value="00000000 01000000"/>
+ <usFirstCharIndex value="0"/>
+ <usLastCharIndex value="67"/>
+ <sTypoAscender value="750"/>
+ <sTypoDescender value="-250"/>
+ <sTypoLineGap value="0"/>
+ <usWinAscent value="750"/>
+ <usWinDescent value="250"/>
+ <ulCodePageRange1 value="00000000 00000000 00000000 00000011"/>
+ <ulCodePageRange2 value="00000000 00000000 00000000 00000000"/>
+ <sxHeight value="400"/>
+ <sCapHeight value="700"/>
+ <usDefaultChar value="32"/>
+ <usBreakChar value="32"/>
+ <usMaxContext value="0"/>
+ </OS_2>
+
+ <hmtx>
+ <mtx name=".notdef" width="1000" lsb="0"/>
+ <mtx name="A" width="1000" lsb="0"/>
+ <mtx name="B" width="1000" lsb="0"/>
+ <mtx name="C" width="1000" lsb="0"/>
+ <mtx name="space" width="1000" lsb="0"/>
+ <mtx name="uni0000" width="0" lsb="0"/>
+ <mtx name="uni000D" width="0" lsb="0"/>
+ </hmtx>
+
+ <cmap>
+ <tableVersion version="0"/>
+ <cmap_format_4 platformID="3" platEncID="1" language="0">
+ <map code="0x0" name="uni0000"/><!-- ???? -->
+ <map code="0xd" name="uni000D"/><!-- ???? -->
+ <map code="0x20" name="space"/><!-- SPACE -->
+ <map code="0x41" name="A"/><!-- LATIN CAPITAL LETTER A -->
+ <map code="0x42" name="B"/><!-- LATIN CAPITAL LETTER B -->
+ <map code="0x43" name="C"/><!-- LATIN CAPITAL LETTER C -->
+ </cmap_format_4>
+ </cmap>
+
+ <loca>
+ <!-- The 'loca' table will be calculated by the compiler -->
+ </loca>
+
+ <glyf>
+
+ <!-- The xMin, yMin, xMax and yMax values
+ will be recalculated by the compiler. -->
+
+ <TTGlyph name=".notdef"/><!-- contains no outline data -->
+
+ <TTGlyph name="A" xMin="0" yMin="-250" xMax="1000" yMax="750">
+ <contour>
+ <pt x="0" y="-250" on="1"/>
+ </contour>
+ <contour>
+ <pt x="1000" y="750" on="1"/>
+ </contour>
+ <instructions/>
+ </TTGlyph>
+
+ <TTGlyph name="B" xMin="0" yMin="-250" xMax="1000" yMax="750">
+ <contour>
+ <pt x="0" y="-250" on="1"/>
+ </contour>
+ <contour>
+ <pt x="1000" y="750" on="1"/>
+ </contour>
+ <instructions/>
+ </TTGlyph>
+
+ <TTGlyph name="C" xMin="0" yMin="-250" xMax="1000" yMax="750">
+ <contour>
+ <pt x="0" y="-250" on="1"/>
+ </contour>
+ <contour>
+ <pt x="1000" y="750" on="1"/>
+ </contour>
+ <instructions/>
+ </TTGlyph>
+
+ <TTGlyph name="space" xMin="0" yMin="-250" xMax="1000" yMax="750">
+ <contour>
+ <pt x="0" y="-250" on="1"/>
+ </contour>
+ <contour>
+ <pt x="1000" y="750" on="1"/>
+ </contour>
+ <instructions/>
+ </TTGlyph>
+
+ <TTGlyph name="uni0000"/><!-- contains no outline data -->
+
+ <TTGlyph name="uni000D"/><!-- contains no outline data -->
+
+ </glyf>
+
+ <name>
+ <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
+ SVG-Bitmap
+ </namerecord>
+ <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
+ Regular
+ </namerecord>
+ <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
+ SVG-Bitmap-Regular:v1.0
+ </namerecord>
+ <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
+ SVG-Bitmap Regular
+ </namerecord>
+ <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
+ Version 1.0
+ </namerecord>
+ <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
+ SVG-Bitmap-Regular
+ </namerecord>
+ </name>
+
+ <post>
+ <formatType value="3.0"/>
+ <italicAngle value="0.0"/>
+ <underlinePosition value="0"/>
+ <underlineThickness value="0"/>
+ <isFixedPitch value="0"/>
+ <minMemType42 value="0"/>
+ <maxMemType42 value="0"/>
+ <minMemType1 value="0"/>
+ <maxMemType1 value="0"/>
+ </post>
+
+ <SVG>
+
+ <svgDoc endGlyphID="4" startGlyphID="4">
+ <![CDATA[<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="glyph4" viewBox="0 0 1000 1000"><image x="0" y="-750" width="1000" height="1000" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEBNbnUEAoFAIBAIBALBk2ABo8QBP1gd7ycAAAAASUVORK5CYII="/></svg>]]>
+ </svgDoc>
+ <svgDoc endGlyphID="5" startGlyphID="5">
+ <![CDATA[<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="glyph5" viewBox="0 0 1000 1000"><image x="0" y="-750" width="1000" height="1000" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUENAAAIBKDT/p01hQ83KEDN5FQnAoFAIBAIBAKB4EewtloCPhS2RvMAAAAASUVORK5CYII="/></svg>]]>
+ </svgDoc>
+ <svgDoc endGlyphID="6" startGlyphID="6">
+ <![CDATA[<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="glyph6" viewBox="0 0 1000 1000"><image x="0" y="-750" width="1000" height="1000" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAChJREFUSMftzUEBAAAEBLCjf2dK8NsKrJLJp84zgUAgEAgEAoFAcGUBocYBP+pqhN4AAAAASUVORK5CYII="/></svg>]]>
+ </svgDoc>
+ </SVG>
+
+</ttFont>
diff --git a/layout/reftests/text-svgglyphs/resources/svg-glyph-extents.otf b/layout/reftests/text-svgglyphs/resources/svg-glyph-extents.otf
new file mode 100644
index 0000000000..1083f397f6
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/svg-glyph-extents.otf
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/svg-gz.ttf b/layout/reftests/text-svgglyphs/resources/svg-gz.ttf
new file mode 100644
index 0000000000..3a9660224a
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/svg-gz.ttf
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/resources/svg.woff b/layout/reftests/text-svgglyphs/resources/svg.woff
new file mode 100644
index 0000000000..6deee1460d
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/resources/svg.woff
Binary files differ
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-basic-disabled.svg b/layout/reftests/text-svgglyphs/svg-glyph-basic-disabled.svg
new file mode 100644
index 0000000000..493a9260b7
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-basic-disabled.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ /* For testing with the pref disabled, add a query to the font URL
+ to avoid cache confusion between enabled/disabled. */
+ src:url(resources/svg.woff?disabled);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ stroke: black;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that SVG glyphs are being drawn instead of TrueType glyphs
+ Also testing that this does not happen if the
+ gfx.font_rendering.opentype_svg.enabled preference is set to true.
+ -->
+ <!-- glyphid -->
+ <text x="0" y="200">
+ L
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg
new file mode 100644
index 0000000000..205529a50e
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-basic-ref.svg
@@ -0,0 +1,8 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <g>
+ <rect x="20" y="20" width="160" height="160" stroke-width="10"
+ stroke="black" fill="red" />
+ <rect x="20" y="0" width="20" height="20" stroke="none"
+ fill="turquoise" />
+ </g>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-basic.svg b/layout/reftests/text-svgglyphs/svg-glyph-basic.svg
new file mode 100644
index 0000000000..6eea7d986c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-basic.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ stroke: black;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that SVG glyphs are being drawn instead of TrueType glyphs
+ Also testing that this does not happen if the
+ gfx.font_rendering.opentype_svg.enabled preference is set to true.
+ -->
+ <!-- glyphid -->
+ <text x="0" y="200">
+ L
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity-ref.svg
new file mode 100644
index 0000000000..944ad2efc6
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="20" y="20" width="160" height="60" stroke="red" stroke-width="10"
+ fill-opacity="0.5" stroke-opacity="0.5" />
+ <rect x="20" y="120" width="160" height="60" stroke="red" stroke-width="10"
+ fill-opacity="0.5" stroke-opacity="0.5" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity.svg b/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity.svg
new file mode 100644
index 0000000000..60b11344c8
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-cachedopacity.svg
@@ -0,0 +1,20 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family : svgwoff;
+ src : url(resources/svg.woff);
+ }
+ text {
+ font-family : svgwoff;
+ font-size : 200px;
+ fill-opacity : 0.5;
+ stroke-opacity : 0.5;
+ }
+ ]]></style>
+
+ <!--
+ Test for a bug where cached fill-opacity and stroke-opacity values were
+ being destroyed
+ -->
+ <text x="0" y="200" stroke="black">Y</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html b/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html
new file mode 100644
index 0000000000..3325c05f22
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-compressed-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<title>Test for compressed SVG glyphs</title>
+<style>
+ @font-face {
+ font-family: test;
+ src: url(resources/svg.woff); /* uses uncompressed SVG documents */
+ }
+ html { width: 400px; height: 400px; background-color: white; }
+ body { margin: 0; }
+ div { font: 200px test; color: fuchsia; line-height: 1; stroke: none; }
+</style>
+<div>abcdefg</div>
+<div>LMNOPQR</div>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-compressed.html b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html
new file mode 100644
index 0000000000..0c51a54b12
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-compressed.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<title>Test for compressed SVG glyphs</title>
+<style>
+ @font-face {
+ font-family: test;
+ src: url(resources/svg-gz.ttf); /* copy of svg.woff using gzip-compressed SVG documents */
+ }
+ html { width: 400px; height: 400px; background-color: white; }
+ body { margin: 0; }
+ div { font: 200px test; color: fuchsia; line-height: 1; stroke: none; }
+</style>
+<div>abcdefg</div>
+<div>LMNOPQR</div>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-direct-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-direct-ref.svg
new file mode 100644
index 0000000000..67a5fb8d23
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-direct-ref.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <title>Reference for SVG glyphs being painted when painting properties are simple</title>
+
+ <style>
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ text {
+ font-family: Liberation;
+ font-size: 200px;
+ fill: url(#transparent);
+ }
+ ]]>
+ </style>
+
+ <linearGradient id="transparent">
+ <stop/>
+ </linearGradient>
+
+ <!-- The gradient paint server fill is not used by the "L" glyph,
+ but setting it forces the code path that fills and strokes text
+ in the SVG text frame to be chosen. -->
+ <text x="0" y="200">L</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-direct.svg b/layout/reftests/text-svgglyphs/svg-glyph-direct.svg
new file mode 100644
index 0000000000..c1e38a2cee
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-direct.svg
@@ -0,0 +1,19 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <title>Test for SVG glyphs being painted when painting properties are simple</title>
+
+ <style>
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ text {
+ font-family: Liberation;
+ font-size: 200px;
+ }
+ ]]>
+ </style>
+
+ <text x="0" y="200">L</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-extents-ref.html b/layout/reftests/text-svgglyphs/svg-glyph-extents-ref.html
new file mode 100644
index 0000000000..bd9847928b
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-extents-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<meta charset="utf-8">
+<head>
+<style type="text/css">
+@font-face {
+ font-family: foo;
+ src: url(resources/svg-glyph-extents.otf);
+}
+body {
+ font-family: foo;
+ font-size: 10px;
+}
+div {
+ display: inline-block;
+ height: 100px;
+ width: 100px;
+}
+</style>
+</head>
+<body>
+<div>A</div>
+<div>B</div>
+<div>C</div>
+<div>D</div>
+</body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-extents.html b/layout/reftests/text-svgglyphs/svg-glyph-extents.html
new file mode 100644
index 0000000000..6d7060aada
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-extents.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset="utf-8">
+<head>
+<style type="text/css">
+@font-face {
+ font-family: foo;
+ src: url(resources/svg-glyph-extents.otf);
+}
+body {
+ font-family: foo;
+ font-size: 10px;
+}
+@keyframes test {
+ from {
+ font-size: 100px;
+ }
+ to {
+ font-size: 10px;
+ }
+}
+#start-animation div {
+ display: inline-block;
+ height: 100px;
+ width: 100px;
+ animation-duration: 3s;
+ animation-name: test;
+}
+</style>
+<script type="text/javascript">
+function setup() {
+ var e = document.getElementById("watchme");
+ e.addEventListener("animationend", listener);
+
+ // Start the animation after the animationend listener has been subscribed
+ // (See Bug 1543639 Comment 25 for a rationale).
+ document.body.id = "start-animation";
+}
+function listener() {
+ document.documentElement.className = "";
+}
+</script>
+</head>
+<body onload="setup()">
+<div>A</div>
+<div id="watchme">B</div>
+<div>C</div>
+<div>D</div>
+</body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-html-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-html-ref.svg
new file mode 100644
index 0000000000..6360240ff8
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-html-ref.svg
@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <title>Reference for SVG glyphs being used in HTML content</title>
+ <style>
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ text { font: 200px Liberation; fill: fuchsia; stroke: black; }
+ </style>
+ <text x="0" y="200">b</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-html.html b/layout/reftests/text-svgglyphs/svg-glyph-html.html
new file mode 100644
index 0000000000..5d4298f6df
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-html.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<title>Test for SVG glyphs being used in HTML content</title>
+<style>
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ html { width: 400px; height: 400px; background-color: white; }
+ body { margin: 0; }
+ div { font: 200px Liberation; color: fuchsia; line-height: 1; stroke: none; }
+</style>
+<div>b</div>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids-ref.svg
new file mode 100644
index 0000000000..8666756e4e
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <g>
+ <rect x="20" y="20" width="160" height="160" stroke-width="10"
+ fill="lime" />
+ </g>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids.svg b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids.svg
new file mode 100644
index 0000000000..25813f2972
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ids.svg
@@ -0,0 +1,22 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that the right SVG glyph is picked from a document containing various
+ invalid glyph IDs.
+ -->
+ <text x="0" y="200">
+ M
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-invalid-ref.html b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ref.html
new file mode 100644
index 0000000000..632e8f2ca8
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-invalid-ref.html
@@ -0,0 +1,18 @@
+<html>
+ <head>
+ <title>Reference for test that invalid XML in the 'SVG ' table is rejected</title>
+ <style>
+ @font-face {
+ font-family : 'Liberation';
+ src : url(resources/nosvg.woff);
+ }
+ body {
+ font-family : 'Liberation';
+ font-size : 200px;
+ }
+ </style>
+ </head>
+ <body>
+ LML&#xfe01;
+ </body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-invalid.html b/layout/reftests/text-svgglyphs/svg-glyph-invalid.html
new file mode 100644
index 0000000000..3c785d02f7
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-invalid.html
@@ -0,0 +1,23 @@
+<html>
+ <head>
+ <title>Test that invalid XML in the 'SVG ' table is rejected</title>
+ <style>
+ @font-face {
+ font-family : 'Liberation';
+ src : url(resources/rubbish.woff);
+ }
+ body {
+ font-family : 'Liberation';
+ font-size : 200px;
+ }
+ </style>
+ </head>
+ <!--
+ The font file resources/rubbish.woff contains an SVG table which
+ does not contain valid XML. This test makes sure it falls back
+ on rendering the text using the truetype outlines.
+ -->
+ <body>
+ LML&#xfe01;
+ </body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-mask-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-mask-ref.svg
new file mode 100644
index 0000000000..4f3509c0dc
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-mask-ref.svg
@@ -0,0 +1,15 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style>
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ </style>
+ <mask id="m" x="0" y="0" width="200" height="200">
+ <rect x="30" y="60" width="80" height="80" stroke-width="5"
+ stroke="black" fill="red"/>
+ <rect x="30" y="50" width="10" height="10" stroke="none"
+ fill="turquoise" />
+ </mask>
+ <rect width="200" height="200" mask="url(#m)"/>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-mask.svg b/layout/reftests/text-svgglyphs/svg-glyph-mask.svg
new file mode 100644
index 0000000000..afda2f0908
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-mask.svg
@@ -0,0 +1,12 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style>
+ @font-face {
+ font-family: "Liberation";
+ src: url(resources/svg.woff);
+ }
+ </style>
+ <mask id="m" x="0" y="0" width="200" height="200">
+ <text x="20" y="150" style="font: 100px Liberation" stroke="black">L</text>
+ </mask>
+ <rect width="200" height="200" mask="url(#m)"/>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid-ref.svg
new file mode 100644
index 0000000000..dbaf7f5e15
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid-ref.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="20" y="20" width="160" height="160" fill="turquoise" />
+ <rect x="10" y="210" width="180" height="180" fill="thistle" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid.svg
new file mode 100644
index 0000000000..72b57b30ba
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectfill-solid.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that solid colors are inherited when using the objectFill
+ paint server value in SVG glyphs
+ -->
+
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ }
+ ]]>
+ </style>
+
+ <text fill="turquoise" x="0" y="200">
+ N
+ </text>
+ <text fill="thistle" x="0" y="400">
+ O
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-ref.svg
new file mode 100644
index 0000000000..91ebb683da
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-ref.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+ </defs>
+
+ <rect x="20" y="20" width="160" height="160" stroke="none"
+ fill="url(#grad)" />
+
+ <rect x="310" y="10" width="180" height="180" fill="url(#grad)"
+ stroke="none" />
+
+ <rect x="20" y="320" width="160" height="160" fill="burlywood"
+ stroke="url(#grad2)" stroke-width="10" />
+
+ <rect x="310" y="310" width="180" height="180" fill="url(#grad2)"
+ stroke="url(#grad)" stroke-width="20" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom-ref.svg
new file mode 100644
index 0000000000..95f3d1bb70
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom-ref.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="0.5">
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+ </defs>
+
+ <rect x="20" y="20" width="160" height="160" stroke="none"
+ fill="url(#grad)" />
+
+ <rect x="310" y="10" width="180" height="180" fill="url(#grad)"
+ stroke="none" />
+
+ <rect x="20" y="320" width="160" height="160" fill="burlywood"
+ stroke="url(#grad2)" stroke-width="10" />
+
+ <rect x="310" y="310" width="180" height="180" fill="url(#grad2)"
+ stroke="url(#grad)" stroke-width="20" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom.svg
new file mode 100644
index 0000000000..cebc4fb04c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient-zoom.svg
@@ -0,0 +1,35 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="0.5">
+ <!--
+ Test that gradients are inherited from the outer object under zoom
+ -->
+
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url("resources/svg.woff") format("woff");
+ }
+
+ text {
+ font-family: "Liberation";
+ font-size: 200px;
+ stroke-width: 5;
+ }
+ ]]></style>
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+
+ </defs>
+
+ <text x="0" y="200" fill="url(#grad)" stroke="url(#grad2)">N</text>
+ <text x="300" y="200" fill="url(#grad)" stroke="url(#grad2)">O</text>
+ <text x="0" y="500" fill="url(#grad)" stroke="url(#grad2)">P</text>
+ <text x="300" y="500" fill="url(#grad)" stroke="url(#grad2)">Q</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectgradient.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient.svg
new file mode 100644
index 0000000000..97f10bda4d
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectgradient.svg
@@ -0,0 +1,36 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that gradients are inherited from the outer object when using
+ the objectFill and objectStroke paint server values in SVG glyphs
+ -->
+
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url("resources/svg.woff") format("woff");
+ }
+
+ text {
+ font-family: "Liberation";
+ font-size: 200px;
+ stroke-width: 5;
+ }
+ ]]></style>
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+
+ </defs>
+
+ <text x="0" y="200" fill="url(#grad)" stroke="url(#grad2)">N</text>
+ <text x="300" y="200" fill="url(#grad)" stroke="url(#grad2)">O</text>
+ <text x="0" y="500" fill="url(#grad)" stroke="url(#grad2)">P</text>
+ <text x="300" y="500" fill="url(#grad)" stroke="url(#grad2)">Q</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectopacity-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity-ref.svg
new file mode 100644
index 0000000000..8dfb53aced
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity-ref.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+ </defs>
+
+ <rect x="20" y="20" width="160" height="160" stroke-width="10"
+ fill="url(#grad)" stroke="url(#grad2)"
+ fill-opacity="0.5" stroke-opacity="1.0" />
+
+ <rect x="320" y="20" width="160" height="160" stroke-width="10"
+ fill="url(#grad)" stroke="url(#grad2)"
+ fill-opacity="1.0" stroke-opacity="0.5" />
+
+ <rect x="20" y="320" width="160" height="160" stroke-width="10"
+ fill="url(#grad2)" stroke="url(#grad)"
+ fill-opacity="0.5" stroke-opacity="1.0" />
+
+ <rect x="320" y="320" width="160" height="160" stroke-width="10"
+ fill="url(#grad2)" stroke="url(#grad)"
+ fill-opacity="1.0" stroke-opacity="0.5" />
+
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectopacity.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity.svg
new file mode 100644
index 0000000000..c323640d47
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity.svg
@@ -0,0 +1,40 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that fill-opacity is correctly inherited from the outer text
+ object when -moz-objectFillOpacity is used in an SVG glyph.
+ -->
+
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url("resources/svg.woff") format("woff");
+ }
+
+ text {
+ font-family: "Liberation";
+ font-size: 200px;
+ stroke-width: 5;
+ fill-opacity: 0.5;
+ fill: url(#grad);
+ stroke-opacity: 1.0;
+ stroke: url(#grad2);
+ }
+ ]]></style>
+
+ <defs>
+ <linearGradient id="grad" x1="0" y1="0" x2="800" y2="800" gradientUnits="userSpaceOnUse">
+ <stop stop-color="purple" offset="0%" />
+ <stop stop-color="lime" offset="100%" />
+ </linearGradient>
+ <radialGradient id="grad2" cx="250" cy="400" r="400" gradientUnits="userSpaceOnUse">
+ <stop stop-color="red" offset="0%" />
+ <stop stop-color="blue" offset="100%" />
+ </radialGradient>
+
+ </defs>
+
+ <text x="0" y="200">R</text>
+ <text x="300" y="200">S</text>
+ <text x="0" y="500">T</text>
+ <text x="300" y="500">U</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2-ref.svg
new file mode 100644
index 0000000000..6a261afdbd
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2-ref.svg
@@ -0,0 +1,30 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <defs>
+ <pattern id="pat" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="30" height="30" stroke="salmon" stroke-width="5"
+ fill="mistyrose" />
+ </pattern>
+ <pattern id="pat2" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="10" height="10" stroke="lavenderblush" stroke-width="2"
+ fill="lemonchiffon" />
+ </pattern>
+ </defs>
+
+ <rect x="20" y="20" width="160" height="160" stroke-width="10"
+ fill="url(#pat)" stroke="url(#pat2)"
+ fill-opacity="1.0" stroke-opacity="0.5" />
+
+ <rect x="320" y="20" width="160" height="160" stroke-width="10"
+ fill="url(#pat)" stroke="url(#pat2)"
+ fill-opacity="0.5" stroke-opacity="1.0" />
+
+ <rect x="20" y="320" width="160" height="160" stroke-width="10"
+ fill="url(#pat2)" stroke="url(#pat)"
+ fill-opacity="1.0" stroke-opacity="0.5" />
+
+ <rect x="320" y="320" width="160" height="160" stroke-width="10"
+ fill="url(#pat2)" stroke="url(#pat)"
+ fill-opacity="0.5" stroke-opacity="1.0" />
+
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2.svg
new file mode 100644
index 0000000000..40e4fadf00
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectopacity2.svg
@@ -0,0 +1,39 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that stroke-opacity is correctly inherited from the outer text
+ object when -moz-objectStrokeOpacity is used in an SVG glyph.
+ -->
+
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url("resources/svg.woff") format("woff");
+ }
+
+ text {
+ font-family: "Liberation";
+ font-size: 200px;
+ stroke-width: 5;
+ fill-opacity: 1.0;
+ fill: url(#pat);
+ stroke-opacity: 0.5;
+ stroke: url(#pat2);
+ }
+ ]]></style>
+
+ <defs>
+ <pattern id="pat" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="30" height="30" stroke="salmon" stroke-width="5"
+ fill="mistyrose" />
+ </pattern>
+ <pattern id="pat2" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="10" height="10" stroke="lavenderblush" stroke-width="2"
+ fill="lemonchiffon" />
+ </pattern>
+ </defs>
+
+ <text x="0" y="200">R</text>
+ <text x="300" y="200">S</text>
+ <text x="0" y="500">T</text>
+ <text x="300" y="500">U</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectpattern-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectpattern-ref.svg
new file mode 100644
index 0000000000..e12e60d1b2
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectpattern-ref.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+
+ <defs>
+ <pattern id="pat" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="30" height="30" stroke="salmon" stroke-width="5"
+ fill="mistyrose" />
+ </pattern>
+ <pattern id="pat2" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="10" height="10" stroke="lavenderblush" stroke-width="2"
+ fill="lemonchiffon" />
+ </pattern>
+ </defs>
+
+ <rect x="20" y="20" width="160" height="160" stroke="none"
+ fill="url(#pat)" />
+
+ <rect x="310" y="10" width="180" height="180" fill="url(#pat)"
+ stroke="none" />
+
+ <rect x="20" y="320" width="160" height="160" fill="burlywood"
+ stroke="url(#pat2)" stroke-width="10" />
+
+ <rect x="310" y="310" width="180" height="180" fill="url(#pat2)"
+ stroke="url(#pat)" stroke-width="20" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectpattern.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectpattern.svg
new file mode 100644
index 0000000000..475165cd40
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectpattern.svg
@@ -0,0 +1,35 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that patterns are inherited from the outer object when using
+ the objectFill and objectStroke paint server values in SVG glyphs
+ -->
+
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url("resources/svg.woff") format("woff");
+ }
+
+ text {
+ font-family: "Liberation";
+ font-size: 200px;
+ stroke-width: 5;
+ }
+ ]]></style>
+
+ <defs>
+ <pattern id="pat" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="30" height="30" stroke="salmon" stroke-width="5"
+ fill="mistyrose" />
+ </pattern>
+ <pattern id="pat2" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse">
+ <rect x="5" y="5" width="10" height="10" stroke="lavenderblush" stroke-width="2"
+ fill="lemonchiffon" />
+ </pattern>
+ </defs>
+
+ <text x="0" y="200" fill="url(#pat)" stroke="url(#pat2)">N</text>
+ <text x="300" y="200" fill="url(#pat)" stroke="url(#pat2)">O</text>
+ <text x="0" y="500" fill="url(#pat)" stroke="url(#pat2)">P</text>
+ <text x="300" y="500" fill="url(#pat)" stroke="url(#pat2)">Q</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid-ref.svg
new file mode 100644
index 0000000000..797357537c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid-ref.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="20" y="20" width="160" height="160"
+ stroke-width="10" stroke="cornflowerblue" fill="burlywood" />
+ <rect x="10" y="210" width="180" height="180"
+ stroke-width="20" stroke="blanchedalmond" fill="darkolivegreen" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid.svg
new file mode 100644
index 0000000000..8e1088df73
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectstroke-solid.svg
@@ -0,0 +1,27 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!--
+ Test that solid colors are inherited when using the objectStroke
+ paint server value in SVG glyphs
+ -->
+
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ }
+ ]]>
+ </style>
+
+ <text stroke="cornflowerblue" x="0" y="200">
+ P
+ </text>
+ <text fill="blanchedalmond" stroke="darkolivegreen" x="0" y="400">
+ Q
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150-ref.svg
new file mode 100644
index 0000000000..561b294a93
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150-ref.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="1.5">
+ <style type="text/css"><![CDATA[
+ rect {
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ }
+ ]]></style>
+ <rect x="20" y="20" width="160" height="160" stroke="powderblue" />
+ <rect x="220" y="20" width="160" height="160" stroke="chartreuse" />
+ <rect x="20" y="220" width="160" height="160" stroke="sienna" />
+ <rect x="220" y="220" width="160" height="160" stroke="olivedrab" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150.svg
new file mode 100644
index 0000000000..4b687aa178
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-150.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="1.5">
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: svgwoff;
+ src: url(resources/svg.woff);
+ }
+
+ text {
+ font-family: svgwoff;
+ font-size: 200px;
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ stroke: black;
+ }
+ ]]></style>
+ <text x="0" y="200">a</text>
+ <text x="200" y="200">b</text>
+ <text x="0" y="400">c</text>
+ <text x="200" y="400">d</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75-ref.svg
new file mode 100644
index 0000000000..c47b309af6
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75-ref.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="0.75">
+ <style type="text/css"><![CDATA[
+ rect {
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ }
+ ]]></style>
+ <rect x="20" y="20" width="160" height="160" stroke="powderblue" />
+ <rect x="220" y="20" width="160" height="160" stroke="chartreuse" />
+ <rect x="20" y="220" width="160" height="160" stroke="sienna" />
+ <rect x="220" y="220" width="160" height="160" stroke="olivedrab" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75.svg
new file mode 100644
index 0000000000..eaa9d37440
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-75.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg" reftest-zoom="0.75">
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: svgwoff;
+ src: url(resources/svg.woff);
+ }
+
+ text {
+ font-family: svgwoff;
+ font-size: 200px;
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ stroke: black;
+ }
+ ]]></style>
+ <text x="0" y="200">a</text>
+ <text x="200" y="200">b</text>
+ <text x="0" y="400">c</text>
+ <text x="200" y="400">d</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-ref.svg
new file mode 100644
index 0000000000..73e006f353
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue-ref.svg
@@ -0,0 +1,13 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css"><![CDATA[
+ rect {
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ }
+ ]]></style>
+ <rect x="20" y="20" width="160" height="160" stroke="powderblue" />
+ <rect x="220" y="20" width="160" height="160" stroke="chartreuse" />
+ <rect x="20" y="220" width="160" height="160" stroke="sienna" />
+ <rect x="220" y="220" width="160" height="160" stroke="olivedrab" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-objectvalue.svg b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue.svg
new file mode 100644
index 0000000000..1a94b43554
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-objectvalue.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css"><![CDATA[
+ @font-face {
+ font-family: svgwoff;
+ src: url(resources/svg.woff);
+ }
+
+ text {
+ font-family: svgwoff;
+ font-size: 200px;
+ stroke-width: 10;
+ stroke-dasharray: 10 10;
+ stroke-dashoffset: 7;
+ stroke: black;
+ }
+ ]]></style>
+ <text x="0" y="200">a</text>
+ <text x="200" y="200">b</text>
+ <text x="0" y="400">c</text>
+ <text x="200" y="400">d</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-paint-server-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-paint-server-ref.svg
new file mode 100644
index 0000000000..dde80a92fa
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-paint-server-ref.svg
@@ -0,0 +1,10 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <defs>
+ <linearGradient id="grad">
+ <stop offset="0%" stop-color="papayawhip" />
+ <stop offset="100%" stop-color="plum" />
+ </linearGradient>
+ </defs>
+
+ <rect x="50" y="50" width="100" height="100" fill="url(#grad)" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-paint-server.svg b/layout/reftests/text-svgglyphs/svg-glyph-paint-server.svg
new file mode 100644
index 0000000000..4e3bdd6772
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-paint-server.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that paintservers within SVG glyph documents are rendered properly
+ -->
+ <text x="0" y="200">
+ e
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-paintnone-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-paintnone-ref.svg
new file mode 100644
index 0000000000..cde840eb4e
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-paintnone-ref.svg
@@ -0,0 +1,17 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <rect x="30" y="30" width="160" height="160" stroke-width="10"
+ fill="darkorchid" stroke="none"
+ fill-opacity="0.5" />
+
+ <rect x="30" y="230" width="160" height="160" stroke-width="10"
+ stroke="goldenrod" fill="none"
+ stroke-opacity="0.5" />
+
+ <rect x="230" y="30" width="160" height="160" stroke-width="10"
+ stroke="goldenrod" fill="none"
+ stroke-opacity="0.5" />
+
+ <rect x="230" y="230" width="160" height="160" stroke-width="10"
+ fill="darkorchid" stroke="none"
+ fill-opacity="0.5" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-paintnone.svg b/layout/reftests/text-svgglyphs/svg-glyph-paintnone.svg
new file mode 100644
index 0000000000..7b8d01d87c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-paintnone.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ stroke-opacity: 0.5;
+ fill-opacity: 0.5;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that objectFillOpacity evaluates to 0 when fill="none" even when
+ fill-opacity is set, and similar for objectStrokeOpacity.
+ -->
+ <text x="10" y="210" stroke="none" fill="black">W</text>
+ <text x="10" y="410" stroke="black" fill="none">W</text>
+ <text x="210" y="210" stroke="none" fill="black">X</text>
+ <text x="210" y="410" stroke="black" fill="none">X</text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-positioning-disabled.svg b/layout/reftests/text-svgglyphs/svg-glyph-positioning-disabled.svg
new file mode 100644
index 0000000000..69418fde8c
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-positioning-disabled.svg
@@ -0,0 +1,25 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ /* For testing with the pref disabled, add a query to the font URL
+ to avoid cache confusion between enabled/disabled. */
+ src:url(resources/svg.woff?disabled);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ stroke: black;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that we're rendering in the right place in the middle of a
+ text run
+ -->
+ <text x="0" y="200">
+ LLL
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-positioning-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-positioning-ref.svg
new file mode 100644
index 0000000000..10e8ff1161
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-positioning-ref.svg
@@ -0,0 +1,21 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <!-- The "L" glyph in Fira Sans has been hacked to have an advance of
+ exactly 500/1000 em, or 100px at a font size of 200px. -->
+ <!-- L -->
+ <rect x="20" y="20" width="160" height="160" stroke-width="10"
+ stroke="black" fill="red" />
+ <rect x="20" y="0" width="20" height="20" stroke="none"
+ fill="turquoise" />
+
+ <!-- L -->
+ <rect x="120" y="20" width="160" height="160" stroke-width="10"
+ stroke="black" fill="red" />
+ <rect x="120" y="0" width="20" height="20" stroke="none"
+ fill="turquoise" />
+
+ <!-- L -->
+ <rect x="220" y="20" width="160" height="160" stroke-width="10"
+ stroke="black" fill="red" />
+ <rect x="220" y="0" width="20" height="20" stroke="none"
+ fill="turquoise" />
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-positioning.svg b/layout/reftests/text-svgglyphs/svg-glyph-positioning.svg
new file mode 100644
index 0000000000..a16056a244
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-positioning.svg
@@ -0,0 +1,23 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 200px;
+ stroke: black;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that we're rendering in the right place in the middle of a
+ text run
+ -->
+ <text x="0" y="200">
+ LLL
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-transform-ref.svg b/layout/reftests/text-svgglyphs/svg-glyph-transform-ref.svg
new file mode 100644
index 0000000000..759e06ae42
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-transform-ref.svg
@@ -0,0 +1,48 @@
+<svg xmlns="http://www.w3.org/2000/svg">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 100px;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that transforms within SVG glyph documents are applied properly
+ -->
+ <text x="0" y="100">
+ g
+ </text>
+ <text x="0" y="200">
+ g
+ </text>
+ <text x="0" y="300">
+ g
+ </text>
+
+ <text x="100" y="100">
+ g
+ </text>
+ <text x="100" y="200">
+ g
+ </text>
+ <text x="100" y="300">
+ g
+ </text>
+
+ <text x="200" y="100">
+ g
+ </text>
+ <!-- note that the next two are different from the preceding glyphs! -->
+ <text x="200" y="200">
+ q
+ </text>
+ <text x="200" y="300">
+ q
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-glyph-transform.svg b/layout/reftests/text-svgglyphs/svg-glyph-transform.svg
new file mode 100644
index 0000000000..933dea3725
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-glyph-transform.svg
@@ -0,0 +1,48 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="300" height="600">
+ <style type="text/css">
+ <![CDATA[
+ @font-face {
+ font-family: "Liberation";
+ src:url(resources/svg.woff);
+ }
+ text
+ {
+ font-family: Liberation;
+ font-size: 100px;
+ }
+ ]]>
+ </style>
+ <!--
+ Test that transforms within SVG glyph documents are applied properly
+ -->
+ <text x="0" y="100">
+ h
+ </text>
+ <text x="0" y="200">
+ i
+ </text>
+ <text x="0" y="300">
+ j
+ </text>
+
+ <text x="100" y="100">
+ k
+ </text>
+ <text x="100" y="200">
+ l
+ </text>
+ <text x="100" y="300">
+ m
+ </text>
+
+ <text x="200" y="100">
+ n
+ </text>
+ <!-- note that the next two are different from the preceding glyphs! -->
+ <text x="200" y="200">
+ o
+ </text>
+ <text x="200" y="300">
+ p
+ </text>
+</svg>
diff --git a/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1-ref.html b/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1-ref.html
new file mode 100644
index 0000000000..c93fc86c94
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="utf-8">
+ <title>SVG-in-OT bitmap issue</title>
+ <style>
+ @font-face {
+ font-family: test;
+ src: url("resources/svg-bitmap.ttf");
+ }
+ span {
+ white-space: pre;
+ }
+ .a {
+ background: red;
+ }
+ .b {
+ background: yellow;
+ }
+ .c {
+ background: blue;
+ }
+ </style>
+</head>
+<body>
+ <div style="font: 32px/1 test, serif">
+ x <span class=a> </span><span class=b> </span><span class=c> </span> x
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1.html b/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1.html
new file mode 100644
index 0000000000..6f8055ebd1
--- /dev/null
+++ b/layout/reftests/text-svgglyphs/svg-in-ot-bitmap-1.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="utf-8">
+ <title>SVG-in-OT bitmap issue</title>
+ <style>
+ @font-face {
+ font-family: test;
+ src: url("resources/svg-bitmap.ttf");
+ }
+ </style>
+ <script>
+ // Spin for 1 second using requestAnimationFrame, which should be plenty
+ // for the PNG images in the SVG-in-OT font to be decoded.
+ let start;
+ function rAF(timestamp) {
+ if (start === undefined) {
+ start = timestamp;
+ }
+ if (timestamp - start < 1000) {
+ window.requestAnimationFrame(rAF);
+ } else {
+ document.documentElement.classList.remove("reftest-wait");
+ }
+ }
+ </script>
+</head>
+<body onload="window.requestAnimationFrame(rAF)">
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 50" x="0" y="0" width="400" height="50">
+ <text x="0" y="24" font-family="test, serif" font-size="32px">x ABC x</text>
+ </svg>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/all-lower-ref.html b/layout/reftests/text-transform/all-lower-ref.html
new file mode 100644
index 0000000000..10f07b56fe
--- /dev/null
+++ b/layout/reftests/text-transform/all-lower-ref.html
@@ -0,0 +1,1448 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; font-size: 12px; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0061;
+&#x0062;
+&#x0063;
+&#x0064;
+&#x0065;
+&#x0066;
+&#x0067;
+&#x0068;
+&#x0069;
+&#x006A;
+&#x006B;
+&#x006C;
+&#x006D;
+&#x006E;
+&#x006F;
+&#x0070;
+&#x0071;
+&#x0072;
+&#x0073;
+&#x0074;
+&#x0075;
+&#x0076;
+&#x0077;
+&#x0078;
+&#x0079;
+&#x007A;
+&#x00E0;
+&#x00E1;
+&#x00E2;
+&#x00E3;
+&#x00E4;
+&#x00E5;
+&#x00E6;
+&#x00E7;
+&#x00E8;
+&#x00E9;
+&#x00EA;
+&#x00EB;
+&#x00EC;
+&#x00ED;
+&#x00EE;
+&#x00EF;
+&#x00F0;
+&#x00F1;
+&#x00F2;
+&#x00F3;
+&#x00F4;
+&#x00F5;
+&#x00F6;
+&#x00F8;
+&#x00F9;
+&#x00FA;
+&#x00FB;
+&#x00FC;
+&#x00FD;
+&#x00FE;
+&#x0101;
+&#x0103;
+&#x0105;
+&#x0107;
+&#x0109;
+&#x010B;
+&#x010D;
+&#x010F;
+&#x0111;
+&#x0113;
+&#x0115;
+&#x0117;
+&#x0119;
+&#x011B;
+&#x011D;
+&#x011F;
+&#x0121;
+&#x0123;
+&#x0125;
+&#x0127;
+&#x0129;
+&#x012B;
+&#x012D;
+&#x012F;
+&#x0069;&#x0307; <!-- LATIN CAPITAL LETTER I WITH DOT ABOVE -->
+&#x0133;
+&#x0135;
+&#x0137;
+&#x013A;
+&#x013C;
+&#x013E;
+&#x0140;
+&#x0142;
+&#x0144;
+&#x0146;
+&#x0148;
+&#x014B;
+&#x014D;
+&#x014F;
+&#x0151;
+&#x0153;
+&#x0155;
+&#x0157;
+&#x0159;
+&#x015B;
+&#x015D;
+&#x015F;
+&#x0161;
+&#x0163;
+&#x0165;
+&#x0167;
+&#x0169;
+&#x016B;
+&#x016D;
+&#x016F;
+&#x0171;
+&#x0173;
+&#x0175;
+&#x0177;
+&#x00FF;
+&#x017A;
+&#x017C;
+&#x017E;
+&#x0253;
+&#x0183;
+&#x0185;
+&#x0254;
+&#x0188;
+&#x0256;
+&#x0257;
+&#x018C;
+&#x01DD;
+&#x0259;
+&#x025B;
+&#x0192;
+&#x0260;
+&#x0263;
+&#x0269;
+&#x0268;
+&#x0199;
+&#x026F;
+&#x0272;
+&#x0275;
+&#x01A1;
+&#x01A3;
+&#x01A5;
+&#x0280;
+&#x01A8;
+&#x0283;
+&#x01AD;
+&#x0288;
+&#x01B0;
+&#x028A;
+&#x028B;
+&#x01B4;
+&#x01B6;
+&#x0292;
+&#x01B9;
+&#x01BD;
+&#x01C6;
+&#x01C6;
+&#x01C9;
+&#x01C9;
+&#x01CC;
+&#x01CC;
+&#x01CE;
+&#x01D0;
+&#x01D2;
+&#x01D4;
+&#x01D6;
+&#x01D8;
+&#x01DA;
+&#x01DC;
+&#x01DF;
+&#x01E1;
+&#x01E3;
+&#x01E5;
+&#x01E7;
+&#x01E9;
+&#x01EB;
+&#x01ED;
+&#x01EF;
+&#x01F3;
+&#x01F3;
+&#x01F5;
+&#x0195;
+&#x01BF;
+&#x01F9;
+&#x01FB;
+&#x01FD;
+&#x01FF;
+&#x0201;
+&#x0203;
+&#x0205;
+&#x0207;
+&#x0209;
+&#x020B;
+&#x020D;
+&#x020F;
+&#x0211;
+&#x0213;
+&#x0215;
+&#x0217;
+&#x0219;
+&#x021B;
+&#x021D;
+&#x021F;
+&#x019E;
+&#x0223;
+&#x0225;
+&#x0227;
+&#x0229;
+&#x022B;
+&#x022D;
+&#x022F;
+&#x0231;
+&#x0233;
+&#x2C65;
+&#x023C;
+&#x019A;
+&#x2C66;
+&#x0242;
+&#x0180;
+&#x0289;
+&#x028C;
+&#x0247;
+&#x0249;
+&#x024B;
+&#x024D;
+&#x024F;
+&#x0371;
+&#x0373;
+&#x0377;
+&#x03F3;
+&#x03AC;
+&#x03AD;
+&#x03AE;
+&#x03AF;
+&#x03CC;
+&#x03CD;
+&#x03CE;
+&#x03B1;
+&#x03B2;
+&#x03B3;
+&#x03B4;
+&#x03B5;
+&#x03B6;
+&#x03B7;
+&#x03B8;
+&#x03B9;
+&#x03BA;
+&#x03BB;
+&#x03BC;
+&#x03BD;
+&#x03BE;
+&#x03BF;
+&#x03C0;
+&#x03C1;
+&#x03C3;
+&#x03C4;
+&#x03C5;
+&#x03C6;
+&#x03C7;
+&#x03C8;
+&#x03C9;
+&#x03CA;
+&#x03CB;
+&#x03D7;
+&#x03D9;
+&#x03DB;
+&#x03DD;
+&#x03DF;
+&#x03E1;
+&#x03E3;
+&#x03E5;
+&#x03E7;
+&#x03E9;
+&#x03EB;
+&#x03ED;
+&#x03EF;
+&#x03B8;
+&#x03F8;
+&#x03F2;
+&#x03FB;
+&#x037B;
+&#x037C;
+&#x037D;
+&#x0450;
+&#x0451;
+&#x0452;
+&#x0453;
+&#x0454;
+&#x0455;
+&#x0456;
+&#x0457;
+&#x0458;
+&#x0459;
+&#x045A;
+&#x045B;
+&#x045C;
+&#x045D;
+&#x045E;
+&#x045F;
+&#x0430;
+&#x0431;
+&#x0432;
+&#x0433;
+&#x0434;
+&#x0435;
+&#x0436;
+&#x0437;
+&#x0438;
+&#x0439;
+&#x043A;
+&#x043B;
+&#x043C;
+&#x043D;
+&#x043E;
+&#x043F;
+&#x0440;
+&#x0441;
+&#x0442;
+&#x0443;
+&#x0444;
+&#x0445;
+&#x0446;
+&#x0447;
+&#x0448;
+&#x0449;
+&#x044A;
+&#x044B;
+&#x044C;
+&#x044D;
+&#x044E;
+&#x044F;
+&#x0461;
+&#x0463;
+&#x0465;
+&#x0467;
+&#x0469;
+&#x046B;
+&#x046D;
+&#x046F;
+&#x0471;
+&#x0473;
+&#x0475;
+&#x0477;
+&#x0479;
+&#x047B;
+&#x047D;
+&#x047F;
+&#x0481;
+&#x048B;
+&#x048D;
+&#x048F;
+&#x0491;
+&#x0493;
+&#x0495;
+&#x0497;
+&#x0499;
+&#x049B;
+&#x049D;
+&#x049F;
+&#x04A1;
+&#x04A3;
+&#x04A5;
+&#x04A7;
+&#x04A9;
+&#x04AB;
+&#x04AD;
+&#x04AF;
+&#x04B1;
+&#x04B3;
+&#x04B5;
+&#x04B7;
+&#x04B9;
+&#x04BB;
+&#x04BD;
+&#x04BF;
+&#x04CF;
+&#x04C2;
+&#x04C4;
+&#x04C6;
+&#x04C8;
+&#x04CA;
+&#x04CC;
+&#x04CE;
+&#x04D1;
+&#x04D3;
+&#x04D5;
+&#x04D7;
+&#x04D9;
+&#x04DB;
+&#x04DD;
+&#x04DF;
+&#x04E1;
+&#x04E3;
+&#x04E5;
+&#x04E7;
+&#x04E9;
+&#x04EB;
+&#x04ED;
+&#x04EF;
+&#x04F1;
+&#x04F3;
+&#x04F5;
+&#x04F7;
+&#x04F9;
+&#x04FB;
+&#x04FD;
+&#x04FF;
+&#x0501;
+&#x0503;
+&#x0505;
+&#x0507;
+&#x0509;
+&#x050B;
+&#x050D;
+&#x050F;
+&#x0511;
+&#x0513;
+&#x0515;
+&#x0517;
+&#x0519;
+&#x051B;
+&#x051D;
+&#x051F;
+&#x0521;
+&#x0523;
+&#x0525;
+&#x0527;
+&#x0529;
+&#x052B;
+&#x052D;
+&#x052F;
+&#x0561;
+&#x0562;
+&#x0563;
+&#x0564;
+&#x0565;
+&#x0566;
+&#x0567;
+&#x0568;
+&#x0569;
+&#x056A;
+&#x056B;
+&#x056C;
+&#x056D;
+&#x056E;
+&#x056F;
+&#x0570;
+&#x0571;
+&#x0572;
+&#x0573;
+&#x0574;
+&#x0575;
+&#x0576;
+&#x0577;
+&#x0578;
+&#x0579;
+&#x057A;
+&#x057B;
+&#x057C;
+&#x057D;
+&#x057E;
+&#x057F;
+&#x0580;
+&#x0581;
+&#x0582;
+&#x0583;
+&#x0584;
+&#x0585;
+&#x0586;
+&#x2D00;
+&#x2D01;
+&#x2D02;
+&#x2D03;
+&#x2D04;
+&#x2D05;
+&#x2D06;
+&#x2D07;
+&#x2D08;
+&#x2D09;
+&#x2D0A;
+&#x2D0B;
+&#x2D0C;
+&#x2D0D;
+&#x2D0E;
+&#x2D0F;
+&#x2D10;
+&#x2D11;
+&#x2D12;
+&#x2D13;
+&#x2D14;
+&#x2D15;
+&#x2D16;
+&#x2D17;
+&#x2D18;
+&#x2D19;
+&#x2D1A;
+&#x2D1B;
+&#x2D1C;
+&#x2D1D;
+&#x2D1E;
+&#x2D1F;
+&#x2D20;
+&#x2D21;
+&#x2D22;
+&#x2D23;
+&#x2D24;
+&#x2D25;
+&#x2D27;
+&#x2D2D;
+&#xAB70;
+&#xAB71;
+&#xAB72;
+&#xAB73;
+&#xAB74;
+&#xAB75;
+&#xAB76;
+&#xAB77;
+&#xAB78;
+&#xAB79;
+&#xAB7A;
+&#xAB7B;
+&#xAB7C;
+&#xAB7D;
+&#xAB7E;
+&#xAB7F;
+&#xAB80;
+&#xAB81;
+&#xAB82;
+&#xAB83;
+&#xAB84;
+&#xAB85;
+&#xAB86;
+&#xAB87;
+&#xAB88;
+&#xAB89;
+&#xAB8A;
+&#xAB8B;
+&#xAB8C;
+&#xAB8D;
+&#xAB8E;
+&#xAB8F;
+&#xAB90;
+&#xAB91;
+&#xAB92;
+&#xAB93;
+&#xAB94;
+&#xAB95;
+&#xAB96;
+&#xAB97;
+&#xAB98;
+&#xAB99;
+&#xAB9A;
+&#xAB9B;
+&#xAB9C;
+&#xAB9D;
+&#xAB9E;
+&#xAB9F;
+&#xABA0;
+&#xABA1;
+&#xABA2;
+&#xABA3;
+&#xABA4;
+&#xABA5;
+&#xABA6;
+&#xABA7;
+&#xABA8;
+&#xABA9;
+&#xABAA;
+&#xABAB;
+&#xABAC;
+&#xABAD;
+&#xABAE;
+&#xABAF;
+&#xABB0;
+&#xABB1;
+&#xABB2;
+&#xABB3;
+&#xABB4;
+&#xABB5;
+&#xABB6;
+&#xABB7;
+&#xABB8;
+&#xABB9;
+&#xABBA;
+&#xABBB;
+&#xABBC;
+&#xABBD;
+&#xABBE;
+&#xABBF;
+&#x13F8;
+&#x13F9;
+&#x13FA;
+&#x13FB;
+&#x13FC;
+&#x13FD;
+&#x10D0;
+&#x10D1;
+&#x10D2;
+&#x10D3;
+&#x10D4;
+&#x10D5;
+&#x10D6;
+&#x10D7;
+&#x10D8;
+&#x10D9;
+&#x10DA;
+&#x10DB;
+&#x10DC;
+&#x10DD;
+&#x10DE;
+&#x10DF;
+&#x10E0;
+&#x10E1;
+&#x10E2;
+&#x10E3;
+&#x10E4;
+&#x10E5;
+&#x10E6;
+&#x10E7;
+&#x10E8;
+&#x10E9;
+&#x10EA;
+&#x10EB;
+&#x10EC;
+&#x10ED;
+&#x10EE;
+&#x10EF;
+&#x10F0;
+&#x10F1;
+&#x10F2;
+&#x10F3;
+&#x10F4;
+&#x10F5;
+&#x10F6;
+&#x10F7;
+&#x10F8;
+&#x10F9;
+&#x10FA;
+&#x10FD;
+&#x10FE;
+&#x10FF;
+&#x1E01;
+&#x1E03;
+&#x1E05;
+&#x1E07;
+&#x1E09;
+&#x1E0B;
+&#x1E0D;
+&#x1E0F;
+&#x1E11;
+&#x1E13;
+&#x1E15;
+&#x1E17;
+&#x1E19;
+&#x1E1B;
+&#x1E1D;
+&#x1E1F;
+&#x1E21;
+&#x1E23;
+&#x1E25;
+&#x1E27;
+&#x1E29;
+&#x1E2B;
+&#x1E2D;
+&#x1E2F;
+&#x1E31;
+&#x1E33;
+&#x1E35;
+&#x1E37;
+&#x1E39;
+&#x1E3B;
+&#x1E3D;
+&#x1E3F;
+&#x1E41;
+&#x1E43;
+&#x1E45;
+&#x1E47;
+&#x1E49;
+&#x1E4B;
+&#x1E4D;
+&#x1E4F;
+&#x1E51;
+&#x1E53;
+&#x1E55;
+&#x1E57;
+&#x1E59;
+&#x1E5B;
+&#x1E5D;
+&#x1E5F;
+&#x1E61;
+&#x1E63;
+&#x1E65;
+&#x1E67;
+&#x1E69;
+&#x1E6B;
+&#x1E6D;
+&#x1E6F;
+&#x1E71;
+&#x1E73;
+&#x1E75;
+&#x1E77;
+&#x1E79;
+&#x1E7B;
+&#x1E7D;
+&#x1E7F;
+&#x1E81;
+&#x1E83;
+&#x1E85;
+&#x1E87;
+&#x1E89;
+&#x1E8B;
+&#x1E8D;
+&#x1E8F;
+&#x1E91;
+&#x1E93;
+&#x1E95;
+&#x00DF;
+&#x1EA1;
+&#x1EA3;
+&#x1EA5;
+&#x1EA7;
+&#x1EA9;
+&#x1EAB;
+&#x1EAD;
+&#x1EAF;
+&#x1EB1;
+&#x1EB3;
+&#x1EB5;
+&#x1EB7;
+&#x1EB9;
+&#x1EBB;
+&#x1EBD;
+&#x1EBF;
+&#x1EC1;
+&#x1EC3;
+&#x1EC5;
+&#x1EC7;
+&#x1EC9;
+&#x1ECB;
+&#x1ECD;
+&#x1ECF;
+&#x1ED1;
+&#x1ED3;
+&#x1ED5;
+&#x1ED7;
+&#x1ED9;
+&#x1EDB;
+&#x1EDD;
+&#x1EDF;
+&#x1EE1;
+&#x1EE3;
+&#x1EE5;
+&#x1EE7;
+&#x1EE9;
+&#x1EEB;
+&#x1EED;
+&#x1EEF;
+&#x1EF1;
+&#x1EF3;
+&#x1EF5;
+&#x1EF7;
+&#x1EF9;
+&#x1EFB;
+&#x1EFD;
+&#x1EFF;
+&#x1F00;
+&#x1F01;
+&#x1F02;
+&#x1F03;
+&#x1F04;
+&#x1F05;
+&#x1F06;
+&#x1F07;
+&#x1F10;
+&#x1F11;
+&#x1F12;
+&#x1F13;
+&#x1F14;
+&#x1F15;
+&#x1F20;
+&#x1F21;
+&#x1F22;
+&#x1F23;
+&#x1F24;
+&#x1F25;
+&#x1F26;
+&#x1F27;
+&#x1F30;
+&#x1F31;
+&#x1F32;
+&#x1F33;
+&#x1F34;
+&#x1F35;
+&#x1F36;
+&#x1F37;
+&#x1F40;
+&#x1F41;
+&#x1F42;
+&#x1F43;
+&#x1F44;
+&#x1F45;
+&#x1F51;
+&#x1F53;
+&#x1F55;
+&#x1F57;
+&#x1F60;
+&#x1F61;
+&#x1F62;
+&#x1F63;
+&#x1F64;
+&#x1F65;
+&#x1F66;
+&#x1F67;
+&#x1F80; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F81; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F82; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F83; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F84; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F85; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F86; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F87; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F90; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F91; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F92; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F93; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F94; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F95; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F96; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F97; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FA0; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1FA1; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1FA2; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1FA3; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1FA4; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1FA5; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1FA6; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FA7; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FB0;
+&#x1FB1;
+&#x1F70;
+&#x1F71;
+&#x1FB3; <!-- GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI -->
+&#x1F72;
+&#x1F73;
+&#x1F74;
+&#x1F75;
+&#x1FC3; <!-- GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI -->
+&#x1FD0;
+&#x1FD1;
+&#x1F76;
+&#x1F77;
+&#x1FE0;
+&#x1FE1;
+&#x1F7A;
+&#x1F7B;
+&#x1FE5;
+&#x1F78;
+&#x1F79;
+&#x1F7C;
+&#x1F7D;
+&#x1FF3; <!-- GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI -->
+&#x03C9;
+&#x006B;
+&#x00E5;
+&#x214E;
+&#x2170;
+&#x2171;
+&#x2172;
+&#x2173;
+&#x2174;
+&#x2175;
+&#x2176;
+&#x2177;
+&#x2178;
+&#x2179;
+&#x217A;
+&#x217B;
+&#x217C;
+&#x217D;
+&#x217E;
+&#x217F;
+&#x2184;
+&#x24D0;
+&#x24D1;
+&#x24D2;
+&#x24D3;
+&#x24D4;
+&#x24D5;
+&#x24D6;
+&#x24D7;
+&#x24D8;
+&#x24D9;
+&#x24DA;
+&#x24DB;
+&#x24DC;
+&#x24DD;
+&#x24DE;
+&#x24DF;
+&#x24E0;
+&#x24E1;
+&#x24E2;
+&#x24E3;
+&#x24E4;
+&#x24E5;
+&#x24E6;
+&#x24E7;
+&#x24E8;
+&#x24E9;
+&#x2C30;
+&#x2C31;
+&#x2C32;
+&#x2C33;
+&#x2C34;
+&#x2C35;
+&#x2C36;
+&#x2C37;
+&#x2C38;
+&#x2C39;
+&#x2C3A;
+&#x2C3B;
+&#x2C3C;
+&#x2C3D;
+&#x2C3E;
+&#x2C3F;
+&#x2C40;
+&#x2C41;
+&#x2C42;
+&#x2C43;
+&#x2C44;
+&#x2C45;
+&#x2C46;
+&#x2C47;
+&#x2C48;
+&#x2C49;
+&#x2C4A;
+&#x2C4B;
+&#x2C4C;
+&#x2C4D;
+&#x2C4E;
+&#x2C4F;
+&#x2C50;
+&#x2C51;
+&#x2C52;
+&#x2C53;
+&#x2C54;
+&#x2C55;
+&#x2C56;
+&#x2C57;
+&#x2C58;
+&#x2C59;
+&#x2C5A;
+&#x2C5B;
+&#x2C5C;
+&#x2C5D;
+&#x2C5E;
+&#x2C5F;
+&#x2C61;
+&#x026B;
+&#x1D7D;
+&#x027D;
+&#x2C68;
+&#x2C6A;
+&#x2C6C;
+&#x0251;
+&#x0271;
+&#x0250;
+&#x0252;
+&#x2C73;
+&#x2C76;
+&#x023F;
+&#x0240;
+&#x2C81;
+&#x2C83;
+&#x2C85;
+&#x2C87;
+&#x2C89;
+&#x2C8B;
+&#x2C8D;
+&#x2C8F;
+&#x2C91;
+&#x2C93;
+&#x2C95;
+&#x2C97;
+&#x2C99;
+&#x2C9B;
+&#x2C9D;
+&#x2C9F;
+&#x2CA1;
+&#x2CA3;
+&#x2CA5;
+&#x2CA7;
+&#x2CA9;
+&#x2CAB;
+&#x2CAD;
+&#x2CAF;
+&#x2CB1;
+&#x2CB3;
+&#x2CB5;
+&#x2CB7;
+&#x2CB9;
+&#x2CBB;
+&#x2CBD;
+&#x2CBF;
+&#x2CC1;
+&#x2CC3;
+&#x2CC5;
+&#x2CC7;
+&#x2CC9;
+&#x2CCB;
+&#x2CCD;
+&#x2CCF;
+&#x2CD1;
+&#x2CD3;
+&#x2CD5;
+&#x2CD7;
+&#x2CD9;
+&#x2CDB;
+&#x2CDD;
+&#x2CDF;
+&#x2CE1;
+&#x2CE3;
+&#x2CEC;
+&#x2CEE;
+&#x2CF3;
+&#xA641;
+&#xA643;
+&#xA645;
+&#xA647;
+&#xA649;
+&#xA64B;
+&#xA64D;
+&#xA64F;
+&#xA651;
+&#xA653;
+&#xA655;
+&#xA657;
+&#xA659;
+&#xA65B;
+&#xA65D;
+&#xA65F;
+&#xA661;
+&#xA663;
+&#xA665;
+&#xA667;
+&#xA669;
+&#xA66B;
+&#xA66D;
+&#xA681;
+&#xA683;
+&#xA685;
+&#xA687;
+&#xA689;
+&#xA68B;
+&#xA68D;
+&#xA68F;
+&#xA691;
+&#xA693;
+&#xA695;
+&#xA697;
+&#xA699;
+&#xA69B;
+&#xA723;
+&#xA725;
+&#xA727;
+&#xA729;
+&#xA72B;
+&#xA72D;
+&#xA72F;
+&#xA733;
+&#xA735;
+&#xA737;
+&#xA739;
+&#xA73B;
+&#xA73D;
+&#xA73F;
+&#xA741;
+&#xA743;
+&#xA745;
+&#xA747;
+&#xA749;
+&#xA74B;
+&#xA74D;
+&#xA74F;
+&#xA751;
+&#xA753;
+&#xA755;
+&#xA757;
+&#xA759;
+&#xA75B;
+&#xA75D;
+&#xA75F;
+&#xA761;
+&#xA763;
+&#xA765;
+&#xA767;
+&#xA769;
+&#xA76B;
+&#xA76D;
+&#xA76F;
+&#xA77A;
+&#xA77C;
+&#x1D79;
+&#xA77F;
+&#xA781;
+&#xA783;
+&#xA785;
+&#xA787;
+&#xA78C;
+&#x0265;
+&#xA791;
+&#xA793;
+&#xA797;
+&#xA799;
+&#xA79B;
+&#xA79D;
+&#xA79F;
+&#xA7A1;
+&#xA7A3;
+&#xA7A5;
+&#xA7A7;
+&#xA7A9;
+&#x0266;
+&#x025C;
+&#x0261;
+&#x026C;
+&#x026A;
+&#x029E;
+&#x0287;
+&#x029D;
+&#xAB53;
+&#xA7B5;
+&#xA7B7;
+&#xA7B9;
+&#xA7BB;
+&#xA7BD;
+&#xA7BF;
+&#xA7C1;
+&#xA7C3;
+&#xA794;
+&#x0282;
+&#x1D8E;
+&#xA7C8;
+&#xA7CA;
+&#xA7D1;
+&#xA7D7;
+&#xA7D9;
+&#xA7F6;
+&#xFF41;
+&#xFF42;
+&#xFF43;
+&#xFF44;
+&#xFF45;
+&#xFF46;
+&#xFF47;
+&#xFF48;
+&#xFF49;
+&#xFF4A;
+&#xFF4B;
+&#xFF4C;
+&#xFF4D;
+&#xFF4E;
+&#xFF4F;
+&#xFF50;
+&#xFF51;
+&#xFF52;
+&#xFF53;
+&#xFF54;
+&#xFF55;
+&#xFF56;
+&#xFF57;
+&#xFF58;
+&#xFF59;
+&#xFF5A;
+&#x10428;
+&#x10429;
+&#x1042A;
+&#x1042B;
+&#x1042C;
+&#x1042D;
+&#x1042E;
+&#x1042F;
+&#x10430;
+&#x10431;
+&#x10432;
+&#x10433;
+&#x10434;
+&#x10435;
+&#x10436;
+&#x10437;
+&#x10438;
+&#x10439;
+&#x1043A;
+&#x1043B;
+&#x1043C;
+&#x1043D;
+&#x1043E;
+&#x1043F;
+&#x10440;
+&#x10441;
+&#x10442;
+&#x10443;
+&#x10444;
+&#x10445;
+&#x10446;
+&#x10447;
+&#x10448;
+&#x10449;
+&#x1044A;
+&#x1044B;
+&#x1044C;
+&#x1044D;
+&#x1044E;
+&#x1044F;
+&#x104D8;
+&#x104D9;
+&#x104DA;
+&#x104DB;
+&#x104DC;
+&#x104DD;
+&#x104DE;
+&#x104DF;
+&#x104E0;
+&#x104E1;
+&#x104E2;
+&#x104E3;
+&#x104E4;
+&#x104E5;
+&#x104E6;
+&#x104E7;
+&#x104E8;
+&#x104E9;
+&#x104EA;
+&#x104EB;
+&#x104EC;
+&#x104ED;
+&#x104EE;
+&#x104EF;
+&#x104F0;
+&#x104F1;
+&#x104F2;
+&#x104F3;
+&#x104F4;
+&#x104F5;
+&#x104F6;
+&#x104F7;
+&#x104F8;
+&#x104F9;
+&#x104FA;
+&#x104FB;
+&#x10597;
+&#x10598;
+&#x10599;
+&#x1059A;
+&#x1059B;
+&#x1059C;
+&#x1059D;
+&#x1059E;
+&#x1059F;
+&#x105A0;
+&#x105A1;
+&#x105A3;
+&#x105A4;
+&#x105A5;
+&#x105A6;
+&#x105A7;
+&#x105A8;
+&#x105A9;
+&#x105AA;
+&#x105AB;
+&#x105AC;
+&#x105AD;
+&#x105AE;
+&#x105AF;
+&#x105B0;
+&#x105B1;
+&#x105B3;
+&#x105B4;
+&#x105B5;
+&#x105B6;
+&#x105B7;
+&#x105B8;
+&#x105B9;
+&#x105BB;
+&#x105BC;
+&#x10CC0;
+&#x10CC1;
+&#x10CC2;
+&#x10CC3;
+&#x10CC4;
+&#x10CC5;
+&#x10CC6;
+&#x10CC7;
+&#x10CC8;
+&#x10CC9;
+&#x10CCA;
+&#x10CCB;
+&#x10CCC;
+&#x10CCD;
+&#x10CCE;
+&#x10CCF;
+&#x10CD0;
+&#x10CD1;
+&#x10CD2;
+&#x10CD3;
+&#x10CD4;
+&#x10CD5;
+&#x10CD6;
+&#x10CD7;
+&#x10CD8;
+&#x10CD9;
+&#x10CDA;
+&#x10CDB;
+&#x10CDC;
+&#x10CDD;
+&#x10CDE;
+&#x10CDF;
+&#x10CE0;
+&#x10CE1;
+&#x10CE2;
+&#x10CE3;
+&#x10CE4;
+&#x10CE5;
+&#x10CE6;
+&#x10CE7;
+&#x10CE8;
+&#x10CE9;
+&#x10CEA;
+&#x10CEB;
+&#x10CEC;
+&#x10CED;
+&#x10CEE;
+&#x10CEF;
+&#x10CF0;
+&#x10CF1;
+&#x10CF2;
+&#x118C0;
+&#x118C1;
+&#x118C2;
+&#x118C3;
+&#x118C4;
+&#x118C5;
+&#x118C6;
+&#x118C7;
+&#x118C8;
+&#x118C9;
+&#x118CA;
+&#x118CB;
+&#x118CC;
+&#x118CD;
+&#x118CE;
+&#x118CF;
+&#x118D0;
+&#x118D1;
+&#x118D2;
+&#x118D3;
+&#x118D4;
+&#x118D5;
+&#x118D6;
+&#x118D7;
+&#x118D8;
+&#x118D9;
+&#x118DA;
+&#x118DB;
+&#x118DC;
+&#x118DD;
+&#x118DE;
+&#x118DF;
+&#x16E60;
+&#x16E61;
+&#x16E62;
+&#x16E63;
+&#x16E64;
+&#x16E65;
+&#x16E66;
+&#x16E67;
+&#x16E68;
+&#x16E69;
+&#x16E6A;
+&#x16E6B;
+&#x16E6C;
+&#x16E6D;
+&#x16E6E;
+&#x16E6F;
+&#x16E70;
+&#x16E71;
+&#x16E72;
+&#x16E73;
+&#x16E74;
+&#x16E75;
+&#x16E76;
+&#x16E77;
+&#x16E78;
+&#x16E79;
+&#x16E7A;
+&#x16E7B;
+&#x16E7C;
+&#x16E7D;
+&#x16E7E;
+&#x16E7F;
+&#x1E922;
+&#x1E923;
+&#x1E924;
+&#x1E925;
+&#x1E926;
+&#x1E927;
+&#x1E928;
+&#x1E929;
+&#x1E92A;
+&#x1E92B;
+&#x1E92C;
+&#x1E92D;
+&#x1E92E;
+&#x1E92F;
+&#x1E930;
+&#x1E931;
+&#x1E932;
+&#x1E933;
+&#x1E934;
+&#x1E935;
+&#x1E936;
+&#x1E937;
+&#x1E938;
+&#x1E939;
+&#x1E93A;
+&#x1E93B;
+&#x1E93C;
+&#x1E93D;
+&#x1E93E;
+&#x1E93F;
+&#x1E940;
+&#x1E941;
+&#x1E942;
+&#x1E943;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/all-lower.html b/layout/reftests/text-transform/all-lower.html
new file mode 100644
index 0000000000..7fd1eec18e
--- /dev/null
+++ b/layout/reftests/text-transform/all-lower.html
@@ -0,0 +1,1448 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; font-size: 12px; text-transform: lowercase; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0041;
+&#x0042;
+&#x0043;
+&#x0044;
+&#x0045;
+&#x0046;
+&#x0047;
+&#x0048;
+&#x0049;
+&#x004A;
+&#x004B;
+&#x004C;
+&#x004D;
+&#x004E;
+&#x004F;
+&#x0050;
+&#x0051;
+&#x0052;
+&#x0053;
+&#x0054;
+&#x0055;
+&#x0056;
+&#x0057;
+&#x0058;
+&#x0059;
+&#x005A;
+&#x00C0;
+&#x00C1;
+&#x00C2;
+&#x00C3;
+&#x00C4;
+&#x00C5;
+&#x00C6;
+&#x00C7;
+&#x00C8;
+&#x00C9;
+&#x00CA;
+&#x00CB;
+&#x00CC;
+&#x00CD;
+&#x00CE;
+&#x00CF;
+&#x00D0;
+&#x00D1;
+&#x00D2;
+&#x00D3;
+&#x00D4;
+&#x00D5;
+&#x00D6;
+&#x00D8;
+&#x00D9;
+&#x00DA;
+&#x00DB;
+&#x00DC;
+&#x00DD;
+&#x00DE;
+&#x0100;
+&#x0102;
+&#x0104;
+&#x0106;
+&#x0108;
+&#x010A;
+&#x010C;
+&#x010E;
+&#x0110;
+&#x0112;
+&#x0114;
+&#x0116;
+&#x0118;
+&#x011A;
+&#x011C;
+&#x011E;
+&#x0120;
+&#x0122;
+&#x0124;
+&#x0126;
+&#x0128;
+&#x012A;
+&#x012C;
+&#x012E;
+&#x0130; <!-- LATIN CAPITAL LETTER I WITH DOT ABOVE -->
+&#x0132;
+&#x0134;
+&#x0136;
+&#x0139;
+&#x013B;
+&#x013D;
+&#x013F;
+&#x0141;
+&#x0143;
+&#x0145;
+&#x0147;
+&#x014A;
+&#x014C;
+&#x014E;
+&#x0150;
+&#x0152;
+&#x0154;
+&#x0156;
+&#x0158;
+&#x015A;
+&#x015C;
+&#x015E;
+&#x0160;
+&#x0162;
+&#x0164;
+&#x0166;
+&#x0168;
+&#x016A;
+&#x016C;
+&#x016E;
+&#x0170;
+&#x0172;
+&#x0174;
+&#x0176;
+&#x0178;
+&#x0179;
+&#x017B;
+&#x017D;
+&#x0181;
+&#x0182;
+&#x0184;
+&#x0186;
+&#x0187;
+&#x0189;
+&#x018A;
+&#x018B;
+&#x018E;
+&#x018F;
+&#x0190;
+&#x0191;
+&#x0193;
+&#x0194;
+&#x0196;
+&#x0197;
+&#x0198;
+&#x019C;
+&#x019D;
+&#x019F;
+&#x01A0;
+&#x01A2;
+&#x01A4;
+&#x01A6;
+&#x01A7;
+&#x01A9;
+&#x01AC;
+&#x01AE;
+&#x01AF;
+&#x01B1;
+&#x01B2;
+&#x01B3;
+&#x01B5;
+&#x01B7;
+&#x01B8;
+&#x01BC;
+&#x01C4;
+&#x01C5;
+&#x01C7;
+&#x01C8;
+&#x01CA;
+&#x01CB;
+&#x01CD;
+&#x01CF;
+&#x01D1;
+&#x01D3;
+&#x01D5;
+&#x01D7;
+&#x01D9;
+&#x01DB;
+&#x01DE;
+&#x01E0;
+&#x01E2;
+&#x01E4;
+&#x01E6;
+&#x01E8;
+&#x01EA;
+&#x01EC;
+&#x01EE;
+&#x01F1;
+&#x01F2;
+&#x01F4;
+&#x01F6;
+&#x01F7;
+&#x01F8;
+&#x01FA;
+&#x01FC;
+&#x01FE;
+&#x0200;
+&#x0202;
+&#x0204;
+&#x0206;
+&#x0208;
+&#x020A;
+&#x020C;
+&#x020E;
+&#x0210;
+&#x0212;
+&#x0214;
+&#x0216;
+&#x0218;
+&#x021A;
+&#x021C;
+&#x021E;
+&#x0220;
+&#x0222;
+&#x0224;
+&#x0226;
+&#x0228;
+&#x022A;
+&#x022C;
+&#x022E;
+&#x0230;
+&#x0232;
+&#x023A;
+&#x023B;
+&#x023D;
+&#x023E;
+&#x0241;
+&#x0243;
+&#x0244;
+&#x0245;
+&#x0246;
+&#x0248;
+&#x024A;
+&#x024C;
+&#x024E;
+&#x0370;
+&#x0372;
+&#x0376;
+&#x037F;
+&#x0386;
+&#x0388;
+&#x0389;
+&#x038A;
+&#x038C;
+&#x038E;
+&#x038F;
+&#x0391;
+&#x0392;
+&#x0393;
+&#x0394;
+&#x0395;
+&#x0396;
+&#x0397;
+&#x0398;
+&#x0399;
+&#x039A;
+&#x039B;
+&#x039C;
+&#x039D;
+&#x039E;
+&#x039F;
+&#x03A0;
+&#x03A1;
+&#x03A3;
+&#x03A4;
+&#x03A5;
+&#x03A6;
+&#x03A7;
+&#x03A8;
+&#x03A9;
+&#x03AA;
+&#x03AB;
+&#x03CF;
+&#x03D8;
+&#x03DA;
+&#x03DC;
+&#x03DE;
+&#x03E0;
+&#x03E2;
+&#x03E4;
+&#x03E6;
+&#x03E8;
+&#x03EA;
+&#x03EC;
+&#x03EE;
+&#x03F4;
+&#x03F7;
+&#x03F9;
+&#x03FA;
+&#x03FD;
+&#x03FE;
+&#x03FF;
+&#x0400;
+&#x0401;
+&#x0402;
+&#x0403;
+&#x0404;
+&#x0405;
+&#x0406;
+&#x0407;
+&#x0408;
+&#x0409;
+&#x040A;
+&#x040B;
+&#x040C;
+&#x040D;
+&#x040E;
+&#x040F;
+&#x0410;
+&#x0411;
+&#x0412;
+&#x0413;
+&#x0414;
+&#x0415;
+&#x0416;
+&#x0417;
+&#x0418;
+&#x0419;
+&#x041A;
+&#x041B;
+&#x041C;
+&#x041D;
+&#x041E;
+&#x041F;
+&#x0420;
+&#x0421;
+&#x0422;
+&#x0423;
+&#x0424;
+&#x0425;
+&#x0426;
+&#x0427;
+&#x0428;
+&#x0429;
+&#x042A;
+&#x042B;
+&#x042C;
+&#x042D;
+&#x042E;
+&#x042F;
+&#x0460;
+&#x0462;
+&#x0464;
+&#x0466;
+&#x0468;
+&#x046A;
+&#x046C;
+&#x046E;
+&#x0470;
+&#x0472;
+&#x0474;
+&#x0476;
+&#x0478;
+&#x047A;
+&#x047C;
+&#x047E;
+&#x0480;
+&#x048A;
+&#x048C;
+&#x048E;
+&#x0490;
+&#x0492;
+&#x0494;
+&#x0496;
+&#x0498;
+&#x049A;
+&#x049C;
+&#x049E;
+&#x04A0;
+&#x04A2;
+&#x04A4;
+&#x04A6;
+&#x04A8;
+&#x04AA;
+&#x04AC;
+&#x04AE;
+&#x04B0;
+&#x04B2;
+&#x04B4;
+&#x04B6;
+&#x04B8;
+&#x04BA;
+&#x04BC;
+&#x04BE;
+&#x04C0;
+&#x04C1;
+&#x04C3;
+&#x04C5;
+&#x04C7;
+&#x04C9;
+&#x04CB;
+&#x04CD;
+&#x04D0;
+&#x04D2;
+&#x04D4;
+&#x04D6;
+&#x04D8;
+&#x04DA;
+&#x04DC;
+&#x04DE;
+&#x04E0;
+&#x04E2;
+&#x04E4;
+&#x04E6;
+&#x04E8;
+&#x04EA;
+&#x04EC;
+&#x04EE;
+&#x04F0;
+&#x04F2;
+&#x04F4;
+&#x04F6;
+&#x04F8;
+&#x04FA;
+&#x04FC;
+&#x04FE;
+&#x0500;
+&#x0502;
+&#x0504;
+&#x0506;
+&#x0508;
+&#x050A;
+&#x050C;
+&#x050E;
+&#x0510;
+&#x0512;
+&#x0514;
+&#x0516;
+&#x0518;
+&#x051A;
+&#x051C;
+&#x051E;
+&#x0520;
+&#x0522;
+&#x0524;
+&#x0526;
+&#x0528;
+&#x052A;
+&#x052C;
+&#x052E;
+&#x0531;
+&#x0532;
+&#x0533;
+&#x0534;
+&#x0535;
+&#x0536;
+&#x0537;
+&#x0538;
+&#x0539;
+&#x053A;
+&#x053B;
+&#x053C;
+&#x053D;
+&#x053E;
+&#x053F;
+&#x0540;
+&#x0541;
+&#x0542;
+&#x0543;
+&#x0544;
+&#x0545;
+&#x0546;
+&#x0547;
+&#x0548;
+&#x0549;
+&#x054A;
+&#x054B;
+&#x054C;
+&#x054D;
+&#x054E;
+&#x054F;
+&#x0550;
+&#x0551;
+&#x0552;
+&#x0553;
+&#x0554;
+&#x0555;
+&#x0556;
+&#x10A0;
+&#x10A1;
+&#x10A2;
+&#x10A3;
+&#x10A4;
+&#x10A5;
+&#x10A6;
+&#x10A7;
+&#x10A8;
+&#x10A9;
+&#x10AA;
+&#x10AB;
+&#x10AC;
+&#x10AD;
+&#x10AE;
+&#x10AF;
+&#x10B0;
+&#x10B1;
+&#x10B2;
+&#x10B3;
+&#x10B4;
+&#x10B5;
+&#x10B6;
+&#x10B7;
+&#x10B8;
+&#x10B9;
+&#x10BA;
+&#x10BB;
+&#x10BC;
+&#x10BD;
+&#x10BE;
+&#x10BF;
+&#x10C0;
+&#x10C1;
+&#x10C2;
+&#x10C3;
+&#x10C4;
+&#x10C5;
+&#x10C7;
+&#x10CD;
+&#x13A0;
+&#x13A1;
+&#x13A2;
+&#x13A3;
+&#x13A4;
+&#x13A5;
+&#x13A6;
+&#x13A7;
+&#x13A8;
+&#x13A9;
+&#x13AA;
+&#x13AB;
+&#x13AC;
+&#x13AD;
+&#x13AE;
+&#x13AF;
+&#x13B0;
+&#x13B1;
+&#x13B2;
+&#x13B3;
+&#x13B4;
+&#x13B5;
+&#x13B6;
+&#x13B7;
+&#x13B8;
+&#x13B9;
+&#x13BA;
+&#x13BB;
+&#x13BC;
+&#x13BD;
+&#x13BE;
+&#x13BF;
+&#x13C0;
+&#x13C1;
+&#x13C2;
+&#x13C3;
+&#x13C4;
+&#x13C5;
+&#x13C6;
+&#x13C7;
+&#x13C8;
+&#x13C9;
+&#x13CA;
+&#x13CB;
+&#x13CC;
+&#x13CD;
+&#x13CE;
+&#x13CF;
+&#x13D0;
+&#x13D1;
+&#x13D2;
+&#x13D3;
+&#x13D4;
+&#x13D5;
+&#x13D6;
+&#x13D7;
+&#x13D8;
+&#x13D9;
+&#x13DA;
+&#x13DB;
+&#x13DC;
+&#x13DD;
+&#x13DE;
+&#x13DF;
+&#x13E0;
+&#x13E1;
+&#x13E2;
+&#x13E3;
+&#x13E4;
+&#x13E5;
+&#x13E6;
+&#x13E7;
+&#x13E8;
+&#x13E9;
+&#x13EA;
+&#x13EB;
+&#x13EC;
+&#x13ED;
+&#x13EE;
+&#x13EF;
+&#x13F0;
+&#x13F1;
+&#x13F2;
+&#x13F3;
+&#x13F4;
+&#x13F5;
+&#x1C90;
+&#x1C91;
+&#x1C92;
+&#x1C93;
+&#x1C94;
+&#x1C95;
+&#x1C96;
+&#x1C97;
+&#x1C98;
+&#x1C99;
+&#x1C9A;
+&#x1C9B;
+&#x1C9C;
+&#x1C9D;
+&#x1C9E;
+&#x1C9F;
+&#x1CA0;
+&#x1CA1;
+&#x1CA2;
+&#x1CA3;
+&#x1CA4;
+&#x1CA5;
+&#x1CA6;
+&#x1CA7;
+&#x1CA8;
+&#x1CA9;
+&#x1CAA;
+&#x1CAB;
+&#x1CAC;
+&#x1CAD;
+&#x1CAE;
+&#x1CAF;
+&#x1CB0;
+&#x1CB1;
+&#x1CB2;
+&#x1CB3;
+&#x1CB4;
+&#x1CB5;
+&#x1CB6;
+&#x1CB7;
+&#x1CB8;
+&#x1CB9;
+&#x1CBA;
+&#x1CBD;
+&#x1CBE;
+&#x1CBF;
+&#x1E00;
+&#x1E02;
+&#x1E04;
+&#x1E06;
+&#x1E08;
+&#x1E0A;
+&#x1E0C;
+&#x1E0E;
+&#x1E10;
+&#x1E12;
+&#x1E14;
+&#x1E16;
+&#x1E18;
+&#x1E1A;
+&#x1E1C;
+&#x1E1E;
+&#x1E20;
+&#x1E22;
+&#x1E24;
+&#x1E26;
+&#x1E28;
+&#x1E2A;
+&#x1E2C;
+&#x1E2E;
+&#x1E30;
+&#x1E32;
+&#x1E34;
+&#x1E36;
+&#x1E38;
+&#x1E3A;
+&#x1E3C;
+&#x1E3E;
+&#x1E40;
+&#x1E42;
+&#x1E44;
+&#x1E46;
+&#x1E48;
+&#x1E4A;
+&#x1E4C;
+&#x1E4E;
+&#x1E50;
+&#x1E52;
+&#x1E54;
+&#x1E56;
+&#x1E58;
+&#x1E5A;
+&#x1E5C;
+&#x1E5E;
+&#x1E60;
+&#x1E62;
+&#x1E64;
+&#x1E66;
+&#x1E68;
+&#x1E6A;
+&#x1E6C;
+&#x1E6E;
+&#x1E70;
+&#x1E72;
+&#x1E74;
+&#x1E76;
+&#x1E78;
+&#x1E7A;
+&#x1E7C;
+&#x1E7E;
+&#x1E80;
+&#x1E82;
+&#x1E84;
+&#x1E86;
+&#x1E88;
+&#x1E8A;
+&#x1E8C;
+&#x1E8E;
+&#x1E90;
+&#x1E92;
+&#x1E94;
+&#x1E9E;
+&#x1EA0;
+&#x1EA2;
+&#x1EA4;
+&#x1EA6;
+&#x1EA8;
+&#x1EAA;
+&#x1EAC;
+&#x1EAE;
+&#x1EB0;
+&#x1EB2;
+&#x1EB4;
+&#x1EB6;
+&#x1EB8;
+&#x1EBA;
+&#x1EBC;
+&#x1EBE;
+&#x1EC0;
+&#x1EC2;
+&#x1EC4;
+&#x1EC6;
+&#x1EC8;
+&#x1ECA;
+&#x1ECC;
+&#x1ECE;
+&#x1ED0;
+&#x1ED2;
+&#x1ED4;
+&#x1ED6;
+&#x1ED8;
+&#x1EDA;
+&#x1EDC;
+&#x1EDE;
+&#x1EE0;
+&#x1EE2;
+&#x1EE4;
+&#x1EE6;
+&#x1EE8;
+&#x1EEA;
+&#x1EEC;
+&#x1EEE;
+&#x1EF0;
+&#x1EF2;
+&#x1EF4;
+&#x1EF6;
+&#x1EF8;
+&#x1EFA;
+&#x1EFC;
+&#x1EFE;
+&#x1F08;
+&#x1F09;
+&#x1F0A;
+&#x1F0B;
+&#x1F0C;
+&#x1F0D;
+&#x1F0E;
+&#x1F0F;
+&#x1F18;
+&#x1F19;
+&#x1F1A;
+&#x1F1B;
+&#x1F1C;
+&#x1F1D;
+&#x1F28;
+&#x1F29;
+&#x1F2A;
+&#x1F2B;
+&#x1F2C;
+&#x1F2D;
+&#x1F2E;
+&#x1F2F;
+&#x1F38;
+&#x1F39;
+&#x1F3A;
+&#x1F3B;
+&#x1F3C;
+&#x1F3D;
+&#x1F3E;
+&#x1F3F;
+&#x1F48;
+&#x1F49;
+&#x1F4A;
+&#x1F4B;
+&#x1F4C;
+&#x1F4D;
+&#x1F59;
+&#x1F5B;
+&#x1F5D;
+&#x1F5F;
+&#x1F68;
+&#x1F69;
+&#x1F6A;
+&#x1F6B;
+&#x1F6C;
+&#x1F6D;
+&#x1F6E;
+&#x1F6F;
+&#x1F88; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F89; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F8A; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F8B; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F8C; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F8D; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F8E; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F8F; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F98; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F99; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F9A; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F9B; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F9C; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F9D; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F9E; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F9F; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FA8; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1FA9; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1FAA; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1FAB; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1FAC; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1FAD; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1FAE; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FAF; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FB8;
+&#x1FB9;
+&#x1FBA;
+&#x1FBB;
+&#x1FBC; <!-- GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI -->
+&#x1FC8;
+&#x1FC9;
+&#x1FCA;
+&#x1FCB;
+&#x1FCC; <!-- GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI -->
+&#x1FD8;
+&#x1FD9;
+&#x1FDA;
+&#x1FDB;
+&#x1FE8;
+&#x1FE9;
+&#x1FEA;
+&#x1FEB;
+&#x1FEC;
+&#x1FF8;
+&#x1FF9;
+&#x1FFA;
+&#x1FFB;
+&#x1FFC; <!-- GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI -->
+&#x2126;
+&#x212A;
+&#x212B;
+&#x2132;
+&#x2160;
+&#x2161;
+&#x2162;
+&#x2163;
+&#x2164;
+&#x2165;
+&#x2166;
+&#x2167;
+&#x2168;
+&#x2169;
+&#x216A;
+&#x216B;
+&#x216C;
+&#x216D;
+&#x216E;
+&#x216F;
+&#x2183;
+&#x24B6;
+&#x24B7;
+&#x24B8;
+&#x24B9;
+&#x24BA;
+&#x24BB;
+&#x24BC;
+&#x24BD;
+&#x24BE;
+&#x24BF;
+&#x24C0;
+&#x24C1;
+&#x24C2;
+&#x24C3;
+&#x24C4;
+&#x24C5;
+&#x24C6;
+&#x24C7;
+&#x24C8;
+&#x24C9;
+&#x24CA;
+&#x24CB;
+&#x24CC;
+&#x24CD;
+&#x24CE;
+&#x24CF;
+&#x2C00;
+&#x2C01;
+&#x2C02;
+&#x2C03;
+&#x2C04;
+&#x2C05;
+&#x2C06;
+&#x2C07;
+&#x2C08;
+&#x2C09;
+&#x2C0A;
+&#x2C0B;
+&#x2C0C;
+&#x2C0D;
+&#x2C0E;
+&#x2C0F;
+&#x2C10;
+&#x2C11;
+&#x2C12;
+&#x2C13;
+&#x2C14;
+&#x2C15;
+&#x2C16;
+&#x2C17;
+&#x2C18;
+&#x2C19;
+&#x2C1A;
+&#x2C1B;
+&#x2C1C;
+&#x2C1D;
+&#x2C1E;
+&#x2C1F;
+&#x2C20;
+&#x2C21;
+&#x2C22;
+&#x2C23;
+&#x2C24;
+&#x2C25;
+&#x2C26;
+&#x2C27;
+&#x2C28;
+&#x2C29;
+&#x2C2A;
+&#x2C2B;
+&#x2C2C;
+&#x2C2D;
+&#x2C2E;
+&#x2C2F;
+&#x2C60;
+&#x2C62;
+&#x2C63;
+&#x2C64;
+&#x2C67;
+&#x2C69;
+&#x2C6B;
+&#x2C6D;
+&#x2C6E;
+&#x2C6F;
+&#x2C70;
+&#x2C72;
+&#x2C75;
+&#x2C7E;
+&#x2C7F;
+&#x2C80;
+&#x2C82;
+&#x2C84;
+&#x2C86;
+&#x2C88;
+&#x2C8A;
+&#x2C8C;
+&#x2C8E;
+&#x2C90;
+&#x2C92;
+&#x2C94;
+&#x2C96;
+&#x2C98;
+&#x2C9A;
+&#x2C9C;
+&#x2C9E;
+&#x2CA0;
+&#x2CA2;
+&#x2CA4;
+&#x2CA6;
+&#x2CA8;
+&#x2CAA;
+&#x2CAC;
+&#x2CAE;
+&#x2CB0;
+&#x2CB2;
+&#x2CB4;
+&#x2CB6;
+&#x2CB8;
+&#x2CBA;
+&#x2CBC;
+&#x2CBE;
+&#x2CC0;
+&#x2CC2;
+&#x2CC4;
+&#x2CC6;
+&#x2CC8;
+&#x2CCA;
+&#x2CCC;
+&#x2CCE;
+&#x2CD0;
+&#x2CD2;
+&#x2CD4;
+&#x2CD6;
+&#x2CD8;
+&#x2CDA;
+&#x2CDC;
+&#x2CDE;
+&#x2CE0;
+&#x2CE2;
+&#x2CEB;
+&#x2CED;
+&#x2CF2;
+&#xA640;
+&#xA642;
+&#xA644;
+&#xA646;
+&#xA648;
+&#xA64A;
+&#xA64C;
+&#xA64E;
+&#xA650;
+&#xA652;
+&#xA654;
+&#xA656;
+&#xA658;
+&#xA65A;
+&#xA65C;
+&#xA65E;
+&#xA660;
+&#xA662;
+&#xA664;
+&#xA666;
+&#xA668;
+&#xA66A;
+&#xA66C;
+&#xA680;
+&#xA682;
+&#xA684;
+&#xA686;
+&#xA688;
+&#xA68A;
+&#xA68C;
+&#xA68E;
+&#xA690;
+&#xA692;
+&#xA694;
+&#xA696;
+&#xA698;
+&#xA69A;
+&#xA722;
+&#xA724;
+&#xA726;
+&#xA728;
+&#xA72A;
+&#xA72C;
+&#xA72E;
+&#xA732;
+&#xA734;
+&#xA736;
+&#xA738;
+&#xA73A;
+&#xA73C;
+&#xA73E;
+&#xA740;
+&#xA742;
+&#xA744;
+&#xA746;
+&#xA748;
+&#xA74A;
+&#xA74C;
+&#xA74E;
+&#xA750;
+&#xA752;
+&#xA754;
+&#xA756;
+&#xA758;
+&#xA75A;
+&#xA75C;
+&#xA75E;
+&#xA760;
+&#xA762;
+&#xA764;
+&#xA766;
+&#xA768;
+&#xA76A;
+&#xA76C;
+&#xA76E;
+&#xA779;
+&#xA77B;
+&#xA77D;
+&#xA77E;
+&#xA780;
+&#xA782;
+&#xA784;
+&#xA786;
+&#xA78B;
+&#xA78D;
+&#xA790;
+&#xA792;
+&#xA796;
+&#xA798;
+&#xA79A;
+&#xA79C;
+&#xA79E;
+&#xA7A0;
+&#xA7A2;
+&#xA7A4;
+&#xA7A6;
+&#xA7A8;
+&#xA7AA;
+&#xA7AB;
+&#xA7AC;
+&#xA7AD;
+&#xA7AE;
+&#xA7B0;
+&#xA7B1;
+&#xA7B2;
+&#xA7B3;
+&#xA7B4;
+&#xA7B6;
+&#xA7B8;
+&#xA7BA;
+&#xA7BC;
+&#xA7BE;
+&#xA7C0;
+&#xA7C2;
+&#xA7C4;
+&#xA7C5;
+&#xA7C6;
+&#xA7C7;
+&#xA7C9;
+&#xA7D0;
+&#xA7D6;
+&#xA7D8;
+&#xA7F5;
+&#xFF21;
+&#xFF22;
+&#xFF23;
+&#xFF24;
+&#xFF25;
+&#xFF26;
+&#xFF27;
+&#xFF28;
+&#xFF29;
+&#xFF2A;
+&#xFF2B;
+&#xFF2C;
+&#xFF2D;
+&#xFF2E;
+&#xFF2F;
+&#xFF30;
+&#xFF31;
+&#xFF32;
+&#xFF33;
+&#xFF34;
+&#xFF35;
+&#xFF36;
+&#xFF37;
+&#xFF38;
+&#xFF39;
+&#xFF3A;
+&#x10400;
+&#x10401;
+&#x10402;
+&#x10403;
+&#x10404;
+&#x10405;
+&#x10406;
+&#x10407;
+&#x10408;
+&#x10409;
+&#x1040A;
+&#x1040B;
+&#x1040C;
+&#x1040D;
+&#x1040E;
+&#x1040F;
+&#x10410;
+&#x10411;
+&#x10412;
+&#x10413;
+&#x10414;
+&#x10415;
+&#x10416;
+&#x10417;
+&#x10418;
+&#x10419;
+&#x1041A;
+&#x1041B;
+&#x1041C;
+&#x1041D;
+&#x1041E;
+&#x1041F;
+&#x10420;
+&#x10421;
+&#x10422;
+&#x10423;
+&#x10424;
+&#x10425;
+&#x10426;
+&#x10427;
+&#x104B0;
+&#x104B1;
+&#x104B2;
+&#x104B3;
+&#x104B4;
+&#x104B5;
+&#x104B6;
+&#x104B7;
+&#x104B8;
+&#x104B9;
+&#x104BA;
+&#x104BB;
+&#x104BC;
+&#x104BD;
+&#x104BE;
+&#x104BF;
+&#x104C0;
+&#x104C1;
+&#x104C2;
+&#x104C3;
+&#x104C4;
+&#x104C5;
+&#x104C6;
+&#x104C7;
+&#x104C8;
+&#x104C9;
+&#x104CA;
+&#x104CB;
+&#x104CC;
+&#x104CD;
+&#x104CE;
+&#x104CF;
+&#x104D0;
+&#x104D1;
+&#x104D2;
+&#x104D3;
+&#x10570;
+&#x10571;
+&#x10572;
+&#x10573;
+&#x10574;
+&#x10575;
+&#x10576;
+&#x10577;
+&#x10578;
+&#x10579;
+&#x1057A;
+&#x1057C;
+&#x1057D;
+&#x1057E;
+&#x1057F;
+&#x10580;
+&#x10581;
+&#x10582;
+&#x10583;
+&#x10584;
+&#x10585;
+&#x10586;
+&#x10587;
+&#x10588;
+&#x10589;
+&#x1058A;
+&#x1058C;
+&#x1058D;
+&#x1058E;
+&#x1058F;
+&#x10590;
+&#x10591;
+&#x10592;
+&#x10594;
+&#x10595;
+&#x10C80;
+&#x10C81;
+&#x10C82;
+&#x10C83;
+&#x10C84;
+&#x10C85;
+&#x10C86;
+&#x10C87;
+&#x10C88;
+&#x10C89;
+&#x10C8A;
+&#x10C8B;
+&#x10C8C;
+&#x10C8D;
+&#x10C8E;
+&#x10C8F;
+&#x10C90;
+&#x10C91;
+&#x10C92;
+&#x10C93;
+&#x10C94;
+&#x10C95;
+&#x10C96;
+&#x10C97;
+&#x10C98;
+&#x10C99;
+&#x10C9A;
+&#x10C9B;
+&#x10C9C;
+&#x10C9D;
+&#x10C9E;
+&#x10C9F;
+&#x10CA0;
+&#x10CA1;
+&#x10CA2;
+&#x10CA3;
+&#x10CA4;
+&#x10CA5;
+&#x10CA6;
+&#x10CA7;
+&#x10CA8;
+&#x10CA9;
+&#x10CAA;
+&#x10CAB;
+&#x10CAC;
+&#x10CAD;
+&#x10CAE;
+&#x10CAF;
+&#x10CB0;
+&#x10CB1;
+&#x10CB2;
+&#x118A0;
+&#x118A1;
+&#x118A2;
+&#x118A3;
+&#x118A4;
+&#x118A5;
+&#x118A6;
+&#x118A7;
+&#x118A8;
+&#x118A9;
+&#x118AA;
+&#x118AB;
+&#x118AC;
+&#x118AD;
+&#x118AE;
+&#x118AF;
+&#x118B0;
+&#x118B1;
+&#x118B2;
+&#x118B3;
+&#x118B4;
+&#x118B5;
+&#x118B6;
+&#x118B7;
+&#x118B8;
+&#x118B9;
+&#x118BA;
+&#x118BB;
+&#x118BC;
+&#x118BD;
+&#x118BE;
+&#x118BF;
+&#x16E40;
+&#x16E41;
+&#x16E42;
+&#x16E43;
+&#x16E44;
+&#x16E45;
+&#x16E46;
+&#x16E47;
+&#x16E48;
+&#x16E49;
+&#x16E4A;
+&#x16E4B;
+&#x16E4C;
+&#x16E4D;
+&#x16E4E;
+&#x16E4F;
+&#x16E50;
+&#x16E51;
+&#x16E52;
+&#x16E53;
+&#x16E54;
+&#x16E55;
+&#x16E56;
+&#x16E57;
+&#x16E58;
+&#x16E59;
+&#x16E5A;
+&#x16E5B;
+&#x16E5C;
+&#x16E5D;
+&#x16E5E;
+&#x16E5F;
+&#x1E900;
+&#x1E901;
+&#x1E902;
+&#x1E903;
+&#x1E904;
+&#x1E905;
+&#x1E906;
+&#x1E907;
+&#x1E908;
+&#x1E909;
+&#x1E90A;
+&#x1E90B;
+&#x1E90C;
+&#x1E90D;
+&#x1E90E;
+&#x1E90F;
+&#x1E910;
+&#x1E911;
+&#x1E912;
+&#x1E913;
+&#x1E914;
+&#x1E915;
+&#x1E916;
+&#x1E917;
+&#x1E918;
+&#x1E919;
+&#x1E91A;
+&#x1E91B;
+&#x1E91C;
+&#x1E91D;
+&#x1E91E;
+&#x1E91F;
+&#x1E920;
+&#x1E921;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/all-title-ref.html b/layout/reftests/text-transform/all-title-ref.html
new file mode 100644
index 0000000000..ed9ab70691
--- /dev/null
+++ b/layout/reftests/text-transform/all-title-ref.html
@@ -0,0 +1,1517 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0041;x
+&#x0042;x
+&#x0043;x
+&#x0044;x
+&#x0045;x
+&#x0046;x
+&#x0047;x
+&#x0048;x
+&#x0049;x
+&#x004A;x
+&#x004B;x
+&#x004C;x
+&#x004D;x
+&#x004E;x
+&#x004F;x
+&#x0050;x
+&#x0051;x
+&#x0052;x
+&#x0053;x
+&#x0054;x
+&#x0055;x
+&#x0056;x
+&#x0057;x
+&#x0058;x
+&#x0059;x
+&#x005A;x
+&#x039C;x
+&#x0053;&#x0073;x <!-- LATIN SMALL LETTER SHARP S -->
+&#x00C0;x
+&#x00C1;x
+&#x00C2;x
+&#x00C3;x
+&#x00C4;x
+&#x00C5;x
+&#x00C6;x
+&#x00C7;x
+&#x00C8;x
+&#x00C9;x
+&#x00CA;x
+&#x00CB;x
+&#x00CC;x
+&#x00CD;x
+&#x00CE;x
+&#x00CF;x
+&#x00D0;x
+&#x00D1;x
+&#x00D2;x
+&#x00D3;x
+&#x00D4;x
+&#x00D5;x
+&#x00D6;x
+&#x00D8;x
+&#x00D9;x
+&#x00DA;x
+&#x00DB;x
+&#x00DC;x
+&#x00DD;x
+&#x00DE;x
+&#x0178;x
+&#x0100;x
+&#x0102;x
+&#x0104;x
+&#x0106;x
+&#x0108;x
+&#x010A;x
+&#x010C;x
+&#x010E;x
+&#x0110;x
+&#x0112;x
+&#x0114;x
+&#x0116;x
+&#x0118;x
+&#x011A;x
+&#x011C;x
+&#x011E;x
+&#x0120;x
+&#x0122;x
+&#x0124;x
+&#x0126;x
+&#x0128;x
+&#x012A;x
+&#x012C;x
+&#x012E;x
+&#x0049;x
+&#x0132;x
+&#x0134;x
+&#x0136;x
+&#x0139;x
+&#x013B;x
+&#x013D;x
+&#x013F;x
+&#x0141;x
+&#x0143;x
+&#x0145;x
+&#x0147;x
+&#x02BC;&#x004E;x <!-- LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -->
+&#x014A;x
+&#x014C;x
+&#x014E;x
+&#x0150;x
+&#x0152;x
+&#x0154;x
+&#x0156;x
+&#x0158;x
+&#x015A;x
+&#x015C;x
+&#x015E;x
+&#x0160;x
+&#x0162;x
+&#x0164;x
+&#x0166;x
+&#x0168;x
+&#x016A;x
+&#x016C;x
+&#x016E;x
+&#x0170;x
+&#x0172;x
+&#x0174;x
+&#x0176;x
+&#x0179;x
+&#x017B;x
+&#x017D;x
+&#x0053;x
+&#x0243;x
+&#x0182;x
+&#x0184;x
+&#x0187;x
+&#x018B;x
+&#x0191;x
+&#x01F6;x
+&#x0198;x
+&#x023D;x
+&#x0220;x
+&#x01A0;x
+&#x01A2;x
+&#x01A4;x
+&#x01A7;x
+&#x01AC;x
+&#x01AF;x
+&#x01B3;x
+&#x01B5;x
+&#x01B8;x
+&#x01BC;x
+&#x01F7;x
+&#x01C4;x
+&#x01C5;x
+&#x01C5;x
+&#x01C7;x
+&#x01C8;x
+&#x01C8;x
+&#x01CA;x
+&#x01CB;x
+&#x01CB;x
+&#x01CD;x
+&#x01CF;x
+&#x01D1;x
+&#x01D3;x
+&#x01D5;x
+&#x01D7;x
+&#x01D9;x
+&#x01DB;x
+&#x018E;x
+&#x01DE;x
+&#x01E0;x
+&#x01E2;x
+&#x01E4;x
+&#x01E6;x
+&#x01E8;x
+&#x01EA;x
+&#x01EC;x
+&#x01EE;x
+&#x004A;&#x030C;x <!-- LATIN SMALL LETTER J WITH CARON -->
+&#x01F1;x
+&#x01F2;x
+&#x01F2;x
+&#x01F4;x
+&#x01F8;x
+&#x01FA;x
+&#x01FC;x
+&#x01FE;x
+&#x0200;x
+&#x0202;x
+&#x0204;x
+&#x0206;x
+&#x0208;x
+&#x020A;x
+&#x020C;x
+&#x020E;x
+&#x0210;x
+&#x0212;x
+&#x0214;x
+&#x0216;x
+&#x0218;x
+&#x021A;x
+&#x021C;x
+&#x021E;x
+&#x0222;x
+&#x0224;x
+&#x0226;x
+&#x0228;x
+&#x022A;x
+&#x022C;x
+&#x022E;x
+&#x0230;x
+&#x0232;x
+&#x023B;x
+&#x2C7E;x
+&#x2C7F;x
+&#x0241;x
+&#x0246;x
+&#x0248;x
+&#x024A;x
+&#x024C;x
+&#x024E;x
+&#x2C6F;x
+&#x2C6D;x
+&#x2C70;x
+&#x0181;x
+&#x0186;x
+&#x0189;x
+&#x018A;x
+&#x018F;x
+&#x0190;x
+&#xA7AB;x
+&#x0193;x
+&#xA7AC;x
+&#x0194;x
+&#xA78D;x
+&#xA7AA;x
+&#x0197;x
+&#x0196;x
+&#xA7AE;x
+&#x2C62;x
+&#xA7AD;x
+&#x019C;x
+&#x2C6E;x
+&#x019D;x
+&#x019F;x
+&#x2C64;x
+&#x01A6;x
+&#xA7C5;x
+&#x01A9;x
+&#xA7B1;x
+&#x01AE;x
+&#x0244;x
+&#x01B1;x
+&#x01B2;x
+&#x0245;x
+&#x01B7;x
+&#xA7B2;x
+&#xA7B0;x
+&#x0345;X
+&#x0370;x
+&#x0372;x
+&#x0376;x
+&#x03FD;x
+&#x03FE;x
+&#x03FF;x
+&#x03AA;&#x0301;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -->
+&#x0386;x
+&#x0388;x
+&#x0389;x
+&#x038A;x
+&#x03AB;&#x0301;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -->
+&#x0391;x
+&#x0392;x
+&#x0393;x
+&#x0394;x
+&#x0395;x
+&#x0396;x
+&#x0397;x
+&#x0398;x
+&#x0399;x
+&#x039A;x
+&#x039B;x
+&#x039C;x
+&#x039D;x
+&#x039E;x
+&#x039F;x
+&#x03A0;x
+&#x03A1;x
+&#x03A3;x
+&#x03A3;x
+&#x03A4;x
+&#x03A5;x
+&#x03A6;x
+&#x03A7;x
+&#x03A8;x
+&#x03A9;x
+&#x03AA;x
+&#x03AB;x
+&#x038C;x
+&#x038E;x
+&#x038F;x
+&#x0392;x
+&#x0398;x
+&#x03A6;x
+&#x03A0;x
+&#x03CF;x
+&#x03D8;x
+&#x03DA;x
+&#x03DC;x
+&#x03DE;x
+&#x03E0;x
+&#x03E2;x
+&#x03E4;x
+&#x03E6;x
+&#x03E8;x
+&#x03EA;x
+&#x03EC;x
+&#x03EE;x
+&#x039A;x
+&#x03A1;x
+&#x03F9;x
+&#x037F;x
+&#x0395;x
+&#x03F7;x
+&#x03FA;x
+&#x0410;x
+&#x0411;x
+&#x0412;x
+&#x0413;x
+&#x0414;x
+&#x0415;x
+&#x0416;x
+&#x0417;x
+&#x0418;x
+&#x0419;x
+&#x041A;x
+&#x041B;x
+&#x041C;x
+&#x041D;x
+&#x041E;x
+&#x041F;x
+&#x0420;x
+&#x0421;x
+&#x0422;x
+&#x0423;x
+&#x0424;x
+&#x0425;x
+&#x0426;x
+&#x0427;x
+&#x0428;x
+&#x0429;x
+&#x042A;x
+&#x042B;x
+&#x042C;x
+&#x042D;x
+&#x042E;x
+&#x042F;x
+&#x0400;x
+&#x0401;x
+&#x0402;x
+&#x0403;x
+&#x0404;x
+&#x0405;x
+&#x0406;x
+&#x0407;x
+&#x0408;x
+&#x0409;x
+&#x040A;x
+&#x040B;x
+&#x040C;x
+&#x040D;x
+&#x040E;x
+&#x040F;x
+&#x0460;x
+&#x0462;x
+&#x0464;x
+&#x0466;x
+&#x0468;x
+&#x046A;x
+&#x046C;x
+&#x046E;x
+&#x0470;x
+&#x0472;x
+&#x0474;x
+&#x0476;x
+&#x0478;x
+&#x047A;x
+&#x047C;x
+&#x047E;x
+&#x0480;x
+&#x048A;x
+&#x048C;x
+&#x048E;x
+&#x0490;x
+&#x0492;x
+&#x0494;x
+&#x0496;x
+&#x0498;x
+&#x049A;x
+&#x049C;x
+&#x049E;x
+&#x04A0;x
+&#x04A2;x
+&#x04A4;x
+&#x04A6;x
+&#x04A8;x
+&#x04AA;x
+&#x04AC;x
+&#x04AE;x
+&#x04B0;x
+&#x04B2;x
+&#x04B4;x
+&#x04B6;x
+&#x04B8;x
+&#x04BA;x
+&#x04BC;x
+&#x04BE;x
+&#x04C1;x
+&#x04C3;x
+&#x04C5;x
+&#x04C7;x
+&#x04C9;x
+&#x04CB;x
+&#x04CD;x
+&#x04C0;x
+&#x04D0;x
+&#x04D2;x
+&#x04D4;x
+&#x04D6;x
+&#x04D8;x
+&#x04DA;x
+&#x04DC;x
+&#x04DE;x
+&#x04E0;x
+&#x04E2;x
+&#x04E4;x
+&#x04E6;x
+&#x04E8;x
+&#x04EA;x
+&#x04EC;x
+&#x04EE;x
+&#x04F0;x
+&#x04F2;x
+&#x04F4;x
+&#x04F6;x
+&#x04F8;x
+&#x04FA;x
+&#x04FC;x
+&#x04FE;x
+&#x0500;x
+&#x0502;x
+&#x0504;x
+&#x0506;x
+&#x0508;x
+&#x050A;x
+&#x050C;x
+&#x050E;x
+&#x0510;x
+&#x0512;x
+&#x0514;x
+&#x0516;x
+&#x0518;x
+&#x051A;x
+&#x051C;x
+&#x051E;x
+&#x0520;x
+&#x0522;x
+&#x0524;x
+&#x0526;x
+&#x0528;x
+&#x052A;x
+&#x052C;x
+&#x052E;x
+&#x0531;x
+&#x0532;x
+&#x0533;x
+&#x0534;x
+&#x0535;x
+&#x0536;x
+&#x0537;x
+&#x0538;x
+&#x0539;x
+&#x053A;x
+&#x053B;x
+&#x053C;x
+&#x053D;x
+&#x053E;x
+&#x053F;x
+&#x0540;x
+&#x0541;x
+&#x0542;x
+&#x0543;x
+&#x0544;x
+&#x0545;x
+&#x0546;x
+&#x0547;x
+&#x0548;x
+&#x0549;x
+&#x054A;x
+&#x054B;x
+&#x054C;x
+&#x054D;x
+&#x054E;x
+&#x054F;x
+&#x0550;x
+&#x0551;x
+&#x0552;x
+&#x0553;x
+&#x0554;x
+&#x0555;x
+&#x0556;x
+&#x0535;&#x0582;x <!-- ARMENIAN SMALL LIGATURE ECH YIWN -->
+&#x10D0;x
+&#x10D1;x
+&#x10D2;x
+&#x10D3;x
+&#x10D4;x
+&#x10D5;x
+&#x10D6;x
+&#x10D7;x
+&#x10D8;x
+&#x10D9;x
+&#x10DA;x
+&#x10DB;x
+&#x10DC;x
+&#x10DD;x
+&#x10DE;x
+&#x10DF;x
+&#x10E0;x
+&#x10E1;x
+&#x10E2;x
+&#x10E3;x
+&#x10E4;x
+&#x10E5;x
+&#x10E6;x
+&#x10E7;x
+&#x10E8;x
+&#x10E9;x
+&#x10EA;x
+&#x10EB;x
+&#x10EC;x
+&#x10ED;x
+&#x10EE;x
+&#x10EF;x
+&#x10F0;x
+&#x10F1;x
+&#x10F2;x
+&#x10F3;x
+&#x10F4;x
+&#x10F5;x
+&#x10F6;x
+&#x10F7;x
+&#x10F8;x
+&#x10F9;x
+&#x10FA;x
+&#x10FD;x
+&#x10FE;x
+&#x10FF;x
+&#x13F0;x
+&#x13F1;x
+&#x13F2;x
+&#x13F3;x
+&#x13F4;x
+&#x13F5;x
+&#x0412;x
+&#x0414;x
+&#x041E;x
+&#x0421;x
+&#x0422;x
+&#x0422;x
+&#x042A;x
+&#x0462;x
+&#xA64A;x
+&#xA77D;x
+&#x2C63;x
+&#xA7C6;x
+&#x1E00;x
+&#x1E02;x
+&#x1E04;x
+&#x1E06;x
+&#x1E08;x
+&#x1E0A;x
+&#x1E0C;x
+&#x1E0E;x
+&#x1E10;x
+&#x1E12;x
+&#x1E14;x
+&#x1E16;x
+&#x1E18;x
+&#x1E1A;x
+&#x1E1C;x
+&#x1E1E;x
+&#x1E20;x
+&#x1E22;x
+&#x1E24;x
+&#x1E26;x
+&#x1E28;x
+&#x1E2A;x
+&#x1E2C;x
+&#x1E2E;x
+&#x1E30;x
+&#x1E32;x
+&#x1E34;x
+&#x1E36;x
+&#x1E38;x
+&#x1E3A;x
+&#x1E3C;x
+&#x1E3E;x
+&#x1E40;x
+&#x1E42;x
+&#x1E44;x
+&#x1E46;x
+&#x1E48;x
+&#x1E4A;x
+&#x1E4C;x
+&#x1E4E;x
+&#x1E50;x
+&#x1E52;x
+&#x1E54;x
+&#x1E56;x
+&#x1E58;x
+&#x1E5A;x
+&#x1E5C;x
+&#x1E5E;x
+&#x1E60;x
+&#x1E62;x
+&#x1E64;x
+&#x1E66;x
+&#x1E68;x
+&#x1E6A;x
+&#x1E6C;x
+&#x1E6E;x
+&#x1E70;x
+&#x1E72;x
+&#x1E74;x
+&#x1E76;x
+&#x1E78;x
+&#x1E7A;x
+&#x1E7C;x
+&#x1E7E;x
+&#x1E80;x
+&#x1E82;x
+&#x1E84;x
+&#x1E86;x
+&#x1E88;x
+&#x1E8A;x
+&#x1E8C;x
+&#x1E8E;x
+&#x1E90;x
+&#x1E92;x
+&#x1E94;x
+&#x0048;&#x0331;x <!-- LATIN SMALL LETTER H WITH LINE BELOW -->
+&#x0054;&#x0308;x <!-- LATIN SMALL LETTER T WITH DIAERESIS -->
+&#x0057;&#x030A;x <!-- LATIN SMALL LETTER W WITH RING ABOVE -->
+&#x0059;&#x030A;x <!-- LATIN SMALL LETTER Y WITH RING ABOVE -->
+&#x0041;&#x02BE;x <!-- LATIN SMALL LETTER A WITH RIGHT HALF RING -->
+&#x1E60;x
+&#x1EA0;x
+&#x1EA2;x
+&#x1EA4;x
+&#x1EA6;x
+&#x1EA8;x
+&#x1EAA;x
+&#x1EAC;x
+&#x1EAE;x
+&#x1EB0;x
+&#x1EB2;x
+&#x1EB4;x
+&#x1EB6;x
+&#x1EB8;x
+&#x1EBA;x
+&#x1EBC;x
+&#x1EBE;x
+&#x1EC0;x
+&#x1EC2;x
+&#x1EC4;x
+&#x1EC6;x
+&#x1EC8;x
+&#x1ECA;x
+&#x1ECC;x
+&#x1ECE;x
+&#x1ED0;x
+&#x1ED2;x
+&#x1ED4;x
+&#x1ED6;x
+&#x1ED8;x
+&#x1EDA;x
+&#x1EDC;x
+&#x1EDE;x
+&#x1EE0;x
+&#x1EE2;x
+&#x1EE4;x
+&#x1EE6;x
+&#x1EE8;x
+&#x1EEA;x
+&#x1EEC;x
+&#x1EEE;x
+&#x1EF0;x
+&#x1EF2;x
+&#x1EF4;x
+&#x1EF6;x
+&#x1EF8;x
+&#x1EFA;x
+&#x1EFC;x
+&#x1EFE;x
+&#x1F08;x
+&#x1F09;x
+&#x1F0A;x
+&#x1F0B;x
+&#x1F0C;x
+&#x1F0D;x
+&#x1F0E;x
+&#x1F0F;x
+&#x1F18;x
+&#x1F19;x
+&#x1F1A;x
+&#x1F1B;x
+&#x1F1C;x
+&#x1F1D;x
+&#x1F28;x
+&#x1F29;x
+&#x1F2A;x
+&#x1F2B;x
+&#x1F2C;x
+&#x1F2D;x
+&#x1F2E;x
+&#x1F2F;x
+&#x1F38;x
+&#x1F39;x
+&#x1F3A;x
+&#x1F3B;x
+&#x1F3C;x
+&#x1F3D;x
+&#x1F3E;x
+&#x1F3F;x
+&#x1F48;x
+&#x1F49;x
+&#x1F4A;x
+&#x1F4B;x
+&#x1F4C;x
+&#x1F4D;x
+&#x03A5;&#x0313;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI -->
+&#x1F59;x
+&#x03A5;&#x0313;&#x0300;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA -->
+&#x1F5B;x
+&#x03A5;&#x0313;&#x0301;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA -->
+&#x1F5D;x
+&#x03A5;&#x0313;&#x0342;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI -->
+&#x1F5F;x
+&#x1F68;x
+&#x1F69;x
+&#x1F6A;x
+&#x1F6B;x
+&#x1F6C;x
+&#x1F6D;x
+&#x1F6E;x
+&#x1F6F;x
+&#x1FBA;x
+&#x1FBB;x
+&#x1FC8;x
+&#x1FC9;x
+&#x1FCA;x
+&#x1FCB;x
+&#x1FDA;x
+&#x1FDB;x
+&#x1FF8;x
+&#x1FF9;x
+&#x1FEA;x
+&#x1FEB;x
+&#x1FFA;x
+&#x1FFB;x
+&#x1F88;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F89;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F8A;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F8B;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F8C;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F8D;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F8E;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F8F;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F98;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F99;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F9A;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F9B;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F9C;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F9D;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F9E;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F9F;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FA8;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1FA9;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1FAA;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1FAB;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1FAC;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1FAD;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1FAE;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FAF;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FB8;x
+&#x1FB9;x
+&#x1FBA;&#x0345;x <!-- GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FBC;x <!-- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI -->
+&#x0386;&#x0345;x <!-- GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI -->
+&#x0391;&#x0342;x <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI -->
+&#x0391;&#x0342;&#x0345;x <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x0399;x
+&#x1FCA;&#x0345;x <!-- GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FCC;x <!-- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI -->
+&#x0389;&#x0345;x <!-- GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI -->
+&#x0397;&#x0342;x <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI -->
+&#x0397;&#x0342;&#x0345;x <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FD8;x
+&#x1FD9;x
+&#x03AA;&#x0300;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA -->
+&#x03AA;&#x0301;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA -->
+&#x0399;&#x0342;x <!-- GREEK SMALL LETTER IOTA WITH PERISPOMENI -->
+&#x03AA;&#x0342;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FE8;x
+&#x1FE9;x
+&#x03AB;&#x0300;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA -->
+&#x03AB;&#x0301;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA -->
+&#x03A1;&#x0313;x <!-- GREEK SMALL LETTER RHO WITH PSILI -->
+&#x1FEC;x
+&#x03A5;&#x0342;x <!-- GREEK SMALL LETTER UPSILON WITH PERISPOMENI -->
+&#x03AB;&#x0342;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FFA;&#x0345;x <!-- GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FFC;x <!-- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI -->
+&#x038F;&#x0345;x <!-- GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI -->
+&#x03A9;&#x0342;x <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI -->
+&#x03A9;&#x0342;&#x0345;x <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x2132;x
+&#x2160;x
+&#x2161;x
+&#x2162;x
+&#x2163;x
+&#x2164;x
+&#x2165;x
+&#x2166;x
+&#x2167;x
+&#x2168;x
+&#x2169;x
+&#x216A;x
+&#x216B;x
+&#x216C;x
+&#x216D;x
+&#x216E;x
+&#x216F;x
+&#x2183;x
+&#x24D0;X
+&#x24D1;X
+&#x24D2;X
+&#x24D3;X
+&#x24D4;X
+&#x24D5;X
+&#x24D6;X
+&#x24D7;X
+&#x24D8;X
+&#x24D9;X
+&#x24DA;X
+&#x24DB;X
+&#x24DC;X
+&#x24DD;X
+&#x24DE;X
+&#x24DF;X
+&#x24E0;X
+&#x24E1;X
+&#x24E2;X
+&#x24E3;X
+&#x24E4;X
+&#x24E5;X
+&#x24E6;X
+&#x24E7;X
+&#x24E8;X
+&#x24E9;X
+&#x2C00;x
+&#x2C01;x
+&#x2C02;x
+&#x2C03;x
+&#x2C04;x
+&#x2C05;x
+&#x2C06;x
+&#x2C07;x
+&#x2C08;x
+&#x2C09;x
+&#x2C0A;x
+&#x2C0B;x
+&#x2C0C;x
+&#x2C0D;x
+&#x2C0E;x
+&#x2C0F;x
+&#x2C10;x
+&#x2C11;x
+&#x2C12;x
+&#x2C13;x
+&#x2C14;x
+&#x2C15;x
+&#x2C16;x
+&#x2C17;x
+&#x2C18;x
+&#x2C19;x
+&#x2C1A;x
+&#x2C1B;x
+&#x2C1C;x
+&#x2C1D;x
+&#x2C1E;x
+&#x2C1F;x
+&#x2C20;x
+&#x2C21;x
+&#x2C22;x
+&#x2C23;x
+&#x2C24;x
+&#x2C25;x
+&#x2C26;x
+&#x2C27;x
+&#x2C28;x
+&#x2C29;x
+&#x2C2A;x
+&#x2C2B;x
+&#x2C2C;x
+&#x2C2D;x
+&#x2C2E;x
+&#x2C2F;x
+&#x2C60;x
+&#x023A;x
+&#x023E;x
+&#x2C67;x
+&#x2C69;x
+&#x2C6B;x
+&#x2C72;x
+&#x2C75;x
+&#x2C80;x
+&#x2C82;x
+&#x2C84;x
+&#x2C86;x
+&#x2C88;x
+&#x2C8A;x
+&#x2C8C;x
+&#x2C8E;x
+&#x2C90;x
+&#x2C92;x
+&#x2C94;x
+&#x2C96;x
+&#x2C98;x
+&#x2C9A;x
+&#x2C9C;x
+&#x2C9E;x
+&#x2CA0;x
+&#x2CA2;x
+&#x2CA4;x
+&#x2CA6;x
+&#x2CA8;x
+&#x2CAA;x
+&#x2CAC;x
+&#x2CAE;x
+&#x2CB0;x
+&#x2CB2;x
+&#x2CB4;x
+&#x2CB6;x
+&#x2CB8;x
+&#x2CBA;x
+&#x2CBC;x
+&#x2CBE;x
+&#x2CC0;x
+&#x2CC2;x
+&#x2CC4;x
+&#x2CC6;x
+&#x2CC8;x
+&#x2CCA;x
+&#x2CCC;x
+&#x2CCE;x
+&#x2CD0;x
+&#x2CD2;x
+&#x2CD4;x
+&#x2CD6;x
+&#x2CD8;x
+&#x2CDA;x
+&#x2CDC;x
+&#x2CDE;x
+&#x2CE0;x
+&#x2CE2;x
+&#x2CEB;x
+&#x2CED;x
+&#x2CF2;x
+&#x10A0;x
+&#x10A1;x
+&#x10A2;x
+&#x10A3;x
+&#x10A4;x
+&#x10A5;x
+&#x10A6;x
+&#x10A7;x
+&#x10A8;x
+&#x10A9;x
+&#x10AA;x
+&#x10AB;x
+&#x10AC;x
+&#x10AD;x
+&#x10AE;x
+&#x10AF;x
+&#x10B0;x
+&#x10B1;x
+&#x10B2;x
+&#x10B3;x
+&#x10B4;x
+&#x10B5;x
+&#x10B6;x
+&#x10B7;x
+&#x10B8;x
+&#x10B9;x
+&#x10BA;x
+&#x10BB;x
+&#x10BC;x
+&#x10BD;x
+&#x10BE;x
+&#x10BF;x
+&#x10C0;x
+&#x10C1;x
+&#x10C2;x
+&#x10C3;x
+&#x10C4;x
+&#x10C5;x
+&#x10C7;x
+&#x10CD;x
+&#xA640;x
+&#xA642;x
+&#xA644;x
+&#xA646;x
+&#xA648;x
+&#xA64A;x
+&#xA64C;x
+&#xA64E;x
+&#xA650;x
+&#xA652;x
+&#xA654;x
+&#xA656;x
+&#xA658;x
+&#xA65A;x
+&#xA65C;x
+&#xA65E;x
+&#xA660;x
+&#xA662;x
+&#xA664;x
+&#xA666;x
+&#xA668;x
+&#xA66A;x
+&#xA66C;x
+&#xA680;x
+&#xA682;x
+&#xA684;x
+&#xA686;x
+&#xA688;x
+&#xA68A;x
+&#xA68C;x
+&#xA68E;x
+&#xA690;x
+&#xA692;x
+&#xA694;x
+&#xA696;x
+&#xA698;x
+&#xA69A;x
+&#xA722;x
+&#xA724;x
+&#xA726;x
+&#xA728;x
+&#xA72A;x
+&#xA72C;x
+&#xA72E;x
+&#xA732;x
+&#xA734;x
+&#xA736;x
+&#xA738;x
+&#xA73A;x
+&#xA73C;x
+&#xA73E;x
+&#xA740;x
+&#xA742;x
+&#xA744;x
+&#xA746;x
+&#xA748;x
+&#xA74A;x
+&#xA74C;x
+&#xA74E;x
+&#xA750;x
+&#xA752;x
+&#xA754;x
+&#xA756;x
+&#xA758;x
+&#xA75A;x
+&#xA75C;x
+&#xA75E;x
+&#xA760;x
+&#xA762;x
+&#xA764;x
+&#xA766;x
+&#xA768;x
+&#xA76A;x
+&#xA76C;x
+&#xA76E;x
+&#xA779;x
+&#xA77B;x
+&#xA77E;x
+&#xA780;x
+&#xA782;x
+&#xA784;x
+&#xA786;x
+&#xA78B;x
+&#xA790;x
+&#xA792;x
+&#xA7C4;x
+&#xA796;x
+&#xA798;x
+&#xA79A;x
+&#xA79C;x
+&#xA79E;x
+&#xA7A0;x
+&#xA7A2;x
+&#xA7A4;x
+&#xA7A6;x
+&#xA7A8;x
+&#xA7B4;x
+&#xA7B6;x
+&#xA7B8;x
+&#xA7BA;x
+&#xA7BC;x
+&#xA7BE;x
+&#xA7C0;x
+&#xA7C2;x
+&#xA7C7;x
+&#xA7C9;x
+&#xA7D0;x
+&#xA7D6;x
+&#xA7D8;x
+&#xA7F5;x
+&#xA7B3;x
+&#x13A0;x
+&#x13A1;x
+&#x13A2;x
+&#x13A3;x
+&#x13A4;x
+&#x13A5;x
+&#x13A6;x
+&#x13A7;x
+&#x13A8;x
+&#x13A9;x
+&#x13AA;x
+&#x13AB;x
+&#x13AC;x
+&#x13AD;x
+&#x13AE;x
+&#x13AF;x
+&#x13B0;x
+&#x13B1;x
+&#x13B2;x
+&#x13B3;x
+&#x13B4;x
+&#x13B5;x
+&#x13B6;x
+&#x13B7;x
+&#x13B8;x
+&#x13B9;x
+&#x13BA;x
+&#x13BB;x
+&#x13BC;x
+&#x13BD;x
+&#x13BE;x
+&#x13BF;x
+&#x13C0;x
+&#x13C1;x
+&#x13C2;x
+&#x13C3;x
+&#x13C4;x
+&#x13C5;x
+&#x13C6;x
+&#x13C7;x
+&#x13C8;x
+&#x13C9;x
+&#x13CA;x
+&#x13CB;x
+&#x13CC;x
+&#x13CD;x
+&#x13CE;x
+&#x13CF;x
+&#x13D0;x
+&#x13D1;x
+&#x13D2;x
+&#x13D3;x
+&#x13D4;x
+&#x13D5;x
+&#x13D6;x
+&#x13D7;x
+&#x13D8;x
+&#x13D9;x
+&#x13DA;x
+&#x13DB;x
+&#x13DC;x
+&#x13DD;x
+&#x13DE;x
+&#x13DF;x
+&#x13E0;x
+&#x13E1;x
+&#x13E2;x
+&#x13E3;x
+&#x13E4;x
+&#x13E5;x
+&#x13E6;x
+&#x13E7;x
+&#x13E8;x
+&#x13E9;x
+&#x13EA;x
+&#x13EB;x
+&#x13EC;x
+&#x13ED;x
+&#x13EE;x
+&#x13EF;x
+&#x0046;&#x0066;x <!-- LATIN SMALL LIGATURE FF -->
+&#x0046;&#x0069;x <!-- LATIN SMALL LIGATURE FI -->
+&#x0046;&#x006C;x <!-- LATIN SMALL LIGATURE FL -->
+&#x0046;&#x0066;&#x0069;x <!-- LATIN SMALL LIGATURE FFI -->
+&#x0046;&#x0066;&#x006C;x <!-- LATIN SMALL LIGATURE FFL -->
+&#x0053;&#x0074;x <!-- LATIN SMALL LIGATURE LONG S T -->
+&#x0053;&#x0074;x <!-- LATIN SMALL LIGATURE ST -->
+&#x0544;&#x0576;x <!-- ARMENIAN SMALL LIGATURE MEN NOW -->
+&#x0544;&#x0565;x <!-- ARMENIAN SMALL LIGATURE MEN ECH -->
+&#x0544;&#x056B;x <!-- ARMENIAN SMALL LIGATURE MEN INI -->
+&#x054E;&#x0576;x <!-- ARMENIAN SMALL LIGATURE VEW NOW -->
+&#x0544;&#x056D;x <!-- ARMENIAN SMALL LIGATURE MEN XEH -->
+&#xFF21;x
+&#xFF22;x
+&#xFF23;x
+&#xFF24;x
+&#xFF25;x
+&#xFF26;x
+&#xFF27;x
+&#xFF28;x
+&#xFF29;x
+&#xFF2A;x
+&#xFF2B;x
+&#xFF2C;x
+&#xFF2D;x
+&#xFF2E;x
+&#xFF2F;x
+&#xFF30;x
+&#xFF31;x
+&#xFF32;x
+&#xFF33;x
+&#xFF34;x
+&#xFF35;x
+&#xFF36;x
+&#xFF37;x
+&#xFF38;x
+&#xFF39;x
+&#xFF3A;x
+&#x10400;x
+&#x10401;x
+&#x10402;x
+&#x10403;x
+&#x10404;x
+&#x10405;x
+&#x10406;x
+&#x10407;x
+&#x10408;x
+&#x10409;x
+&#x1040A;x
+&#x1040B;x
+&#x1040C;x
+&#x1040D;x
+&#x1040E;x
+&#x1040F;x
+&#x10410;x
+&#x10411;x
+&#x10412;x
+&#x10413;x
+&#x10414;x
+&#x10415;x
+&#x10416;x
+&#x10417;x
+&#x10418;x
+&#x10419;x
+&#x1041A;x
+&#x1041B;x
+&#x1041C;x
+&#x1041D;x
+&#x1041E;x
+&#x1041F;x
+&#x10420;x
+&#x10421;x
+&#x10422;x
+&#x10423;x
+&#x10424;x
+&#x10425;x
+&#x10426;x
+&#x10427;x
+&#x104B0;x
+&#x104B1;x
+&#x104B2;x
+&#x104B3;x
+&#x104B4;x
+&#x104B5;x
+&#x104B6;x
+&#x104B7;x
+&#x104B8;x
+&#x104B9;x
+&#x104BA;x
+&#x104BB;x
+&#x104BC;x
+&#x104BD;x
+&#x104BE;x
+&#x104BF;x
+&#x104C0;x
+&#x104C1;x
+&#x104C2;x
+&#x104C3;x
+&#x104C4;x
+&#x104C5;x
+&#x104C6;x
+&#x104C7;x
+&#x104C8;x
+&#x104C9;x
+&#x104CA;x
+&#x104CB;x
+&#x104CC;x
+&#x104CD;x
+&#x104CE;x
+&#x104CF;x
+&#x104D0;x
+&#x104D1;x
+&#x104D2;x
+&#x104D3;x
+&#x10570;x
+&#x10571;x
+&#x10572;x
+&#x10573;x
+&#x10574;x
+&#x10575;x
+&#x10576;x
+&#x10577;x
+&#x10578;x
+&#x10579;x
+&#x1057A;x
+&#x1057C;x
+&#x1057D;x
+&#x1057E;x
+&#x1057F;x
+&#x10580;x
+&#x10581;x
+&#x10582;x
+&#x10583;x
+&#x10584;x
+&#x10585;x
+&#x10586;x
+&#x10587;x
+&#x10588;x
+&#x10589;x
+&#x1058A;x
+&#x1058C;x
+&#x1058D;x
+&#x1058E;x
+&#x1058F;x
+&#x10590;x
+&#x10591;x
+&#x10592;x
+&#x10594;x
+&#x10595;x
+&#x10C80;x
+&#x10C81;x
+&#x10C82;x
+&#x10C83;x
+&#x10C84;x
+&#x10C85;x
+&#x10C86;x
+&#x10C87;x
+&#x10C88;x
+&#x10C89;x
+&#x10C8A;x
+&#x10C8B;x
+&#x10C8C;x
+&#x10C8D;x
+&#x10C8E;x
+&#x10C8F;x
+&#x10C90;x
+&#x10C91;x
+&#x10C92;x
+&#x10C93;x
+&#x10C94;x
+&#x10C95;x
+&#x10C96;x
+&#x10C97;x
+&#x10C98;x
+&#x10C99;x
+&#x10C9A;x
+&#x10C9B;x
+&#x10C9C;x
+&#x10C9D;x
+&#x10C9E;x
+&#x10C9F;x
+&#x10CA0;x
+&#x10CA1;x
+&#x10CA2;x
+&#x10CA3;x
+&#x10CA4;x
+&#x10CA5;x
+&#x10CA6;x
+&#x10CA7;x
+&#x10CA8;x
+&#x10CA9;x
+&#x10CAA;x
+&#x10CAB;x
+&#x10CAC;x
+&#x10CAD;x
+&#x10CAE;x
+&#x10CAF;x
+&#x10CB0;x
+&#x10CB1;x
+&#x10CB2;x
+&#x118A0;x
+&#x118A1;x
+&#x118A2;x
+&#x118A3;x
+&#x118A4;x
+&#x118A5;x
+&#x118A6;x
+&#x118A7;x
+&#x118A8;x
+&#x118A9;x
+&#x118AA;x
+&#x118AB;x
+&#x118AC;x
+&#x118AD;x
+&#x118AE;x
+&#x118AF;x
+&#x118B0;x
+&#x118B1;x
+&#x118B2;x
+&#x118B3;x
+&#x118B4;x
+&#x118B5;x
+&#x118B6;x
+&#x118B7;x
+&#x118B8;x
+&#x118B9;x
+&#x118BA;x
+&#x118BB;x
+&#x118BC;x
+&#x118BD;x
+&#x118BE;x
+&#x118BF;x
+&#x16E40;x
+&#x16E41;x
+&#x16E42;x
+&#x16E43;x
+&#x16E44;x
+&#x16E45;x
+&#x16E46;x
+&#x16E47;x
+&#x16E48;x
+&#x16E49;x
+&#x16E4A;x
+&#x16E4B;x
+&#x16E4C;x
+&#x16E4D;x
+&#x16E4E;x
+&#x16E4F;x
+&#x16E50;x
+&#x16E51;x
+&#x16E52;x
+&#x16E53;x
+&#x16E54;x
+&#x16E55;x
+&#x16E56;x
+&#x16E57;x
+&#x16E58;x
+&#x16E59;x
+&#x16E5A;x
+&#x16E5B;x
+&#x16E5C;x
+&#x16E5D;x
+&#x16E5E;x
+&#x16E5F;x
+&#x1E900;x
+&#x1E901;x
+&#x1E902;x
+&#x1E903;x
+&#x1E904;x
+&#x1E905;x
+&#x1E906;x
+&#x1E907;x
+&#x1E908;x
+&#x1E909;x
+&#x1E90A;x
+&#x1E90B;x
+&#x1E90C;x
+&#x1E90D;x
+&#x1E90E;x
+&#x1E90F;x
+&#x1E910;x
+&#x1E911;x
+&#x1E912;x
+&#x1E913;x
+&#x1E914;x
+&#x1E915;x
+&#x1E916;x
+&#x1E917;x
+&#x1E918;x
+&#x1E919;x
+&#x1E91A;x
+&#x1E91B;x
+&#x1E91C;x
+&#x1E91D;x
+&#x1E91E;x
+&#x1E91F;x
+&#x1E920;x
+&#x1E921;x
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/all-title.html b/layout/reftests/text-transform/all-title.html
new file mode 100644
index 0000000000..29b5a45f1a
--- /dev/null
+++ b/layout/reftests/text-transform/all-title.html
@@ -0,0 +1,1517 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; text-transform: capitalize; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0061;x
+&#x0062;x
+&#x0063;x
+&#x0064;x
+&#x0065;x
+&#x0066;x
+&#x0067;x
+&#x0068;x
+&#x0069;x
+&#x006A;x
+&#x006B;x
+&#x006C;x
+&#x006D;x
+&#x006E;x
+&#x006F;x
+&#x0070;x
+&#x0071;x
+&#x0072;x
+&#x0073;x
+&#x0074;x
+&#x0075;x
+&#x0076;x
+&#x0077;x
+&#x0078;x
+&#x0079;x
+&#x007A;x
+&#x00B5;x
+&#x00DF;x <!-- LATIN SMALL LETTER SHARP S -->
+&#x00E0;x
+&#x00E1;x
+&#x00E2;x
+&#x00E3;x
+&#x00E4;x
+&#x00E5;x
+&#x00E6;x
+&#x00E7;x
+&#x00E8;x
+&#x00E9;x
+&#x00EA;x
+&#x00EB;x
+&#x00EC;x
+&#x00ED;x
+&#x00EE;x
+&#x00EF;x
+&#x00F0;x
+&#x00F1;x
+&#x00F2;x
+&#x00F3;x
+&#x00F4;x
+&#x00F5;x
+&#x00F6;x
+&#x00F8;x
+&#x00F9;x
+&#x00FA;x
+&#x00FB;x
+&#x00FC;x
+&#x00FD;x
+&#x00FE;x
+&#x00FF;x
+&#x0101;x
+&#x0103;x
+&#x0105;x
+&#x0107;x
+&#x0109;x
+&#x010B;x
+&#x010D;x
+&#x010F;x
+&#x0111;x
+&#x0113;x
+&#x0115;x
+&#x0117;x
+&#x0119;x
+&#x011B;x
+&#x011D;x
+&#x011F;x
+&#x0121;x
+&#x0123;x
+&#x0125;x
+&#x0127;x
+&#x0129;x
+&#x012B;x
+&#x012D;x
+&#x012F;x
+&#x0131;x
+&#x0133;x
+&#x0135;x
+&#x0137;x
+&#x013A;x
+&#x013C;x
+&#x013E;x
+&#x0140;x
+&#x0142;x
+&#x0144;x
+&#x0146;x
+&#x0148;x
+&#x0149;x <!-- LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -->
+&#x014B;x
+&#x014D;x
+&#x014F;x
+&#x0151;x
+&#x0153;x
+&#x0155;x
+&#x0157;x
+&#x0159;x
+&#x015B;x
+&#x015D;x
+&#x015F;x
+&#x0161;x
+&#x0163;x
+&#x0165;x
+&#x0167;x
+&#x0169;x
+&#x016B;x
+&#x016D;x
+&#x016F;x
+&#x0171;x
+&#x0173;x
+&#x0175;x
+&#x0177;x
+&#x017A;x
+&#x017C;x
+&#x017E;x
+&#x017F;x
+&#x0180;x
+&#x0183;x
+&#x0185;x
+&#x0188;x
+&#x018C;x
+&#x0192;x
+&#x0195;x
+&#x0199;x
+&#x019A;x
+&#x019E;x
+&#x01A1;x
+&#x01A3;x
+&#x01A5;x
+&#x01A8;x
+&#x01AD;x
+&#x01B0;x
+&#x01B4;x
+&#x01B6;x
+&#x01B9;x
+&#x01BD;x
+&#x01BF;x
+&#x01C4;x
+&#x01C5;x
+&#x01C6;x
+&#x01C7;x
+&#x01C8;x
+&#x01C9;x
+&#x01CA;x
+&#x01CB;x
+&#x01CC;x
+&#x01CE;x
+&#x01D0;x
+&#x01D2;x
+&#x01D4;x
+&#x01D6;x
+&#x01D8;x
+&#x01DA;x
+&#x01DC;x
+&#x01DD;x
+&#x01DF;x
+&#x01E1;x
+&#x01E3;x
+&#x01E5;x
+&#x01E7;x
+&#x01E9;x
+&#x01EB;x
+&#x01ED;x
+&#x01EF;x
+&#x01F0;x <!-- LATIN SMALL LETTER J WITH CARON -->
+&#x01F1;x
+&#x01F2;x
+&#x01F3;x
+&#x01F5;x
+&#x01F9;x
+&#x01FB;x
+&#x01FD;x
+&#x01FF;x
+&#x0201;x
+&#x0203;x
+&#x0205;x
+&#x0207;x
+&#x0209;x
+&#x020B;x
+&#x020D;x
+&#x020F;x
+&#x0211;x
+&#x0213;x
+&#x0215;x
+&#x0217;x
+&#x0219;x
+&#x021B;x
+&#x021D;x
+&#x021F;x
+&#x0223;x
+&#x0225;x
+&#x0227;x
+&#x0229;x
+&#x022B;x
+&#x022D;x
+&#x022F;x
+&#x0231;x
+&#x0233;x
+&#x023C;x
+&#x023F;x
+&#x0240;x
+&#x0242;x
+&#x0247;x
+&#x0249;x
+&#x024B;x
+&#x024D;x
+&#x024F;x
+&#x0250;x
+&#x0251;x
+&#x0252;x
+&#x0253;x
+&#x0254;x
+&#x0256;x
+&#x0257;x
+&#x0259;x
+&#x025B;x
+&#x025C;x
+&#x0260;x
+&#x0261;x
+&#x0263;x
+&#x0265;x
+&#x0266;x
+&#x0268;x
+&#x0269;x
+&#x026A;x
+&#x026B;x
+&#x026C;x
+&#x026F;x
+&#x0271;x
+&#x0272;x
+&#x0275;x
+&#x027D;x
+&#x0280;x
+&#x0282;x
+&#x0283;x
+&#x0287;x
+&#x0288;x
+&#x0289;x
+&#x028A;x
+&#x028B;x
+&#x028C;x
+&#x0292;x
+&#x029D;x
+&#x029E;x
+&#x0345;x
+&#x0371;x
+&#x0373;x
+&#x0377;x
+&#x037B;x
+&#x037C;x
+&#x037D;x
+&#x0390;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -->
+&#x03AC;x
+&#x03AD;x
+&#x03AE;x
+&#x03AF;x
+&#x03B0;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -->
+&#x03B1;x
+&#x03B2;x
+&#x03B3;x
+&#x03B4;x
+&#x03B5;x
+&#x03B6;x
+&#x03B7;x
+&#x03B8;x
+&#x03B9;x
+&#x03BA;x
+&#x03BB;x
+&#x03BC;x
+&#x03BD;x
+&#x03BE;x
+&#x03BF;x
+&#x03C0;x
+&#x03C1;x
+&#x03C2;x
+&#x03C3;x
+&#x03C4;x
+&#x03C5;x
+&#x03C6;x
+&#x03C7;x
+&#x03C8;x
+&#x03C9;x
+&#x03CA;x
+&#x03CB;x
+&#x03CC;x
+&#x03CD;x
+&#x03CE;x
+&#x03D0;x
+&#x03D1;x
+&#x03D5;x
+&#x03D6;x
+&#x03D7;x
+&#x03D9;x
+&#x03DB;x
+&#x03DD;x
+&#x03DF;x
+&#x03E1;x
+&#x03E3;x
+&#x03E5;x
+&#x03E7;x
+&#x03E9;x
+&#x03EB;x
+&#x03ED;x
+&#x03EF;x
+&#x03F0;x
+&#x03F1;x
+&#x03F2;x
+&#x03F3;x
+&#x03F5;x
+&#x03F8;x
+&#x03FB;x
+&#x0430;x
+&#x0431;x
+&#x0432;x
+&#x0433;x
+&#x0434;x
+&#x0435;x
+&#x0436;x
+&#x0437;x
+&#x0438;x
+&#x0439;x
+&#x043A;x
+&#x043B;x
+&#x043C;x
+&#x043D;x
+&#x043E;x
+&#x043F;x
+&#x0440;x
+&#x0441;x
+&#x0442;x
+&#x0443;x
+&#x0444;x
+&#x0445;x
+&#x0446;x
+&#x0447;x
+&#x0448;x
+&#x0449;x
+&#x044A;x
+&#x044B;x
+&#x044C;x
+&#x044D;x
+&#x044E;x
+&#x044F;x
+&#x0450;x
+&#x0451;x
+&#x0452;x
+&#x0453;x
+&#x0454;x
+&#x0455;x
+&#x0456;x
+&#x0457;x
+&#x0458;x
+&#x0459;x
+&#x045A;x
+&#x045B;x
+&#x045C;x
+&#x045D;x
+&#x045E;x
+&#x045F;x
+&#x0461;x
+&#x0463;x
+&#x0465;x
+&#x0467;x
+&#x0469;x
+&#x046B;x
+&#x046D;x
+&#x046F;x
+&#x0471;x
+&#x0473;x
+&#x0475;x
+&#x0477;x
+&#x0479;x
+&#x047B;x
+&#x047D;x
+&#x047F;x
+&#x0481;x
+&#x048B;x
+&#x048D;x
+&#x048F;x
+&#x0491;x
+&#x0493;x
+&#x0495;x
+&#x0497;x
+&#x0499;x
+&#x049B;x
+&#x049D;x
+&#x049F;x
+&#x04A1;x
+&#x04A3;x
+&#x04A5;x
+&#x04A7;x
+&#x04A9;x
+&#x04AB;x
+&#x04AD;x
+&#x04AF;x
+&#x04B1;x
+&#x04B3;x
+&#x04B5;x
+&#x04B7;x
+&#x04B9;x
+&#x04BB;x
+&#x04BD;x
+&#x04BF;x
+&#x04C2;x
+&#x04C4;x
+&#x04C6;x
+&#x04C8;x
+&#x04CA;x
+&#x04CC;x
+&#x04CE;x
+&#x04CF;x
+&#x04D1;x
+&#x04D3;x
+&#x04D5;x
+&#x04D7;x
+&#x04D9;x
+&#x04DB;x
+&#x04DD;x
+&#x04DF;x
+&#x04E1;x
+&#x04E3;x
+&#x04E5;x
+&#x04E7;x
+&#x04E9;x
+&#x04EB;x
+&#x04ED;x
+&#x04EF;x
+&#x04F1;x
+&#x04F3;x
+&#x04F5;x
+&#x04F7;x
+&#x04F9;x
+&#x04FB;x
+&#x04FD;x
+&#x04FF;x
+&#x0501;x
+&#x0503;x
+&#x0505;x
+&#x0507;x
+&#x0509;x
+&#x050B;x
+&#x050D;x
+&#x050F;x
+&#x0511;x
+&#x0513;x
+&#x0515;x
+&#x0517;x
+&#x0519;x
+&#x051B;x
+&#x051D;x
+&#x051F;x
+&#x0521;x
+&#x0523;x
+&#x0525;x
+&#x0527;x
+&#x0529;x
+&#x052B;x
+&#x052D;x
+&#x052F;x
+&#x0561;x
+&#x0562;x
+&#x0563;x
+&#x0564;x
+&#x0565;x
+&#x0566;x
+&#x0567;x
+&#x0568;x
+&#x0569;x
+&#x056A;x
+&#x056B;x
+&#x056C;x
+&#x056D;x
+&#x056E;x
+&#x056F;x
+&#x0570;x
+&#x0571;x
+&#x0572;x
+&#x0573;x
+&#x0574;x
+&#x0575;x
+&#x0576;x
+&#x0577;x
+&#x0578;x
+&#x0579;x
+&#x057A;x
+&#x057B;x
+&#x057C;x
+&#x057D;x
+&#x057E;x
+&#x057F;x
+&#x0580;x
+&#x0581;x
+&#x0582;x
+&#x0583;x
+&#x0584;x
+&#x0585;x
+&#x0586;x
+&#x0587;x <!-- ARMENIAN SMALL LIGATURE ECH YIWN -->
+&#x10D0;x
+&#x10D1;x
+&#x10D2;x
+&#x10D3;x
+&#x10D4;x
+&#x10D5;x
+&#x10D6;x
+&#x10D7;x
+&#x10D8;x
+&#x10D9;x
+&#x10DA;x
+&#x10DB;x
+&#x10DC;x
+&#x10DD;x
+&#x10DE;x
+&#x10DF;x
+&#x10E0;x
+&#x10E1;x
+&#x10E2;x
+&#x10E3;x
+&#x10E4;x
+&#x10E5;x
+&#x10E6;x
+&#x10E7;x
+&#x10E8;x
+&#x10E9;x
+&#x10EA;x
+&#x10EB;x
+&#x10EC;x
+&#x10ED;x
+&#x10EE;x
+&#x10EF;x
+&#x10F0;x
+&#x10F1;x
+&#x10F2;x
+&#x10F3;x
+&#x10F4;x
+&#x10F5;x
+&#x10F6;x
+&#x10F7;x
+&#x10F8;x
+&#x10F9;x
+&#x10FA;x
+&#x10FD;x
+&#x10FE;x
+&#x10FF;x
+&#x13F8;x
+&#x13F9;x
+&#x13FA;x
+&#x13FB;x
+&#x13FC;x
+&#x13FD;x
+&#x1C80;x
+&#x1C81;x
+&#x1C82;x
+&#x1C83;x
+&#x1C84;x
+&#x1C85;x
+&#x1C86;x
+&#x1C87;x
+&#x1C88;x
+&#x1D79;x
+&#x1D7D;x
+&#x1D8E;x
+&#x1E01;x
+&#x1E03;x
+&#x1E05;x
+&#x1E07;x
+&#x1E09;x
+&#x1E0B;x
+&#x1E0D;x
+&#x1E0F;x
+&#x1E11;x
+&#x1E13;x
+&#x1E15;x
+&#x1E17;x
+&#x1E19;x
+&#x1E1B;x
+&#x1E1D;x
+&#x1E1F;x
+&#x1E21;x
+&#x1E23;x
+&#x1E25;x
+&#x1E27;x
+&#x1E29;x
+&#x1E2B;x
+&#x1E2D;x
+&#x1E2F;x
+&#x1E31;x
+&#x1E33;x
+&#x1E35;x
+&#x1E37;x
+&#x1E39;x
+&#x1E3B;x
+&#x1E3D;x
+&#x1E3F;x
+&#x1E41;x
+&#x1E43;x
+&#x1E45;x
+&#x1E47;x
+&#x1E49;x
+&#x1E4B;x
+&#x1E4D;x
+&#x1E4F;x
+&#x1E51;x
+&#x1E53;x
+&#x1E55;x
+&#x1E57;x
+&#x1E59;x
+&#x1E5B;x
+&#x1E5D;x
+&#x1E5F;x
+&#x1E61;x
+&#x1E63;x
+&#x1E65;x
+&#x1E67;x
+&#x1E69;x
+&#x1E6B;x
+&#x1E6D;x
+&#x1E6F;x
+&#x1E71;x
+&#x1E73;x
+&#x1E75;x
+&#x1E77;x
+&#x1E79;x
+&#x1E7B;x
+&#x1E7D;x
+&#x1E7F;x
+&#x1E81;x
+&#x1E83;x
+&#x1E85;x
+&#x1E87;x
+&#x1E89;x
+&#x1E8B;x
+&#x1E8D;x
+&#x1E8F;x
+&#x1E91;x
+&#x1E93;x
+&#x1E95;x
+&#x1E96;x <!-- LATIN SMALL LETTER H WITH LINE BELOW -->
+&#x1E97;x <!-- LATIN SMALL LETTER T WITH DIAERESIS -->
+&#x1E98;x <!-- LATIN SMALL LETTER W WITH RING ABOVE -->
+&#x1E99;x <!-- LATIN SMALL LETTER Y WITH RING ABOVE -->
+&#x1E9A;x <!-- LATIN SMALL LETTER A WITH RIGHT HALF RING -->
+&#x1E9B;x
+&#x1EA1;x
+&#x1EA3;x
+&#x1EA5;x
+&#x1EA7;x
+&#x1EA9;x
+&#x1EAB;x
+&#x1EAD;x
+&#x1EAF;x
+&#x1EB1;x
+&#x1EB3;x
+&#x1EB5;x
+&#x1EB7;x
+&#x1EB9;x
+&#x1EBB;x
+&#x1EBD;x
+&#x1EBF;x
+&#x1EC1;x
+&#x1EC3;x
+&#x1EC5;x
+&#x1EC7;x
+&#x1EC9;x
+&#x1ECB;x
+&#x1ECD;x
+&#x1ECF;x
+&#x1ED1;x
+&#x1ED3;x
+&#x1ED5;x
+&#x1ED7;x
+&#x1ED9;x
+&#x1EDB;x
+&#x1EDD;x
+&#x1EDF;x
+&#x1EE1;x
+&#x1EE3;x
+&#x1EE5;x
+&#x1EE7;x
+&#x1EE9;x
+&#x1EEB;x
+&#x1EED;x
+&#x1EEF;x
+&#x1EF1;x
+&#x1EF3;x
+&#x1EF5;x
+&#x1EF7;x
+&#x1EF9;x
+&#x1EFB;x
+&#x1EFD;x
+&#x1EFF;x
+&#x1F00;x
+&#x1F01;x
+&#x1F02;x
+&#x1F03;x
+&#x1F04;x
+&#x1F05;x
+&#x1F06;x
+&#x1F07;x
+&#x1F10;x
+&#x1F11;x
+&#x1F12;x
+&#x1F13;x
+&#x1F14;x
+&#x1F15;x
+&#x1F20;x
+&#x1F21;x
+&#x1F22;x
+&#x1F23;x
+&#x1F24;x
+&#x1F25;x
+&#x1F26;x
+&#x1F27;x
+&#x1F30;x
+&#x1F31;x
+&#x1F32;x
+&#x1F33;x
+&#x1F34;x
+&#x1F35;x
+&#x1F36;x
+&#x1F37;x
+&#x1F40;x
+&#x1F41;x
+&#x1F42;x
+&#x1F43;x
+&#x1F44;x
+&#x1F45;x
+&#x1F50;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI -->
+&#x1F51;x
+&#x1F52;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA -->
+&#x1F53;x
+&#x1F54;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA -->
+&#x1F55;x
+&#x1F56;x <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI -->
+&#x1F57;x
+&#x1F60;x
+&#x1F61;x
+&#x1F62;x
+&#x1F63;x
+&#x1F64;x
+&#x1F65;x
+&#x1F66;x
+&#x1F67;x
+&#x1F70;x
+&#x1F71;x
+&#x1F72;x
+&#x1F73;x
+&#x1F74;x
+&#x1F75;x
+&#x1F76;x
+&#x1F77;x
+&#x1F78;x
+&#x1F79;x
+&#x1F7A;x
+&#x1F7B;x
+&#x1F7C;x
+&#x1F7D;x
+&#x1F80;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F81;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F82;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F83;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F84;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F85;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F86;x <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F87;x <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F90;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F91;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F92;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F93;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F94;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F95;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F96;x <!-- GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F97;x <!-- GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FA0;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1FA1;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1FA2;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1FA3;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1FA4;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1FA5;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1FA6;x <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FA7;x <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FB0;x
+&#x1FB1;x
+&#x1FB2;x <!-- GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FB3;x <!-- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI -->
+&#x1FB4;x <!-- GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FB6;x <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI -->
+&#x1FB7;x <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FBE;x
+&#x1FC2;x <!-- GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FC3;x <!-- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI -->
+&#x1FC4;x <!-- GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FC6;x <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI -->
+&#x1FC7;x <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FD0;x
+&#x1FD1;x
+&#x1FD2;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA -->
+&#x1FD3;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA -->
+&#x1FD6;x <!-- GREEK SMALL LETTER IOTA WITH PERISPOMENI -->
+&#x1FD7;x <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FE0;x
+&#x1FE1;x
+&#x1FE2;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA -->
+&#x1FE3;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA -->
+&#x1FE4;x <!-- GREEK SMALL LETTER RHO WITH PSILI -->
+&#x1FE5;x
+&#x1FE6;x <!-- GREEK SMALL LETTER UPSILON WITH PERISPOMENI -->
+&#x1FE7;x <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FF2;x <!-- GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FF3;x <!-- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI -->
+&#x1FF4;x <!-- GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FF6;x <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI -->
+&#x1FF7;x <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x214E;x
+&#x2170;x
+&#x2171;x
+&#x2172;x
+&#x2173;x
+&#x2174;x
+&#x2175;x
+&#x2176;x
+&#x2177;x
+&#x2178;x
+&#x2179;x
+&#x217A;x
+&#x217B;x
+&#x217C;x
+&#x217D;x
+&#x217E;x
+&#x217F;x
+&#x2184;x
+&#x24D0;x
+&#x24D1;x
+&#x24D2;x
+&#x24D3;x
+&#x24D4;x
+&#x24D5;x
+&#x24D6;x
+&#x24D7;x
+&#x24D8;x
+&#x24D9;x
+&#x24DA;x
+&#x24DB;x
+&#x24DC;x
+&#x24DD;x
+&#x24DE;x
+&#x24DF;x
+&#x24E0;x
+&#x24E1;x
+&#x24E2;x
+&#x24E3;x
+&#x24E4;x
+&#x24E5;x
+&#x24E6;x
+&#x24E7;x
+&#x24E8;x
+&#x24E9;x
+&#x2C30;x
+&#x2C31;x
+&#x2C32;x
+&#x2C33;x
+&#x2C34;x
+&#x2C35;x
+&#x2C36;x
+&#x2C37;x
+&#x2C38;x
+&#x2C39;x
+&#x2C3A;x
+&#x2C3B;x
+&#x2C3C;x
+&#x2C3D;x
+&#x2C3E;x
+&#x2C3F;x
+&#x2C40;x
+&#x2C41;x
+&#x2C42;x
+&#x2C43;x
+&#x2C44;x
+&#x2C45;x
+&#x2C46;x
+&#x2C47;x
+&#x2C48;x
+&#x2C49;x
+&#x2C4A;x
+&#x2C4B;x
+&#x2C4C;x
+&#x2C4D;x
+&#x2C4E;x
+&#x2C4F;x
+&#x2C50;x
+&#x2C51;x
+&#x2C52;x
+&#x2C53;x
+&#x2C54;x
+&#x2C55;x
+&#x2C56;x
+&#x2C57;x
+&#x2C58;x
+&#x2C59;x
+&#x2C5A;x
+&#x2C5B;x
+&#x2C5C;x
+&#x2C5D;x
+&#x2C5E;x
+&#x2C5F;x
+&#x2C61;x
+&#x2C65;x
+&#x2C66;x
+&#x2C68;x
+&#x2C6A;x
+&#x2C6C;x
+&#x2C73;x
+&#x2C76;x
+&#x2C81;x
+&#x2C83;x
+&#x2C85;x
+&#x2C87;x
+&#x2C89;x
+&#x2C8B;x
+&#x2C8D;x
+&#x2C8F;x
+&#x2C91;x
+&#x2C93;x
+&#x2C95;x
+&#x2C97;x
+&#x2C99;x
+&#x2C9B;x
+&#x2C9D;x
+&#x2C9F;x
+&#x2CA1;x
+&#x2CA3;x
+&#x2CA5;x
+&#x2CA7;x
+&#x2CA9;x
+&#x2CAB;x
+&#x2CAD;x
+&#x2CAF;x
+&#x2CB1;x
+&#x2CB3;x
+&#x2CB5;x
+&#x2CB7;x
+&#x2CB9;x
+&#x2CBB;x
+&#x2CBD;x
+&#x2CBF;x
+&#x2CC1;x
+&#x2CC3;x
+&#x2CC5;x
+&#x2CC7;x
+&#x2CC9;x
+&#x2CCB;x
+&#x2CCD;x
+&#x2CCF;x
+&#x2CD1;x
+&#x2CD3;x
+&#x2CD5;x
+&#x2CD7;x
+&#x2CD9;x
+&#x2CDB;x
+&#x2CDD;x
+&#x2CDF;x
+&#x2CE1;x
+&#x2CE3;x
+&#x2CEC;x
+&#x2CEE;x
+&#x2CF3;x
+&#x2D00;x
+&#x2D01;x
+&#x2D02;x
+&#x2D03;x
+&#x2D04;x
+&#x2D05;x
+&#x2D06;x
+&#x2D07;x
+&#x2D08;x
+&#x2D09;x
+&#x2D0A;x
+&#x2D0B;x
+&#x2D0C;x
+&#x2D0D;x
+&#x2D0E;x
+&#x2D0F;x
+&#x2D10;x
+&#x2D11;x
+&#x2D12;x
+&#x2D13;x
+&#x2D14;x
+&#x2D15;x
+&#x2D16;x
+&#x2D17;x
+&#x2D18;x
+&#x2D19;x
+&#x2D1A;x
+&#x2D1B;x
+&#x2D1C;x
+&#x2D1D;x
+&#x2D1E;x
+&#x2D1F;x
+&#x2D20;x
+&#x2D21;x
+&#x2D22;x
+&#x2D23;x
+&#x2D24;x
+&#x2D25;x
+&#x2D27;x
+&#x2D2D;x
+&#xA641;x
+&#xA643;x
+&#xA645;x
+&#xA647;x
+&#xA649;x
+&#xA64B;x
+&#xA64D;x
+&#xA64F;x
+&#xA651;x
+&#xA653;x
+&#xA655;x
+&#xA657;x
+&#xA659;x
+&#xA65B;x
+&#xA65D;x
+&#xA65F;x
+&#xA661;x
+&#xA663;x
+&#xA665;x
+&#xA667;x
+&#xA669;x
+&#xA66B;x
+&#xA66D;x
+&#xA681;x
+&#xA683;x
+&#xA685;x
+&#xA687;x
+&#xA689;x
+&#xA68B;x
+&#xA68D;x
+&#xA68F;x
+&#xA691;x
+&#xA693;x
+&#xA695;x
+&#xA697;x
+&#xA699;x
+&#xA69B;x
+&#xA723;x
+&#xA725;x
+&#xA727;x
+&#xA729;x
+&#xA72B;x
+&#xA72D;x
+&#xA72F;x
+&#xA733;x
+&#xA735;x
+&#xA737;x
+&#xA739;x
+&#xA73B;x
+&#xA73D;x
+&#xA73F;x
+&#xA741;x
+&#xA743;x
+&#xA745;x
+&#xA747;x
+&#xA749;x
+&#xA74B;x
+&#xA74D;x
+&#xA74F;x
+&#xA751;x
+&#xA753;x
+&#xA755;x
+&#xA757;x
+&#xA759;x
+&#xA75B;x
+&#xA75D;x
+&#xA75F;x
+&#xA761;x
+&#xA763;x
+&#xA765;x
+&#xA767;x
+&#xA769;x
+&#xA76B;x
+&#xA76D;x
+&#xA76F;x
+&#xA77A;x
+&#xA77C;x
+&#xA77F;x
+&#xA781;x
+&#xA783;x
+&#xA785;x
+&#xA787;x
+&#xA78C;x
+&#xA791;x
+&#xA793;x
+&#xA794;x
+&#xA797;x
+&#xA799;x
+&#xA79B;x
+&#xA79D;x
+&#xA79F;x
+&#xA7A1;x
+&#xA7A3;x
+&#xA7A5;x
+&#xA7A7;x
+&#xA7A9;x
+&#xA7B5;x
+&#xA7B7;x
+&#xA7B9;x
+&#xA7BB;x
+&#xA7BD;x
+&#xA7BF;x
+&#xA7C1;x
+&#xA7C3;x
+&#xA7C8;x
+&#xA7CA;x
+&#xA7D1;x
+&#xA7D7;x
+&#xA7D9;x
+&#xA7F6;x
+&#xAB53;x
+&#xAB70;x
+&#xAB71;x
+&#xAB72;x
+&#xAB73;x
+&#xAB74;x
+&#xAB75;x
+&#xAB76;x
+&#xAB77;x
+&#xAB78;x
+&#xAB79;x
+&#xAB7A;x
+&#xAB7B;x
+&#xAB7C;x
+&#xAB7D;x
+&#xAB7E;x
+&#xAB7F;x
+&#xAB80;x
+&#xAB81;x
+&#xAB82;x
+&#xAB83;x
+&#xAB84;x
+&#xAB85;x
+&#xAB86;x
+&#xAB87;x
+&#xAB88;x
+&#xAB89;x
+&#xAB8A;x
+&#xAB8B;x
+&#xAB8C;x
+&#xAB8D;x
+&#xAB8E;x
+&#xAB8F;x
+&#xAB90;x
+&#xAB91;x
+&#xAB92;x
+&#xAB93;x
+&#xAB94;x
+&#xAB95;x
+&#xAB96;x
+&#xAB97;x
+&#xAB98;x
+&#xAB99;x
+&#xAB9A;x
+&#xAB9B;x
+&#xAB9C;x
+&#xAB9D;x
+&#xAB9E;x
+&#xAB9F;x
+&#xABA0;x
+&#xABA1;x
+&#xABA2;x
+&#xABA3;x
+&#xABA4;x
+&#xABA5;x
+&#xABA6;x
+&#xABA7;x
+&#xABA8;x
+&#xABA9;x
+&#xABAA;x
+&#xABAB;x
+&#xABAC;x
+&#xABAD;x
+&#xABAE;x
+&#xABAF;x
+&#xABB0;x
+&#xABB1;x
+&#xABB2;x
+&#xABB3;x
+&#xABB4;x
+&#xABB5;x
+&#xABB6;x
+&#xABB7;x
+&#xABB8;x
+&#xABB9;x
+&#xABBA;x
+&#xABBB;x
+&#xABBC;x
+&#xABBD;x
+&#xABBE;x
+&#xABBF;x
+&#xFB00;x <!-- LATIN SMALL LIGATURE FF -->
+&#xFB01;x <!-- LATIN SMALL LIGATURE FI -->
+&#xFB02;x <!-- LATIN SMALL LIGATURE FL -->
+&#xFB03;x <!-- LATIN SMALL LIGATURE FFI -->
+&#xFB04;x <!-- LATIN SMALL LIGATURE FFL -->
+&#xFB05;x <!-- LATIN SMALL LIGATURE LONG S T -->
+&#xFB06;x <!-- LATIN SMALL LIGATURE ST -->
+&#xFB13;x <!-- ARMENIAN SMALL LIGATURE MEN NOW -->
+&#xFB14;x <!-- ARMENIAN SMALL LIGATURE MEN ECH -->
+&#xFB15;x <!-- ARMENIAN SMALL LIGATURE MEN INI -->
+&#xFB16;x <!-- ARMENIAN SMALL LIGATURE VEW NOW -->
+&#xFB17;x <!-- ARMENIAN SMALL LIGATURE MEN XEH -->
+&#xFF41;x
+&#xFF42;x
+&#xFF43;x
+&#xFF44;x
+&#xFF45;x
+&#xFF46;x
+&#xFF47;x
+&#xFF48;x
+&#xFF49;x
+&#xFF4A;x
+&#xFF4B;x
+&#xFF4C;x
+&#xFF4D;x
+&#xFF4E;x
+&#xFF4F;x
+&#xFF50;x
+&#xFF51;x
+&#xFF52;x
+&#xFF53;x
+&#xFF54;x
+&#xFF55;x
+&#xFF56;x
+&#xFF57;x
+&#xFF58;x
+&#xFF59;x
+&#xFF5A;x
+&#x10428;x
+&#x10429;x
+&#x1042A;x
+&#x1042B;x
+&#x1042C;x
+&#x1042D;x
+&#x1042E;x
+&#x1042F;x
+&#x10430;x
+&#x10431;x
+&#x10432;x
+&#x10433;x
+&#x10434;x
+&#x10435;x
+&#x10436;x
+&#x10437;x
+&#x10438;x
+&#x10439;x
+&#x1043A;x
+&#x1043B;x
+&#x1043C;x
+&#x1043D;x
+&#x1043E;x
+&#x1043F;x
+&#x10440;x
+&#x10441;x
+&#x10442;x
+&#x10443;x
+&#x10444;x
+&#x10445;x
+&#x10446;x
+&#x10447;x
+&#x10448;x
+&#x10449;x
+&#x1044A;x
+&#x1044B;x
+&#x1044C;x
+&#x1044D;x
+&#x1044E;x
+&#x1044F;x
+&#x104D8;x
+&#x104D9;x
+&#x104DA;x
+&#x104DB;x
+&#x104DC;x
+&#x104DD;x
+&#x104DE;x
+&#x104DF;x
+&#x104E0;x
+&#x104E1;x
+&#x104E2;x
+&#x104E3;x
+&#x104E4;x
+&#x104E5;x
+&#x104E6;x
+&#x104E7;x
+&#x104E8;x
+&#x104E9;x
+&#x104EA;x
+&#x104EB;x
+&#x104EC;x
+&#x104ED;x
+&#x104EE;x
+&#x104EF;x
+&#x104F0;x
+&#x104F1;x
+&#x104F2;x
+&#x104F3;x
+&#x104F4;x
+&#x104F5;x
+&#x104F6;x
+&#x104F7;x
+&#x104F8;x
+&#x104F9;x
+&#x104FA;x
+&#x104FB;x
+&#x10597;x
+&#x10598;x
+&#x10599;x
+&#x1059A;x
+&#x1059B;x
+&#x1059C;x
+&#x1059D;x
+&#x1059E;x
+&#x1059F;x
+&#x105A0;x
+&#x105A1;x
+&#x105A3;x
+&#x105A4;x
+&#x105A5;x
+&#x105A6;x
+&#x105A7;x
+&#x105A8;x
+&#x105A9;x
+&#x105AA;x
+&#x105AB;x
+&#x105AC;x
+&#x105AD;x
+&#x105AE;x
+&#x105AF;x
+&#x105B0;x
+&#x105B1;x
+&#x105B3;x
+&#x105B4;x
+&#x105B5;x
+&#x105B6;x
+&#x105B7;x
+&#x105B8;x
+&#x105B9;x
+&#x105BB;x
+&#x105BC;x
+&#x10CC0;x
+&#x10CC1;x
+&#x10CC2;x
+&#x10CC3;x
+&#x10CC4;x
+&#x10CC5;x
+&#x10CC6;x
+&#x10CC7;x
+&#x10CC8;x
+&#x10CC9;x
+&#x10CCA;x
+&#x10CCB;x
+&#x10CCC;x
+&#x10CCD;x
+&#x10CCE;x
+&#x10CCF;x
+&#x10CD0;x
+&#x10CD1;x
+&#x10CD2;x
+&#x10CD3;x
+&#x10CD4;x
+&#x10CD5;x
+&#x10CD6;x
+&#x10CD7;x
+&#x10CD8;x
+&#x10CD9;x
+&#x10CDA;x
+&#x10CDB;x
+&#x10CDC;x
+&#x10CDD;x
+&#x10CDE;x
+&#x10CDF;x
+&#x10CE0;x
+&#x10CE1;x
+&#x10CE2;x
+&#x10CE3;x
+&#x10CE4;x
+&#x10CE5;x
+&#x10CE6;x
+&#x10CE7;x
+&#x10CE8;x
+&#x10CE9;x
+&#x10CEA;x
+&#x10CEB;x
+&#x10CEC;x
+&#x10CED;x
+&#x10CEE;x
+&#x10CEF;x
+&#x10CF0;x
+&#x10CF1;x
+&#x10CF2;x
+&#x118C0;x
+&#x118C1;x
+&#x118C2;x
+&#x118C3;x
+&#x118C4;x
+&#x118C5;x
+&#x118C6;x
+&#x118C7;x
+&#x118C8;x
+&#x118C9;x
+&#x118CA;x
+&#x118CB;x
+&#x118CC;x
+&#x118CD;x
+&#x118CE;x
+&#x118CF;x
+&#x118D0;x
+&#x118D1;x
+&#x118D2;x
+&#x118D3;x
+&#x118D4;x
+&#x118D5;x
+&#x118D6;x
+&#x118D7;x
+&#x118D8;x
+&#x118D9;x
+&#x118DA;x
+&#x118DB;x
+&#x118DC;x
+&#x118DD;x
+&#x118DE;x
+&#x118DF;x
+&#x16E60;x
+&#x16E61;x
+&#x16E62;x
+&#x16E63;x
+&#x16E64;x
+&#x16E65;x
+&#x16E66;x
+&#x16E67;x
+&#x16E68;x
+&#x16E69;x
+&#x16E6A;x
+&#x16E6B;x
+&#x16E6C;x
+&#x16E6D;x
+&#x16E6E;x
+&#x16E6F;x
+&#x16E70;x
+&#x16E71;x
+&#x16E72;x
+&#x16E73;x
+&#x16E74;x
+&#x16E75;x
+&#x16E76;x
+&#x16E77;x
+&#x16E78;x
+&#x16E79;x
+&#x16E7A;x
+&#x16E7B;x
+&#x16E7C;x
+&#x16E7D;x
+&#x16E7E;x
+&#x16E7F;x
+&#x1E922;x
+&#x1E923;x
+&#x1E924;x
+&#x1E925;x
+&#x1E926;x
+&#x1E927;x
+&#x1E928;x
+&#x1E929;x
+&#x1E92A;x
+&#x1E92B;x
+&#x1E92C;x
+&#x1E92D;x
+&#x1E92E;x
+&#x1E92F;x
+&#x1E930;x
+&#x1E931;x
+&#x1E932;x
+&#x1E933;x
+&#x1E934;x
+&#x1E935;x
+&#x1E936;x
+&#x1E937;x
+&#x1E938;x
+&#x1E939;x
+&#x1E93A;x
+&#x1E93B;x
+&#x1E93C;x
+&#x1E93D;x
+&#x1E93E;x
+&#x1E93F;x
+&#x1E940;x
+&#x1E941;x
+&#x1E942;x
+&#x1E943;x
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/all-upper-ref.html b/layout/reftests/text-transform/all-upper-ref.html
new file mode 100644
index 0000000000..c7158cf88b
--- /dev/null
+++ b/layout/reftests/text-transform/all-upper-ref.html
@@ -0,0 +1,1540 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; font-size: 12px; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0041;
+&#x0042;
+&#x0043;
+&#x0044;
+&#x0045;
+&#x0046;
+&#x0047;
+&#x0048;
+&#x0049;
+&#x004A;
+&#x004B;
+&#x004C;
+&#x004D;
+&#x004E;
+&#x004F;
+&#x0050;
+&#x0051;
+&#x0052;
+&#x0053;
+&#x0054;
+&#x0055;
+&#x0056;
+&#x0057;
+&#x0058;
+&#x0059;
+&#x005A;
+&#x039C;
+&#x0053;&#x0053; <!-- LATIN SMALL LETTER SHARP S -->
+&#x00C0;
+&#x00C1;
+&#x00C2;
+&#x00C3;
+&#x00C4;
+&#x00C5;
+&#x00C6;
+&#x00C7;
+&#x00C8;
+&#x00C9;
+&#x00CA;
+&#x00CB;
+&#x00CC;
+&#x00CD;
+&#x00CE;
+&#x00CF;
+&#x00D0;
+&#x00D1;
+&#x00D2;
+&#x00D3;
+&#x00D4;
+&#x00D5;
+&#x00D6;
+&#x00D8;
+&#x00D9;
+&#x00DA;
+&#x00DB;
+&#x00DC;
+&#x00DD;
+&#x00DE;
+&#x0178;
+&#x0100;
+&#x0102;
+&#x0104;
+&#x0106;
+&#x0108;
+&#x010A;
+&#x010C;
+&#x010E;
+&#x0110;
+&#x0112;
+&#x0114;
+&#x0116;
+&#x0118;
+&#x011A;
+&#x011C;
+&#x011E;
+&#x0120;
+&#x0122;
+&#x0124;
+&#x0126;
+&#x0128;
+&#x012A;
+&#x012C;
+&#x012E;
+&#x0049;
+&#x0132;
+&#x0134;
+&#x0136;
+&#x0139;
+&#x013B;
+&#x013D;
+&#x013F;
+&#x0141;
+&#x0143;
+&#x0145;
+&#x0147;
+&#x02BC;&#x004E; <!-- LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -->
+&#x014A;
+&#x014C;
+&#x014E;
+&#x0150;
+&#x0152;
+&#x0154;
+&#x0156;
+&#x0158;
+&#x015A;
+&#x015C;
+&#x015E;
+&#x0160;
+&#x0162;
+&#x0164;
+&#x0166;
+&#x0168;
+&#x016A;
+&#x016C;
+&#x016E;
+&#x0170;
+&#x0172;
+&#x0174;
+&#x0176;
+&#x0179;
+&#x017B;
+&#x017D;
+&#x0053;
+&#x0243;
+&#x0182;
+&#x0184;
+&#x0187;
+&#x018B;
+&#x0191;
+&#x01F6;
+&#x0198;
+&#x023D;
+&#x0220;
+&#x01A0;
+&#x01A2;
+&#x01A4;
+&#x01A7;
+&#x01AC;
+&#x01AF;
+&#x01B3;
+&#x01B5;
+&#x01B8;
+&#x01BC;
+&#x01F7;
+&#x01C4;
+&#x01C4;
+&#x01C7;
+&#x01C7;
+&#x01CA;
+&#x01CA;
+&#x01CD;
+&#x01CF;
+&#x01D1;
+&#x01D3;
+&#x01D5;
+&#x01D7;
+&#x01D9;
+&#x01DB;
+&#x018E;
+&#x01DE;
+&#x01E0;
+&#x01E2;
+&#x01E4;
+&#x01E6;
+&#x01E8;
+&#x01EA;
+&#x01EC;
+&#x01EE;
+&#x004A;&#x030C; <!-- LATIN SMALL LETTER J WITH CARON -->
+&#x01F1;
+&#x01F1;
+&#x01F4;
+&#x01F8;
+&#x01FA;
+&#x01FC;
+&#x01FE;
+&#x0200;
+&#x0202;
+&#x0204;
+&#x0206;
+&#x0208;
+&#x020A;
+&#x020C;
+&#x020E;
+&#x0210;
+&#x0212;
+&#x0214;
+&#x0216;
+&#x0218;
+&#x021A;
+&#x021C;
+&#x021E;
+&#x0222;
+&#x0224;
+&#x0226;
+&#x0228;
+&#x022A;
+&#x022C;
+&#x022E;
+&#x0230;
+&#x0232;
+&#x023B;
+&#x2C7E;
+&#x2C7F;
+&#x0241;
+&#x0246;
+&#x0248;
+&#x024A;
+&#x024C;
+&#x024E;
+&#x2C6F;
+&#x2C6D;
+&#x2C70;
+&#x0181;
+&#x0186;
+&#x0189;
+&#x018A;
+&#x018F;
+&#x0190;
+&#xA7AB;
+&#x0193;
+&#xA7AC;
+&#x0194;
+&#xA78D;
+&#xA7AA;
+&#x0197;
+&#x0196;
+&#xA7AE;
+&#x2C62;
+&#xA7AD;
+&#x019C;
+&#x2C6E;
+&#x019D;
+&#x019F;
+&#x2C64;
+&#x01A6;
+&#xA7C5;
+&#x01A9;
+&#xA7B1;
+&#x01AE;
+&#x0244;
+&#x01B1;
+&#x01B2;
+&#x0245;
+&#x01B7;
+&#xA7B2;
+&#xA7B0;
+&#x0399;
+&#x0370;
+&#x0372;
+&#x0376;
+&#x03FD;
+&#x03FE;
+&#x03FF;
+&#x03AA;&#x0301; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -->
+&#x0386;
+&#x0388;
+&#x0389;
+&#x038A;
+&#x03AB;&#x0301; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -->
+&#x0391;
+&#x0392;
+&#x0393;
+&#x0394;
+&#x0395;
+&#x0396;
+&#x0397;
+&#x0398;
+&#x0399;
+&#x039A;
+&#x039B;
+&#x039C;
+&#x039D;
+&#x039E;
+&#x039F;
+&#x03A0;
+&#x03A1;
+&#x03A3;
+&#x03A3;
+&#x03A4;
+&#x03A5;
+&#x03A6;
+&#x03A7;
+&#x03A8;
+&#x03A9;
+&#x03AA;
+&#x03AB;
+&#x038C;
+&#x038E;
+&#x038F;
+&#x0392;
+&#x0398;
+&#x03A6;
+&#x03A0;
+&#x03CF;
+&#x03D8;
+&#x03DA;
+&#x03DC;
+&#x03DE;
+&#x03E0;
+&#x03E2;
+&#x03E4;
+&#x03E6;
+&#x03E8;
+&#x03EA;
+&#x03EC;
+&#x03EE;
+&#x039A;
+&#x03A1;
+&#x03F9;
+&#x037F;
+&#x0395;
+&#x03F7;
+&#x03FA;
+&#x0410;
+&#x0411;
+&#x0412;
+&#x0413;
+&#x0414;
+&#x0415;
+&#x0416;
+&#x0417;
+&#x0418;
+&#x0419;
+&#x041A;
+&#x041B;
+&#x041C;
+&#x041D;
+&#x041E;
+&#x041F;
+&#x0420;
+&#x0421;
+&#x0422;
+&#x0423;
+&#x0424;
+&#x0425;
+&#x0426;
+&#x0427;
+&#x0428;
+&#x0429;
+&#x042A;
+&#x042B;
+&#x042C;
+&#x042D;
+&#x042E;
+&#x042F;
+&#x0400;
+&#x0401;
+&#x0402;
+&#x0403;
+&#x0404;
+&#x0405;
+&#x0406;
+&#x0407;
+&#x0408;
+&#x0409;
+&#x040A;
+&#x040B;
+&#x040C;
+&#x040D;
+&#x040E;
+&#x040F;
+&#x0460;
+&#x0462;
+&#x0464;
+&#x0466;
+&#x0468;
+&#x046A;
+&#x046C;
+&#x046E;
+&#x0470;
+&#x0472;
+&#x0474;
+&#x0476;
+&#x0478;
+&#x047A;
+&#x047C;
+&#x047E;
+&#x0480;
+&#x048A;
+&#x048C;
+&#x048E;
+&#x0490;
+&#x0492;
+&#x0494;
+&#x0496;
+&#x0498;
+&#x049A;
+&#x049C;
+&#x049E;
+&#x04A0;
+&#x04A2;
+&#x04A4;
+&#x04A6;
+&#x04A8;
+&#x04AA;
+&#x04AC;
+&#x04AE;
+&#x04B0;
+&#x04B2;
+&#x04B4;
+&#x04B6;
+&#x04B8;
+&#x04BA;
+&#x04BC;
+&#x04BE;
+&#x04C1;
+&#x04C3;
+&#x04C5;
+&#x04C7;
+&#x04C9;
+&#x04CB;
+&#x04CD;
+&#x04C0;
+&#x04D0;
+&#x04D2;
+&#x04D4;
+&#x04D6;
+&#x04D8;
+&#x04DA;
+&#x04DC;
+&#x04DE;
+&#x04E0;
+&#x04E2;
+&#x04E4;
+&#x04E6;
+&#x04E8;
+&#x04EA;
+&#x04EC;
+&#x04EE;
+&#x04F0;
+&#x04F2;
+&#x04F4;
+&#x04F6;
+&#x04F8;
+&#x04FA;
+&#x04FC;
+&#x04FE;
+&#x0500;
+&#x0502;
+&#x0504;
+&#x0506;
+&#x0508;
+&#x050A;
+&#x050C;
+&#x050E;
+&#x0510;
+&#x0512;
+&#x0514;
+&#x0516;
+&#x0518;
+&#x051A;
+&#x051C;
+&#x051E;
+&#x0520;
+&#x0522;
+&#x0524;
+&#x0526;
+&#x0528;
+&#x052A;
+&#x052C;
+&#x052E;
+&#x0531;
+&#x0532;
+&#x0533;
+&#x0534;
+&#x0535;
+&#x0536;
+&#x0537;
+&#x0538;
+&#x0539;
+&#x053A;
+&#x053B;
+&#x053C;
+&#x053D;
+&#x053E;
+&#x053F;
+&#x0540;
+&#x0541;
+&#x0542;
+&#x0543;
+&#x0544;
+&#x0545;
+&#x0546;
+&#x0547;
+&#x0548;
+&#x0549;
+&#x054A;
+&#x054B;
+&#x054C;
+&#x054D;
+&#x054E;
+&#x054F;
+&#x0550;
+&#x0551;
+&#x0552;
+&#x0553;
+&#x0554;
+&#x0555;
+&#x0556;
+&#x0535;&#x0552; <!-- ARMENIAN SMALL LIGATURE ECH YIWN -->
+<!-- &#x1C90; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C91; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C92; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C93; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C94; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C95; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C96; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C97; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C98; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C99; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9A; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9B; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9C; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9D; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9E; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1C9F; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA0; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA1; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA2; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA3; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA4; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA5; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA6; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA7; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA8; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CA9; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAA; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAB; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAC; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAD; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAE; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CAF; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB0; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB1; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB2; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB3; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB4; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB5; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB6; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB7; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB8; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CB9; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CBA; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CBD; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CBE; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x1CBF; --> <!-- Temporarily skipped, see bug 1476304. -->
+&#x13F0;
+&#x13F1;
+&#x13F2;
+&#x13F3;
+&#x13F4;
+&#x13F5;
+&#x0412;
+&#x0414;
+&#x041E;
+&#x0421;
+&#x0422;
+&#x0422;
+&#x042A;
+&#x0462;
+&#xA64A;
+&#xA77D;
+&#x2C63;
+&#xA7C6;
+&#x1E00;
+&#x1E02;
+&#x1E04;
+&#x1E06;
+&#x1E08;
+&#x1E0A;
+&#x1E0C;
+&#x1E0E;
+&#x1E10;
+&#x1E12;
+&#x1E14;
+&#x1E16;
+&#x1E18;
+&#x1E1A;
+&#x1E1C;
+&#x1E1E;
+&#x1E20;
+&#x1E22;
+&#x1E24;
+&#x1E26;
+&#x1E28;
+&#x1E2A;
+&#x1E2C;
+&#x1E2E;
+&#x1E30;
+&#x1E32;
+&#x1E34;
+&#x1E36;
+&#x1E38;
+&#x1E3A;
+&#x1E3C;
+&#x1E3E;
+&#x1E40;
+&#x1E42;
+&#x1E44;
+&#x1E46;
+&#x1E48;
+&#x1E4A;
+&#x1E4C;
+&#x1E4E;
+&#x1E50;
+&#x1E52;
+&#x1E54;
+&#x1E56;
+&#x1E58;
+&#x1E5A;
+&#x1E5C;
+&#x1E5E;
+&#x1E60;
+&#x1E62;
+&#x1E64;
+&#x1E66;
+&#x1E68;
+&#x1E6A;
+&#x1E6C;
+&#x1E6E;
+&#x1E70;
+&#x1E72;
+&#x1E74;
+&#x1E76;
+&#x1E78;
+&#x1E7A;
+&#x1E7C;
+&#x1E7E;
+&#x1E80;
+&#x1E82;
+&#x1E84;
+&#x1E86;
+&#x1E88;
+&#x1E8A;
+&#x1E8C;
+&#x1E8E;
+&#x1E90;
+&#x1E92;
+&#x1E94;
+&#x0048;&#x0331; <!-- LATIN SMALL LETTER H WITH LINE BELOW -->
+&#x0054;&#x0308; <!-- LATIN SMALL LETTER T WITH DIAERESIS -->
+&#x0057;&#x030A; <!-- LATIN SMALL LETTER W WITH RING ABOVE -->
+&#x0059;&#x030A; <!-- LATIN SMALL LETTER Y WITH RING ABOVE -->
+&#x0041;&#x02BE; <!-- LATIN SMALL LETTER A WITH RIGHT HALF RING -->
+&#x1E60;
+&#x1EA0;
+&#x1EA2;
+&#x1EA4;
+&#x1EA6;
+&#x1EA8;
+&#x1EAA;
+&#x1EAC;
+&#x1EAE;
+&#x1EB0;
+&#x1EB2;
+&#x1EB4;
+&#x1EB6;
+&#x1EB8;
+&#x1EBA;
+&#x1EBC;
+&#x1EBE;
+&#x1EC0;
+&#x1EC2;
+&#x1EC4;
+&#x1EC6;
+&#x1EC8;
+&#x1ECA;
+&#x1ECC;
+&#x1ECE;
+&#x1ED0;
+&#x1ED2;
+&#x1ED4;
+&#x1ED6;
+&#x1ED8;
+&#x1EDA;
+&#x1EDC;
+&#x1EDE;
+&#x1EE0;
+&#x1EE2;
+&#x1EE4;
+&#x1EE6;
+&#x1EE8;
+&#x1EEA;
+&#x1EEC;
+&#x1EEE;
+&#x1EF0;
+&#x1EF2;
+&#x1EF4;
+&#x1EF6;
+&#x1EF8;
+&#x1EFA;
+&#x1EFC;
+&#x1EFE;
+&#x1F08;
+&#x1F09;
+&#x1F0A;
+&#x1F0B;
+&#x1F0C;
+&#x1F0D;
+&#x1F0E;
+&#x1F0F;
+&#x1F18;
+&#x1F19;
+&#x1F1A;
+&#x1F1B;
+&#x1F1C;
+&#x1F1D;
+&#x1F28;
+&#x1F29;
+&#x1F2A;
+&#x1F2B;
+&#x1F2C;
+&#x1F2D;
+&#x1F2E;
+&#x1F2F;
+&#x1F38;
+&#x1F39;
+&#x1F3A;
+&#x1F3B;
+&#x1F3C;
+&#x1F3D;
+&#x1F3E;
+&#x1F3F;
+&#x1F48;
+&#x1F49;
+&#x1F4A;
+&#x1F4B;
+&#x1F4C;
+&#x1F4D;
+&#x03A5;&#x0313; <!-- GREEK SMALL LETTER UPSILON WITH PSILI -->
+&#x1F59;
+&#x03A5;&#x0313;&#x0300; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA -->
+&#x1F5B;
+&#x03A5;&#x0313;&#x0301; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA -->
+&#x1F5D;
+&#x03A5;&#x0313;&#x0342; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI -->
+&#x1F5F;
+&#x1F68;
+&#x1F69;
+&#x1F6A;
+&#x1F6B;
+&#x1F6C;
+&#x1F6D;
+&#x1F6E;
+&#x1F6F;
+&#x1FBA;
+&#x1FBB;
+&#x1FC8;
+&#x1FC9;
+&#x1FCA;
+&#x1FCB;
+&#x1FDA;
+&#x1FDB;
+&#x1FF8;
+&#x1FF9;
+&#x1FEA;
+&#x1FEB;
+&#x1FFA;
+&#x1FFB;
+&#x1F08;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F09;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F0A;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F0B;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F0C;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F0D;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F0E;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F0F;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F08;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F09;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F0A;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F0B;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F0C;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F0D;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F0E;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F0F;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F28;&#x0399; <!-- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F29;&#x0399; <!-- GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F2A;&#x0399; <!-- GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F2B;&#x0399; <!-- GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F2C;&#x0399; <!-- GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F2D;&#x0399; <!-- GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F2E;&#x0399; <!-- GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F2F;&#x0399; <!-- GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F28;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F29;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F2A;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F2B;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F2C;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F2D;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F2E;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F2F;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F68;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F69;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F6A;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F6B;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F6C;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F6D;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F6E;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F6F;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F68;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F69;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F6A;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F6B;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F6C;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F6D;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F6E;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F6F;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FB8;
+&#x1FB9;
+&#x1FBA;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI -->
+&#x0391;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI -->
+&#x0386;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI -->
+&#x0391;&#x0342; <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI -->
+&#x0391;&#x0342;&#x0399; <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x0391;&#x0399; <!-- GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI -->
+&#x0399;
+&#x1FCA;&#x0399; <!-- GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI -->
+&#x0397;&#x0399; <!-- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI -->
+&#x0389;&#x0399; <!-- GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI -->
+&#x0397;&#x0342; <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI -->
+&#x0397;&#x0342;&#x0399; <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x0397;&#x0399; <!-- GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI -->
+&#x1FD8;
+&#x1FD9;
+&#x03AA;&#x0300; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA -->
+&#x03AA;&#x0301; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA -->
+&#x0399;&#x0342; <!-- GREEK SMALL LETTER IOTA WITH PERISPOMENI -->
+&#x03AA;&#x0342; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FE8;
+&#x1FE9;
+&#x03AB;&#x0300; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA -->
+&#x03AB;&#x0301; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA -->
+&#x03A1;&#x0313; <!-- GREEK SMALL LETTER RHO WITH PSILI -->
+&#x1FEC;
+&#x03A5;&#x0342; <!-- GREEK SMALL LETTER UPSILON WITH PERISPOMENI -->
+&#x03AB;&#x0342; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FFA;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI -->
+&#x03A9;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI -->
+&#x038F;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI -->
+&#x03A9;&#x0342; <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI -->
+&#x03A9;&#x0342;&#x0399; <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x03A9;&#x0399; <!-- GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI -->
+&#x2132;
+&#x2160;
+&#x2161;
+&#x2162;
+&#x2163;
+&#x2164;
+&#x2165;
+&#x2166;
+&#x2167;
+&#x2168;
+&#x2169;
+&#x216A;
+&#x216B;
+&#x216C;
+&#x216D;
+&#x216E;
+&#x216F;
+&#x2183;
+&#x24B6;
+&#x24B7;
+&#x24B8;
+&#x24B9;
+&#x24BA;
+&#x24BB;
+&#x24BC;
+&#x24BD;
+&#x24BE;
+&#x24BF;
+&#x24C0;
+&#x24C1;
+&#x24C2;
+&#x24C3;
+&#x24C4;
+&#x24C5;
+&#x24C6;
+&#x24C7;
+&#x24C8;
+&#x24C9;
+&#x24CA;
+&#x24CB;
+&#x24CC;
+&#x24CD;
+&#x24CE;
+&#x24CF;
+&#x2C00;
+&#x2C01;
+&#x2C02;
+&#x2C03;
+&#x2C04;
+&#x2C05;
+&#x2C06;
+&#x2C07;
+&#x2C08;
+&#x2C09;
+&#x2C0A;
+&#x2C0B;
+&#x2C0C;
+&#x2C0D;
+&#x2C0E;
+&#x2C0F;
+&#x2C10;
+&#x2C11;
+&#x2C12;
+&#x2C13;
+&#x2C14;
+&#x2C15;
+&#x2C16;
+&#x2C17;
+&#x2C18;
+&#x2C19;
+&#x2C1A;
+&#x2C1B;
+&#x2C1C;
+&#x2C1D;
+&#x2C1E;
+&#x2C1F;
+&#x2C20;
+&#x2C21;
+&#x2C22;
+&#x2C23;
+&#x2C24;
+&#x2C25;
+&#x2C26;
+&#x2C27;
+&#x2C28;
+&#x2C29;
+&#x2C2A;
+&#x2C2B;
+&#x2C2C;
+&#x2C2D;
+&#x2C2E;
+&#x2C2F;
+&#x2C60;
+&#x023A;
+&#x023E;
+&#x2C67;
+&#x2C69;
+&#x2C6B;
+&#x2C72;
+&#x2C75;
+&#x2C80;
+&#x2C82;
+&#x2C84;
+&#x2C86;
+&#x2C88;
+&#x2C8A;
+&#x2C8C;
+&#x2C8E;
+&#x2C90;
+&#x2C92;
+&#x2C94;
+&#x2C96;
+&#x2C98;
+&#x2C9A;
+&#x2C9C;
+&#x2C9E;
+&#x2CA0;
+&#x2CA2;
+&#x2CA4;
+&#x2CA6;
+&#x2CA8;
+&#x2CAA;
+&#x2CAC;
+&#x2CAE;
+&#x2CB0;
+&#x2CB2;
+&#x2CB4;
+&#x2CB6;
+&#x2CB8;
+&#x2CBA;
+&#x2CBC;
+&#x2CBE;
+&#x2CC0;
+&#x2CC2;
+&#x2CC4;
+&#x2CC6;
+&#x2CC8;
+&#x2CCA;
+&#x2CCC;
+&#x2CCE;
+&#x2CD0;
+&#x2CD2;
+&#x2CD4;
+&#x2CD6;
+&#x2CD8;
+&#x2CDA;
+&#x2CDC;
+&#x2CDE;
+&#x2CE0;
+&#x2CE2;
+&#x2CEB;
+&#x2CED;
+&#x2CF2;
+&#x10A0;
+&#x10A1;
+&#x10A2;
+&#x10A3;
+&#x10A4;
+&#x10A5;
+&#x10A6;
+&#x10A7;
+&#x10A8;
+&#x10A9;
+&#x10AA;
+&#x10AB;
+&#x10AC;
+&#x10AD;
+&#x10AE;
+&#x10AF;
+&#x10B0;
+&#x10B1;
+&#x10B2;
+&#x10B3;
+&#x10B4;
+&#x10B5;
+&#x10B6;
+&#x10B7;
+&#x10B8;
+&#x10B9;
+&#x10BA;
+&#x10BB;
+&#x10BC;
+&#x10BD;
+&#x10BE;
+&#x10BF;
+&#x10C0;
+&#x10C1;
+&#x10C2;
+&#x10C3;
+&#x10C4;
+&#x10C5;
+&#x10C7;
+&#x10CD;
+&#xA640;
+&#xA642;
+&#xA644;
+&#xA646;
+&#xA648;
+&#xA64A;
+&#xA64C;
+&#xA64E;
+&#xA650;
+&#xA652;
+&#xA654;
+&#xA656;
+&#xA658;
+&#xA65A;
+&#xA65C;
+&#xA65E;
+&#xA660;
+&#xA662;
+&#xA664;
+&#xA666;
+&#xA668;
+&#xA66A;
+&#xA66C;
+&#xA680;
+&#xA682;
+&#xA684;
+&#xA686;
+&#xA688;
+&#xA68A;
+&#xA68C;
+&#xA68E;
+&#xA690;
+&#xA692;
+&#xA694;
+&#xA696;
+&#xA698;
+&#xA69A;
+&#xA722;
+&#xA724;
+&#xA726;
+&#xA728;
+&#xA72A;
+&#xA72C;
+&#xA72E;
+&#xA732;
+&#xA734;
+&#xA736;
+&#xA738;
+&#xA73A;
+&#xA73C;
+&#xA73E;
+&#xA740;
+&#xA742;
+&#xA744;
+&#xA746;
+&#xA748;
+&#xA74A;
+&#xA74C;
+&#xA74E;
+&#xA750;
+&#xA752;
+&#xA754;
+&#xA756;
+&#xA758;
+&#xA75A;
+&#xA75C;
+&#xA75E;
+&#xA760;
+&#xA762;
+&#xA764;
+&#xA766;
+&#xA768;
+&#xA76A;
+&#xA76C;
+&#xA76E;
+&#xA779;
+&#xA77B;
+&#xA77E;
+&#xA780;
+&#xA782;
+&#xA784;
+&#xA786;
+&#xA78B;
+&#xA790;
+&#xA792;
+&#xA7C4;
+&#xA796;
+&#xA798;
+&#xA79A;
+&#xA79C;
+&#xA79E;
+&#xA7A0;
+&#xA7A2;
+&#xA7A4;
+&#xA7A6;
+&#xA7A8;
+&#xA7B4;
+&#xA7B6;
+&#xA7B8;
+&#xA7BA;
+&#xA7BC;
+&#xA7BE;
+&#xA7C0;
+&#xA7C2;
+&#xA7C7;
+&#xA7C9;
+&#xA7D0;
+&#xA7D6;
+&#xA7D8;
+&#xA7F5;
+&#xA7B3;
+&#x13A0;
+&#x13A1;
+&#x13A2;
+&#x13A3;
+&#x13A4;
+&#x13A5;
+&#x13A6;
+&#x13A7;
+&#x13A8;
+&#x13A9;
+&#x13AA;
+&#x13AB;
+&#x13AC;
+&#x13AD;
+&#x13AE;
+&#x13AF;
+&#x13B0;
+&#x13B1;
+&#x13B2;
+&#x13B3;
+&#x13B4;
+&#x13B5;
+&#x13B6;
+&#x13B7;
+&#x13B8;
+&#x13B9;
+&#x13BA;
+&#x13BB;
+&#x13BC;
+&#x13BD;
+&#x13BE;
+&#x13BF;
+&#x13C0;
+&#x13C1;
+&#x13C2;
+&#x13C3;
+&#x13C4;
+&#x13C5;
+&#x13C6;
+&#x13C7;
+&#x13C8;
+&#x13C9;
+&#x13CA;
+&#x13CB;
+&#x13CC;
+&#x13CD;
+&#x13CE;
+&#x13CF;
+&#x13D0;
+&#x13D1;
+&#x13D2;
+&#x13D3;
+&#x13D4;
+&#x13D5;
+&#x13D6;
+&#x13D7;
+&#x13D8;
+&#x13D9;
+&#x13DA;
+&#x13DB;
+&#x13DC;
+&#x13DD;
+&#x13DE;
+&#x13DF;
+&#x13E0;
+&#x13E1;
+&#x13E2;
+&#x13E3;
+&#x13E4;
+&#x13E5;
+&#x13E6;
+&#x13E7;
+&#x13E8;
+&#x13E9;
+&#x13EA;
+&#x13EB;
+&#x13EC;
+&#x13ED;
+&#x13EE;
+&#x13EF;
+&#x0046;&#x0046; <!-- LATIN SMALL LIGATURE FF -->
+&#x0046;&#x0049; <!-- LATIN SMALL LIGATURE FI -->
+&#x0046;&#x004C; <!-- LATIN SMALL LIGATURE FL -->
+&#x0046;&#x0046;&#x0049; <!-- LATIN SMALL LIGATURE FFI -->
+&#x0046;&#x0046;&#x004C; <!-- LATIN SMALL LIGATURE FFL -->
+&#x0053;&#x0054; <!-- LATIN SMALL LIGATURE LONG S T -->
+&#x0053;&#x0054; <!-- LATIN SMALL LIGATURE ST -->
+&#x0544;&#x0546; <!-- ARMENIAN SMALL LIGATURE MEN NOW -->
+&#x0544;&#x0535; <!-- ARMENIAN SMALL LIGATURE MEN ECH -->
+&#x0544;&#x053B; <!-- ARMENIAN SMALL LIGATURE MEN INI -->
+&#x054E;&#x0546; <!-- ARMENIAN SMALL LIGATURE VEW NOW -->
+&#x0544;&#x053D; <!-- ARMENIAN SMALL LIGATURE MEN XEH -->
+&#xFF21;
+&#xFF22;
+&#xFF23;
+&#xFF24;
+&#xFF25;
+&#xFF26;
+&#xFF27;
+&#xFF28;
+&#xFF29;
+&#xFF2A;
+&#xFF2B;
+&#xFF2C;
+&#xFF2D;
+&#xFF2E;
+&#xFF2F;
+&#xFF30;
+&#xFF31;
+&#xFF32;
+&#xFF33;
+&#xFF34;
+&#xFF35;
+&#xFF36;
+&#xFF37;
+&#xFF38;
+&#xFF39;
+&#xFF3A;
+&#x10400;
+&#x10401;
+&#x10402;
+&#x10403;
+&#x10404;
+&#x10405;
+&#x10406;
+&#x10407;
+&#x10408;
+&#x10409;
+&#x1040A;
+&#x1040B;
+&#x1040C;
+&#x1040D;
+&#x1040E;
+&#x1040F;
+&#x10410;
+&#x10411;
+&#x10412;
+&#x10413;
+&#x10414;
+&#x10415;
+&#x10416;
+&#x10417;
+&#x10418;
+&#x10419;
+&#x1041A;
+&#x1041B;
+&#x1041C;
+&#x1041D;
+&#x1041E;
+&#x1041F;
+&#x10420;
+&#x10421;
+&#x10422;
+&#x10423;
+&#x10424;
+&#x10425;
+&#x10426;
+&#x10427;
+&#x104B0;
+&#x104B1;
+&#x104B2;
+&#x104B3;
+&#x104B4;
+&#x104B5;
+&#x104B6;
+&#x104B7;
+&#x104B8;
+&#x104B9;
+&#x104BA;
+&#x104BB;
+&#x104BC;
+&#x104BD;
+&#x104BE;
+&#x104BF;
+&#x104C0;
+&#x104C1;
+&#x104C2;
+&#x104C3;
+&#x104C4;
+&#x104C5;
+&#x104C6;
+&#x104C7;
+&#x104C8;
+&#x104C9;
+&#x104CA;
+&#x104CB;
+&#x104CC;
+&#x104CD;
+&#x104CE;
+&#x104CF;
+&#x104D0;
+&#x104D1;
+&#x104D2;
+&#x104D3;
+&#x10570;
+&#x10571;
+&#x10572;
+&#x10573;
+&#x10574;
+&#x10575;
+&#x10576;
+&#x10577;
+&#x10578;
+&#x10579;
+&#x1057A;
+&#x1057C;
+&#x1057D;
+&#x1057E;
+&#x1057F;
+&#x10580;
+&#x10581;
+&#x10582;
+&#x10583;
+&#x10584;
+&#x10585;
+&#x10586;
+&#x10587;
+&#x10588;
+&#x10589;
+&#x1058A;
+&#x1058C;
+&#x1058D;
+&#x1058E;
+&#x1058F;
+&#x10590;
+&#x10591;
+&#x10592;
+&#x10594;
+&#x10595;
+&#x10C80;
+&#x10C81;
+&#x10C82;
+&#x10C83;
+&#x10C84;
+&#x10C85;
+&#x10C86;
+&#x10C87;
+&#x10C88;
+&#x10C89;
+&#x10C8A;
+&#x10C8B;
+&#x10C8C;
+&#x10C8D;
+&#x10C8E;
+&#x10C8F;
+&#x10C90;
+&#x10C91;
+&#x10C92;
+&#x10C93;
+&#x10C94;
+&#x10C95;
+&#x10C96;
+&#x10C97;
+&#x10C98;
+&#x10C99;
+&#x10C9A;
+&#x10C9B;
+&#x10C9C;
+&#x10C9D;
+&#x10C9E;
+&#x10C9F;
+&#x10CA0;
+&#x10CA1;
+&#x10CA2;
+&#x10CA3;
+&#x10CA4;
+&#x10CA5;
+&#x10CA6;
+&#x10CA7;
+&#x10CA8;
+&#x10CA9;
+&#x10CAA;
+&#x10CAB;
+&#x10CAC;
+&#x10CAD;
+&#x10CAE;
+&#x10CAF;
+&#x10CB0;
+&#x10CB1;
+&#x10CB2;
+&#x118A0;
+&#x118A1;
+&#x118A2;
+&#x118A3;
+&#x118A4;
+&#x118A5;
+&#x118A6;
+&#x118A7;
+&#x118A8;
+&#x118A9;
+&#x118AA;
+&#x118AB;
+&#x118AC;
+&#x118AD;
+&#x118AE;
+&#x118AF;
+&#x118B0;
+&#x118B1;
+&#x118B2;
+&#x118B3;
+&#x118B4;
+&#x118B5;
+&#x118B6;
+&#x118B7;
+&#x118B8;
+&#x118B9;
+&#x118BA;
+&#x118BB;
+&#x118BC;
+&#x118BD;
+&#x118BE;
+&#x118BF;
+&#x16E40;
+&#x16E41;
+&#x16E42;
+&#x16E43;
+&#x16E44;
+&#x16E45;
+&#x16E46;
+&#x16E47;
+&#x16E48;
+&#x16E49;
+&#x16E4A;
+&#x16E4B;
+&#x16E4C;
+&#x16E4D;
+&#x16E4E;
+&#x16E4F;
+&#x16E50;
+&#x16E51;
+&#x16E52;
+&#x16E53;
+&#x16E54;
+&#x16E55;
+&#x16E56;
+&#x16E57;
+&#x16E58;
+&#x16E59;
+&#x16E5A;
+&#x16E5B;
+&#x16E5C;
+&#x16E5D;
+&#x16E5E;
+&#x16E5F;
+&#x1E900;
+&#x1E901;
+&#x1E902;
+&#x1E903;
+&#x1E904;
+&#x1E905;
+&#x1E906;
+&#x1E907;
+&#x1E908;
+&#x1E909;
+&#x1E90A;
+&#x1E90B;
+&#x1E90C;
+&#x1E90D;
+&#x1E90E;
+&#x1E90F;
+&#x1E910;
+&#x1E911;
+&#x1E912;
+&#x1E913;
+&#x1E914;
+&#x1E915;
+&#x1E916;
+&#x1E917;
+&#x1E918;
+&#x1E919;
+&#x1E91A;
+&#x1E91B;
+&#x1E91C;
+&#x1E91D;
+&#x1E91E;
+&#x1E91F;
+&#x1E920;
+&#x1E921;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/all-upper.html b/layout/reftests/text-transform/all-upper.html
new file mode 100644
index 0000000000..51e8b88b02
--- /dev/null
+++ b/layout/reftests/text-transform/all-upper.html
@@ -0,0 +1,1540 @@
+<!DOCTYPE html>
+<!-- GENERATED FILE, DO NOT EDIT -->
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ @font-face { font-family: foo; src: url(../fonts/dejavu-sans/DejaVuSans.ttf); }
+ p { font-family: foo; font-size: 12px; text-transform: uppercase; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x0061;
+&#x0062;
+&#x0063;
+&#x0064;
+&#x0065;
+&#x0066;
+&#x0067;
+&#x0068;
+&#x0069;
+&#x006A;
+&#x006B;
+&#x006C;
+&#x006D;
+&#x006E;
+&#x006F;
+&#x0070;
+&#x0071;
+&#x0072;
+&#x0073;
+&#x0074;
+&#x0075;
+&#x0076;
+&#x0077;
+&#x0078;
+&#x0079;
+&#x007A;
+&#x00B5;
+&#x00DF; <!-- LATIN SMALL LETTER SHARP S -->
+&#x00E0;
+&#x00E1;
+&#x00E2;
+&#x00E3;
+&#x00E4;
+&#x00E5;
+&#x00E6;
+&#x00E7;
+&#x00E8;
+&#x00E9;
+&#x00EA;
+&#x00EB;
+&#x00EC;
+&#x00ED;
+&#x00EE;
+&#x00EF;
+&#x00F0;
+&#x00F1;
+&#x00F2;
+&#x00F3;
+&#x00F4;
+&#x00F5;
+&#x00F6;
+&#x00F8;
+&#x00F9;
+&#x00FA;
+&#x00FB;
+&#x00FC;
+&#x00FD;
+&#x00FE;
+&#x00FF;
+&#x0101;
+&#x0103;
+&#x0105;
+&#x0107;
+&#x0109;
+&#x010B;
+&#x010D;
+&#x010F;
+&#x0111;
+&#x0113;
+&#x0115;
+&#x0117;
+&#x0119;
+&#x011B;
+&#x011D;
+&#x011F;
+&#x0121;
+&#x0123;
+&#x0125;
+&#x0127;
+&#x0129;
+&#x012B;
+&#x012D;
+&#x012F;
+&#x0131;
+&#x0133;
+&#x0135;
+&#x0137;
+&#x013A;
+&#x013C;
+&#x013E;
+&#x0140;
+&#x0142;
+&#x0144;
+&#x0146;
+&#x0148;
+&#x0149; <!-- LATIN SMALL LETTER N PRECEDED BY APOSTROPHE -->
+&#x014B;
+&#x014D;
+&#x014F;
+&#x0151;
+&#x0153;
+&#x0155;
+&#x0157;
+&#x0159;
+&#x015B;
+&#x015D;
+&#x015F;
+&#x0161;
+&#x0163;
+&#x0165;
+&#x0167;
+&#x0169;
+&#x016B;
+&#x016D;
+&#x016F;
+&#x0171;
+&#x0173;
+&#x0175;
+&#x0177;
+&#x017A;
+&#x017C;
+&#x017E;
+&#x017F;
+&#x0180;
+&#x0183;
+&#x0185;
+&#x0188;
+&#x018C;
+&#x0192;
+&#x0195;
+&#x0199;
+&#x019A;
+&#x019E;
+&#x01A1;
+&#x01A3;
+&#x01A5;
+&#x01A8;
+&#x01AD;
+&#x01B0;
+&#x01B4;
+&#x01B6;
+&#x01B9;
+&#x01BD;
+&#x01BF;
+&#x01C5;
+&#x01C6;
+&#x01C8;
+&#x01C9;
+&#x01CB;
+&#x01CC;
+&#x01CE;
+&#x01D0;
+&#x01D2;
+&#x01D4;
+&#x01D6;
+&#x01D8;
+&#x01DA;
+&#x01DC;
+&#x01DD;
+&#x01DF;
+&#x01E1;
+&#x01E3;
+&#x01E5;
+&#x01E7;
+&#x01E9;
+&#x01EB;
+&#x01ED;
+&#x01EF;
+&#x01F0; <!-- LATIN SMALL LETTER J WITH CARON -->
+&#x01F2;
+&#x01F3;
+&#x01F5;
+&#x01F9;
+&#x01FB;
+&#x01FD;
+&#x01FF;
+&#x0201;
+&#x0203;
+&#x0205;
+&#x0207;
+&#x0209;
+&#x020B;
+&#x020D;
+&#x020F;
+&#x0211;
+&#x0213;
+&#x0215;
+&#x0217;
+&#x0219;
+&#x021B;
+&#x021D;
+&#x021F;
+&#x0223;
+&#x0225;
+&#x0227;
+&#x0229;
+&#x022B;
+&#x022D;
+&#x022F;
+&#x0231;
+&#x0233;
+&#x023C;
+&#x023F;
+&#x0240;
+&#x0242;
+&#x0247;
+&#x0249;
+&#x024B;
+&#x024D;
+&#x024F;
+&#x0250;
+&#x0251;
+&#x0252;
+&#x0253;
+&#x0254;
+&#x0256;
+&#x0257;
+&#x0259;
+&#x025B;
+&#x025C;
+&#x0260;
+&#x0261;
+&#x0263;
+&#x0265;
+&#x0266;
+&#x0268;
+&#x0269;
+&#x026A;
+&#x026B;
+&#x026C;
+&#x026F;
+&#x0271;
+&#x0272;
+&#x0275;
+&#x027D;
+&#x0280;
+&#x0282;
+&#x0283;
+&#x0287;
+&#x0288;
+&#x0289;
+&#x028A;
+&#x028B;
+&#x028C;
+&#x0292;
+&#x029D;
+&#x029E;
+&#x0345;
+&#x0371;
+&#x0373;
+&#x0377;
+&#x037B;
+&#x037C;
+&#x037D;
+&#x0390; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS -->
+&#x03AC;
+&#x03AD;
+&#x03AE;
+&#x03AF;
+&#x03B0; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS -->
+&#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;
+&#x03CA;
+&#x03CB;
+&#x03CC;
+&#x03CD;
+&#x03CE;
+&#x03D0;
+&#x03D1;
+&#x03D5;
+&#x03D6;
+&#x03D7;
+&#x03D9;
+&#x03DB;
+&#x03DD;
+&#x03DF;
+&#x03E1;
+&#x03E3;
+&#x03E5;
+&#x03E7;
+&#x03E9;
+&#x03EB;
+&#x03ED;
+&#x03EF;
+&#x03F0;
+&#x03F1;
+&#x03F2;
+&#x03F3;
+&#x03F5;
+&#x03F8;
+&#x03FB;
+&#x0430;
+&#x0431;
+&#x0432;
+&#x0433;
+&#x0434;
+&#x0435;
+&#x0436;
+&#x0437;
+&#x0438;
+&#x0439;
+&#x043A;
+&#x043B;
+&#x043C;
+&#x043D;
+&#x043E;
+&#x043F;
+&#x0440;
+&#x0441;
+&#x0442;
+&#x0443;
+&#x0444;
+&#x0445;
+&#x0446;
+&#x0447;
+&#x0448;
+&#x0449;
+&#x044A;
+&#x044B;
+&#x044C;
+&#x044D;
+&#x044E;
+&#x044F;
+&#x0450;
+&#x0451;
+&#x0452;
+&#x0453;
+&#x0454;
+&#x0455;
+&#x0456;
+&#x0457;
+&#x0458;
+&#x0459;
+&#x045A;
+&#x045B;
+&#x045C;
+&#x045D;
+&#x045E;
+&#x045F;
+&#x0461;
+&#x0463;
+&#x0465;
+&#x0467;
+&#x0469;
+&#x046B;
+&#x046D;
+&#x046F;
+&#x0471;
+&#x0473;
+&#x0475;
+&#x0477;
+&#x0479;
+&#x047B;
+&#x047D;
+&#x047F;
+&#x0481;
+&#x048B;
+&#x048D;
+&#x048F;
+&#x0491;
+&#x0493;
+&#x0495;
+&#x0497;
+&#x0499;
+&#x049B;
+&#x049D;
+&#x049F;
+&#x04A1;
+&#x04A3;
+&#x04A5;
+&#x04A7;
+&#x04A9;
+&#x04AB;
+&#x04AD;
+&#x04AF;
+&#x04B1;
+&#x04B3;
+&#x04B5;
+&#x04B7;
+&#x04B9;
+&#x04BB;
+&#x04BD;
+&#x04BF;
+&#x04C2;
+&#x04C4;
+&#x04C6;
+&#x04C8;
+&#x04CA;
+&#x04CC;
+&#x04CE;
+&#x04CF;
+&#x04D1;
+&#x04D3;
+&#x04D5;
+&#x04D7;
+&#x04D9;
+&#x04DB;
+&#x04DD;
+&#x04DF;
+&#x04E1;
+&#x04E3;
+&#x04E5;
+&#x04E7;
+&#x04E9;
+&#x04EB;
+&#x04ED;
+&#x04EF;
+&#x04F1;
+&#x04F3;
+&#x04F5;
+&#x04F7;
+&#x04F9;
+&#x04FB;
+&#x04FD;
+&#x04FF;
+&#x0501;
+&#x0503;
+&#x0505;
+&#x0507;
+&#x0509;
+&#x050B;
+&#x050D;
+&#x050F;
+&#x0511;
+&#x0513;
+&#x0515;
+&#x0517;
+&#x0519;
+&#x051B;
+&#x051D;
+&#x051F;
+&#x0521;
+&#x0523;
+&#x0525;
+&#x0527;
+&#x0529;
+&#x052B;
+&#x052D;
+&#x052F;
+&#x0561;
+&#x0562;
+&#x0563;
+&#x0564;
+&#x0565;
+&#x0566;
+&#x0567;
+&#x0568;
+&#x0569;
+&#x056A;
+&#x056B;
+&#x056C;
+&#x056D;
+&#x056E;
+&#x056F;
+&#x0570;
+&#x0571;
+&#x0572;
+&#x0573;
+&#x0574;
+&#x0575;
+&#x0576;
+&#x0577;
+&#x0578;
+&#x0579;
+&#x057A;
+&#x057B;
+&#x057C;
+&#x057D;
+&#x057E;
+&#x057F;
+&#x0580;
+&#x0581;
+&#x0582;
+&#x0583;
+&#x0584;
+&#x0585;
+&#x0586;
+&#x0587; <!-- ARMENIAN SMALL LIGATURE ECH YIWN -->
+<!-- &#x10D0; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D1; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D2; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D3; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D4; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D5; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D6; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D7; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D8; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10D9; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DA; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DB; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DC; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DD; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DE; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10DF; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E0; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E1; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E2; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E3; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E4; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E5; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E6; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E7; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E8; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10E9; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10EA; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10EB; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10EC; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10ED; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10EE; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10EF; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F0; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F1; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F2; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F3; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F4; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F5; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F6; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F7; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F8; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10F9; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10FA; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10FD; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10FE; --> <!-- Temporarily skipped, see bug 1476304. -->
+<!-- &#x10FF; --> <!-- Temporarily skipped, see bug 1476304. -->
+&#x13F8;
+&#x13F9;
+&#x13FA;
+&#x13FB;
+&#x13FC;
+&#x13FD;
+&#x1C80;
+&#x1C81;
+&#x1C82;
+&#x1C83;
+&#x1C84;
+&#x1C85;
+&#x1C86;
+&#x1C87;
+&#x1C88;
+&#x1D79;
+&#x1D7D;
+&#x1D8E;
+&#x1E01;
+&#x1E03;
+&#x1E05;
+&#x1E07;
+&#x1E09;
+&#x1E0B;
+&#x1E0D;
+&#x1E0F;
+&#x1E11;
+&#x1E13;
+&#x1E15;
+&#x1E17;
+&#x1E19;
+&#x1E1B;
+&#x1E1D;
+&#x1E1F;
+&#x1E21;
+&#x1E23;
+&#x1E25;
+&#x1E27;
+&#x1E29;
+&#x1E2B;
+&#x1E2D;
+&#x1E2F;
+&#x1E31;
+&#x1E33;
+&#x1E35;
+&#x1E37;
+&#x1E39;
+&#x1E3B;
+&#x1E3D;
+&#x1E3F;
+&#x1E41;
+&#x1E43;
+&#x1E45;
+&#x1E47;
+&#x1E49;
+&#x1E4B;
+&#x1E4D;
+&#x1E4F;
+&#x1E51;
+&#x1E53;
+&#x1E55;
+&#x1E57;
+&#x1E59;
+&#x1E5B;
+&#x1E5D;
+&#x1E5F;
+&#x1E61;
+&#x1E63;
+&#x1E65;
+&#x1E67;
+&#x1E69;
+&#x1E6B;
+&#x1E6D;
+&#x1E6F;
+&#x1E71;
+&#x1E73;
+&#x1E75;
+&#x1E77;
+&#x1E79;
+&#x1E7B;
+&#x1E7D;
+&#x1E7F;
+&#x1E81;
+&#x1E83;
+&#x1E85;
+&#x1E87;
+&#x1E89;
+&#x1E8B;
+&#x1E8D;
+&#x1E8F;
+&#x1E91;
+&#x1E93;
+&#x1E95;
+&#x1E96; <!-- LATIN SMALL LETTER H WITH LINE BELOW -->
+&#x1E97; <!-- LATIN SMALL LETTER T WITH DIAERESIS -->
+&#x1E98; <!-- LATIN SMALL LETTER W WITH RING ABOVE -->
+&#x1E99; <!-- LATIN SMALL LETTER Y WITH RING ABOVE -->
+&#x1E9A; <!-- LATIN SMALL LETTER A WITH RIGHT HALF RING -->
+&#x1E9B;
+&#x1EA1;
+&#x1EA3;
+&#x1EA5;
+&#x1EA7;
+&#x1EA9;
+&#x1EAB;
+&#x1EAD;
+&#x1EAF;
+&#x1EB1;
+&#x1EB3;
+&#x1EB5;
+&#x1EB7;
+&#x1EB9;
+&#x1EBB;
+&#x1EBD;
+&#x1EBF;
+&#x1EC1;
+&#x1EC3;
+&#x1EC5;
+&#x1EC7;
+&#x1EC9;
+&#x1ECB;
+&#x1ECD;
+&#x1ECF;
+&#x1ED1;
+&#x1ED3;
+&#x1ED5;
+&#x1ED7;
+&#x1ED9;
+&#x1EDB;
+&#x1EDD;
+&#x1EDF;
+&#x1EE1;
+&#x1EE3;
+&#x1EE5;
+&#x1EE7;
+&#x1EE9;
+&#x1EEB;
+&#x1EED;
+&#x1EEF;
+&#x1EF1;
+&#x1EF3;
+&#x1EF5;
+&#x1EF7;
+&#x1EF9;
+&#x1EFB;
+&#x1EFD;
+&#x1EFF;
+&#x1F00;
+&#x1F01;
+&#x1F02;
+&#x1F03;
+&#x1F04;
+&#x1F05;
+&#x1F06;
+&#x1F07;
+&#x1F10;
+&#x1F11;
+&#x1F12;
+&#x1F13;
+&#x1F14;
+&#x1F15;
+&#x1F20;
+&#x1F21;
+&#x1F22;
+&#x1F23;
+&#x1F24;
+&#x1F25;
+&#x1F26;
+&#x1F27;
+&#x1F30;
+&#x1F31;
+&#x1F32;
+&#x1F33;
+&#x1F34;
+&#x1F35;
+&#x1F36;
+&#x1F37;
+&#x1F40;
+&#x1F41;
+&#x1F42;
+&#x1F43;
+&#x1F44;
+&#x1F45;
+&#x1F50; <!-- GREEK SMALL LETTER UPSILON WITH PSILI -->
+&#x1F51;
+&#x1F52; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND VARIA -->
+&#x1F53;
+&#x1F54; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND OXIA -->
+&#x1F55;
+&#x1F56; <!-- GREEK SMALL LETTER UPSILON WITH PSILI AND PERISPOMENI -->
+&#x1F57;
+&#x1F60;
+&#x1F61;
+&#x1F62;
+&#x1F63;
+&#x1F64;
+&#x1F65;
+&#x1F66;
+&#x1F67;
+&#x1F70;
+&#x1F71;
+&#x1F72;
+&#x1F73;
+&#x1F74;
+&#x1F75;
+&#x1F76;
+&#x1F77;
+&#x1F78;
+&#x1F79;
+&#x1F7A;
+&#x1F7B;
+&#x1F7C;
+&#x1F7D;
+&#x1F80; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F81; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F82; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F83; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F84; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F85; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F86; <!-- GREEK SMALL LETTER ALPHA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F87; <!-- GREEK SMALL LETTER ALPHA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F88; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F89; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F8A; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F8B; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F8C; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F8D; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F8E; <!-- GREEK CAPITAL LETTER ALPHA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F8F; <!-- GREEK CAPITAL LETTER ALPHA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F90; <!-- GREEK SMALL LETTER ETA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1F91; <!-- GREEK SMALL LETTER ETA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1F92; <!-- GREEK SMALL LETTER ETA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1F93; <!-- GREEK SMALL LETTER ETA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1F94; <!-- GREEK SMALL LETTER ETA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1F95; <!-- GREEK SMALL LETTER ETA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1F96; <!-- GREEK SMALL LETTER ETA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F97; <!-- GREEK SMALL LETTER ETA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1F98; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1F99; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1F9A; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1F9B; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1F9C; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1F9D; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1F9E; <!-- GREEK CAPITAL LETTER ETA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1F9F; <!-- GREEK CAPITAL LETTER ETA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FA0; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND YPOGEGRAMMENI -->
+&#x1FA1; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND YPOGEGRAMMENI -->
+&#x1FA2; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND VARIA AND YPOGEGRAMMENI -->
+&#x1FA3; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND VARIA AND YPOGEGRAMMENI -->
+&#x1FA4; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND OXIA AND YPOGEGRAMMENI -->
+&#x1FA5; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND OXIA AND YPOGEGRAMMENI -->
+&#x1FA6; <!-- GREEK SMALL LETTER OMEGA WITH PSILI AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FA7; <!-- GREEK SMALL LETTER OMEGA WITH DASIA AND PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FA8; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PROSGEGRAMMENI -->
+&#x1FA9; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PROSGEGRAMMENI -->
+&#x1FAA; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND VARIA AND PROSGEGRAMMENI -->
+&#x1FAB; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND VARIA AND PROSGEGRAMMENI -->
+&#x1FAC; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND OXIA AND PROSGEGRAMMENI -->
+&#x1FAD; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND OXIA AND PROSGEGRAMMENI -->
+&#x1FAE; <!-- GREEK CAPITAL LETTER OMEGA WITH PSILI AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FAF; <!-- GREEK CAPITAL LETTER OMEGA WITH DASIA AND PERISPOMENI AND PROSGEGRAMMENI -->
+&#x1FB0;
+&#x1FB1;
+&#x1FB2; <!-- GREEK SMALL LETTER ALPHA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FB3; <!-- GREEK SMALL LETTER ALPHA WITH YPOGEGRAMMENI -->
+&#x1FB4; <!-- GREEK SMALL LETTER ALPHA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FB6; <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI -->
+&#x1FB7; <!-- GREEK SMALL LETTER ALPHA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FBC; <!-- GREEK CAPITAL LETTER ALPHA WITH PROSGEGRAMMENI -->
+&#x1FBE;
+&#x1FC2; <!-- GREEK SMALL LETTER ETA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FC3; <!-- GREEK SMALL LETTER ETA WITH YPOGEGRAMMENI -->
+&#x1FC4; <!-- GREEK SMALL LETTER ETA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FC6; <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI -->
+&#x1FC7; <!-- GREEK SMALL LETTER ETA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FCC; <!-- GREEK CAPITAL LETTER ETA WITH PROSGEGRAMMENI -->
+&#x1FD0;
+&#x1FD1;
+&#x1FD2; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND VARIA -->
+&#x1FD3; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND OXIA -->
+&#x1FD6; <!-- GREEK SMALL LETTER IOTA WITH PERISPOMENI -->
+&#x1FD7; <!-- GREEK SMALL LETTER IOTA WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FE0;
+&#x1FE1;
+&#x1FE2; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND VARIA -->
+&#x1FE3; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND OXIA -->
+&#x1FE4; <!-- GREEK SMALL LETTER RHO WITH PSILI -->
+&#x1FE5;
+&#x1FE6; <!-- GREEK SMALL LETTER UPSILON WITH PERISPOMENI -->
+&#x1FE7; <!-- GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND PERISPOMENI -->
+&#x1FF2; <!-- GREEK SMALL LETTER OMEGA WITH VARIA AND YPOGEGRAMMENI -->
+&#x1FF3; <!-- GREEK SMALL LETTER OMEGA WITH YPOGEGRAMMENI -->
+&#x1FF4; <!-- GREEK SMALL LETTER OMEGA WITH OXIA AND YPOGEGRAMMENI -->
+&#x1FF6; <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI -->
+&#x1FF7; <!-- GREEK SMALL LETTER OMEGA WITH PERISPOMENI AND YPOGEGRAMMENI -->
+&#x1FFC; <!-- GREEK CAPITAL LETTER OMEGA WITH PROSGEGRAMMENI -->
+&#x214E;
+&#x2170;
+&#x2171;
+&#x2172;
+&#x2173;
+&#x2174;
+&#x2175;
+&#x2176;
+&#x2177;
+&#x2178;
+&#x2179;
+&#x217A;
+&#x217B;
+&#x217C;
+&#x217D;
+&#x217E;
+&#x217F;
+&#x2184;
+&#x24D0;
+&#x24D1;
+&#x24D2;
+&#x24D3;
+&#x24D4;
+&#x24D5;
+&#x24D6;
+&#x24D7;
+&#x24D8;
+&#x24D9;
+&#x24DA;
+&#x24DB;
+&#x24DC;
+&#x24DD;
+&#x24DE;
+&#x24DF;
+&#x24E0;
+&#x24E1;
+&#x24E2;
+&#x24E3;
+&#x24E4;
+&#x24E5;
+&#x24E6;
+&#x24E7;
+&#x24E8;
+&#x24E9;
+&#x2C30;
+&#x2C31;
+&#x2C32;
+&#x2C33;
+&#x2C34;
+&#x2C35;
+&#x2C36;
+&#x2C37;
+&#x2C38;
+&#x2C39;
+&#x2C3A;
+&#x2C3B;
+&#x2C3C;
+&#x2C3D;
+&#x2C3E;
+&#x2C3F;
+&#x2C40;
+&#x2C41;
+&#x2C42;
+&#x2C43;
+&#x2C44;
+&#x2C45;
+&#x2C46;
+&#x2C47;
+&#x2C48;
+&#x2C49;
+&#x2C4A;
+&#x2C4B;
+&#x2C4C;
+&#x2C4D;
+&#x2C4E;
+&#x2C4F;
+&#x2C50;
+&#x2C51;
+&#x2C52;
+&#x2C53;
+&#x2C54;
+&#x2C55;
+&#x2C56;
+&#x2C57;
+&#x2C58;
+&#x2C59;
+&#x2C5A;
+&#x2C5B;
+&#x2C5C;
+&#x2C5D;
+&#x2C5E;
+&#x2C5F;
+&#x2C61;
+&#x2C65;
+&#x2C66;
+&#x2C68;
+&#x2C6A;
+&#x2C6C;
+&#x2C73;
+&#x2C76;
+&#x2C81;
+&#x2C83;
+&#x2C85;
+&#x2C87;
+&#x2C89;
+&#x2C8B;
+&#x2C8D;
+&#x2C8F;
+&#x2C91;
+&#x2C93;
+&#x2C95;
+&#x2C97;
+&#x2C99;
+&#x2C9B;
+&#x2C9D;
+&#x2C9F;
+&#x2CA1;
+&#x2CA3;
+&#x2CA5;
+&#x2CA7;
+&#x2CA9;
+&#x2CAB;
+&#x2CAD;
+&#x2CAF;
+&#x2CB1;
+&#x2CB3;
+&#x2CB5;
+&#x2CB7;
+&#x2CB9;
+&#x2CBB;
+&#x2CBD;
+&#x2CBF;
+&#x2CC1;
+&#x2CC3;
+&#x2CC5;
+&#x2CC7;
+&#x2CC9;
+&#x2CCB;
+&#x2CCD;
+&#x2CCF;
+&#x2CD1;
+&#x2CD3;
+&#x2CD5;
+&#x2CD7;
+&#x2CD9;
+&#x2CDB;
+&#x2CDD;
+&#x2CDF;
+&#x2CE1;
+&#x2CE3;
+&#x2CEC;
+&#x2CEE;
+&#x2CF3;
+&#x2D00;
+&#x2D01;
+&#x2D02;
+&#x2D03;
+&#x2D04;
+&#x2D05;
+&#x2D06;
+&#x2D07;
+&#x2D08;
+&#x2D09;
+&#x2D0A;
+&#x2D0B;
+&#x2D0C;
+&#x2D0D;
+&#x2D0E;
+&#x2D0F;
+&#x2D10;
+&#x2D11;
+&#x2D12;
+&#x2D13;
+&#x2D14;
+&#x2D15;
+&#x2D16;
+&#x2D17;
+&#x2D18;
+&#x2D19;
+&#x2D1A;
+&#x2D1B;
+&#x2D1C;
+&#x2D1D;
+&#x2D1E;
+&#x2D1F;
+&#x2D20;
+&#x2D21;
+&#x2D22;
+&#x2D23;
+&#x2D24;
+&#x2D25;
+&#x2D27;
+&#x2D2D;
+&#xA641;
+&#xA643;
+&#xA645;
+&#xA647;
+&#xA649;
+&#xA64B;
+&#xA64D;
+&#xA64F;
+&#xA651;
+&#xA653;
+&#xA655;
+&#xA657;
+&#xA659;
+&#xA65B;
+&#xA65D;
+&#xA65F;
+&#xA661;
+&#xA663;
+&#xA665;
+&#xA667;
+&#xA669;
+&#xA66B;
+&#xA66D;
+&#xA681;
+&#xA683;
+&#xA685;
+&#xA687;
+&#xA689;
+&#xA68B;
+&#xA68D;
+&#xA68F;
+&#xA691;
+&#xA693;
+&#xA695;
+&#xA697;
+&#xA699;
+&#xA69B;
+&#xA723;
+&#xA725;
+&#xA727;
+&#xA729;
+&#xA72B;
+&#xA72D;
+&#xA72F;
+&#xA733;
+&#xA735;
+&#xA737;
+&#xA739;
+&#xA73B;
+&#xA73D;
+&#xA73F;
+&#xA741;
+&#xA743;
+&#xA745;
+&#xA747;
+&#xA749;
+&#xA74B;
+&#xA74D;
+&#xA74F;
+&#xA751;
+&#xA753;
+&#xA755;
+&#xA757;
+&#xA759;
+&#xA75B;
+&#xA75D;
+&#xA75F;
+&#xA761;
+&#xA763;
+&#xA765;
+&#xA767;
+&#xA769;
+&#xA76B;
+&#xA76D;
+&#xA76F;
+&#xA77A;
+&#xA77C;
+&#xA77F;
+&#xA781;
+&#xA783;
+&#xA785;
+&#xA787;
+&#xA78C;
+&#xA791;
+&#xA793;
+&#xA794;
+&#xA797;
+&#xA799;
+&#xA79B;
+&#xA79D;
+&#xA79F;
+&#xA7A1;
+&#xA7A3;
+&#xA7A5;
+&#xA7A7;
+&#xA7A9;
+&#xA7B5;
+&#xA7B7;
+&#xA7B9;
+&#xA7BB;
+&#xA7BD;
+&#xA7BF;
+&#xA7C1;
+&#xA7C3;
+&#xA7C8;
+&#xA7CA;
+&#xA7D1;
+&#xA7D7;
+&#xA7D9;
+&#xA7F6;
+&#xAB53;
+&#xAB70;
+&#xAB71;
+&#xAB72;
+&#xAB73;
+&#xAB74;
+&#xAB75;
+&#xAB76;
+&#xAB77;
+&#xAB78;
+&#xAB79;
+&#xAB7A;
+&#xAB7B;
+&#xAB7C;
+&#xAB7D;
+&#xAB7E;
+&#xAB7F;
+&#xAB80;
+&#xAB81;
+&#xAB82;
+&#xAB83;
+&#xAB84;
+&#xAB85;
+&#xAB86;
+&#xAB87;
+&#xAB88;
+&#xAB89;
+&#xAB8A;
+&#xAB8B;
+&#xAB8C;
+&#xAB8D;
+&#xAB8E;
+&#xAB8F;
+&#xAB90;
+&#xAB91;
+&#xAB92;
+&#xAB93;
+&#xAB94;
+&#xAB95;
+&#xAB96;
+&#xAB97;
+&#xAB98;
+&#xAB99;
+&#xAB9A;
+&#xAB9B;
+&#xAB9C;
+&#xAB9D;
+&#xAB9E;
+&#xAB9F;
+&#xABA0;
+&#xABA1;
+&#xABA2;
+&#xABA3;
+&#xABA4;
+&#xABA5;
+&#xABA6;
+&#xABA7;
+&#xABA8;
+&#xABA9;
+&#xABAA;
+&#xABAB;
+&#xABAC;
+&#xABAD;
+&#xABAE;
+&#xABAF;
+&#xABB0;
+&#xABB1;
+&#xABB2;
+&#xABB3;
+&#xABB4;
+&#xABB5;
+&#xABB6;
+&#xABB7;
+&#xABB8;
+&#xABB9;
+&#xABBA;
+&#xABBB;
+&#xABBC;
+&#xABBD;
+&#xABBE;
+&#xABBF;
+&#xFB00; <!-- LATIN SMALL LIGATURE FF -->
+&#xFB01; <!-- LATIN SMALL LIGATURE FI -->
+&#xFB02; <!-- LATIN SMALL LIGATURE FL -->
+&#xFB03; <!-- LATIN SMALL LIGATURE FFI -->
+&#xFB04; <!-- LATIN SMALL LIGATURE FFL -->
+&#xFB05; <!-- LATIN SMALL LIGATURE LONG S T -->
+&#xFB06; <!-- LATIN SMALL LIGATURE ST -->
+&#xFB13; <!-- ARMENIAN SMALL LIGATURE MEN NOW -->
+&#xFB14; <!-- ARMENIAN SMALL LIGATURE MEN ECH -->
+&#xFB15; <!-- ARMENIAN SMALL LIGATURE MEN INI -->
+&#xFB16; <!-- ARMENIAN SMALL LIGATURE VEW NOW -->
+&#xFB17; <!-- ARMENIAN SMALL LIGATURE MEN XEH -->
+&#xFF41;
+&#xFF42;
+&#xFF43;
+&#xFF44;
+&#xFF45;
+&#xFF46;
+&#xFF47;
+&#xFF48;
+&#xFF49;
+&#xFF4A;
+&#xFF4B;
+&#xFF4C;
+&#xFF4D;
+&#xFF4E;
+&#xFF4F;
+&#xFF50;
+&#xFF51;
+&#xFF52;
+&#xFF53;
+&#xFF54;
+&#xFF55;
+&#xFF56;
+&#xFF57;
+&#xFF58;
+&#xFF59;
+&#xFF5A;
+&#x10428;
+&#x10429;
+&#x1042A;
+&#x1042B;
+&#x1042C;
+&#x1042D;
+&#x1042E;
+&#x1042F;
+&#x10430;
+&#x10431;
+&#x10432;
+&#x10433;
+&#x10434;
+&#x10435;
+&#x10436;
+&#x10437;
+&#x10438;
+&#x10439;
+&#x1043A;
+&#x1043B;
+&#x1043C;
+&#x1043D;
+&#x1043E;
+&#x1043F;
+&#x10440;
+&#x10441;
+&#x10442;
+&#x10443;
+&#x10444;
+&#x10445;
+&#x10446;
+&#x10447;
+&#x10448;
+&#x10449;
+&#x1044A;
+&#x1044B;
+&#x1044C;
+&#x1044D;
+&#x1044E;
+&#x1044F;
+&#x104D8;
+&#x104D9;
+&#x104DA;
+&#x104DB;
+&#x104DC;
+&#x104DD;
+&#x104DE;
+&#x104DF;
+&#x104E0;
+&#x104E1;
+&#x104E2;
+&#x104E3;
+&#x104E4;
+&#x104E5;
+&#x104E6;
+&#x104E7;
+&#x104E8;
+&#x104E9;
+&#x104EA;
+&#x104EB;
+&#x104EC;
+&#x104ED;
+&#x104EE;
+&#x104EF;
+&#x104F0;
+&#x104F1;
+&#x104F2;
+&#x104F3;
+&#x104F4;
+&#x104F5;
+&#x104F6;
+&#x104F7;
+&#x104F8;
+&#x104F9;
+&#x104FA;
+&#x104FB;
+&#x10597;
+&#x10598;
+&#x10599;
+&#x1059A;
+&#x1059B;
+&#x1059C;
+&#x1059D;
+&#x1059E;
+&#x1059F;
+&#x105A0;
+&#x105A1;
+&#x105A3;
+&#x105A4;
+&#x105A5;
+&#x105A6;
+&#x105A7;
+&#x105A8;
+&#x105A9;
+&#x105AA;
+&#x105AB;
+&#x105AC;
+&#x105AD;
+&#x105AE;
+&#x105AF;
+&#x105B0;
+&#x105B1;
+&#x105B3;
+&#x105B4;
+&#x105B5;
+&#x105B6;
+&#x105B7;
+&#x105B8;
+&#x105B9;
+&#x105BB;
+&#x105BC;
+&#x10CC0;
+&#x10CC1;
+&#x10CC2;
+&#x10CC3;
+&#x10CC4;
+&#x10CC5;
+&#x10CC6;
+&#x10CC7;
+&#x10CC8;
+&#x10CC9;
+&#x10CCA;
+&#x10CCB;
+&#x10CCC;
+&#x10CCD;
+&#x10CCE;
+&#x10CCF;
+&#x10CD0;
+&#x10CD1;
+&#x10CD2;
+&#x10CD3;
+&#x10CD4;
+&#x10CD5;
+&#x10CD6;
+&#x10CD7;
+&#x10CD8;
+&#x10CD9;
+&#x10CDA;
+&#x10CDB;
+&#x10CDC;
+&#x10CDD;
+&#x10CDE;
+&#x10CDF;
+&#x10CE0;
+&#x10CE1;
+&#x10CE2;
+&#x10CE3;
+&#x10CE4;
+&#x10CE5;
+&#x10CE6;
+&#x10CE7;
+&#x10CE8;
+&#x10CE9;
+&#x10CEA;
+&#x10CEB;
+&#x10CEC;
+&#x10CED;
+&#x10CEE;
+&#x10CEF;
+&#x10CF0;
+&#x10CF1;
+&#x10CF2;
+&#x118C0;
+&#x118C1;
+&#x118C2;
+&#x118C3;
+&#x118C4;
+&#x118C5;
+&#x118C6;
+&#x118C7;
+&#x118C8;
+&#x118C9;
+&#x118CA;
+&#x118CB;
+&#x118CC;
+&#x118CD;
+&#x118CE;
+&#x118CF;
+&#x118D0;
+&#x118D1;
+&#x118D2;
+&#x118D3;
+&#x118D4;
+&#x118D5;
+&#x118D6;
+&#x118D7;
+&#x118D8;
+&#x118D9;
+&#x118DA;
+&#x118DB;
+&#x118DC;
+&#x118DD;
+&#x118DE;
+&#x118DF;
+&#x16E60;
+&#x16E61;
+&#x16E62;
+&#x16E63;
+&#x16E64;
+&#x16E65;
+&#x16E66;
+&#x16E67;
+&#x16E68;
+&#x16E69;
+&#x16E6A;
+&#x16E6B;
+&#x16E6C;
+&#x16E6D;
+&#x16E6E;
+&#x16E6F;
+&#x16E70;
+&#x16E71;
+&#x16E72;
+&#x16E73;
+&#x16E74;
+&#x16E75;
+&#x16E76;
+&#x16E77;
+&#x16E78;
+&#x16E79;
+&#x16E7A;
+&#x16E7B;
+&#x16E7C;
+&#x16E7D;
+&#x16E7E;
+&#x16E7F;
+&#x1E922;
+&#x1E923;
+&#x1E924;
+&#x1E925;
+&#x1E926;
+&#x1E927;
+&#x1E928;
+&#x1E929;
+&#x1E92A;
+&#x1E92B;
+&#x1E92C;
+&#x1E92D;
+&#x1E92E;
+&#x1E92F;
+&#x1E930;
+&#x1E931;
+&#x1E932;
+&#x1E933;
+&#x1E934;
+&#x1E935;
+&#x1E936;
+&#x1E937;
+&#x1E938;
+&#x1E939;
+&#x1E93A;
+&#x1E93B;
+&#x1E93C;
+&#x1E93D;
+&#x1E93E;
+&#x1E93F;
+&#x1E940;
+&#x1E941;
+&#x1E942;
+&#x1E943;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-1.html b/layout/reftests/text-transform/capitalize-1.html
new file mode 100644
index 0000000000..be5bdf7f2e
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+ <body style="letter-spacing:2px">
+ <span style="text-transform:capitalize">This text should be capitalized.</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-2.html b/layout/reftests/text-transform/capitalize-2.html
new file mode 100644
index 0000000000..95578ca7a8
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+ <body style="letter-spacing:2px">
+ T<span style="text-transform:capitalize">his text should be capitalized.</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-3-ref.html b/layout/reftests/text-transform/capitalize-3-ref.html
new file mode 100644
index 0000000000..96289a5603
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-3-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<html>
+<body style="letter-spacing:2px">
+<p>I Ask "Questions"
+<p>i ask "Questions"
+<p>I Ask questions
+<p>I Ask<br>Questions
+<p>I Ask&nbsp;Questions
+<p style="white-space:nowrap">I Ask Questions
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-3.html b/layout/reftests/text-transform/capitalize-3.html
new file mode 100644
index 0000000000..970469554e
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-3.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+<body style="letter-spacing:2px">
+<p><span style="text-transform:capitalize">i ask "questions"</span>
+<p>i ask "<span style="text-transform:capitalize">questions"</span>
+<p><span style="text-transform:capitalize">i ask <span style="text-transform:none">q</span>uestions</span>
+<p><span style="text-transform:capitalize">i ask<br>questions</span>
+<p><span style="text-transform:capitalize">i ask&nbsp;questions</span>
+<p style="white-space:nowrap"><span style="text-transform:capitalize">i ask questions</span>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-4-ref.html b/layout/reftests/text-transform/capitalize-4-ref.html
new file mode 100644
index 0000000000..35b4a5dd10
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-4-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>text-transform:capitalize with punctuation</title>
+ </head>
+ <body>
+ <div>
+ "This" (Is) /A/ _Short_ *Test* -For- —The— ¡Capitalize! ¿Transform? «With» [Punctuation] “Marks”.
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-4.html b/layout/reftests/text-transform/capitalize-4.html
new file mode 100644
index 0000000000..7cb04afb24
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-4.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>text-transform:capitalize with punctuation</title>
+ </head>
+ <body>
+ <div style="text-transform:capitalize">
+ "This" (is) /a/ _short_ *test* -for- —the— ¡capitalize! ¿transform? «with» [punctuation] “marks”.
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-5-ref.html b/layout/reftests/text-transform/capitalize-5-ref.html
new file mode 100644
index 0000000000..2174e91878
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-5-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>text-transform:capitalize Deseret with punctuation</title>
+ </head>
+ <body>
+ <div>
+𐐧𐑌𐐮𐐿𐐬𐐼&nbsp;𐐑𐑉𐐲𐑂𐐴𐐼𐑆 (𐐊) _𐐧𐑌𐐨𐐿_ “𐐤𐐲𐑋𐐺𐐲𐑉” -𐐙𐐫𐑉- ¿𐐇𐑂𐑉𐐨? 𐐗𐐯𐑉𐐲𐐿𐐻𐐲𐑉.
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-5.html b/layout/reftests/text-transform/capitalize-5.html
new file mode 100644
index 0000000000..38dcb11752
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-5.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <title>text-transform:capitalize Deseret with punctuation</title>
+ </head>
+ <body>
+ <div style="text-transform:capitalize">
+𐐧𐑌𐐮𐐿𐐬𐐼&nbsp;𐐹𐑉𐐲𐑂𐐴𐐼𐑆 (𐐲) _𐑏𐑌𐐨𐐿_ “𐑌𐐲𐑋𐐺𐐲𐑉” -𐑁𐐫𐑉- ¿𐐯𐑂𐑉𐐨? 𐐿𐐯𐑉𐐲𐐿𐐻𐐲𐑉.
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-6-ref.html b/layout/reftests/text-transform/capitalize-6-ref.html
new file mode 100644
index 0000000000..132d90fe8c
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-6-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div lang="en">
+Ijsland Xijsland Ijsland Ixjsland
+</div>
+<div lang="nl">
+IJsland Xijsland Ijsland Ixjsland
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-6.html b/layout/reftests/text-transform/capitalize-6.html
new file mode 100644
index 0000000000..0aef807233
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-6.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div lang="en" style="text-transform:capitalize">
+ijsland xijsland Ijsland ixjsland
+</div>
+<div lang="nl" style="text-transform:capitalize">
+ijsland xijsland Ijsland ixjsland
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-7-ref.html b/layout/reftests/text-transform/capitalize-7-ref.html
new file mode 100644
index 0000000000..16a71c1020
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-7-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>Blah Blah</p>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-7.html b/layout/reftests/text-transform/capitalize-7.html
new file mode 100644
index 0000000000..3db9a27452
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-7.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<style>
+p:first-letter { text-transform: uppercase; }
+p { text-transform: capitalize }
+</style>
+<body>
+<p>blah blah</p>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-7a.html b/layout/reftests/text-transform/capitalize-7a.html
new file mode 100644
index 0000000000..06360354cf
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-7a.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<style>
+html { overflow: hidden; }
+p:first-letter { text-transform: uppercase; }
+p { text-transform: capitalize }
+</style>
+<body>
+<p>blah blah</p>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/capitalize-8-ref.html b/layout/reftests/text-transform/capitalize-8-ref.html
new file mode 100644
index 0000000000..632398b1ec
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-8-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<style>
+div {
+ white-space: pre;
+}
+</style>
+<div>
+The Quick Brown Fox
+Jumps Over
+The Lazy Dog
diff --git a/layout/reftests/text-transform/capitalize-8.html b/layout/reftests/text-transform/capitalize-8.html
new file mode 100644
index 0000000000..5d1f32a722
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-8.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<style>
+div {
+ text-transform: capitalize;
+ white-space: pre;
+}
+</style>
+<div>
+the quick brown fox
+jumps over
+the lazy dog
diff --git a/layout/reftests/text-transform/capitalize-9-ref.html b/layout/reftests/text-transform/capitalize-9-ref.html
new file mode 100644
index 0000000000..05924a30fc
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-9-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div>
+Double-Barrelled
+What.Three.Words
+Snake_case
+Kebab-Case
+Colo[u]r
+Pass/Fail
+Lowe's
+Black’s
diff --git a/layout/reftests/text-transform/capitalize-9.html b/layout/reftests/text-transform/capitalize-9.html
new file mode 100644
index 0000000000..609810b1f6
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-9.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div style="text-transform:capitalize">
+double-barrelled
+what.three.words
+snake_case
+kebab-case
+colo[u]r
+pass/fail
+lowe's
+black’s
diff --git a/layout/reftests/text-transform/capitalize-ref.html b/layout/reftests/text-transform/capitalize-ref.html
new file mode 100644
index 0000000000..16e4d52a96
--- /dev/null
+++ b/layout/reftests/text-transform/capitalize-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body style="letter-spacing:2px">
+ This Text Should Be Capitalized.
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/fake-small-caps-1-ref.html b/layout/reftests/text-transform/fake-small-caps-1-ref.html
new file mode 100644
index 0000000000..3b14167ad2
--- /dev/null
+++ b/layout/reftests/text-transform/fake-small-caps-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that does NOT support the 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+body {
+ font: 100px test;
+}
+span {
+ font-size: 80px;
+}
+</style>
+</head>
+<body>
+<div>S<span>MALL</span> C<span>APS</span>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/fake-small-caps-1.html b/layout/reftests/text-transform/fake-small-caps-1.html
new file mode 100644
index 0000000000..21d83c3636
--- /dev/null
+++ b/layout/reftests/text-transform/fake-small-caps-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that does NOT support the 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+body {
+ font: 100px test;
+}
+</style>
+</head>
+<body>
+<div style="font-variant:small-caps">Small Caps
+</body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-1-ref.html b/layout/reftests/text-transform/fullwidth-1-ref.html
new file mode 100644
index 0000000000..d49be61210
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <span>&#xff46;&#xff55;&#xff4c;&#xff4c;&#x3000;&#xff57;&#xff49;&#xff44;&#xff54;&#xff48;&#x3000;&#xffe5;&#xff11;&#xff10;</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-1.html b/layout/reftests/text-transform/fullwidth-1.html
new file mode 100644
index 0000000000..147bea6241
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <span style="text-transform: full-width;">full width &#xa5;10</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-2-ref.html b/layout/reftests/text-transform/fullwidth-2-ref.html
new file mode 100644
index 0000000000..a3a2761509
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-2-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <span style="text-transform: full-width;">&#xff71;&#xff72;&#xff73;&#x3099;</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-2.html b/layout/reftests/text-transform/fullwidth-2.html
new file mode 100644
index 0000000000..745b8ad19a
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-2.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <span style="text-transform: full-width;">&#xff71;&#xff72;&#xff73;&#xff9e;</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-all-ref.html b/layout/reftests/text-transform/fullwidth-all-ref.html
new file mode 100644
index 0000000000..550c3d6bf8
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-all-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+<body style="white-space: pre-wrap; word-wrap: break-word">
+<!-- List of all wide characters that have mappings to/from narrow equivalents.
+ Extracted from the Unicode database (v6.2) by running
+
+ cut -d \; -f 1,6 UnicodeData.txt | \
+ perl -n -e 'if (/(....);<(wide|narrow)> (....)/) { printf "&#x%s;%s", ($2 eq 'wide' ? $1 : $3), ++$i % 10 ? "" : "\n" }'
+ -->
+&#x3000;&#xFF01;&#xFF02;&#xFF03;&#xFF04;&#xFF05;&#xFF06;&#xFF07;&#xFF08;&#xFF09;
+&#xFF0A;&#xFF0B;&#xFF0C;&#xFF0D;&#xFF0E;&#xFF0F;&#xFF10;&#xFF11;&#xFF12;&#xFF13;
+&#xFF14;&#xFF15;&#xFF16;&#xFF17;&#xFF18;&#xFF19;&#xFF1A;&#xFF1B;&#xFF1C;&#xFF1D;
+&#xFF1E;&#xFF1F;&#xFF20;&#xFF21;&#xFF22;&#xFF23;&#xFF24;&#xFF25;&#xFF26;&#xFF27;
+&#xFF28;&#xFF29;&#xFF2A;&#xFF2B;&#xFF2C;&#xFF2D;&#xFF2E;&#xFF2F;&#xFF30;&#xFF31;
+&#xFF32;&#xFF33;&#xFF34;&#xFF35;&#xFF36;&#xFF37;&#xFF38;&#xFF39;&#xFF3A;&#xFF3B;
+&#xFF3C;&#xFF3D;&#xFF3E;&#xFF3F;&#xFF40;&#xFF41;&#xFF42;&#xFF43;&#xFF44;&#xFF45;
+&#xFF46;&#xFF47;&#xFF48;&#xFF49;&#xFF4A;&#xFF4B;&#xFF4C;&#xFF4D;&#xFF4E;&#xFF4F;
+&#xFF50;&#xFF51;&#xFF52;&#xFF53;&#xFF54;&#xFF55;&#xFF56;&#xFF57;&#xFF58;&#xFF59;
+&#xFF5A;&#xFF5B;&#xFF5C;&#xFF5D;&#xFF5E;&#xFF5F;&#xFF60;&#x3002;&#x300C;&#x300D;
+&#x3001;&#x30FB;&#x30F2;&#x30A1;&#x30A3;&#x30A5;&#x30A7;&#x30A9;&#x30E3;&#x30E5;
+&#x30E7;&#x30C3;&#x30FC;&#x30A2;&#x30A4;&#x30A6;&#x30A8;&#x30AA;&#x30AB;&#x30AD;
+&#x30AF;&#x30B1;&#x30B3;&#x30B5;&#x30B7;&#x30B9;&#x30BB;&#x30BD;&#x30BF;&#x30C1;
+&#x30C4;&#x30C6;&#x30C8;&#x30CA;&#x30CB;&#x30CC;&#x30CD;&#x30CE;&#x30CF;&#x30D2;
+&#x30D5;&#x30D8;&#x30DB;&#x30DE;&#x30DF;&#x30E0;&#x30E1;&#x30E2;&#x30E4;&#x30E6;
+&#x30E8;&#x30E9;&#x30EA;&#x30EB;&#x30EC;&#x30ED;&#x30EF;&#x30F3;&#x3099;&#x309A;
+&#x3164;&#x3131;&#x3132;&#x3133;&#x3134;&#x3135;&#x3136;&#x3137;&#x3138;&#x3139;
+&#x313A;&#x313B;&#x313C;&#x313D;&#x313E;&#x313F;&#x3140;&#x3141;&#x3142;&#x3143;
+&#x3144;&#x3145;&#x3146;&#x3147;&#x3148;&#x3149;&#x314A;&#x314B;&#x314C;&#x314D;
+&#x314E;&#x314F;&#x3150;&#x3151;&#x3152;&#x3153;&#x3154;&#x3155;&#x3156;&#x3157;
+&#x3158;&#x3159;&#x315A;&#x315B;&#x315C;&#x315D;&#x315E;&#x315F;&#x3160;&#x3161;
+&#x3162;&#x3163;&#xFFE0;&#xFFE1;&#xFFE2;&#xFFE3;&#xFFE4;&#xFFE5;&#xFFE6;&#x2502;
+&#x2190;&#x2191;&#x2192;&#x2193;&#x25A0;&#x25CB;
+</body>
+</html>
diff --git a/layout/reftests/text-transform/fullwidth-all.html b/layout/reftests/text-transform/fullwidth-all.html
new file mode 100644
index 0000000000..2670fac924
--- /dev/null
+++ b/layout/reftests/text-transform/fullwidth-all.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html lang="en">
+<body style="text-transform: full-width; white-space: pre">
+<!-- List of all "narrow" characters that have a full-width mapping in Unicode.
+ Extracted from the Unicode database (v6.2) by running
+
+ cut -d \; -f 1,6 UnicodeData.txt | \
+ perl -n -e 'if (/(....);<(wide|narrow)> (....)/) { printf "&#x%s;%s", ($2 eq 'narrow' ? $1 : $3), ++$i % 10 ? "" : "\n" }'
+ -->
+&#x0020;&#x0021;&#x0022;&#x0023;&#x0024;&#x0025;&#x0026;&#x0027;&#x0028;&#x0029;
+&#x002A;&#x002B;&#x002C;&#x002D;&#x002E;&#x002F;&#x0030;&#x0031;&#x0032;&#x0033;
+&#x0034;&#x0035;&#x0036;&#x0037;&#x0038;&#x0039;&#x003A;&#x003B;&#x003C;&#x003D;
+&#x003E;&#x003F;&#x0040;&#x0041;&#x0042;&#x0043;&#x0044;&#x0045;&#x0046;&#x0047;
+&#x0048;&#x0049;&#x004A;&#x004B;&#x004C;&#x004D;&#x004E;&#x004F;&#x0050;&#x0051;
+&#x0052;&#x0053;&#x0054;&#x0055;&#x0056;&#x0057;&#x0058;&#x0059;&#x005A;&#x005B;
+&#x005C;&#x005D;&#x005E;&#x005F;&#x0060;&#x0061;&#x0062;&#x0063;&#x0064;&#x0065;
+&#x0066;&#x0067;&#x0068;&#x0069;&#x006A;&#x006B;&#x006C;&#x006D;&#x006E;&#x006F;
+&#x0070;&#x0071;&#x0072;&#x0073;&#x0074;&#x0075;&#x0076;&#x0077;&#x0078;&#x0079;
+&#x007A;&#x007B;&#x007C;&#x007D;&#x007E;&#x2985;&#x2986;&#xFF61;&#xFF62;&#xFF63;
+&#xFF64;&#xFF65;&#xFF66;&#xFF67;&#xFF68;&#xFF69;&#xFF6A;&#xFF6B;&#xFF6C;&#xFF6D;
+&#xFF6E;&#xFF6F;&#xFF70;&#xFF71;&#xFF72;&#xFF73;&#xFF74;&#xFF75;&#xFF76;&#xFF77;
+&#xFF78;&#xFF79;&#xFF7A;&#xFF7B;&#xFF7C;&#xFF7D;&#xFF7E;&#xFF7F;&#xFF80;&#xFF81;
+&#xFF82;&#xFF83;&#xFF84;&#xFF85;&#xFF86;&#xFF87;&#xFF88;&#xFF89;&#xFF8A;&#xFF8B;
+&#xFF8C;&#xFF8D;&#xFF8E;&#xFF8F;&#xFF90;&#xFF91;&#xFF92;&#xFF93;&#xFF94;&#xFF95;
+&#xFF96;&#xFF97;&#xFF98;&#xFF99;&#xFF9A;&#xFF9B;&#xFF9C;&#xFF9D;&#xFF9E;&#xFF9F;
+&#xFFA0;&#xFFA1;&#xFFA2;&#xFFA3;&#xFFA4;&#xFFA5;&#xFFA6;&#xFFA7;&#xFFA8;&#xFFA9;
+&#xFFAA;&#xFFAB;&#xFFAC;&#xFFAD;&#xFFAE;&#xFFAF;&#xFFB0;&#xFFB1;&#xFFB2;&#xFFB3;
+&#xFFB4;&#xFFB5;&#xFFB6;&#xFFB7;&#xFFB8;&#xFFB9;&#xFFBA;&#xFFBB;&#xFFBC;&#xFFBD;
+&#xFFBE;&#xFFC2;&#xFFC3;&#xFFC4;&#xFFC5;&#xFFC6;&#xFFC7;&#xFFCA;&#xFFCB;&#xFFCC;
+&#xFFCD;&#xFFCE;&#xFFCF;&#xFFD2;&#xFFD3;&#xFFD4;&#xFFD5;&#xFFD6;&#xFFD7;&#xFFDA;
+&#xFFDB;&#xFFDC;&#x00A2;&#x00A3;&#x00AC;&#x00AF;&#x00A6;&#x00A5;&#x20A9;&#xFFE8;
+&#xFFE9;&#xFFEA;&#xFFEB;&#xFFEC;&#xFFED;&#xFFEE;
+</body>
+</html>
diff --git a/layout/reftests/text-transform/graphite-small-caps-1-notref.html b/layout/reftests/text-transform/graphite-small-caps-1-notref.html
new file mode 100644
index 0000000000..d56a6694e0
--- /dev/null
+++ b/layout/reftests/text-transform/graphite-small-caps-1-notref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the Graphite 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/sil/CharisSIL-R.ttf);
+}
+body {
+ font: 100px test;
+}
+span {
+ font-size: 80px;
+}
+</style>
+</head>
+<body>
+<div>S<span>MALL</span> C<span>APS</span>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/graphite-small-caps-1-ref.html b/layout/reftests/text-transform/graphite-small-caps-1-ref.html
new file mode 100644
index 0000000000..0d553460af
--- /dev/null
+++ b/layout/reftests/text-transform/graphite-small-caps-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the Graphite 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/sil/CharisSIL-R.ttf);
+}
+body {
+ font: 100px test;
+}
+div {
+ font-feature-settings: 'smcp' on;
+}
+</style>
+</head>
+<body>
+<div>Small Caps
+</body>
+</html>
diff --git a/layout/reftests/text-transform/graphite-small-caps-1.html b/layout/reftests/text-transform/graphite-small-caps-1.html
new file mode 100644
index 0000000000..eb9d35bc88
--- /dev/null
+++ b/layout/reftests/text-transform/graphite-small-caps-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the Graphite 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/sil/CharisSIL-R.ttf);
+}
+body {
+ font: 100px test;
+}
+</style>
+</head>
+<body>
+<div style="font-variant:small-caps">Small Caps
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-small-caps-1-ref.html b/layout/reftests/text-transform/greek-small-caps-1-ref.html
new file mode 100644
index 0000000000..7e30707574
--- /dev/null
+++ b/layout/reftests/text-transform/greek-small-caps-1-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for Greek small-caps</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+/* use a known font, to avoid dependency on platform font behavior */
+@font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+div {
+ font: 150% test;
+ margin: 1em;
+}
+span {
+ font-variant: small-caps;
+}
+</style>
+</head>
+<body lang="en">
+<div>Π<span>ατάτα</span>, Α<span>έρας</span>, Μ<span>άιος</span>, <span>άυλος</span>, <span>αϋπνία</span>, Μ<span>αΐου</span>, <span>χούι</span>, ΆΈΉΊΌΎΏ, Ά<span>κλιτα</span></div>
+<div lang="el">Π<span>ατατα</span>, Α<span>ερας</span>, Μ<span>αϊος</span>, <span>αϋλος</span>, <span>αϋπνία</span>, Μ<span>αϊου</span>, <span>χουι<span>, ΑΕΗΙΟΥΩ, Α<span>κλιτα</span></div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-small-caps-1.html b/layout/reftests/text-transform/greek-small-caps-1.html
new file mode 100644
index 0000000000..ba672429c0
--- /dev/null
+++ b/layout/reftests/text-transform/greek-small-caps-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for Greek small-caps</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+/* use a known font, to avoid dependency on platform font behavior */
+@font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+div {
+ font: 150% test;
+ font-variant: small-caps;
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι, ΆΈΉΊΌΎΏ, Άκλιτα</div>
+<div lang="el">Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι, ΆΈΉΊΌΎΏ, Άκλιτα</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-1-ref.html b/layout/reftests/text-transform/greek-uppercase-1-ref.html
new file mode 100644
index 0000000000..ec38eb4698
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek (NFC)</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+div {
+ font: 150% "Droid Serif", serif; /* explicitly prefer Droid over Charis on Android */
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>ΠΑΤΆΤΑ, ΑΈΡΑΣ, ΜΆΙΟΣ, ΆΥΛΟΣ, ΑΫΠΝΊΑ, ΜΑΪ&#x301;ΟΥ, ΧΟΎΙ</div>
+<div lang="el">ΠΑΤΑΤΑ, ΑΕΡΑΣ, ΜΑΪΟΣ, ΑΫΛΟΣ, ΑΫΠΝΙΑ, ΜΑΪΟΥ, ΧΟΥΙ</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-1a.html b/layout/reftests/text-transform/greek-uppercase-1a.html
new file mode 100644
index 0000000000..af620e9675
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-1a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek (NFC)</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+/* Note that this test depends on finding the same "serif" font for the
+ English- and Greek-tagged elements; on most platforms, our default prefs
+ provide that, but on Android they currently differ, hence the explicit
+ Droid Serif setting below. */
+div {
+ font: 150% "Droid Serif", serif; /* explicitly prefer Droid over Charis on Android */
+ text-transform: uppercase;
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι</div>
+<div lang="el">Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-1b.html b/layout/reftests/text-transform/greek-uppercase-1b.html
new file mode 100644
index 0000000000..a6398e7e85
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-1b.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek (NFC)</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+/* Note that this test depends on finding the same "serif" font for the
+ English- and Greek-tagged elements; on most platforms, our default prefs
+ provide that, but on Android they currently differ, hence the explicit
+ Droid Serif setting below. */
+div {
+ font: 150% "Droid Serif", serif; /* explicitly prefer Droid over Charis on Android */
+ text-transform: uppercase;
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι</div>
+<div lang="el-GR">Πατάτα, Αέρας, Μάιος, άυλος, αϋπνία, Μαΐου, χούι</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-2-ref.html b/layout/reftests/text-transform/greek-uppercase-2-ref.html
new file mode 100644
index 0000000000..2013a4e4af
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-2-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek (NFD)</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+div {
+ font: 150% serif;
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>ΠΑΤΑ&#x301;ΤΑ, ΑΕ&#x301;ΡΑΣ, ΜΑ&#x301;ΙΟΣ, Α&#x301;ΥΛΟΣ, ΑΥ&#x308;ΠΝΙ&#x301;Α, ΜΑΙ&#x308;&#x301;ΟΥ, ΧΟΥ&#x301;Ι</div>
+<div lang="el">ΠΑΤΑΤΑ, ΑΕΡΑΣ, ΜΑΪΟΣ, ΑΫΛΟΣ, ΑΥ&#x308;ΠΝΙΑ, ΜΑΙ&#x308;ΟΥ, ΧΟΥΙ</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-2.html b/layout/reftests/text-transform/greek-uppercase-2.html
new file mode 100644
index 0000000000..11c8d09648
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek (NFD)</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+div {
+ font: 150% serif;
+ text-transform: uppercase;
+ margin: 1em;
+}
+</style>
+</head>
+<body lang="en">
+<div>Πατα&#x301;τα, Αε&#x301;ρας, Μα&#x301;ιος, α&#x301;υλος, αυ&#x308;πνι&#x301;α, Μαι&#x308;&#x301;ου, χου&#x301;ι</div>
+<div lang="el">Πατα&#x301;τα, Αε&#x301;ρας, Μα&#x301;ιος, α&#x301;υλος, αυ&#x308;πνι&#x301;α, Μαι&#x308;&#x301;ου, χου&#x301;ι</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/greek-uppercase-3-ref.html b/layout/reftests/text-transform/greek-uppercase-3-ref.html
new file mode 100644
index 0000000000..66a60a47ea
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-3-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek disjunctive eta</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+div {
+ font: 150% serif;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div lang="en">ΉΣΟΥΝ Ή ΕΓΏ Ή ΕΣΎ (ΝΉ) (ΉΝ) (Ή) (Ή.) Ή</div>
+<div lang="el">ΗΣΟΥΝ Ή ΕΓΩ Ή ΕΣΥ (ΝΗ) (ΗΝ) (Ή) (Ή.) Ή</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text-transform/greek-uppercase-3.html b/layout/reftests/text-transform/greek-uppercase-3.html
new file mode 100644
index 0000000000..4d12475ec2
--- /dev/null
+++ b/layout/reftests/text-transform/greek-uppercase-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Test for uppercasing of Greek disjunctive eta</title>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+<style type="text/css">
+div {
+ font: 150% serif;
+ text-transform: uppercase;
+ margin: 1em;
+}
+</style>
+</head>
+<body>
+<div lang="en">ήσουν ή εγώ ή εσύ (νή) (ήν) (ή) (ή.) ή</div>
+<div lang="el">ήσουν ή εγώ ή εσύ (νή) (ήν) (ή) (ή.) ή</div>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text-transform/irish-lowercase-1-ref.html b/layout/reftests/text-transform/irish-lowercase-1-ref.html
new file mode 100644
index 0000000000..5c04f721a4
--- /dev/null
+++ b/layout/reftests/text-transform/irish-lowercase-1-ref.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html>
+<html lang="ga-IE">
+<head>
+<meta charset="utf-8">
+<title>Test for Irish lowercasing</title>
+<style>
+body {
+ font: 16px/20px monospace;
+ text-transform: none;
+}
+</style>
+</head>
+<body>
+ ár n-acmhainní uisce
+/ ár n-acmhainní uisce
+/ ár n-acmhainní uisce
+/ ár n-acmhainní uisce
+/ ár n-acmhainní uisce
+/ ár nathair
+/ ár nathair
+/ ár nathair
+/ n-a shaighdiúir
+/ gan dul as aca ach le n-a chabhair
+/ eolaíocht na n-ábhar
+/ eolaíocht na n-ábhar
+/ eolaíocht na n-ábhar
+/ eolaíocht na n-ábhar
+/ eolaíocht na n-ábhar
+/ amhrán náisiúnta
+/ amhrán náisiúnta
+/ amhrán náisiúnta
+/ lucht na n-ealaíon
+/ lucht na n-ealaíon
+/ lucht na n-ealaíon
+/ lucht na n-ealaíon
+/ lucht na n-ealaíon
+/ neart daoine
+/ neart daoine
+/ neart daoine
+/ ceol na n-éan
+/ ceol na n-éan
+/ ceol na n-éan
+/ ceol na n-éan
+/ ceol na n-éan
+/ sa néal
+/ sa néal
+/ sa néal
+/ ord na n-imeachtaí
+/ ord na n-imeachtaí
+/ ord na n-imeachtaí
+/ ord na n-imeachtaí
+/ ord na n-imeachtaí
+/ nathair nimhe
+/ nathair nimhe
+/ nathair nimhe
+/ lucht adhartha na n-íomhánna
+/ lucht adhartha na n-íomhánna
+/ lucht adhartha na n-íomhánna
+/ lucht adhartha na n-íomhánna
+/ lucht adhartha na n-íomhánna
+/ níos measa
+/ níos measa
+/ níos measa
+/ gnéithe dár n-oidhreacht
+/ gnéithe dár n-oidhreacht
+/ gnéithe dár n-oidhreacht
+/ gnéithe dár n-oidhreacht
+/ gnéithe dár n-oidhreacht
+/ duine nochta
+/ duine nochta
+/ duine nochta
+/ cultúr na n-óg
+/ cultúr na n-óg
+/ cultúr na n-óg
+/ cultúr na n-óg
+/ cultúr na n-óg
+/ dhá nóiméad
+/ dhá nóiméad
+/ dhá nóiméad
+/ ocht n-uaire sa lá
+/ ocht n-uaire sa lá
+/ ocht n-uaire sa lá
+/ ocht n-uaire sa lá
+/ ocht n-uaire sa lá
+/ gúna nua
+/ gúna nua
+/ gúna nua
+/ formhór na n-údarás
+/ formhór na n-údarás
+/ formhór na n-údarás
+/ formhór na n-údarás
+/ formhór na n-údarás
+/ imoibreoir núicléach
+/ imoibreoir núicléach
+/ imoibreoir núicléach
+/ sean-airteagal
+/ seanairteagal
+/ bunioncaim
+/ bun-ioncaim
+/ buanorduithe
+/ buan-orduithe
+/ ár n-athair
+/ ár n-athair
+/ clár na n-ábhar
+/ clár na n-ábhar
+/ ceol na ndaoine
+/ ceol na ndaoine
+/ táim i ngrá leat
+/ táim i ngrá leat
+/ cén t-am é?
+/ cén t-am é?
+/ cén t-am é?
+/ cén t-am é?
+/ cén t-am é?
+/ tar ar ais!
+/ tar ar ais!
+/ tá an t-ádh orm inniu!
+/ tá an t-ádh orm inniu!
+/ tá an t-ádh orm inniu!
+/ tá an t-ádh orm inniu!
+/ tá an t-ádh orm inniu!
+/ rud tábhachtach
+/ rud tábhachtach
+/ rud tábhachtach
+/ den obair an t-eolas
+/ den obair an t-eolas
+/ den obair an t-eolas
+/ den obair an t-eolas
+/ den obair an t-eolas
+/ an t-éileamh a íoc
+/ an t-éileamh a íoc
+/ an t-éileamh a íoc
+/ an t-éileamh a íoc
+/ an t-éileamh a íoc
+/ an t-inneall cuardaigh is fearr
+/ an t-inneall cuardaigh is fearr
+/ an t-inneall cuardaigh is fearr
+/ an t-inneall cuardaigh is fearr
+/ an t-inneall cuardaigh is fearr
+/ an t-íochtar a chur in uachtar
+/ an t-íochtar a chur in uachtar
+/ an t-íochtar a chur in uachtar
+/ an t-íochtar a chur in uachtar
+/ an t-íochtar a chur in uachtar
+/ tabhair an t-ordú seo dó!
+/ tabhair an t-ordú seo dó!
+/ tabhair an t-ordú seo dó!
+/ tabhair an t-ordú seo dó!
+/ tabhair an t-ordú seo dó!
+/ tá an t-ór buí aige.
+/ tá an t-ór buí aige.
+/ tá an t-ór buí aige.
+/ tá an t-ór buí aige.
+/ tá an t-ór buí aige.
+/ an t-uisce beatha ar an tábla.
+/ an t-uisce beatha ar an tábla.
+/ an t-uisce beatha ar an tábla.
+/ an t-uisce beatha ar an tábla.
+/ an t-uisce beatha ar an tábla.
+/ an t-úrscéal is deireanaí
+/ an t-úrscéal is deireanaí
+/ an t-úrscéal is deireanaí
+/ an t-úrscéal is deireanaí
+/ an t-úrscéal is deireanaí
+/ dréacht-acht
+/ dréachtphlean
+/ dréacht-phlean
+/ dréacht-íocaíocht
+/ áitainmneacha
+/ áit-ainmneacha
+/ státurraithe
+/ stát-urraithe
+/ ar aon tslí
+/ ar aon tslí
+/ amach ón tsnáthaid
+/ amach ón tsnáthaid
+/ ar an tsráid
+/ ar an tsráid
+/ caint an tsráidbhaile
+/ caint an tsráidbhaile
+/ cora crua an tsaoil
+/ cora crua an tsaoil
+/ bholadh an tsáile
+/ bholadh an tsáile
+/ uair sa tseachtain
+/ uair sa tseachtain
+/ deireadh an tséasúir
+/ deireadh an tséasúir
+/ fear an tsiopa
+/ fear an tsiopa
+/ an tsíocháin a choimeád
+/ an tsíocháin a choimeád
+/ an tsochaí faisnéise
+/ an tsochaí faisnéise
+/ gaoth an tsóláis
+/ gaoth an tsóláis
+/ is beag an tsuim iad
+/ is beag an tsuim iad
+/ infheicthe ag an tsúil
+/ infheicthe ag an tsúil
+/ scríobhfaidh
+/ scríobhfaidh
+/ preabphas
+/ preabphas
+/ úsáidtear
+/ úsáidtear
+/ snagcheol
+/ snagcheol
+/ in-athnuaite agatsa
+/ in-athnuaite agatsa
+/ teanga dhomhanda
+/ teanga dhomhanda
+/ réaltsruth
+/ réaltsruth
+/ na hataí
+/ na hataí
+/ t-léine
+/ t-léine
+/ t-léine
+/ t-léine
+/ torc allta
+/ torc allta
+/ tsk tsk tsk a chara
+/ tsk tsk tsk a chara
+</body>
+</html>
diff --git a/layout/reftests/text-transform/irish-lowercase-1a.html b/layout/reftests/text-transform/irish-lowercase-1a.html
new file mode 100644
index 0000000000..71052d98c3
--- /dev/null
+++ b/layout/reftests/text-transform/irish-lowercase-1a.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html>
+<html lang="ga">
+<head>
+<meta charset="utf-8">
+<title>Test for Irish lowercasing</title>
+<style>
+body {
+ font: 16px/20px monospace;
+ text-transform: lowercase;
+}
+</style>
+</head>
+<body>
+ ÁR nACMHAINNÍ UISCE
+/ ÁR N-ACMHAINNÍ UISCE
+/ Ár nAcmhainní Uisce
+/ Ár n-Acmhainní Uisce
+/ ár n-acmhainní uisce
+/ Ár nathair
+/ ÁR NATHAIR
+/ Ár Nathair
+/ N-a shaighdiúir
+/ gan dul as aca ach le nA chabhair
+/ EOLAÍOCHT NA nÁBHAR
+/ EOLAÍOCHT NA n-ÁBHAR
+/ Eolaíocht na nÁbhar
+/ Eolaíocht na n-Ábhar
+/ eolaíocht na n-ábhar
+/ Amhrán náisiúnta
+/ Amhrán Náisiúnta
+/ AMHRÁN NÁISIÚNTA
+/ LUCHT NA nEALAÍON
+/ LUCHT NA n-EALAÍON
+/ Lucht na nEalaíon
+/ Lucht na n-Ealaíon
+/ lucht na n-ealaíon
+/ Neart Daoine
+/ neart daoine
+/ NEART DAOINE
+/ CEOL NA nÉAN
+/ CEOL NA n-ÉAN
+/ Ceol na nÉan
+/ Ceol na n-Éan
+/ ceol na n-éan
+/ Sa Néal
+/ Sa néal
+/ SA NÉAL
+/ ORD NA nIMEACHTAÍ
+/ ORD NA n-IMEACHTAÍ
+/ Ord na nImeachtaí
+/ Ord na n-Imeachtaí
+/ ord na n-imeachtaí
+/ Nathair Nimhe
+/ Nathair nimhe
+/ NATHAIR NIMHE
+/ LUCHT ADHARTHA NA nÍOMHÁNNA
+/ LUCHT ADHARTHA NA n-ÍOMHÁNNA
+/ Lucht Adhartha na nÍomhánna
+/ Lucht Adhartha na n-Íomhánna
+/ lucht adhartha na n-íomhánna
+/ Níos Measa
+/ níos measa
+/ NÍOS MEASA
+/ GNÉITHE DÁR nOIDHREACHT
+/ GNÉITHE DÁR n-OIDHREACHT
+/ Gnéithe Dár nOidhreacht
+/ Gnéithe Dár n-Oidhreacht
+/ gnéithe dár n-oidhreacht
+/ Duine Nochta
+/ Duine nochta
+/ DUINE NOCHTA
+/ CULTÚR NA nÓG
+/ CULTÚR NA n-ÓG
+/ Cultúr na nÓg
+/ Cultúr na n-Óg
+/ cultúr na n-óg
+/ Dhá Nóiméad
+/ Dhá nóiméad
+/ DHÁ NÓIMÉAD
+/ OCHT nUAIRE SA LÁ
+/ OCHT n-UAIRE SA LÁ
+/ Ocht nUaire Sa Lá
+/ Ocht n-Uaire Sa Lá
+/ ocht n-uaire sa lá
+/ Gúna Nua
+/ gúna nua
+/ GÚNA NUA
+/ FORMHÓR NA nÚDARÁS
+/ FORMHÓR NA n-ÚDARÁS
+/ Formhór na nÚdarás
+/ Formhór na n-Údarás
+/ formhór na n-údarás
+/ Imoibreoir Núicléach
+/ Imoibreoir núicléach
+/ IMOIBREOIR NÚICLÉACH
+/ sean-Airteagal
+/ SeanAirteagal
+/ BunIoncaim
+/ Bun-Ioncaim
+/ BuanOrduithe
+/ Buan-Orduithe
+/ ÁR nATHAIR
+/ Ár nAthair
+/ CLÁR NA nÁBHAR
+/ Clár na nÁbhar
+/ CEOL NA nDAOINE
+/ Ceol na nDaoine
+/ TÁIM I nGRÁ LEAT
+/ Táim i nGrá Leat
+/ CÉN tAM É?
+/ CÉN t-AM É?
+/ Cén tAm É?
+/ Cén t-Am É?
+/ cén t-am é?
+/ Tar Ar Ais!
+/ tar ar ais!
+/ TÁ AN tÁDH ORM INNIU!
+/ TÁ AN t-ÁDH ORM INNIU!
+/ Tá An tÁdh Orm Inniu!
+/ Tá An t-Ádh Orm Inniu!
+/ tá an t-ádh orm inniu!
+/ Rud Tábhachtach
+/ Rud tábhachtach
+/ rud tábhachtach
+/ DEN OBAIR AN tEOLAS
+/ DEN OBAIR AN t-EOLAS
+/ Den Obair an tEolas
+/ Den Obair an t-Eolas
+/ den obair an t-eolas
+/ AN tÉILEAMH A ÍOC
+/ AN t-ÉILEAMH A ÍOC
+/ An tÉileamh a Íoc
+/ An t-Éileamh a Íoc
+/ an t-éileamh a íoc
+/ AN tINNEALL CUARDAIGH IS FEARR
+/ AN t-INNEALL CUARDAIGH IS FEARR
+/ An tInneall Cuardaigh Is Fearr
+/ An t-Inneall Cuardaigh Is Fearr
+/ an t-inneall cuardaigh is fearr
+/ AN tÍOCHTAR A CHUR IN UACHTAR
+/ AN t-ÍOCHTAR A CHUR IN UACHTAR
+/ An tÍochtar a Chur In Uachtar
+/ An t-Íochtar a Chur In Uachtar
+/ an t-íochtar a chur in uachtar
+/ TABHAIR AN tORDÚ SEO DÓ!
+/ TABHAIR AN t-ORDÚ SEO DÓ!
+/ Tabhair An tOrdú Seo Dó!
+/ Tabhair An t-Ordú Seo Dó!
+/ tabhair an t-ordú seo dó!
+/ TÁ AN tÓR BUÍ AIGE.
+/ TÁ AN t-ÓR BUÍ AIGE.
+/ Tá An tÓr Buí Aige.
+/ Tá An t-Ór Buí Aige.
+/ tá an t-ór buí aige.
+/ AN tUISCE BEATHA AR AN TÁBLA.
+/ AN t-UISCE BEATHA AR AN TÁBLA.
+/ An tUisce Beatha Ar An Tábla.
+/ An t-Uisce Beatha Ar An Tábla.
+/ an t-uisce beatha ar an tábla.
+/ AN tÚRSCÉAL IS DEIREANAÍ
+/ AN t-ÚRSCÉAL IS DEIREANAÍ
+/ An tÚrscéal Is Deireanaí
+/ An t-Úrscéal Is Deireanaí
+/ an t-úrscéal is deireanaí
+/ Dréacht-Acht
+/ DréachtPhlean
+/ Dréacht-Phlean
+/ Dréacht-Íocaíocht
+/ ÁitAinmneacha
+/ Áit-Ainmneacha
+/ StátUrraithe
+/ Stát-Urraithe
+/ AR AON tSLÍ
+/ Ar Aon tSlí
+/ AMACH ÓN tSNÁTHAID
+/ Amach Ón tSnáthaid
+/ AR AN tSRÁID
+/ Ar An tSráid
+/ CAINT AN tSRÁIDBHAILE
+/ Caint An tSráidbhaile
+/ CORA CRUA AN tSAOIL
+/ Cora Crua An tSaoil
+/ BHOLADH AN tSÁILE
+/ Bholadh An tSáile
+/ UAIR SA tSEACHTAIN
+/ Uair Sa tSeachtain
+/ DEIREADH AN tSÉASÚIR
+/ Deireadh An tSéasúir
+/ FEAR AN tSIOPA
+/ Fear an tSiopa
+/ AN tSÍOCHÁIN A CHOIMEÁD
+/ An tSíocháin a Choimeád
+/ AN tSOCHAÍ FAISNÉISE
+/ An tSochaí Faisnéise
+/ GAOTH AN tSÓLÁIS
+/ Gaoth aN tSóláis
+/ IS BEAG AN tSUIM IAD
+/ Is Beag An tSuim Iad
+/ INFHEICTHE AG AN tSÚIL
+/ Infheicthe Ag An tSúil
+/ SCRÍOBHFAIDH
+/ Scríobhfaidh
+/ PREABPHAS
+/ Preabphas
+/ ÚSÁIDTEAR
+/ Úsáidtear
+/ SNAGCHEOL
+/ Snagcheol
+/ IN-ATHNUAITE AGATSA
+/ In-Athnuaite AGATSA
+/ TEANGA DHOMHANDA
+/ Teanga Dhomhanda
+/ RÉALTSRUTH
+/ Réaltsruth
+/ NA HATAÍ
+/ Na Hataí
+/ T-LÉINE
+/ T-Léine
+/ t-Léine
+/ t-léine
+/ TORC ALLTA
+/ Torc Allta
+/ TSK TSK TSK A CHARA
+/ Tsk Tsk Tsk a Chara
+</body>
+</html>
diff --git a/layout/reftests/text-transform/irish-lowercase-1b.html b/layout/reftests/text-transform/irish-lowercase-1b.html
new file mode 100644
index 0000000000..e53465784e
--- /dev/null
+++ b/layout/reftests/text-transform/irish-lowercase-1b.html
@@ -0,0 +1,226 @@
+<!DOCTYPE html>
+<html lang="ga-IE">
+<head>
+<meta charset="utf-8">
+<title>Test for Irish lowercasing</title>
+<style>
+body {
+ font: 16px/20px monospace;
+ text-transform: lowercase;
+}
+</style>
+</head>
+<body>
+ ÁR nACMHAINNÍ UISCE
+/ ÁR N-ACMHAINNÍ UISCE
+/ Ár nAcmhainní Uisce
+/ Ár n-Acmhainní Uisce
+/ ár n-acmhainní uisce
+/ Ár nathair
+/ ÁR NATHAIR
+/ Ár Nathair
+/ N-a shaighdiúir
+/ gan dul as aca ach le nA chabhair
+/ EOLAÍOCHT NA nÁBHAR
+/ EOLAÍOCHT NA n-ÁBHAR
+/ Eolaíocht na nÁbhar
+/ Eolaíocht na n-Ábhar
+/ eolaíocht na n-ábhar
+/ Amhrán náisiúnta
+/ Amhrán Náisiúnta
+/ AMHRÁN NÁISIÚNTA
+/ LUCHT NA nEALAÍON
+/ LUCHT NA n-EALAÍON
+/ Lucht na nEalaíon
+/ Lucht na n-Ealaíon
+/ lucht na n-ealaíon
+/ Neart Daoine
+/ neart daoine
+/ NEART DAOINE
+/ CEOL NA nÉAN
+/ CEOL NA n-ÉAN
+/ Ceol na nÉan
+/ Ceol na n-Éan
+/ ceol na n-éan
+/ Sa Néal
+/ Sa néal
+/ SA NÉAL
+/ ORD NA nIMEACHTAÍ
+/ ORD NA n-IMEACHTAÍ
+/ Ord na nImeachtaí
+/ Ord na n-Imeachtaí
+/ ord na n-imeachtaí
+/ Nathair Nimhe
+/ Nathair nimhe
+/ NATHAIR NIMHE
+/ LUCHT ADHARTHA NA nÍOMHÁNNA
+/ LUCHT ADHARTHA NA n-ÍOMHÁNNA
+/ Lucht Adhartha na nÍomhánna
+/ Lucht Adhartha na n-Íomhánna
+/ lucht adhartha na n-íomhánna
+/ Níos Measa
+/ níos measa
+/ NÍOS MEASA
+/ GNÉITHE DÁR nOIDHREACHT
+/ GNÉITHE DÁR n-OIDHREACHT
+/ Gnéithe Dár nOidhreacht
+/ Gnéithe Dár n-Oidhreacht
+/ gnéithe dár n-oidhreacht
+/ Duine Nochta
+/ Duine nochta
+/ DUINE NOCHTA
+/ CULTÚR NA nÓG
+/ CULTÚR NA n-ÓG
+/ Cultúr na nÓg
+/ Cultúr na n-Óg
+/ cultúr na n-óg
+/ Dhá Nóiméad
+/ Dhá nóiméad
+/ DHÁ NÓIMÉAD
+/ OCHT nUAIRE SA LÁ
+/ OCHT n-UAIRE SA LÁ
+/ Ocht nUaire Sa Lá
+/ Ocht n-Uaire Sa Lá
+/ ocht n-uaire sa lá
+/ Gúna Nua
+/ gúna nua
+/ GÚNA NUA
+/ FORMHÓR NA nÚDARÁS
+/ FORMHÓR NA n-ÚDARÁS
+/ Formhór na nÚdarás
+/ Formhór na n-Údarás
+/ formhór na n-údarás
+/ Imoibreoir Núicléach
+/ Imoibreoir núicléach
+/ IMOIBREOIR NÚICLÉACH
+/ sean-Airteagal
+/ SeanAirteagal
+/ BunIoncaim
+/ Bun-Ioncaim
+/ BuanOrduithe
+/ Buan-Orduithe
+/ ÁR nATHAIR
+/ Ár nAthair
+/ CLÁR NA nÁBHAR
+/ Clár na nÁbhar
+/ CEOL NA nDAOINE
+/ Ceol na nDaoine
+/ TÁIM I nGRÁ LEAT
+/ Táim i nGrá Leat
+/ CÉN tAM É?
+/ CÉN t-AM É?
+/ Cén tAm É?
+/ Cén t-Am É?
+/ cén t-am é?
+/ Tar Ar Ais!
+/ tar ar ais!
+/ TÁ AN tÁDH ORM INNIU!
+/ TÁ AN t-ÁDH ORM INNIU!
+/ Tá An tÁdh Orm Inniu!
+/ Tá An t-Ádh Orm Inniu!
+/ tá an t-ádh orm inniu!
+/ Rud Tábhachtach
+/ Rud tábhachtach
+/ rud tábhachtach
+/ DEN OBAIR AN tEOLAS
+/ DEN OBAIR AN t-EOLAS
+/ Den Obair an tEolas
+/ Den Obair an t-Eolas
+/ den obair an t-eolas
+/ AN tÉILEAMH A ÍOC
+/ AN t-ÉILEAMH A ÍOC
+/ An tÉileamh a Íoc
+/ An t-Éileamh a Íoc
+/ an t-éileamh a íoc
+/ AN tINNEALL CUARDAIGH IS FEARR
+/ AN t-INNEALL CUARDAIGH IS FEARR
+/ An tInneall Cuardaigh Is Fearr
+/ An t-Inneall Cuardaigh Is Fearr
+/ an t-inneall cuardaigh is fearr
+/ AN tÍOCHTAR A CHUR IN UACHTAR
+/ AN t-ÍOCHTAR A CHUR IN UACHTAR
+/ An tÍochtar a Chur In Uachtar
+/ An t-Íochtar a Chur In Uachtar
+/ an t-íochtar a chur in uachtar
+/ TABHAIR AN tORDÚ SEO DÓ!
+/ TABHAIR AN t-ORDÚ SEO DÓ!
+/ Tabhair An tOrdú Seo Dó!
+/ Tabhair An t-Ordú Seo Dó!
+/ tabhair an t-ordú seo dó!
+/ TÁ AN tÓR BUÍ AIGE.
+/ TÁ AN t-ÓR BUÍ AIGE.
+/ Tá An tÓr Buí Aige.
+/ Tá An t-Ór Buí Aige.
+/ tá an t-ór buí aige.
+/ AN tUISCE BEATHA AR AN TÁBLA.
+/ AN t-UISCE BEATHA AR AN TÁBLA.
+/ An tUisce Beatha Ar An Tábla.
+/ An t-Uisce Beatha Ar An Tábla.
+/ an t-uisce beatha ar an tábla.
+/ AN tÚRSCÉAL IS DEIREANAÍ
+/ AN t-ÚRSCÉAL IS DEIREANAÍ
+/ An tÚrscéal Is Deireanaí
+/ An t-Úrscéal Is Deireanaí
+/ an t-úrscéal is deireanaí
+/ Dréacht-Acht
+/ DréachtPhlean
+/ Dréacht-Phlean
+/ Dréacht-Íocaíocht
+/ ÁitAinmneacha
+/ Áit-Ainmneacha
+/ StátUrraithe
+/ Stát-Urraithe
+/ AR AON tSLÍ
+/ Ar Aon tSlí
+/ AMACH ÓN tSNÁTHAID
+/ Amach Ón tSnáthaid
+/ AR AN tSRÁID
+/ Ar An tSráid
+/ CAINT AN tSRÁIDBHAILE
+/ Caint An tSráidbhaile
+/ CORA CRUA AN tSAOIL
+/ Cora Crua An tSaoil
+/ BHOLADH AN tSÁILE
+/ Bholadh An tSáile
+/ UAIR SA tSEACHTAIN
+/ Uair Sa tSeachtain
+/ DEIREADH AN tSÉASÚIR
+/ Deireadh An tSéasúir
+/ FEAR AN tSIOPA
+/ Fear an tSiopa
+/ AN tSÍOCHÁIN A CHOIMEÁD
+/ An tSíocháin a Choimeád
+/ AN tSOCHAÍ FAISNÉISE
+/ An tSochaí Faisnéise
+/ GAOTH AN tSÓLÁIS
+/ Gaoth aN tSóláis
+/ IS BEAG AN tSUIM IAD
+/ Is Beag An tSuim Iad
+/ INFHEICTHE AG AN tSÚIL
+/ Infheicthe Ag An tSúil
+/ SCRÍOBHFAIDH
+/ Scríobhfaidh
+/ PREABPHAS
+/ Preabphas
+/ ÚSÁIDTEAR
+/ Úsáidtear
+/ SNAGCHEOL
+/ Snagcheol
+/ IN-ATHNUAITE AGATSA
+/ In-Athnuaite AGATSA
+/ TEANGA DHOMHANDA
+/ Teanga Dhomhanda
+/ RÉALTSRUTH
+/ Réaltsruth
+/ NA HATAÍ
+/ Na Hataí
+/ T-LÉINE
+/ T-Léine
+/ t-Léine
+/ t-léine
+/ TORC ALLTA
+/ Torc Allta
+/ TSK TSK TSK A CHARA
+/ Tsk Tsk Tsk a Chara
+</body>
+</html>
diff --git a/layout/reftests/text-transform/irish-uppercase-1-ref.html b/layout/reftests/text-transform/irish-uppercase-1-ref.html
new file mode 100644
index 0000000000..a9dc7ddc12
--- /dev/null
+++ b/layout/reftests/text-transform/irish-uppercase-1-ref.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<html lang="ga-IE">
+<head>
+<meta charset="utf-8">
+<title>Test for Irish uppercasing</title>
+<style>
+body {
+ font: 16px/20px monospace;
+ text-transform: none;
+}
+</style>
+</head>
+<body>
+ ORD NA bhFOCAL
+/ COSÁN NA bhFILÍ
+/ ÁR bPOBAL
+/ NÓRA NA bPORTACH
+/ I dTOSACH BÁIRE
+/ AN GHAEILGE I dTUAISCEART NA hÉIREANN
+/ AS AN gCEANTAR SIN
+/ I gCONTAE NA MÍ AGUS I gCONAMARA
+/ DÉ hAOINE
+/ OIRTHEAR NA hÁISE
+/ PARLAIMINT NA hEORPA
+/ POBLACHT NA hÉIREANN
+/ EALAÍN NA hIODÁILE
+/ NA hÍOSÁNAIGH
+/ ACADAMH NA hOLLSCOLAÍOCHTA
+/ TÍR NA hÓIGE
+/ TOGHCHÁN NA hUACHTARÁNACHTA
+/ NA hÚDARÁIS CHÁNACH
+/ I mBUN MO MHACHNAMH
+/ I mBÉAL FEIRSTE AGUS I mBAILE ÁTHA CLIATH
+/ ÁR nACMHAINNÍ UISCE
+/ EOLAÍOCHT NA nÁBHAR
+/ LUCHT NA nEALAÍON
+/ CEOL NA nÉAN
+/ ORD NA nIMEACHTAÍ
+/ LUCHT ADHARTHA NA nÍOMHÁNNA
+/ GNÉITHE DÁR nOIDHREACHT
+/ CULTÚR NA nÓG
+/ OCHT nUAIRE SA LÁ
+/ FORMHÓR NA nÚDARÁS
+/ ÁR nATHAIR
+/ CLÁR NA nÁBHAR
+/ LOCH nEATHACH
+/ CUMANN NA nÉIREANNACH AONTAITHE
+/ GRÉASÁN NA nIONTAS
+/ NÓIBHÍSEACHT NA nÍOSÁNACH
+/ I gCEANTAR NA nOILEÁN
+/ TÍR NA nÓG
+/ BAILE NA nULTACH
+/ GORT NA nÚLL
+/ CEOL NA nDAOINE
+/ I nDÚN NA nGALL
+/ TÁIM I nGRÁ LEAT
+/ LABHAIR SÉ I nGAEILGE!
+/ CÉN tAM É?
+/ TÁ AN tÁDH ORM INNIU!
+/ DEN OBAIR AN tEOLAS
+/ AN tÉILEAMH A ÍOC
+/ AN tINNEALL CUARDAIGH IS FEARR
+/ AN tÍOCHTAR A CHUR IN UACHTAR
+/ TABHAIR AN tORDÚ SEO DÓ!
+/ TÁ AN tÓR BUÍ AIGE.
+/ AN tUISCE BEATHA AR AN TÁBLA.
+/ AN tÚRSCÉAL IS DEIREANAÍ
+/ AN tACHT OIDEACHAIS
+/ AN tÁIVÉ MÁIRIA
+/ AN tEARRACH ARABACH
+/ AN tÉIRÍ AMACH
+/ AN tIMEALL
+/ AN tÍOSÁNACH PEADAR CANISIUS
+/ AN tOILEÁNACH
+/ AN tÓR MUIRE
+/ AN tUASAL ÉAMON Ó CUÍV
+/ AN tÚDARÁS UM BÓITHRE NÁISIÚNTA
+/ AR AON tSLÍ
+/ BÉAL ÁTHA AN tSLÉIBHE
+/ AMACH ÓN tSNÁTHAID
+/ BANRÍON AN tSNEACHTA
+/ AR AN tSRÁID
+/ CAINT AN tSRÁIDBHAILE
+/ CORA CRUA AN tSAOIL
+/ BHOLADH AN tSÁILE
+/ UAIR SA tSEACHTAIN
+/ DEIREADH AN tSÉASÚIR
+/ FEAR AN tSIOPA
+/ AN tSÍOCHÁIN A CHOIMEÁD
+/ AN tSOCHAÍ FAISNÉISE
+/ GAOTH AN tSÓLÁIS
+/ IS BEAG AN tSUIM IAD
+/ INFHEICTHE AG AN tSÚIL
+/ CNOC AN tSAMHRAIDH
+/ CIONN tSÁILE
+/ AN tSEIRBHÍS PHOIBLÍ
+/ BAILE AN tSÉIPÉIL
+/ AN tSIRIA
+/ AN tSÍN
+/ OIFIG AN tSOLÁTHAIR
+/ POLL AN tSÓMAIS
+/ EOLAIRE AN tSUÍMH
+/ CASADH AN tSÚGÁIN
+/ SCRÍOBHFAIDH
+/ PREABPHAS
+/ ÚSÁIDTEAR
+/ SNAGCHEOL
+/ STÁITSE IMBOLC
+/ IN-ATHNUAITE AGATSA
+/ TEANGA DHOMHANDA
+/ RÉALTSRUTH
+/ NA HATAÍ
+/ NA HATAÍ
+/ ÁR NATHAIR
+/ ÁR NATHAIR
+/ T-LÉINE
+/ TORC ALLTA
+/ TSK TSK TSK A CHARA
+</body>
+</html>
diff --git a/layout/reftests/text-transform/irish-uppercase-1.html b/layout/reftests/text-transform/irish-uppercase-1.html
new file mode 100644
index 0000000000..9e4743917e
--- /dev/null
+++ b/layout/reftests/text-transform/irish-uppercase-1.html
@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<html lang="ga-IE">
+<head>
+<meta charset="utf-8">
+<title>Test for Irish uppercasing</title>
+<style>
+body {
+ font: 16px/20px monospace;
+ text-transform: uppercase;
+}
+</style>
+</head>
+<body>
+ ord na bhfocal
+/ Cosán na bhFilí
+/ ár bpobal
+/ Nóra na bPortach
+/ i dtosach báire
+/ An Ghaeilge i dTuaisceart na hÉireann
+/ as an gceantar sin
+/ I gContae na Mí agus i gConamara
+/ Dé hAoine
+/ Oirthear na hÁise
+/ Parlaimint na hEorpa
+/ Poblacht na hÉireann
+/ Ealaín na hIodáile
+/ na hÍosánaigh
+/ Acadamh na hOllscolaíochta
+/ Tír na hÓige
+/ toghchán na hUachtaránachta
+/ na hÚdaráis Chánach
+/ I mbun mo mhachnamh
+/ I mBéal Feirste agus i mBaile Átha Cliath
+/ ár n-acmhainní uisce
+/ eolaíocht na n-ábhar
+/ lucht na n-ealaíon
+/ ceol na n-éan
+/ ord na n-imeachtaí
+/ lucht adhartha na n-íomhánna
+/ gnéithe dár n-oidhreacht
+/ cultúr na n-óg
+/ ocht n-uaire sa lá
+/ formhór na n-údarás
+/ Ár nAthair
+/ Clár na nÁbhar
+/ Loch nEathach
+/ Cumann na nÉireannach Aontaithe
+/ Gréasán na nIontas
+/ nóibhíseacht na nÍosánach
+/ i gCeantar na nOileán
+/ Tír na nÓg
+/ Baile na nUltach
+/ Gort na nÚll
+/ ceol na ndaoine
+/ i nDún na nGall
+/ táim i ngrá leat
+/ labhair sé i nGaeilge!
+/ cén t-am é?
+/ tá an t-ádh orm inniu!
+/ Den obair an t-eolas
+/ An t-éileamh a íoc
+/ an t-inneall cuardaigh is fearr
+/ an t-íochtar a chur in uachtar
+/ Tabhair an t-ordú seo dó!
+/ Tá an t-ór buí aige.
+/ an t-uisce beatha ar an tábla.
+/ an t-úrscéal is deireanaí
+/ An tAcht Oideachais
+/ an tÁivé Máiria
+/ An tEarrach Arabach
+/ An tÉirí Amach
+/ An tImeall
+/ An tÍosánach Peadar Canisius
+/ An tOileánach
+/ An tÓr Muire
+/ an tUasal Éamon Ó Cuív
+/ An tÚdarás um Bóithre Náisiúnta
+/ ar aon tslí
+/ Béal Átha an tSléibhe
+/ Amach ón tsnáthaid
+/ Banríon an tSneachta
+/ ar an tsráid
+/ Caint an tSráidbhaile
+/ cora crua an tsaoil
+/ bholadh an tsáile
+/ uair sa tseachtain
+/ deireadh an tséasúir
+/ fear an tsiopa
+/ an tsíocháin a choimeád
+/ an tsochaí faisnéise
+/ gaoth an tsóláis
+/ Is beag an tsuim iad
+/ infheicthe ag an tsúil
+/ Cnoc an tSamhraidh
+/ Cionn tSáile
+/ an tSeirbhís Phoiblí
+/ Baile an tSéipéil
+/ An tSiria
+/ An tSín
+/ Oifig an tSoláthair
+/ Poll an tSómais
+/ Eolaire an tSuímh
+/ Casadh an tSúgáin
+/ scríobhfaidh
+/ preabphas
+/ úsáidtear
+/ snagcheol
+/ Stáitse Imbolc
+/ in-athnuaite agatsa
+/ Teanga Dhomhanda
+/ Réaltsruth
+/ na hataí
+/ Na Hataí
+/ ár nathair
+/ Ár Nathair
+/ t-léine
+/ torc allta
+/ tsk tsk tsk a chara
+</body>
+</html>
diff --git a/layout/reftests/text-transform/lowercase-1.html b/layout/reftests/text-transform/lowercase-1.html
new file mode 100644
index 0000000000..ffe1eb2860
--- /dev/null
+++ b/layout/reftests/text-transform/lowercase-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+ <body>
+ <span style="text-transform:lowercase">This text should be lowercased.</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/lowercase-ref.html b/layout/reftests/text-transform/lowercase-ref.html
new file mode 100644
index 0000000000..86e62bd10d
--- /dev/null
+++ b/layout/reftests/text-transform/lowercase-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ this text should be lowercased.
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/lowercase-sigma-1-ref.html b/layout/reftests/text-transform/lowercase-sigma-1-ref.html
new file mode 100644
index 0000000000..bfb53f68e5
--- /dev/null
+++ b/layout/reftests/text-transform/lowercase-sigma-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
+</head>
+<body>
+ <div>
+ σ σς σσς ας σα ασας ασσα (σ) (σς) (σ-σ) α&#x301;ς α&#x301;ς&#x301; α&#x301;σ&#x301;σ&#x301;α
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/lowercase-sigma-1.html b/layout/reftests/text-transform/lowercase-sigma-1.html
new file mode 100644
index 0000000000..dd7941bf7d
--- /dev/null
+++ b/layout/reftests/text-transform/lowercase-sigma-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="content-type" content="text/html;charset=utf-8">
+</head>
+<body>
+ <div style="text-transform:lowercase">
+ Σ ΣΣ ΣΣΣ ΑΣ ΣΑ ΑΣΑΣ ΑΣΣΑ (Σ) (ΣΣ) (Σ-Σ) Α&#x301;Σ Α&#x301;Σ&#x301; Α&#x301;Σ&#x301;Σ&#x301;Α<br>
+ </div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/opentype-small-caps-1-notref.html b/layout/reftests/text-transform/opentype-small-caps-1-notref.html
new file mode 100644
index 0000000000..fd6ace0774
--- /dev/null
+++ b/layout/reftests/text-transform/opentype-small-caps-1-notref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the OpenType 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+body {
+ font: 100px test;
+}
+span {
+ font-size: 80px;
+}
+</style>
+</head>
+<body>
+<div>S<span>MALL</span> C<span>APS</span>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/opentype-small-caps-1-ref.html b/layout/reftests/text-transform/opentype-small-caps-1-ref.html
new file mode 100644
index 0000000000..ead0ecec88
--- /dev/null
+++ b/layout/reftests/text-transform/opentype-small-caps-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the OpenType 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+body {
+ font: 100px test;
+}
+div {
+ font-feature-settings: 'smcp' on;
+}
+</style>
+</head>
+<body>
+<div>Small Caps
+</body>
+</html>
diff --git a/layout/reftests/text-transform/opentype-small-caps-1.html b/layout/reftests/text-transform/opentype-small-caps-1.html
new file mode 100644
index 0000000000..53974db6e9
--- /dev/null
+++ b/layout/reftests/text-transform/opentype-small-caps-1.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style>
+/* load a font that supports the OpenType 'smcp' feature */
+@font-face {
+ font-family: test;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+body {
+ font: 100px test;
+}
+</style>
+</head>
+<body>
+<div style="font-variant:small-caps">Small Caps
+</body>
+</html>
diff --git a/layout/reftests/text-transform/reftest.list b/layout/reftests/text-transform/reftest.list
new file mode 100644
index 0000000000..3ec0038036
--- /dev/null
+++ b/layout/reftests/text-transform/reftest.list
@@ -0,0 +1,49 @@
+# Some text-transform tests may require font fallback
+defaults pref(gfx.font_rendering.fallback.async,false)
+
+== capitalize-1.html capitalize-ref.html
+== capitalize-2.html capitalize-ref.html
+== capitalize-3.html capitalize-3-ref.html
+== capitalize-4.html capitalize-4-ref.html
+== capitalize-5.html capitalize-5-ref.html
+== capitalize-6.html capitalize-6-ref.html
+== capitalize-7.html capitalize-7-ref.html
+== capitalize-7a.html capitalize-7-ref.html
+== capitalize-8.html capitalize-8-ref.html
+== capitalize-9.html capitalize-9-ref.html
+== lowercase-1.html lowercase-ref.html
+== lowercase-sigma-1.html lowercase-sigma-1-ref.html
+random-if(winWidget) == small-caps-1.html small-caps-1-ref.html # fails if default font supports 'smcp'
+== fake-small-caps-1.html fake-small-caps-1-ref.html
+== opentype-small-caps-1.html opentype-small-caps-1-ref.html
+!= opentype-small-caps-1.html opentype-small-caps-1-notref.html
+== graphite-small-caps-1.html graphite-small-caps-1-ref.html
+!= graphite-small-caps-1.html graphite-small-caps-1-notref.html
+== uppercase-1.html uppercase-ref.html
+== uppercase-szlig-1.html uppercase-szlig-ref.html
+# these use DejaVu Sans via @font-face for consistency of results
+fuzzy-if(cocoaWidget,0-250,0-15) == all-upper.html all-upper-ref.html # bug 1140292
+fuzzy(0-1,0-1800) == all-lower.html all-lower-ref.html # bug 1140292
+fuzzy(0-1,0-80) == all-title.html all-title-ref.html
+== smtp-upper.html smtp-upper-ref.html
+== smtp-lower.html smtp-lower-ref.html
+== smtp-title.html smtp-title-ref.html
+== turkish-casing-1.html turkish-casing-1-ref.html
+!= small-caps-turkish-1.html small-caps-turkish-1-notref.html
+== greek-uppercase-1a.html greek-uppercase-1-ref.html
+== greek-uppercase-1b.html greek-uppercase-1-ref.html
+== greek-uppercase-2.html greek-uppercase-2-ref.html
+== greek-uppercase-3.html greek-uppercase-3-ref.html
+== greek-small-caps-1.html greek-small-caps-1-ref.html
+== irish-uppercase-1.html irish-uppercase-1-ref.html
+== irish-lowercase-1a.html irish-lowercase-1-ref.html
+== irish-lowercase-1b.html irish-lowercase-1-ref.html
+== fullwidth-1.html fullwidth-1-ref.html
+== fullwidth-2.html fullwidth-2-ref.html
+== fullwidth-all.html fullwidth-all-ref.html
+
+pref(layout.css.text-transform.uppercase-eszett.enabled,false) == uppercase-eszett-1.html uppercase-eszett-1a-ref.html
+pref(layout.css.text-transform.uppercase-eszett.enabled,true) == uppercase-eszett-1.html uppercase-eszett-1b-ref.html
+
+# Reset default prefs
+defaults
diff --git a/layout/reftests/text-transform/small-caps-1-ref.html b/layout/reftests/text-transform/small-caps-1-ref.html
new file mode 100644
index 0000000000..e342a3d2a2
--- /dev/null
+++ b/layout/reftests/text-transform/small-caps-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<html>
+<body style="font-size:100px;">A<span style="font-size:80%">A</span></body>
+</html>
diff --git a/layout/reftests/text-transform/small-caps-1.html b/layout/reftests/text-transform/small-caps-1.html
new file mode 100644
index 0000000000..d7146b3e34
--- /dev/null
+++ b/layout/reftests/text-transform/small-caps-1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+<body style="font-variant:small-caps; font-size:100px;">Aa</body>
+</html>
diff --git a/layout/reftests/text-transform/small-caps-turkish-1-notref.html b/layout/reftests/text-transform/small-caps-turkish-1-notref.html
new file mode 100644
index 0000000000..4e735277a1
--- /dev/null
+++ b/layout/reftests/text-transform/small-caps-turkish-1-notref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Test for Turkish small-caps behavior</title>
+<style type="text/css">
+@font-face {
+ font-family: libertine;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+div {
+ font-family: libertine;
+}
+</style>
+</head>
+<body>
+<div lang="en" style="font-variant:small-caps">
+Evrensel Kod her yazı karakteri için bir ve yalnız bir sayı şart koşar,
+hangi altyapı,
+hangi yazılım,
+hangi dil olursa olsun.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/small-caps-turkish-1.html b/layout/reftests/text-transform/small-caps-turkish-1.html
new file mode 100644
index 0000000000..be848f4b27
--- /dev/null
+++ b/layout/reftests/text-transform/small-caps-turkish-1.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Test for Turkish small-caps behavior</title>
+<style type="text/css">
+@font-face {
+ font-family: libertine;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+div {
+ font-family: libertine;
+}
+</style>
+</head>
+<body>
+<div lang="tr" style="font-variant:small-caps">
+Evrensel Kod her yazı karakteri için bir ve yalnız bir sayı şart koşar,
+hangi altyapı,
+hangi yazılım,
+hangi dil olursa olsun.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-lower-ref.html b/layout/reftests/text-transform/smtp-lower-ref.html
new file mode 100644
index 0000000000..f6d91314e4
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-lower-ref.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <p>
+&#x10428;
+&#x10429;
+&#x1042A;
+&#x1042B;
+&#x1042C;
+&#x1042D;
+&#x1042E;
+&#x1042F;
+&#x10430;
+&#x10431;
+&#x10432;
+&#x10433;
+&#x10434;
+&#x10435;
+&#x10436;
+&#x10437;
+&#x10438;
+&#x10439;
+&#x1043A;
+&#x1043B;
+&#x1043C;
+&#x1043D;
+&#x1043E;
+&#x1043F;
+&#x10440;
+&#x10441;
+&#x10442;
+&#x10443;
+&#x10444;
+&#x10445;
+&#x10446;
+&#x10447;
+&#x10448;
+&#x10449;
+&#x1044A;
+&#x1044B;
+&#x1044C;
+&#x1044D;
+&#x1044E;
+&#x1044F;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-lower.html b/layout/reftests/text-transform/smtp-lower.html
new file mode 100644
index 0000000000..2d3ffa6d55
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-lower.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ p { text-transform: lowercase; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x10400;
+&#x10401;
+&#x10402;
+&#x10403;
+&#x10404;
+&#x10405;
+&#x10406;
+&#x10407;
+&#x10408;
+&#x10409;
+&#x1040A;
+&#x1040B;
+&#x1040C;
+&#x1040D;
+&#x1040E;
+&#x1040F;
+&#x10410;
+&#x10411;
+&#x10412;
+&#x10413;
+&#x10414;
+&#x10415;
+&#x10416;
+&#x10417;
+&#x10418;
+&#x10419;
+&#x1041A;
+&#x1041B;
+&#x1041C;
+&#x1041D;
+&#x1041E;
+&#x1041F;
+&#x10420;
+&#x10421;
+&#x10422;
+&#x10423;
+&#x10424;
+&#x10425;
+&#x10426;
+&#x10427;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-title-ref.html b/layout/reftests/text-transform/smtp-title-ref.html
new file mode 100644
index 0000000000..c404cfaecf
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-title-ref.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <p>
+&#x10400;x
+&#x10401;x
+&#x10402;x
+&#x10403;x
+&#x10404;x
+&#x10405;x
+&#x10406;x
+&#x10407;x
+&#x10408;x
+&#x10409;x
+&#x1040A;x
+&#x1040B;x
+&#x1040C;x
+&#x1040D;x
+&#x1040E;x
+&#x1040F;x
+&#x10410;x
+&#x10411;x
+&#x10412;x
+&#x10413;x
+&#x10414;x
+&#x10415;x
+&#x10416;x
+&#x10417;x
+&#x10418;x
+&#x10419;x
+&#x1041A;x
+&#x1041B;x
+&#x1041C;x
+&#x1041D;x
+&#x1041E;x
+&#x1041F;x
+&#x10420;x
+&#x10421;x
+&#x10422;x
+&#x10423;x
+&#x10424;x
+&#x10425;x
+&#x10426;x
+&#x10427;x
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-title.html b/layout/reftests/text-transform/smtp-title.html
new file mode 100644
index 0000000000..c3dd440d5c
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-title.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ p { text-transform: capitalize; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x10428;x
+&#x10429;x
+&#x1042A;x
+&#x1042B;x
+&#x1042C;x
+&#x1042D;x
+&#x1042E;x
+&#x1042F;x
+&#x10430;x
+&#x10431;x
+&#x10432;x
+&#x10433;x
+&#x10434;x
+&#x10435;x
+&#x10436;x
+&#x10437;x
+&#x10438;x
+&#x10439;x
+&#x1043A;x
+&#x1043B;x
+&#x1043C;x
+&#x1043D;x
+&#x1043E;x
+&#x1043F;x
+&#x10440;x
+&#x10441;x
+&#x10442;x
+&#x10443;x
+&#x10444;x
+&#x10445;x
+&#x10446;x
+&#x10447;x
+&#x10448;x
+&#x10449;x
+&#x1044A;x
+&#x1044B;x
+&#x1044C;x
+&#x1044D;x
+&#x1044E;x
+&#x1044F;x
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-upper-ref.html b/layout/reftests/text-transform/smtp-upper-ref.html
new file mode 100644
index 0000000000..3d8a69c566
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-upper-ref.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ </head>
+ <body>
+ <p>
+&#x10400;
+&#x10401;
+&#x10402;
+&#x10403;
+&#x10404;
+&#x10405;
+&#x10406;
+&#x10407;
+&#x10408;
+&#x10409;
+&#x1040A;
+&#x1040B;
+&#x1040C;
+&#x1040D;
+&#x1040E;
+&#x1040F;
+&#x10410;
+&#x10411;
+&#x10412;
+&#x10413;
+&#x10414;
+&#x10415;
+&#x10416;
+&#x10417;
+&#x10418;
+&#x10419;
+&#x1041A;
+&#x1041B;
+&#x1041C;
+&#x1041D;
+&#x1041E;
+&#x1041F;
+&#x10420;
+&#x10421;
+&#x10422;
+&#x10423;
+&#x10424;
+&#x10425;
+&#x10426;
+&#x10427;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/smtp-upper.html b/layout/reftests/text-transform/smtp-upper.html
new file mode 100644
index 0000000000..959765aca0
--- /dev/null
+++ b/layout/reftests/text-transform/smtp-upper.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ p { text-transform: uppercase; }
+ </style>
+ </head>
+ <body>
+ <p>
+&#x10428;
+&#x10429;
+&#x1042A;
+&#x1042B;
+&#x1042C;
+&#x1042D;
+&#x1042E;
+&#x1042F;
+&#x10430;
+&#x10431;
+&#x10432;
+&#x10433;
+&#x10434;
+&#x10435;
+&#x10436;
+&#x10437;
+&#x10438;
+&#x10439;
+&#x1043A;
+&#x1043B;
+&#x1043C;
+&#x1043D;
+&#x1043E;
+&#x1043F;
+&#x10440;
+&#x10441;
+&#x10442;
+&#x10443;
+&#x10444;
+&#x10445;
+&#x10446;
+&#x10447;
+&#x10448;
+&#x10449;
+&#x1044A;
+&#x1044B;
+&#x1044C;
+&#x1044D;
+&#x1044E;
+&#x1044F;
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/turkish-casing-1-ref.html b/layout/reftests/text-transform/turkish-casing-1-ref.html
new file mode 100644
index 0000000000..77acf66cad
--- /dev/null
+++ b/layout/reftests/text-transform/turkish-casing-1-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Test for Turkish casing behavior</title>
+</head>
+<body>
+<div lang="tr">
+EVRENSEL KOD HER YAZI KARAKTERİ İÇİN BİR VE YALNIZ BİR SAYI ŞART KOŞAR,
+HANGİ ALTYAPI,
+HANGİ YAZILIM,
+HANGİ DİL OLURSA OLSUN.
+</div>
+<div lang="tr">
+evrensel kod her yazı karakteri için bir ve yalnız bir sayı şart koşar,
+hangi altyapı,
+hangi yazılım,
+hangi dil olursa olsun.
+</div>
+<div lang="tr">
+Evrensel Kod Her Yazı Karakteri İçin Bir Ve Yalnız Bir Sayı Şart Koşar,
+Hangi Altyapı,
+Hangi Yazılım,
+Hangi Dil Olursa Olsun.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/turkish-casing-1.html b/layout/reftests/text-transform/turkish-casing-1.html
new file mode 100644
index 0000000000..976b9dd8cf
--- /dev/null
+++ b/layout/reftests/text-transform/turkish-casing-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<title>Test for Turkish casing behavior</title>
+</head>
+<body>
+<div lang="tr" style="text-transform:uppercase">
+Evrensel Kod her yazı karakteri için bir ve yalnız bir sayı şart koşar,
+hangi altyapı,
+hangi yazılım,
+hangi dil olursa olsun.
+</div>
+<div lang="tr" style="text-transform:lowercase">
+EVRENSEL KOD HER YAZI KARAKTERİ İÇİN BİR VE YALNIZ BİR SAYI ŞART KOŞAR,
+HANGİ ALTYAPI,
+HANGİ YAZILIM,
+HANGİ DİL OLURSA OLSUN.
+</div>
+<div lang="tr" style="text-transform:capitalize">
+Evrensel Kod her yazı karakteri için bir ve yalnız bir sayı şart koşar,
+hangi altyapı,
+hangi yazılım,
+hangi dil olursa olsun.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text-transform/uppercase-1.html b/layout/reftests/text-transform/uppercase-1.html
new file mode 100644
index 0000000000..8f7cd07244
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+ <body>
+ <span style="text-transform:uppercase">This text should be uppercased.</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/uppercase-eszett-1.html b/layout/reftests/text-transform/uppercase-eszett-1.html
new file mode 100644
index 0000000000..fe0d1929f4
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-eszett-1.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div style="text-transform: uppercase;">
+Straße
+Großmann
diff --git a/layout/reftests/text-transform/uppercase-eszett-1a-ref.html b/layout/reftests/text-transform/uppercase-eszett-1a-ref.html
new file mode 100644
index 0000000000..3aae46af63
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-eszett-1a-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div>
+STRASSE
+GROSSMANN
diff --git a/layout/reftests/text-transform/uppercase-eszett-1b-ref.html b/layout/reftests/text-transform/uppercase-eszett-1b-ref.html
new file mode 100644
index 0000000000..9a31e1e555
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-eszett-1b-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<div>
+STRAẞE
+GROẞMANN
diff --git a/layout/reftests/text-transform/uppercase-ref.html b/layout/reftests/text-transform/uppercase-ref.html
new file mode 100644
index 0000000000..794fe4a152
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ THIS TEXT SHOULD BE UPPERCASED.
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/uppercase-szlig-1.html b/layout/reftests/text-transform/uppercase-szlig-1.html
new file mode 100644
index 0000000000..c1774ada34
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-szlig-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <title>CSS 2.1 Test Suite: text-transform</title>
+ <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/text.html#caps-prop" />
+ <meta name="flags" content="" />
+ <body>
+ <span style="text-transform:uppercase">&szlig;</span>
+ </body>
+</html>
diff --git a/layout/reftests/text-transform/uppercase-szlig-ref.html b/layout/reftests/text-transform/uppercase-szlig-ref.html
new file mode 100644
index 0000000000..e73dd456c0
--- /dev/null
+++ b/layout/reftests/text-transform/uppercase-szlig-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ SS
+ </body>
+</html>
diff --git a/layout/reftests/text/1170688-ref.html b/layout/reftests/text/1170688-ref.html
new file mode 100644
index 0000000000..0fe16cc252
--- /dev/null
+++ b/layout/reftests/text/1170688-ref.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html>
+<head>
+<meta charset=utf-8>
+<style type="text/css">
+@font-face {
+ font-family: local-gentium;
+ src: url(../fonts/sil/GenR102.ttf);
+}
+p {
+ font: 300% local-gentium, serif;
+ font-weight: bold;
+ color: rgb(100,255,100);
+ margin: 0;
+}
+</style>
+</head>
+<body>
+<p>Test</p>
+</body>
+</html>
diff --git a/layout/reftests/text/1170688.html b/layout/reftests/text/1170688.html
new file mode 100644
index 0000000000..d83d81b3c7
--- /dev/null
+++ b/layout/reftests/text/1170688.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<html>
+<head>
+<meta charset=utf-8>
+<style type="text/css">
+@font-face {
+ font-family: local-gentium;
+ src: url(../fonts/sil/GenR102.ttf);
+}
+p {
+ font: 300% local-gentium, serif;
+ font-weight: bold;
+ color: rgba(100,255,100, 0.2);
+ margin: 0;
+}
+</style>
+</head>
+<body>
+<p>Test</p>
+</body>
+</html>
diff --git a/layout/reftests/text/1320665-cmap-format-13-ref.html b/layout/reftests/text/1320665-cmap-format-13-ref.html
new file mode 100644
index 0000000000..7f8314e4b9
--- /dev/null
+++ b/layout/reftests/text/1320665-cmap-format-13-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+body {
+ font-family: monospace;
+ font-size: 48px;
+}
+</style>
+</head>
+<body>
+PASS
diff --git a/layout/reftests/text/1320665-cmap-format-13.html b/layout/reftests/text/1320665-cmap-format-13.html
new file mode 100644
index 0000000000..d8992a236c
--- /dev/null
+++ b/layout/reftests/text/1320665-cmap-format-13.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<head>
+<meta charset=utf-8>
+<style>
+/* Adobe Blank 2 font from https://github.com/adobe-fonts/adobe-blank-2/blob/master/adobe-blank-2.css,
+ licensed under the SIL Open Font License, Version 1.1. http://scripts.sil.org/OFL */
+@font-face {
+ font-family: AdobeBlank2;
+ src: url("data:font/opentype;base64,T1RUTwAKAIAAAwAgQ0ZGIN6nWacAAAfMAAABMURTSUcAAAABAAAJCAAAAAhPUy8yAF+xmwAAARAAAABgY21hcAE0tLwAAAasAAABAGhlYWQIOsNZAAAArAAAADZoaGVhB1oD7wAAAOQAAAAkaG10eAPoAHwAAAkAAAAACG1heHAAAlAAAAABCAAAAAZuYW1lc0mXUAAAAXAAAAU6cG9zdP+4ADIAAAesAAAAIAABAAAAAgBB1Q6SE18PPPUAAwPoAAAAANKdP6AAAAAA0p0/oAB8/4gDbANwAAAAAwACAAAAAAAAAAEAAANw/4gAAAPoAHwAfANsAAEAAAAAAAAAAAAAAAAAAAACAABQAAACAAAAAwPoAZAABQAAAooCWAAAAEsCigJYAAABXgAyANwAAAAAAAAAAAAAAAD3/67/+9///w/gAD8AAAAAQURCTwBAAAD//wNw/4gAAANwAHhgLwH/AAAAAAAAAAAAAAAgAAAAAAALAIoAAwABBAkAAACUAAAAAwABBAkAAQAaAJQAAwABBAkAAgAOAK4AAwABBAkAAwA4ALwAAwABBAkABAAaAJQAAwABBAkABQB0APQAAwABBAkABgAWAWgAAwABBAkACAA0AX4AAwABBAkACwA0AbIAAwABBAkADQKWAeYAAwABBAkADgA0BHwAQwBvAHAAeQByAGkAZwBoAHQAIACpACAAMgAwADEAMwAsACAAMgAwADEANQAgAEEAZABvAGIAZQAgAFMAeQBzAHQAZQBtAHMAIABJAG4AYwBvAHIAcABvAHIAYQB0AGUAZAAgACgAaAB0AHQAcAA6AC8ALwB3AHcAdwAuAGEAZABvAGIAZQAuAGMAbwBtAC8AKQAuAEEAZABvAGIAZQAgAEIAbABhAG4AawAgADIAUgBlAGcAdQBsAGEAcgAyAC4AMAAwADEAOwBBAEQAQgBPADsAQQBkAG8AYgBlAEIAbABhAG4AawAyADsAQQBEAE8AQgBFAFYAZQByAHMAaQBvAG4AIAAyAC4AMAAwADEAOwBQAFMAIAAyAC4AMAAwADEAOwBoAG8AdABjAG8AbgB2ACAAMQAuADAALgA4ADgAOwBtAGEAawBlAG8AdABmAC4AbABpAGIAMgAuADUALgA2ADUAMAAxADIAQQBkAG8AYgBlAEIAbABhAG4AawAyAEEAZABvAGIAZQAgAFMAeQBzAHQAZQBtAHMAIABJAG4AYwBvAHIAcABvAHIAYQB0AGUAZABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBkAG8AYgBlAC4AYwBvAG0ALwB0AHkAcABlAC8AVABoAGkAcwAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUAIABpAHMAIABsAGkAYwBlAG4AcwBlAGQAIAB1AG4AZABlAHIAIAB0AGgAZQAgAFMASQBMACAATwBwAGUAbgAgAEYAbwBuAHQAIABMAGkAYwBlAG4AcwBlACwAIABWAGUAcgBzAGkAbwBuACAAMQAuADEALgAgAFQAaABpAHMAIABGAG8AbgB0ACAAUwBvAGYAdAB3AGEAcgBlACAAaQBzACAAZABpAHMAdAByAGkAYgB1AHQAZQBkACAAbwBuACAAYQBuACAAIgBBAFMAIABJAFMAIgAgAEIAQQBTAEkAUwAsACAAVwBJAFQASABPAFUAVAAgAFcAQQBSAFIAQQBOAFQASQBFAFMAIABPAFIAIABDAE8ATgBEAEkAVABJAE8ATgBTACAATwBGACAAQQBOAFkAIABLAEkATgBEACwAIABlAGkAdABoAGUAcgAgAGUAeABwAHIAZQBzAHMAIABvAHIAIABpAG0AcABsAGkAZQBkAC4AIABTAGUAZQAgAHQAaABlACAAUwBJAEwAIABPAHAAZQBuACAARgBvAG4AdAAgAEwAaQBjAGUAbgBzAGUAIABmAG8AcgAgAHQAaABlACAAcwBwAGUAYwBpAGYAaQBjACAAbABhAG4AZwB1AGEAZwBlACwAIABwAGUAcgBtAGkAcwBzAGkAbwBuAHMAIABhAG4AZAAgAGwAaQBtAGkAdABhAHQAaQBvAG4AcwAgAGcAbwB2AGUAcgBuAGkAbgBnACAAeQBvAHUAcgAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEYAbwBuAHQAIABTAG8AZgB0AHcAYQByAGUALgBoAHQAdABwADoALwAvAHMAYwByAGkAcAB0AHMALgBzAGkAbAAuAG8AcgBnAC8ATwBGAEwAAAAAAAEAAwAKAAAADAANAAAAAAD0AAAAAAAAABMAAAAAAADX/wAAAAEAAOAAAAD9zwAAAAEAAP3wAAD//QAAAAEAAQAAAAH//QAAAAEAAgAAAAL//QAAAAEAAwAAAAP//QAAAAEABAAAAAT//QAAAAEABQAAAAX//QAAAAEABgAAAAb//QAAAAEABwAAAAf//QAAAAEACAAAAAj//QAAAAEACQAAAAn//QAAAAEACgAAAAr//QAAAAEACwAAAAv//QAAAAEADAAAAAz//QAAAAEADQAAAA3//QAAAAEADgAAAA7//QAAAAEADwAAAA///QAAAAEAEAAAABD//QAAAAEAAwAAAAAAAP+1ADIAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAIAAQEBDEFkb2JlQmxhbmsyAAEBAS34G/gciwwe+B0B+B4Ci/sM+gD6BAUeKgAfDB+NDCL3Uw/3WRH3Vgwl96wMJAAFAQEGDlZjcEFkb2JlSWRlbnRpdHlDb3B5cmlnaHQgMjAxMywgMjAxNSBBZG9iZSBTeXN0ZW1zIEluY29ycG9yYXRlZCAoaHR0cDovL3d3dy5hZG9iZS5jb20vKS5BZG9iZSBCbGFuayAyQWRvYmVCbGFuazItMgAAAAABAAAAAAIBAUxO+nz7DLf6JLcB9xC3+Sy3A/cQ+gQV/nz5hPp8B/1Y/icV+dIH98X8MwWmsBX7xfg3Bfj2BqZiFf3SB/vF+DMFcGYV98X8NwX89gYOiw4AAQEBCfgfDCaX97kS+46LHAVGiwa9Cr0LAAAAA+gAfAAAAAAAAAABAAAAAA==");
+}
+body {
+ font-family: monospace;
+ font-size: 48px;
+}
+span {
+ font-family: AdobeBlank2;
+ font-size: 24px; /* smaller size to avoid risk of disrupting line height */
+}
+</style>
+</head>
+<body>
+P<span> (fail) </span>A<span>&#x1234;&#x9876;&#xabcd;</span>S<span>&#x10400;&#x1f333;&#xfe0e;</span>S
diff --git a/layout/reftests/text/1331339-script-extensions-shaping-1-ref.html b/layout/reftests/text/1331339-script-extensions-shaping-1-ref.html
new file mode 100644
index 0000000000..aa86bc2977
--- /dev/null
+++ b/layout/reftests/text/1331339-script-extensions-shaping-1-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/TAMLThiruValluvar-Regular.ttf);
+}
+.test {
+ font-family: test;
+ width: -moz-fit-content;
+}
+.mask {
+ background: green;
+ position: relative;
+ top: -.7em;
+ height: .7em;
+}
+</style>
+</head>
+<body>
+<div class="test">
+&#x0BA4;&#x0BC6;&#x0BAA;&#x0BC6;
+<div class="mask"></div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/1331339-script-extensions-shaping-1.html b/layout/reftests/text/1331339-script-extensions-shaping-1.html
new file mode 100644
index 0000000000..1571e806d8
--- /dev/null
+++ b/layout/reftests/text/1331339-script-extensions-shaping-1.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/TAMLThiruValluvar-Regular.ttf);
+}
+.test {
+ font-family: test;
+ width: -moz-fit-content;
+}
+.mask {
+ background: green;
+ position: relative;
+ top: -.7em;
+ height: .7em;
+}
+</style>
+</head>
+<body>
+<div class="test">
+<!--
+The Grantha nukta characters U+1133C should NOT disrupt shaping of the base text.
+-->
+&#x0BA4;&#x0BC6;&#x1133c;&#x0BAA;&#x1133c;&#x0BC6;&#x1133c;
+<!--
+We place a box over the bottom of the text to mask the nuktas from reftest comparison.
+-->
+<div class="mask"></div>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/1349308-1.html b/layout/reftests/text/1349308-1.html
new file mode 100644
index 0000000000..8be4fa849d
--- /dev/null
+++ b/layout/reftests/text/1349308-1.html
@@ -0,0 +1,2 @@
+<!-- bold font should *not* have the same glyph widths as regular face -->
+<span style="font:36px -apple-system;font-weight:bold;padding:2px;background:black">abcdefghijklmnopqrstuvwxyz
diff --git a/layout/reftests/text/1349308-notref.html b/layout/reftests/text/1349308-notref.html
new file mode 100644
index 0000000000..14d4090f91
--- /dev/null
+++ b/layout/reftests/text/1349308-notref.html
@@ -0,0 +1 @@
+<span style="font:36px -apple-system;font-weight:normal;padding:2px;background:black">abcdefghijklmnopqrstuvwxyz
diff --git a/layout/reftests/text/1463020-letter-spacing-text-transform-1-ref.html b/layout/reftests/text/1463020-letter-spacing-text-transform-1-ref.html
new file mode 100644
index 0000000000..956bb8e45e
--- /dev/null
+++ b/layout/reftests/text/1463020-letter-spacing-text-transform-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<style>
+span {
+ font-size: 36px;
+ font-kerning: none;
+}
+#ref {
+ text-transform: uppercase;
+}
+</style>
+<body>
+ <p>The two lines should match:
+ <p><span id="ref">S&nbsp;&nbsp;🇸🇪&nbsp;&nbsp;v&nbsp;&nbsp;e</span>
+ <p><span id="ref">S&nbsp;&nbsp;🇸🇪&nbsp;&nbsp;v&nbsp;&nbsp;e</span>
+</body>
diff --git a/layout/reftests/text/1463020-letter-spacing-text-transform-1.html b/layout/reftests/text/1463020-letter-spacing-text-transform-1.html
new file mode 100644
index 0000000000..e957a9bc98
--- /dev/null
+++ b/layout/reftests/text/1463020-letter-spacing-text-transform-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset=utf-8>
+<style>
+span {
+ font-size: 36px;
+ font-kerning: none;
+}
+#test, #ref {
+ text-transform: uppercase;
+}
+</style>
+<body>
+ <p>The two lines should match:
+ <p><span id="test">S🇸🇪ve</span><span id="nbsp">&nbsp;</span>
+ <p><span id="ref">S&nbsp;&nbsp;🇸🇪&nbsp;&nbsp;v&nbsp;&nbsp;e</span>
+</body>
+<script>
+var nbspWidth = document.getElementById("nbsp").offsetWidth;
+var test = document.getElementById("test");
+test.style.letterSpacing = (2 * nbspWidth) + "px";
+document.documentElement.classList.remove("reftest-wait");
+</script>
diff --git a/layout/reftests/text/1463020-letter-spacing-text-transform-2-ref.html b/layout/reftests/text/1463020-letter-spacing-text-transform-2-ref.html
new file mode 100644
index 0000000000..5a87a4b570
--- /dev/null
+++ b/layout/reftests/text/1463020-letter-spacing-text-transform-2-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<style>
+span {
+ font-size: 36px;
+ font-kerning: none;
+}
+#ref {
+ text-transform: lowercase;
+}
+</style>
+<body>
+ <p>The two lines should match:
+ <p><span id="ref">𐐔&nbsp;𐐯&nbsp;𐑅&nbsp;𐐨&nbsp;𐑉&nbsp;𐐯&nbsp;𐐻</span>
+ <p><span id="ref">𐐔&nbsp;𐐯&nbsp;𐑅&nbsp;𐐨&nbsp;𐑉&nbsp;𐐯&nbsp;𐐻</span>
+</body>
diff --git a/layout/reftests/text/1463020-letter-spacing-text-transform-2.html b/layout/reftests/text/1463020-letter-spacing-text-transform-2.html
new file mode 100644
index 0000000000..fe6e1b69ea
--- /dev/null
+++ b/layout/reftests/text/1463020-letter-spacing-text-transform-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<meta charset=utf-8>
+<style>
+span {
+ font-size: 36px;
+ font-kerning: none;
+}
+#test, #ref {
+ text-transform: lowercase;
+}
+</style>
+<body>
+ <p>The two lines should match:
+ <p><span id="test">𐐔𐐯𐑅𐐨𐑉𐐯𐐻</span><span id="nbsp">&nbsp;</span>
+ <p><span id="ref">𐐔&nbsp;𐐯&nbsp;𐑅&nbsp;𐐨&nbsp;𐑉&nbsp;𐐯&nbsp;𐐻</span>
+</body>
+<script>
+var nbspWidth = document.getElementById("nbsp").offsetWidth;
+var test = document.getElementById("test");
+test.style.letterSpacing = nbspWidth + "px";
+document.documentElement.classList.remove("reftest-wait");
+</script>
diff --git a/layout/reftests/text/1507661-spurious-hyphenation-after-explicit-ref.html b/layout/reftests/text/1507661-spurious-hyphenation-after-explicit-ref.html
new file mode 100644
index 0000000000..3319b863a2
--- /dev/null
+++ b/layout/reftests/text/1507661-spurious-hyphenation-after-explicit-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div lang="en">e-mail-<br>ing</div>
diff --git a/layout/reftests/text/1507661-spurious-hyphenation-after-explicit.html b/layout/reftests/text/1507661-spurious-hyphenation-after-explicit.html
new file mode 100644
index 0000000000..9872e7a29b
--- /dev/null
+++ b/layout/reftests/text/1507661-spurious-hyphenation-after-explicit.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div lang="en" style="width:0;hyphens:auto">e-mailing</div>
diff --git a/layout/reftests/text/1522857-1-ref.html b/layout/reftests/text/1522857-1-ref.html
new file mode 100644
index 0000000000..4547d25d0e
--- /dev/null
+++ b/layout/reftests/text/1522857-1-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="font:300px monospace;width:3ch;text-align:right">ab<br>cd</div>
diff --git a/layout/reftests/text/1522857-1.html b/layout/reftests/text/1522857-1.html
new file mode 100644
index 0000000000..5c1c3c9722
--- /dev/null
+++ b/layout/reftests/text/1522857-1.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="font:300px monospace;width:3ch;text-align:right">ab cd</div>
diff --git a/layout/reftests/text/1637405-pua-shaping-1-notref.html b/layout/reftests/text/1637405-pua-shaping-1-notref.html
new file mode 100644
index 0000000000..a429031d6f
--- /dev/null
+++ b/layout/reftests/text/1637405-pua-shaping-1-notref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/JuniusX-Regular.woff2);
+}
+.test {
+ font: 50px test;
+}
+</style>
+<p>Test passes if the first line has the diacritic right-aligned over the m,
+while the second line has it centered:</p>
+<div class=test><span style="display:inline-block">m</span>&#xF03E;</div>
+<div class=test><span style="display:inline-block">m</span>&#xF03E;</div>
diff --git a/layout/reftests/text/1637405-pua-shaping-1.html b/layout/reftests/text/1637405-pua-shaping-1.html
new file mode 100644
index 0000000000..dfbb365768
--- /dev/null
+++ b/layout/reftests/text/1637405-pua-shaping-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/JuniusX-Regular.woff2);
+}
+.test {
+ font: 50px test;
+}
+</style>
+<p>Test passes if the first line has the diacritic right-aligned over the m,
+while the second line has it centered:</p>
+<div class=test><span style="display:inline-block">m</span>&#xF03E;</div>
+<div class=test>m&#xF03E;</div>
diff --git a/layout/reftests/text/1655364-1-ref.html b/layout/reftests/text/1655364-1-ref.html
new file mode 100644
index 0000000000..97046449ad
--- /dev/null
+++ b/layout/reftests/text/1655364-1-ref.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="font:300px Consolas, monospace;width:3ch;text-align:right">ab<br>cd</div>
diff --git a/layout/reftests/text/1655364-1.html b/layout/reftests/text/1655364-1.html
new file mode 100644
index 0000000000..627d9ac49b
--- /dev/null
+++ b/layout/reftests/text/1655364-1.html
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<div style="font:300px Consolas, monospace;width:3ch;text-align:right">ab cd</div>
diff --git a/layout/reftests/text/1670581-1-ref.html b/layout/reftests/text/1670581-1-ref.html
new file mode 100644
index 0000000000..dd7e052207
--- /dev/null
+++ b/layout/reftests/text/1670581-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: "SourceSerifPro";
+ src: url("../fonts/SourceSerifPro-Regular.ttf.woff2");
+}
+:root {
+ font-family: "SourceSerifPro", monospace;
+ font-size: 2rem;
+}
+</style>
+Foo-bar-baz.
diff --git a/layout/reftests/text/1670581-1.html b/layout/reftests/text/1670581-1.html
new file mode 100644
index 0000000000..0f5958ba6f
--- /dev/null
+++ b/layout/reftests/text/1670581-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: "SourceSerifPro";
+ src: url("../fonts/SourceSerifPro-Regular.ttf.woff2");
+}
+:root {
+ font-family: "SourceSerifPro", monospace;
+ font-size: 2rem;
+}
+</style>
+Foo&#x2010;bar&#x2011;baz.
diff --git a/layout/reftests/text/1673098-1-ref.html b/layout/reftests/text/1673098-1-ref.html
new file mode 100644
index 0000000000..85732c7da9
--- /dev/null
+++ b/layout/reftests/text/1673098-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: "Chunkfive";
+ src: url("../fonts/Chunkfive.otf");
+}
+:root {
+ font-family: "Chunkfive", monospace;
+ font-size: 2rem;
+}
+</style>
+Foo-bar-baz.
diff --git a/layout/reftests/text/1673098-1.html b/layout/reftests/text/1673098-1.html
new file mode 100644
index 0000000000..d4272e15e4
--- /dev/null
+++ b/layout/reftests/text/1673098-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: "Chunkfive";
+ src: url("../fonts/Chunkfive.otf");
+}
+:root {
+ font-family: "Chunkfive", monospace;
+ font-size: 2rem;
+}
+</style>
+Foo&#x2010;bar&#x2011;baz.
diff --git a/layout/reftests/text/444656-ref.html b/layout/reftests/text/444656-ref.html
new file mode 100644
index 0000000000..9b6e4534b4
--- /dev/null
+++ b/layout/reftests/text/444656-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test soft hyphen in rtl text</title>
+ </head>
+ <body dir="rtl">
+ <p>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכל</p>
+ <p>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשת-<br>אבגדהוזחטיכלמנסעפצקרשת</p>
+ </p>
+ </body>
+</html>
diff --git a/layout/reftests/text/444656.html b/layout/reftests/text/444656.html
new file mode 100644
index 0000000000..85232c500a
--- /dev/null
+++ b/layout/reftests/text/444656.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test soft hyphen in rtl text</title>
+ <style>
+ div { width: min-content; position: relative; }
+
+ /*prevent the soft hyphens from contributing to the minimum content width*/
+ div > p:nth-child(2) {
+ position: absolute;
+ top: auto;
+ right: 0;
+ margin-top: 0;
+ width: 100%;
+ }
+ </style>
+ </head>
+ <body dir="rtl">
+ <div>
+ <!-- add a first paragraph with no soft hyphens to set minimum content width -->
+ <p>אבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכלמנסעפצקרשתאבגדהוזחטיכל</p>
+ <p>אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת&shy;אבגדהוזחטיכלמנסעפצקרשת</p>
+ </p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/449555-1-ref.html b/layout/reftests/text/449555-1-ref.html
new file mode 100644
index 0000000000..4ca2caa546
--- /dev/null
+++ b/layout/reftests/text/449555-1-ref.html
@@ -0,0 +1,33 @@
+<!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" dir="ltr" lang="zh" xml:lang="zh">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<style type="text/css">
+ * { word-wrap: normal;}
+</style>
+<title>Test Wordwrap</title>
+</head>
+<body>
+ <p>Test Text Input:<input type="text" id="username" name="username" size="25" value="this is a very loooooooooooooooooooooooooooooooooog text."/></p>
+ <p>Test Password Input:<input type="password" id="password" name="password" size="25" /></p>
+
+<p>
+<select name="num" style="width: 8em">
+<option value="1">1111111111111111111111111111111111111111</option>
+<option value="2">2222222222222222222222222222222222222222</option>
+<option value="3">3333333333333333333333333333333333333333</option>
+<option value="4">4444444444444444444444444444444444444444</option>
+</select>
+</p>
+
+<p>
+<select name="num2" size="6" style="width: 8em">
+<option value="1">1111111111111111111111111111111111111111</option>
+<option value="2">2222222222222222222222222222222222222222</option>
+<option value="3">3333333333333333333333333333333333333333</option>
+<option value="4">4444444444444444444444444444444444444444</option>
+</select>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/449555-1.html b/layout/reftests/text/449555-1.html
new file mode 100644
index 0000000000..7df5d33ba5
--- /dev/null
+++ b/layout/reftests/text/449555-1.html
@@ -0,0 +1,33 @@
+<!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" dir="ltr" lang="zh" xml:lang="zh">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
+<style type="text/css">
+ * { word-wrap: break-word;}
+</style>
+<title>Test Wordwrap</title>
+</head>
+<body>
+ <p>Test Text Input:<input type="text" id="username" name="username" size="25" value="this is a very loooooooooooooooooooooooooooooooooog text."/></p>
+ <p>Test Password Input:<input type="password" id="password" name="password" size="25" /></p>
+
+<p>
+<select name="num" style="width: 8em">
+<option value="1">1111111111111111111111111111111111111111</option>
+<option value="2">2222222222222222222222222222222222222222</option>
+<option value="3">3333333333333333333333333333333333333333</option>
+<option value="4">4444444444444444444444444444444444444444</option>
+</select>
+</p>
+
+<p>
+<select name="num2" size="6" style="width: 8em">
+<option value="1">1111111111111111111111111111111111111111</option>
+<option value="2">2222222222222222222222222222222222222222</option>
+<option value="3">3333333333333333333333333333333333333333</option>
+<option value="4">4444444444444444444444444444444444444444</option>
+</select>
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/467722-ref.html b/layout/reftests/text/467722-ref.html
new file mode 100644
index 0000000000..28777a1cb3
--- /dev/null
+++ b/layout/reftests/text/467722-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body style="font-size: 150px;">
+
+&zwj;&#x9BB8;&#x9143;
+
+</body>
+</html>
diff --git a/layout/reftests/text/467722.html b/layout/reftests/text/467722.html
new file mode 100644
index 0000000000..5c7ae38352
--- /dev/null
+++ b/layout/reftests/text/467722.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body style="font-size: 150px;" onload="document.documentElement.appendChild(document.body);">
+
+&zwj;&#x9BB8;&#x9143;
+
+</body>
+</html>
diff --git a/layout/reftests/text/475092-pos.html b/layout/reftests/text/475092-pos.html
new file mode 100644
index 0000000000..9c907d08f1
--- /dev/null
+++ b/layout/reftests/text/475092-pos.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <style type="text/css">
+ @font-face {
+ font-family: Pos;
+ src: url(../fonts/PositioningTest1.ttf);
+ }
+ p {
+ font-family: Pos;
+ font-size: 50px;
+ opacity: 0.5;
+ }
+ </style>
+</head>
+<body>
+ <!-- The PositioningTest2 font uses a GPOS positioning lookup
+ to replace the 'o' with a raised version of the glyph -->
+ <p>Hello World!</p>
+</body>
diff --git a/layout/reftests/text/475092-ref.html b/layout/reftests/text/475092-ref.html
new file mode 100644
index 0000000000..5e9509783f
--- /dev/null
+++ b/layout/reftests/text/475092-ref.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <style type="text/css">
+ @font-face {
+ font-family: Pos;
+ src: url(../fonts/PositioningTest1.ttf);
+ }
+ p {
+ font-family: Pos;
+ font-size: 50px;
+ opacity: 0.5;
+ }
+ </style>
+</head>
+<body>
+ <!-- The capital O character in the PositioningTest font
+ is actually a raised lowercase o glyph -->
+ <p>HellO WOrld!</p>
+</body>
diff --git a/layout/reftests/text/475092-sub.html b/layout/reftests/text/475092-sub.html
new file mode 100644
index 0000000000..84b675726f
--- /dev/null
+++ b/layout/reftests/text/475092-sub.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <style type="text/css">
+ @font-face {
+ font-family: Pos;
+ src: url(../fonts/PositioningTest2.ttf);
+ }
+ p {
+ font-family: Pos;
+ font-size: 50px;
+ opacity: 0.5;
+ }
+ </style>
+</head>
+<body>
+ <!-- The PositioningTest2 font uses a GSUB substitution lookup
+ to replace the 'o' with a raised version of the glyph -->
+ <p>Hello World!</p>
+</body>
diff --git a/layout/reftests/text/476378-soft-hyphen-fallback-ref.html b/layout/reftests/text/476378-soft-hyphen-fallback-ref.html
new file mode 100644
index 0000000000..30bf4040d9
--- /dev/null
+++ b/layout/reftests/text/476378-soft-hyphen-fallback-ref.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<title>Soft hyphen font fallback (for bug 476378)</title>
+</head>
+<body>
+
+<!-- On OS X, Hoefler Text has a distinctive hyphen; on Windows, Segoe UI does.
+ In each case U+2010 will fall back to a font with a very different glyph. -->
+<div style="width: 50pt;
+ font-family: Hoefler Text, Segoe UI, Trebuchet MS, Lucida Grande;
+ font-size: 24pt;">
+
+<!-- reference text uses an explicit ASCII hyphen at the expected break point -->
+<p>aaa-<br>aa</p>
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/476378-soft-hyphen-fallback.html b/layout/reftests/text/476378-soft-hyphen-fallback.html
new file mode 100644
index 0000000000..f5aaec8ba9
--- /dev/null
+++ b/layout/reftests/text/476378-soft-hyphen-fallback.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<title>Soft hyphen font fallback (for bug 476378)</title>
+</head>
+<body>
+
+<!-- On OS X, Hoefler Text has a distinctive hyphen; on Windows, Segoe UI does.
+ In each case U+2010 will fall back to a font with a very different glyph. -->
+<div style="width: 50pt;
+ font-family: Hoefler Text, Segoe UI, Trebuchet MS, Lucida Grande;
+ font-size: 24pt;">
+
+<!-- test whether soft-hyphen gets rendered from the primary font -->
+<p>aaa&shy;aa</p>
+
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/577380-ref.html b/layout/reftests/text/577380-ref.html
new file mode 100644
index 0000000000..ebc48f1461
--- /dev/null
+++ b/layout/reftests/text/577380-ref.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<style type="text/css">
+body {
+ font-family: Times; /* this test is only for OS X, we know Times will be there */
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+&#xfb01;
+</body>
+</html>
diff --git a/layout/reftests/text/577380.html b/layout/reftests/text/577380.html
new file mode 100644
index 0000000000..b4368c8651
--- /dev/null
+++ b/layout/reftests/text/577380.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+<style type="text/css">
+body {
+ font-family: Times; /* this test is only for OS X, we know Times will be there */
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+fi
+</body>
+</html>
diff --git a/layout/reftests/text/726392-1-ref.html b/layout/reftests/text/726392-1-ref.html
new file mode 100644
index 0000000000..bf19e00f52
--- /dev/null
+++ b/layout/reftests/text/726392-1-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; letter-spacing: 10px}
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body>
+ <p class="alignLeft alignLastAuto">test</p>
+ <p class="alignLeft alignLastLeft">test</p>
+ <p class="alignLeft alignLastRight">test</p>
+ <p class="alignLeft alignLastCenter">test</p>
+ <p class="alignLeft alignLastJustify">test</p>
+ <p class="alignLeft alignLastStart">test</p>
+ <p class="alignLeft alignLastEnd">test</p>
+ <p class="alignJustify alignLastAuto">test</p>
+ <p class="alignJustify alignLastLeft">test</p>
+ <p class="alignJustify alignLastRight">test</p>
+ <p class="alignJustify alignLastCenter">test</p>
+ <p class="alignJustify alignLastJustify">test</p>
+ <p class="alignJustify alignLastStart">test</p>
+ <p class="alignJustify alignLastEnd">test</p>
+ <p class="alignStart alignLastAuto">test</p>
+ <p class="alignStart alignLastLeft">test</p>
+ <p class="alignStart alignLastRight">test</p>
+ <p class="alignStart alignLastCenter">test</p>
+ <p class="alignStart alignLastJustify">test</p>
+ <p class="alignStart alignLastStart">test</p>
+ <p class="alignStart alignLastEnd">test</p>
+ <p class="alignEnd alignLastAuto">test</p>
+ <p class="alignEnd alignLastLeft">test</p>
+ <p class="alignEnd alignLastRight">test</p>
+ <p class="alignEnd alignLastCenter">test</p>
+ <p class="alignEnd alignLastJustify">test</p>
+ <p class="alignEnd alignLastStart">test</p>
+ <p class="alignEnd alignLastEnd">test</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/726392-1.html b/layout/reftests/text/726392-1.html
new file mode 100644
index 0000000000..e45288ad9a
--- /dev/null
+++ b/layout/reftests/text/726392-1.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; letter-spacing: 10px}
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body>
+ <div id="e" style="width:50%">
+ <p class="alignLeft alignLastAuto">test</p>
+ <p class="alignLeft alignLastLeft">test</p>
+ <p class="alignLeft alignLastRight">test</p>
+ <p class="alignLeft alignLastCenter">test</p>
+ <p class="alignLeft alignLastJustify">test</p>
+ <p class="alignLeft alignLastStart">test</p>
+ <p class="alignLeft alignLastEnd">test</p>
+ <p class="alignJustify alignLastAuto">test</p>
+ <p class="alignJustify alignLastLeft">test</p>
+ <p class="alignJustify alignLastRight">test</p>
+ <p class="alignJustify alignLastCenter">test</p>
+ <p class="alignJustify alignLastJustify">test</p>
+ <p class="alignJustify alignLastStart">test</p>
+ <p class="alignJustify alignLastEnd">test</p>
+ <p class="alignStart alignLastAuto">test</p>
+ <p class="alignStart alignLastLeft">test</p>
+ <p class="alignStart alignLastRight">test</p>
+ <p class="alignStart alignLastCenter">test</p>
+ <p class="alignStart alignLastJustify">test</p>
+ <p class="alignStart alignLastStart">test</p>
+ <p class="alignStart alignLastEnd">test</p>
+ <p class="alignEnd alignLastAuto">test</p>
+ <p class="alignEnd alignLastLeft">test</p>
+ <p class="alignEnd alignLastRight">test</p>
+ <p class="alignEnd alignLastCenter">test</p>
+ <p class="alignEnd alignLastJustify">test</p>
+ <p class="alignEnd alignLastStart">test</p>
+ <p class="alignEnd alignLastEnd">test</p>
+
+<script type="text/javascript">
+function resizeElements()
+{
+ var enclosingDiv = document.getElementById("e");
+ enclosingDiv.style.width = "100%";
+ document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", resizeElements);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/text/726392-2-ref.html b/layout/reftests/text/726392-2-ref.html
new file mode 100644
index 0000000000..645c49b033
--- /dev/null
+++ b/layout/reftests/text/726392-2-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; }
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body dir="rtl">
+ <p dir="rtl" class="alignLeft alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastEnd">בדיקה</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/726392-2.html b/layout/reftests/text/726392-2.html
new file mode 100644
index 0000000000..57b58e32fc
--- /dev/null
+++ b/layout/reftests/text/726392-2.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; }
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body>
+ <div id="e" style="width:50%">
+ <p dir="rtl" class="alignLeft alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignLeft alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignJustify alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignStart alignLastEnd">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastAuto">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastLeft">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastRight">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastCenter">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastJustify">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastStart">בדיקה</p>
+ <p dir="rtl" class="alignEnd alignLastEnd">בדיקה</p>
+ </div>
+<script type="text/javascript">
+function resizeElements()
+{
+ var enclosingDiv = document.getElementById("e");
+ enclosingDiv.style.width = "100%";
+ document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", resizeElements);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/text/726392-3-ref.html b/layout/reftests/text/726392-3-ref.html
new file mode 100644
index 0000000000..338e7ba85c
--- /dev/null
+++ b/layout/reftests/text/726392-3-ref.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; white-space: pre-line; letter-spacing: 10px; font-size:6px;}
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body style="width:590px; height:590px;">
+ <div>
+ <p class="alignLeft alignLastAuto">test
+test</p>
+ <p class="alignLeft alignLastLeft">test
+test</p>
+ <p class="alignLeft alignLastRight">test
+test</p>
+ <p class="alignLeft alignLastCenter">test
+test</p>
+ <p class="alignLeft alignLastJustify">test
+test</p>
+ <p class="alignLeft alignLastStart">test
+test</p>
+ <p class="alignLeft alignLastEnd">test
+test</p>
+ <p class="alignJustify alignLastAuto">test
+test</p>
+ <p class="alignJustify alignLastLeft">test
+test</p>
+ <p class="alignJustify alignLastRight">test
+test</p>
+ <p class="alignJustify alignLastCenter">test
+test</p>
+ <p class="alignJustify alignLastJustify">test
+test</p>
+ <p class="alignJustify alignLastStart">test
+test</p>
+ <p class="alignJustify alignLastEnd">test
+test</p>
+ <p class="alignStart alignLastAuto">test
+test</p>
+ <p class="alignStart alignLastLeft">test
+test</p>
+ <p class="alignStart alignLastRight">test
+test</p>
+ <p class="alignStart alignLastCenter">test
+test</p>
+ <p class="alignStart alignLastJustify">test
+test</p>
+ <p class="alignStart alignLastStart">test
+test</p>
+ <p class="alignStart alignLastEnd">test
+test</p>
+ <p class="alignEnd alignLastAuto">test
+test</p>
+ <p class="alignEnd alignLastLeft">test
+test</p>
+ <p class="alignEnd alignLastRight">test
+test</p>
+ <p class="alignEnd alignLastCenter">test
+test</p>
+ <p class="alignEnd alignLastJustify">test
+test</p>
+ <p class="alignEnd alignLastStart">test
+test</p>
+ <p class="alignEnd alignLastEnd">test
+test</p>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/726392-3.html b/layout/reftests/text/726392-3.html
new file mode 100644
index 0000000000..76a7b284b9
--- /dev/null
+++ b/layout/reftests/text/726392-3.html
@@ -0,0 +1,94 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <head>
+ <meta charset="utf-8">
+ <title>Bug 726392</title>
+ <style type="text/css">
+ p { margin: 0; white-space: pre-line; letter-spacing: 10px; font-size:6px;}
+ .alignLeft { text-align: left; }
+ .alignRight { text-align: right; }
+ .alignCenter { text-align: center; }
+ .alignJustify { text-align: justify; }
+ .alignStart { text-align: start; }
+ .alignEnd { text-align: end; }
+ .alignLastAuto { text-align-last: auto; }
+ .alignLastLeft { text-align-last: left; }
+ .alignLastRight { text-align-last: right; }
+ .alignLastCenter { text-align-last: center; }
+ .alignLastJustify { text-align-last: justify; }
+ .alignLastStart { text-align-last: start; }
+ .alignLastEnd { text-align-last: end; }
+ </style>
+</head>
+ <body style="width:590px; height:590px;">
+ <div id="e" style="width:50%">
+ <p class="alignLeft alignLastAuto">test
+test</p>
+ <p class="alignLeft alignLastLeft">test
+test</p>
+ <p class="alignLeft alignLastRight">test
+test</p>
+ <p class="alignLeft alignLastCenter">test
+test</p>
+ <p class="alignLeft alignLastJustify">test
+test</p>
+ <p class="alignLeft alignLastStart">test
+test</p>
+ <p class="alignLeft alignLastEnd">test
+test</p>
+ <p class="alignJustify alignLastAuto">test
+test</p>
+ <p class="alignJustify alignLastLeft">test
+test</p>
+ <p class="alignJustify alignLastRight">test
+test</p>
+ <p class="alignJustify alignLastCenter">test
+test</p>
+ <p class="alignJustify alignLastJustify">test
+test</p>
+ <p class="alignJustify alignLastStart">test
+test</p>
+ <p class="alignJustify alignLastEnd">test
+test</p>
+ <p class="alignStart alignLastAuto">test
+test</p>
+ <p class="alignStart alignLastLeft">test
+test</p>
+ <p class="alignStart alignLastRight">test
+test</p>
+ <p class="alignStart alignLastCenter">test
+test</p>
+ <p class="alignStart alignLastJustify">test
+test</p>
+ <p class="alignStart alignLastStart">test
+test</p>
+ <p class="alignStart alignLastEnd">test
+test</p>
+ <p class="alignEnd alignLastAuto">test
+test</p>
+ <p class="alignEnd alignLastLeft">test
+test</p>
+ <p class="alignEnd alignLastRight">test
+test</p>
+ <p class="alignEnd alignLastCenter">test
+test</p>
+ <p class="alignEnd alignLastJustify">test
+test</p>
+ <p class="alignEnd alignLastStart">test
+test</p>
+ <p class="alignEnd alignLastEnd">test
+test</p>
+ </div>
+<script type="text/javascript">
+function resizeElements()
+{
+ var enclosingDiv = document.getElementById("e");
+ enclosingDiv.style.width = "100%";
+ document.documentElement.removeAttribute("class");
+}
+
+document.addEventListener("MozReftestInvalidate", resizeElements);
+</script>
+
+</body>
+</html>
diff --git a/layout/reftests/text/745555-1-ref.html b/layout/reftests/text/745555-1-ref.html
new file mode 100644
index 0000000000..5a411b9bc8
--- /dev/null
+++ b/layout/reftests/text/745555-1-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<title>Bug 745555 - line-wrapping with uppercased es-zet</title>
+<style type="text/css">
+div {
+ font-family: monospace;
+ display: inline-block;
+ border: 1px solid red;
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<div style="width:3.0em">SS SS SS SS SS</div>
+<div style="width:3.2em">SS SS SS SS SS</div>
+<div style="width:3.4em">SS SS SS SS SS</div>
+<div style="width:3.6em">SS SS SS SS SS</div>
+<div style="width:3.8em">SS SS SS SS SS</div>
+<div style="width:4.0em">SS SS SS SS SS</div>
+<div style="width:4.2em">SS SS SS SS SS</div>
+<div style="width:4.4em">SS SS SS SS SS</div>
+<div style="width:4.6em">SS SS SS SS SS</div>
+<div style="width:4.8em">SS SS SS SS SS</div>
+<div style="width:5.0em">SS SS SS SS SS</div>
+</body>
+</html>
diff --git a/layout/reftests/text/745555-1.html b/layout/reftests/text/745555-1.html
new file mode 100644
index 0000000000..09b2448f53
--- /dev/null
+++ b/layout/reftests/text/745555-1.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<title>Bug 745555 - line-wrapping with uppercased es-zet</title>
+<style type="text/css">
+div {
+ font-family: monospace;
+ text-transform: uppercase;
+ display: inline-block;
+ border: 1px solid red;
+ vertical-align: top;
+}
+</style>
+</head>
+<body>
+<div style="width:3.0em">ß ß ß ß ß</div>
+<div style="width:3.2em">ß ß ß ß ß</div>
+<div style="width:3.4em">ß ß ß ß ß</div>
+<div style="width:3.6em">ß ß ß ß ß</div>
+<div style="width:3.8em">ß ß ß ß ß</div>
+<div style="width:4.0em">ß ß ß ß ß</div>
+<div style="width:4.2em">ß ß ß ß ß</div>
+<div style="width:4.4em">ß ß ß ß ß</div>
+<div style="width:4.6em">ß ß ß ß ß</div>
+<div style="width:4.8em">ß ß ß ß ß</div>
+<div style="width:5.0em">ß ß ß ß ß</div>
+</body>
+</html>
diff --git a/layout/reftests/text/745555-2-ref.html b/layout/reftests/text/745555-2-ref.html
new file mode 100644
index 0000000000..5bafb6b057
--- /dev/null
+++ b/layout/reftests/text/745555-2-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<title>Bug 745555 - preformatted tabs/newlines with uppercased es-zet</title>
+</head>
+<body>
+<pre>
+FOO SSAR BASS
+ FOOBAR
+THE QUICK BROWN FOX JUMPSS
+</pre>
+</body>
+</html>
diff --git a/layout/reftests/text/745555-2.html b/layout/reftests/text/745555-2.html
new file mode 100644
index 0000000000..243f0f860a
--- /dev/null
+++ b/layout/reftests/text/745555-2.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html;charset=utf-8">
+<title>Bug 745555 - preformatted tabs/newlines with uppercased es-zet</title>
+<style type="text/css">
+pre {
+ text-transform: uppercase;
+}
+</style>
+</head>
+<body>
+<pre>
+foo ßar baß
+ foobar
+the quick brown fox jumpß
+</pre>
+</body>
+</html>
diff --git a/layout/reftests/text/820255-ref.html b/layout/reftests/text/820255-ref.html
new file mode 100644
index 0000000000..5a872b4919
--- /dev/null
+++ b/layout/reftests/text/820255-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Test - Bug 820255</title>
+ </head>
+ <body>
+ <div>A&#x1680;<br>B</div>
+ <div>A&#x205F;<br>B</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/820255.html b/layout/reftests/text/820255.html
new file mode 100644
index 0000000000..5f7afe7a90
--- /dev/null
+++ b/layout/reftests/text/820255.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div { width: 0px; }
+ </style>
+ <title>Test - Bug 820255</title>
+ </head>
+ <body>
+ <div>A&#x1680;B</div>
+ <div>A&#x205F;B</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-1-ref.html b/layout/reftests/text/arabic-fallback-1-ref.html
new file mode 100644
index 0000000000..15ab67df00
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-1-ref.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Arabic: &#xFE8D;&#xFEDF;&#xFECC;&#xFEAE;&#xFE91;&#xFEF2;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-1.html b/layout/reftests/text/arabic-fallback-1.html
new file mode 100644
index 0000000000..091f3e48e0
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-1.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Arabic: &#x627;&#x644;&#x639;&#x631;&#x628;&#x64A;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-2-ref.html b/layout/reftests/text/arabic-fallback-2-ref.html
new file mode 100644
index 0000000000..5f2ade3366
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-2-ref.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>With vowels:
+&#xFE83;&#x064E;&#xFE91;&#x0652;&#xFEA0;&#x064E;&#xFEAA;&#x0650;&#xFEF3;&#x064E;&#x0651;&#xFE94;
+&#xFECB;&#x064E;&#xFEAE;&#x064E;&#xFE91;&#x0650;&#xFEF4;&#x064E;&#x0651;&#xFE94;
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-2.html b/layout/reftests/text/arabic-fallback-2.html
new file mode 100644
index 0000000000..5ad2e46cca
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-2.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>With vowels:
+&#x0623;&#x064E;&#x0628;&#x0652;&#x062C;&#x064E;&#x062F;&#x0650;&#x064A;&#x064E;&#x0651;&#x0629;
+&#x0639;&#x064E;&#x0631;&#x064E;&#x0628;&#x0650;&#x064A;&#x064E;&#x0651;&#x0629;
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-3-ref.html b/layout/reftests/text/arabic-fallback-3-ref.html
new file mode 100644
index 0000000000..b7fb15922e
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-3-ref.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Ligatures: &#xFEFB; &#xFEDF;&#xFEFC;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-3.html b/layout/reftests/text/arabic-fallback-3.html
new file mode 100644
index 0000000000..ed05df74b0
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-3.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Ligatures: &#x0644;&#x0627; &#x0644;&#x0644;&#x0627;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-4-ref.html b/layout/reftests/text/arabic-fallback-4-ref.html
new file mode 100644
index 0000000000..3a1f3b7436
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-4-ref.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Ligature with vowel: &#xFEDF;&#x064E;&#xFE8E;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-fallback-4.html b/layout/reftests/text/arabic-fallback-4.html
new file mode 100644
index 0000000000..6a18456f63
--- /dev/null
+++ b/layout/reftests/text/arabic-fallback-4.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DroidSansArabic-noGSUB.ttf);
+}
+body {
+ font-family: test;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+<p>Ligature with vowel: &#x0644;&#x064E;&#x0627;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-final-ligature-spacing-ref.html b/layout/reftests/text/arabic-final-ligature-spacing-ref.html
new file mode 100644
index 0000000000..63dbff9911
--- /dev/null
+++ b/layout/reftests/text/arabic-final-ligature-spacing-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<style>
+p { font: 36px Geeza Pro, sans-serif; }
+</style>
+
+<p>&#x633;&#x644;&#x627;&#x645;</p>
diff --git a/layout/reftests/text/arabic-final-ligature-spacing.html b/layout/reftests/text/arabic-final-ligature-spacing.html
new file mode 100644
index 0000000000..7ecae5f489
--- /dev/null
+++ b/layout/reftests/text/arabic-final-ligature-spacing.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+p { font: 36px Geeza Pro, sans-serif; }
+span { font-variant: small-caps; }
+</style>
+
+<!-- bug 739117: breaking the run after the lam-alef ligature
+ should NOT cause extra space to appear -->
+<p>&#x633;&#x644;&#x627;<span>&#x645;</span></p>
diff --git a/layout/reftests/text/arabic-marks-1-ref.html b/layout/reftests/text/arabic-marks-1-ref.html
new file mode 100644
index 0000000000..78c86992aa
--- /dev/null
+++ b/layout/reftests/text/arabic-marks-1-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>bug 873902 - marks should not affect width of Arabic text</title>
+<style>
+body {
+ background-color: white;
+ font-size: 50px;
+ margin: 20px;
+}
+
+/* Try several fonts that should be available on Windows; at least Courier New is also on OS X.
+ Elsewhere, we may fall back to default, which may or may not be "interesting" to test,
+ but should pass harmlessly unless there's actually a broken font that shapes badly. */
+#a {
+ font-family: Andalus;
+}
+#b {
+ font-family: Courier New;
+}
+#c {
+ font-family: Simplified Arabic;
+}
+
+.test {
+ color: white;
+}
+</style>
+</head>
+<body>
+<div id="a">
+foo<span class="test">الرحمن الرحيم</span>bar
+</div>
+<div id="b">
+foo<span class="test">الرحمن الرحيم</span>bar
+</div>
+<div id="c">
+foo<span class="test">الرحمن الرحيم</span>bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-marks-1.html b/layout/reftests/text/arabic-marks-1.html
new file mode 100644
index 0000000000..442de13ab7
--- /dev/null
+++ b/layout/reftests/text/arabic-marks-1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>bug 873902 - marks should not affect width of Arabic text</title>
+<style>
+body {
+ background-color: white;
+ font-size: 50px;
+ margin: 20px;
+}
+
+/* Try several fonts that should be available on Windows; at least Courier New is also on OS X.
+ Elsewhere, we may fall back to default, which may or may not be "interesting" to test,
+ but should pass harmlessly unless there's actually a broken font that shapes badly. */
+#a {
+ font-family: Andalus;
+}
+#b {
+ font-family: Courier New;
+}
+#c {
+ font-family: Simplified Arabic;
+}
+
+.test {
+ color: white;
+}
+</style>
+</head>
+<body>
+<div id="a">
+foo<span class="test">الرَّحْمَنِ الرَّحِيمِ</span>bar
+</div>
+<div id="b">
+foo<span class="test">الرَّحْمَنِ الرَّحِيمِ</span>bar
+</div>
+<div id="c">
+foo<span class="test">الرَّحْمَنِ الرَّحِيمِ</span>bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-shaping-1-ref.html b/layout/reftests/text/arabic-shaping-1-ref.html
new file mode 100644
index 0000000000..eed7babab2
--- /dev/null
+++ b/layout/reftests/text/arabic-shaping-1-ref.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+body {
+ font-family: test;
+ font-size: 60pt;
+}
+</style>
+</head>
+<body>
+<p>Arabic: &#xFE8D;&#xFEDF;&#xFECC;&#xFEAE;&#xFE91;&#xFEF2;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arabic-shaping-1.html b/layout/reftests/text/arabic-shaping-1.html
new file mode 100644
index 0000000000..e75e674ca8
--- /dev/null
+++ b/layout/reftests/text/arabic-shaping-1.html
@@ -0,0 +1,17 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+body {
+ font-family: test;
+ font-size: 60pt;
+}
+</style>
+</head>
+<body>
+<p>Arabic: &#x627;&#x644;&#x639;&#x631;&#x628;&#x64A;</p>
+</body>
+</html>
diff --git a/layout/reftests/text/arial-bold-lam-alef-1-ref.html b/layout/reftests/text/arial-bold-lam-alef-1-ref.html
new file mode 100644
index 0000000000..91a9445246
--- /dev/null
+++ b/layout/reftests/text/arial-bold-lam-alef-1-ref.html
@@ -0,0 +1,5 @@
+<html>
+<body style="font-family: arial; font-size: 36px; font-weight: bold;">
+&#xFEFB; &#xFEDF;&#xFEFC;
+</body>
+</html>
diff --git a/layout/reftests/text/arial-bold-lam-alef-1.html b/layout/reftests/text/arial-bold-lam-alef-1.html
new file mode 100644
index 0000000000..2772932d70
--- /dev/null
+++ b/layout/reftests/text/arial-bold-lam-alef-1.html
@@ -0,0 +1,5 @@
+<html>
+<body style="font-family: arial; font-size: 36px; font-weight: bold;">
+&#x644;&#x627; &#x644;&#x644;&#x627;
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-1-notref.html b/layout/reftests/text/auto-hyphenation-1-notref.html
new file mode 100644
index 0000000000..8900244311
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-1-notref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 5em; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-1-ref.html b/layout/reftests/text/auto-hyphenation-1-ref.html
new file mode 100644
index 0000000000..98a59945d6
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 5em; hyphens: manual; font-family:sans-serif;">
+su&shy;per&shy;cal&shy;ifrag&shy;ilis&shy;tic&shy;ex&shy;pi&shy;ali&shy;do&shy;cious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-1.html b/layout/reftests/text/auto-hyphenation-1.html
new file mode 100644
index 0000000000..5822adbef1
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- simple test for automatic hyphenation -->
+<body lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-10-ref.html b/layout/reftests/text/auto-hyphenation-10-ref.html
new file mode 100644
index 0000000000..8914ccbfe1
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-10-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<meta charset="UTF-8">
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: none;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-10.html b/layout/reftests/text/auto-hyphenation-10.html
new file mode 100644
index 0000000000..3411208b5a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-10.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<meta charset="UTF-8">
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-1a.html b/layout/reftests/text/auto-hyphenation-1a.html
new file mode 100644
index 0000000000..2e82f92185
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-1a.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- adding random <span>s should not affect hyphenation -->
+<body lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+super<span>cali</span>frag<span>ili</span>sti<span>cex</span>pialidoc<span>i</span>ous
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-2-ref.html b/layout/reftests/text/auto-hyphenation-2-ref.html
new file mode 100644
index 0000000000..bfb1a4c3bd
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-2-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+<span style="hyphens:none">super<span lang="foo">cali</span>fragilisticexpialidocious</span>
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-2.html b/layout/reftests/text/auto-hyphenation-2.html
new file mode 100644
index 0000000000..45f5aaa991
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-2.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<!-- mixed languages in a word should inhibit automatic hyphenation -->
+<body lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+super<span lang="foo">cali</span>fragilisticexpialidocious
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-3-ref.html b/layout/reftests/text/auto-hyphenation-3-ref.html
new file mode 100644
index 0000000000..99c4fb38b1
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-3-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 5em;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-3.html b/layout/reftests/text/auto-hyphenation-3.html
new file mode 100644
index 0000000000..5ebb1a12ba
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-3.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- check that hyphens:none prevents break at &shy; -->
+<body lang="en-us">
+<div style="width: 5em; hyphens: none;">
+su&shy;per&shy;cal&shy;ifrag&shy;ilis&shy;tic&shy;ex&shy;pi&shy;ali&shy;do&shy;cious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-4-ref.html b/layout/reftests/text/auto-hyphenation-4-ref.html
new file mode 100644
index 0000000000..68cfcf6008
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-4-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="x-unknown-language">
+<div style="width: 5em; hyphens: none;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-4.html b/layout/reftests/text/auto-hyphenation-4.html
new file mode 100644
index 0000000000..82d187e252
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-4.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- check that hyphenation is not applied to unknown language -->
+<body lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-5-ref.html b/layout/reftests/text/auto-hyphenation-5-ref.html
new file mode 100644
index 0000000000..a390ad72a8
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-5-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+div {
+ margin: 10px;
+ width: 10px;
+ font-family: monospace;
+ hyphens: manual;
+}
+</style>
+</head>
+<!-- test some hyphenations that involve overlapping patterns -->
+<body lang="en-us">
+<div>
+photo
+</div>
+<div>
+pho&shy;to&shy;graph
+</div>
+<div>
+pho&shy;tog&shy;ra&shy;pher
+</div>
+<div>
+pho&shy;to&shy;graph&shy;i&shy;cal
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-5.html b/layout/reftests/text/auto-hyphenation-5.html
new file mode 100644
index 0000000000..5075612398
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-5.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+div {
+ margin: 10px;
+ width: 10px;
+ font-family: monospace;
+ hyphens: auto;
+}
+</style>
+</head>
+<!-- test some hyphenations that involve overlapping patterns -->
+<body lang="en-us">
+<div>
+photo
+</div>
+<div>
+photograph
+</div>
+<div>
+photographer
+</div>
+<div>
+photographical
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-6-ref.html b/layout/reftests/text/auto-hyphenation-6-ref.html
new file mode 100644
index 0000000000..3ec974024e
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-6-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 0; hyphens: manual;">
+hy&shy;<span style="color:red">phen&shy;</span>ation
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-6.html b/layout/reftests/text/auto-hyphenation-6.html
new file mode 100644
index 0000000000..5f66d64e2a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-6.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- style changes don't break hyphenation -->
+<body lang="en-us">
+<div style="width: 0; hyphens: auto;">
+hy<span style="color:red">phen</span>ation
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-7-ref.html b/layout/reftests/text/auto-hyphenation-7-ref.html
new file mode 100644
index 0000000000..5ac5916ce3
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-7-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<body lang="en-us">
+<div style="width: 0; hyphens: manual;">
+h<span style="color:red">y&shy;phen&shy;a</span>tion
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-7.html b/layout/reftests/text/auto-hyphenation-7.html
new file mode 100644
index 0000000000..9b95cc1945
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-7.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- style changes don't break hyphenation -->
+<body lang="en-us">
+<div style="width: 0; hyphens: auto;">
+h<span style="color:red">yphena</span>tion
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-8-ref.html b/layout/reftests/text/auto-hyphenation-8-ref.html
new file mode 100644
index 0000000000..7854c5d2ff
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-8-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: none;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-8.html b/layout/reftests/text/auto-hyphenation-8.html
new file mode 100644
index 0000000000..7dd93503d6
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-8.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-9-ref.html b/layout/reftests/text/auto-hyphenation-9-ref.html
new file mode 100644
index 0000000000..54c2006697
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-9-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<meta charset="iso-8859-1">
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: none;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-9.html b/layout/reftests/text/auto-hyphenation-9.html
new file mode 100644
index 0000000000..6eae8d4e97
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-9.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<meta charset="iso-8859-1">
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-af-1-ref.html b/layout/reftests/text/auto-hyphenation-af-1-ref.html
new file mode 100644
index 0000000000..40e2951da8
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-af-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="af">
+Alle mens&shy;li&shy;ke we&shy;sens word vry, met ge&shy;ly&shy;ke waar&shy;dig&shy;heid en reg&shy;te, ge&shy;bo&shy;re.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-af-1.html b/layout/reftests/text/auto-hyphenation-af-1.html
new file mode 100644
index 0000000000..5803ed2e1a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-af-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="af">
+Alle menslike wesens word vry, met gelyke waardigheid en regte, gebore.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-bg-1-ref.html b/layout/reftests/text/auto-hyphenation-bg-1-ref.html
new file mode 100644
index 0000000000..a214a7a76d
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-bg-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="bg">
+Всички хо&shy;ра се раж&shy;дат сво&shy;бод&shy;ни и рав&shy;ни по дос&shy;тойн&shy;с&shy;т&shy;во и пра&shy;ва.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-bg-1.html b/layout/reftests/text/auto-hyphenation-bg-1.html
new file mode 100644
index 0000000000..c1fb848f60
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-bg-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="bg">
+Всички хора се раждат свободни и равни по достойнство и права.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-bn-1-ref.html b/layout/reftests/text/auto-hyphenation-bn-1-ref.html
new file mode 100644
index 0000000000..1c6254b956
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-bn-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="bn" style="width:0; hyphens:manual;">
+সম&shy;স্ত মা&shy;নুষ স্বা&shy;ধী&shy;ন&shy;ভা&shy;বে সমান মর্যা&shy;দা এবং অধি&shy;কার নি&shy;য়ে জন্ম&shy;গ্র&shy;হণ করে।
diff --git a/layout/reftests/text/auto-hyphenation-bn-1.html b/layout/reftests/text/auto-hyphenation-bn-1.html
new file mode 100644
index 0000000000..a0488ceff9
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-bn-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="bn" style="width:0; hyphens:auto;">
+সমস্ত মানুষ স্বাধীনভাবে সমান মর্যাদা এবং অধিকার নিয়ে জন্মগ্রহণ করে।
diff --git a/layout/reftests/text/auto-hyphenation-ca-1-ref.html b/layout/reftests/text/auto-hyphenation-ca-1-ref.html
new file mode 100644
index 0000000000..bf029b5958
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ca-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="ca">
+Tots els és&shy;sers hu&shy;mans nei&shy;xen lliu&shy;res i iguals en dig&shy;ni&shy;tat i en drets.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ca-1.html b/layout/reftests/text/auto-hyphenation-ca-1.html
new file mode 100644
index 0000000000..1e8c9f23bc
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ca-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="ca">
+Tots els éssers humans neixen lliures i iguals en dignitat i en drets.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-cy-1-ref.html b/layout/reftests/text/auto-hyphenation-cy-1-ref.html
new file mode 100644
index 0000000000..b182e9b381
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-cy-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="cy">
+Genir pawb yn rhydd ac yn gyd&shy;radd â'i gil&shy;ydd mewn urdd&shy;as a hawl&shy;iau.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-cy-1.html b/layout/reftests/text/auto-hyphenation-cy-1.html
new file mode 100644
index 0000000000..43876c2ffa
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-cy-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="cy">
+Genir pawb yn rhydd ac yn gydradd â'i gilydd mewn urddas a hawliau.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-da-1-ref.html b/layout/reftests/text/auto-hyphenation-da-1-ref.html
new file mode 100644
index 0000000000..0efd813097
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-da-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="da">
+Alle men&shy;ne&shy;sker er født frie og li&shy;ge i vær&shy;dig&shy;hed og ret&shy;tig&shy;he&shy;der.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-da-1.html b/layout/reftests/text/auto-hyphenation-da-1.html
new file mode 100644
index 0000000000..3a2349403b
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-da-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="da">
+Alle mennesker er født frie og lige i værdighed og rettigheder.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-1901-1-ref.html b/layout/reftests/text/auto-hyphenation-de-1901-1-ref.html
new file mode 100644
index 0000000000..9c1faeb497
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-1901-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="de-1901">
+Al&shy;le Men&shy;schen sind frei und gleich an Wür&shy;de und Rech&shy;ten ge&shy;bo&shy;ren.
+<p>
+bu&shy;sser <!-- example word that is hyphenated differently by de-1901 and de-1996 -->
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-1901-1.html b/layout/reftests/text/auto-hyphenation-de-1901-1.html
new file mode 100644
index 0000000000..e795181f7b
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-1901-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="de-1901">
+Alle Menschen sind frei und gleich an Würde und Rechten geboren.
+<p>
+busser <!-- example word that is hyphenated differently by de-1901 and de-1996 -->
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-1996-1-ref.html b/layout/reftests/text/auto-hyphenation-de-1996-1-ref.html
new file mode 100644
index 0000000000..4294625533
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-1996-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="de-1996">
+Al&shy;le Men&shy;schen sind frei und gleich an Wür&shy;de und Rech&shy;ten ge&shy;bo&shy;ren.
+<p>
+bus&shy;ser <!-- example word that is hyphenated differently by de-1901 and de-1996 -->
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-1996-1.html b/layout/reftests/text/auto-hyphenation-de-1996-1.html
new file mode 100644
index 0000000000..fb542c4757
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-1996-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="de-1996">
+Alle Menschen sind frei und gleich an Würde und Rechten geboren.
+<p>
+busser <!-- example word that is hyphenated differently by de-1901 and de-1996 -->
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-ch-1-ref.html b/layout/reftests/text/auto-hyphenation-de-ch-1-ref.html
new file mode 100644
index 0000000000..f5b9e90a7a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-ch-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="de-CH">
+Al&shy;le Men&shy;schen sind frei und gleich an Wür&shy;de und Rech&shy;ten ge&shy;bo&shy;ren.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-de-ch-1.html b/layout/reftests/text/auto-hyphenation-de-ch-1.html
new file mode 100644
index 0000000000..7b41175419
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-de-ch-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="de-CH">
+Alle Menschen sind frei und gleich an Würde und Rechten geboren.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-eo-1-ref.html b/layout/reftests/text/auto-hyphenation-eo-1-ref.html
new file mode 100644
index 0000000000..f456c15945
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-eo-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="eo">
+Ĉiuj ho&shy;moj es&shy;tas de&shy;na&shy;s&shy;ke li&shy;be&shy;raj kaj ega&shy;laj laŭ di&shy;g&shy;no kaj raj&shy;toj.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-eo-1.html b/layout/reftests/text/auto-hyphenation-eo-1.html
new file mode 100644
index 0000000000..423ca95ae2
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-eo-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="eo">
+Ĉiuj homoj estas denaske liberaj kaj egalaj laŭ digno kaj rajtoj.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-es-1-ref.html b/layout/reftests/text/auto-hyphenation-es-1-ref.html
new file mode 100644
index 0000000000..24300ab510
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-es-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="es">
+Todos los se&shy;res hu&shy;ma&shy;nos na&shy;cen li&shy;bres e igua&shy;les en dig&shy;ni&shy;dad y de&shy;re&shy;chos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-es-1.html b/layout/reftests/text/auto-hyphenation-es-1.html
new file mode 100644
index 0000000000..fa2c688510
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-es-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="es">
+Todos los seres humanos nacen libres e iguales en dignidad y derechos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-et-1-ref.html b/layout/reftests/text/auto-hyphenation-et-1-ref.html
new file mode 100644
index 0000000000..0758d6c587
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-et-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="et">
+Kõik ini&shy;me&shy;sed sün&shy;nivad va&shy;ba&shy;de&shy;na ja võrds&shy;ete&shy;na oma vää&shy;ri&shy;ku&shy;selt ja õi&shy;gus&shy;telt
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-et-1.html b/layout/reftests/text/auto-hyphenation-et-1.html
new file mode 100644
index 0000000000..7009aa7ab3
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-et-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="et">
+Kõik inimesed sünnivad vabadena ja võrdsetena oma väärikuselt ja õigustelt
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-fi-1-ref.html b/layout/reftests/text/auto-hyphenation-fi-1-ref.html
new file mode 100644
index 0000000000..470c07ae41
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-fi-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="fi">
+Kaikki ih&shy;mi&shy;set syn&shy;ty&shy;vät va&shy;pai&shy;na ja ta&shy;sa&shy;ver&shy;tai&shy;si&shy;na ar&shy;vol&shy;taan ja oi&shy;keuk&shy;sil&shy;taan.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-fi-1.html b/layout/reftests/text/auto-hyphenation-fi-1.html
new file mode 100644
index 0000000000..fcf377fbbd
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-fi-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="fi">
+Kaikki ihmiset syntyvät vapaina ja tasavertaisina arvoltaan ja oikeuksiltaan.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-fr-1-ref.html b/layout/reftests/text/auto-hyphenation-fr-1-ref.html
new file mode 100644
index 0000000000..696ebc45b5
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-fr-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="fr">
+Tout in&shy;di&shy;vi&shy;du a droit à la vie, à la li&shy;ber&shy;té et à la sû&shy;re&shy;té de sa per&shy;sonne.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-fr-1.html b/layout/reftests/text/auto-hyphenation-fr-1.html
new file mode 100644
index 0000000000..edc5b47b59
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-fr-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="fr">
+Tout individu a droit à la vie, à la liberté et à la sûreté de sa personne.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-gl-1-ref.html b/layout/reftests/text/auto-hyphenation-gl-1-ref.html
new file mode 100644
index 0000000000..f07e7c2173
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-gl-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="gl">
+Tódolos se&shy;res hu&shy;ma&shy;nos na&shy;cen li&shy;bres e iguais en dig&shy;ni&shy;da&shy;de e de&shy;rei&shy;tos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-gl-1.html b/layout/reftests/text/auto-hyphenation-gl-1.html
new file mode 100644
index 0000000000..55627cc1cb
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-gl-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="gl">
+Tódolos seres humanos nacen libres e iguais en dignidade e dereitos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-gu-1-ref.html b/layout/reftests/text/auto-hyphenation-gu-1-ref.html
new file mode 100644
index 0000000000..04d756a05a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-gu-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="gu" style="width:0; hyphens:manual;">
+પ્ર&shy;તિ&shy;ષ્ઠા અને અધિ&shy;કા&shy;રો&shy;ની દૃ&shy;ષ્ટિએ સર્વ મા&shy;ન&shy;વો જન્મ&shy;થી સ્વ&shy;તંત્ર અને સમાન હોય છે.
diff --git a/layout/reftests/text/auto-hyphenation-gu-1.html b/layout/reftests/text/auto-hyphenation-gu-1.html
new file mode 100644
index 0000000000..45531a9786
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-gu-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="gu" style="width:0; hyphens:auto;">
+પ્રતિષ્ઠા અને અધિકારોની દૃષ્ટિએ સર્વ માનવો જન્મથી સ્વતંત્ર અને સમાન હોય છે.
diff --git a/layout/reftests/text/auto-hyphenation-hi-1-ref.html b/layout/reftests/text/auto-hyphenation-hi-1-ref.html
new file mode 100644
index 0000000000..dd8a8f15b0
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hi-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="hi" style="width:0; hyphens:manual;">
+सभी मनु&shy;ष्यों को गौ&shy;रव और अधि&shy;का&shy;रों के मा&shy;म&shy;ले में जन्म&shy;जात स्व&shy;त&shy;न्त्र&shy;ता और समा&shy;न&shy;ता प्रा&shy;प्त है ।
diff --git a/layout/reftests/text/auto-hyphenation-hi-1.html b/layout/reftests/text/auto-hyphenation-hi-1.html
new file mode 100644
index 0000000000..181804bfed
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hi-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="hi" style="width:0; hyphens:auto;">
+सभी मनुष्यों को गौरव और अधिकारों के मामले में जन्मजात स्वतन्त्रता और समानता प्राप्त है ।
diff --git a/layout/reftests/text/auto-hyphenation-hr-1-ref.html b/layout/reftests/text/auto-hyphenation-hr-1-ref.html
new file mode 100644
index 0000000000..4911fffaa2
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hr-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="hr">
+Sva ljud&shy;ska bi&shy;ća ra&shy;ća&shy;ju se slo&shy;bod&shy;na i jed&shy;na&shy;ka u dos&shy;to&shy;jans&shy;tvu i pra&shy;vi&shy;ma
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-hr-1.html b/layout/reftests/text/auto-hyphenation-hr-1.html
new file mode 100644
index 0000000000..02d902d71c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hr-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="hr">
+Sva ljudska bića raćaju se slobodna i jednaka u dostojanstvu i pravima
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-hsb-1-ref.html b/layout/reftests/text/auto-hyphenation-hsb-1-ref.html
new file mode 100644
index 0000000000..e999792056
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hsb-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="hsb">
+Wšitcy čło&shy;wje&shy;ko&shy;jo su wot na&shy;ro&shy;da swo&shy;bod&shy;ni a su je&shy;na&shy;cy po do&shy;stoj&shy;nos&shy;ći a pra&shy;wach
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-hsb-1.html b/layout/reftests/text/auto-hyphenation-hsb-1.html
new file mode 100644
index 0000000000..45d921f8bd
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hsb-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="hsb">
+Wšitcy čłowjekojo su wot naroda swobodni a su jenacy po dostojnosći a prawach
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-hu-1-ref.html b/layout/reftests/text/auto-hyphenation-hu-1-ref.html
new file mode 100644
index 0000000000..96945aa1dc
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hu-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="hu">
+Minden em&shy;be&shy;ri lény sza&shy;ba&shy;don szü&shy;le&shy;tik és egyen&shy;lő mél&shy;tó&shy;sá&shy;ga és jo&shy;ga van.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-hu-1.html b/layout/reftests/text/auto-hyphenation-hu-1.html
new file mode 100644
index 0000000000..c74f6d725f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-hu-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="hu">
+Minden emberi lény szabadon születik és egyenlő méltósága és joga van.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ia-1-ref.html b/layout/reftests/text/auto-hyphenation-ia-1-ref.html
new file mode 100644
index 0000000000..bd4bbdeb31
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ia-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="ia">
+Tote le es&shy;se&shy;res hu&shy;man na&shy;sce li&shy;be&shy;re e equal in dig&shy;ni&shy;ta&shy;te e in de&shy;rec&shy;tos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ia-1.html b/layout/reftests/text/auto-hyphenation-ia-1.html
new file mode 100644
index 0000000000..dc5972cc00
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ia-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="ia">
+Tote le esseres human nasce libere e equal in dignitate e in derectos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-is-1-ref.html b/layout/reftests/text/auto-hyphenation-is-1-ref.html
new file mode 100644
index 0000000000..76b6d43dc1
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-is-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="is">
+Hver mað&shy;ur er bor&shy;inn frjáls og jafn öðr&shy;um að virð&shy;ingu og rétt&shy;ind&shy;um
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-is-1.html b/layout/reftests/text/auto-hyphenation-is-1.html
new file mode 100644
index 0000000000..3efac1056f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-is-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="is">
+Hver maður er borinn frjáls og jafn öðrum að virðingu og réttindum
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-it-1-ref.html b/layout/reftests/text/auto-hyphenation-it-1-ref.html
new file mode 100644
index 0000000000..25ac37d257
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-it-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="it">
+Tutti gli es&shy;se&shy;ri uma&shy;ni na&shy;sco&shy;no li&shy;be&shy;ri ed egua&shy;li in di&shy;gni&shy;tà e di&shy;rit&shy;ti.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-it-1.html b/layout/reftests/text/auto-hyphenation-it-1.html
new file mode 100644
index 0000000000..963c108982
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-it-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="it">
+Tutti gli esseri umani nascono liberi ed eguali in dignità e diritti.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-kmr-1-ref.html b/layout/reftests/text/auto-hyphenation-kmr-1-ref.html
new file mode 100644
index 0000000000..6af785c4b6
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-kmr-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="kmr">
+Hemû mi&shy;rov azad û di we&shy;qar û ma&shy;fan de we&shy;k&shy;hev tên din&shy;ya&shy;yê
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-kmr-1.html b/layout/reftests/text/auto-hyphenation-kmr-1.html
new file mode 100644
index 0000000000..43887b80f4
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-kmr-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="kmr">
+Hemû mirov azad û di weqar û mafan de wekhev tên dinyayê
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-kn-1-ref.html b/layout/reftests/text/auto-hyphenation-kn-1-ref.html
new file mode 100644
index 0000000000..f791517e8f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-kn-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="kn" style="width:0; hyphens:manual;">
+ಎಲ್ಲಾ ಮಾ&shy;ನ&shy;ವ&shy;ರೂ ಸ್ವ&shy;ತಂ&shy;ತ್ರ&shy;ರಾ&shy;ಗಿ&shy;ಯೇ ಜನಿ&shy;ಸಿ&shy;ದ್ದಾ&shy;ರೆ. ಹಾ&shy;ಗೂ ಘನ&shy;ತೆ ಮತ್ತು ಹಕ್ಕು&shy;ಗ&shy;ಳ&shy;ಲ್ಲಿ ಸಮಾ&shy;ನ&shy;ರಾ&shy;ಗಿ&shy;ದ್ದಾ&shy;ರೆ.
diff --git a/layout/reftests/text/auto-hyphenation-kn-1.html b/layout/reftests/text/auto-hyphenation-kn-1.html
new file mode 100644
index 0000000000..9f520e17d4
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-kn-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="kn" style="width:0; hyphens:auto;">
+ಎಲ್ಲಾ ಮಾನವರೂ ಸ್ವತಂತ್ರರಾಗಿಯೇ ಜನಿಸಿದ್ದಾರೆ. ಹಾಗೂ ಘನತೆ ಮತ್ತು ಹಕ್ಕುಗಳಲ್ಲಿ ಸಮಾನರಾಗಿದ್ದಾರೆ.
diff --git a/layout/reftests/text/auto-hyphenation-la-1-ref.html b/layout/reftests/text/auto-hyphenation-la-1-ref.html
new file mode 100644
index 0000000000..03afab6f3e
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-la-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="la">
+Omnes ho&shy;mi&shy;nes di&shy;gni&shy;ta&shy;te et iu&shy;re li&shy;be&shy;ri et pa&shy;res na&shy;scun&shy;tur
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-la-1.html b/layout/reftests/text/auto-hyphenation-la-1.html
new file mode 100644
index 0000000000..bb76d0d428
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-la-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="la">
+Omnes homines dignitate et iure liberi et pares nascuntur
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-lt-1-ref.html b/layout/reftests/text/auto-hyphenation-lt-1-ref.html
new file mode 100644
index 0000000000..422d57b247
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-lt-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="lt">
+Visi žmo&shy;nės gims&shy;ta lais&shy;vi ir ly&shy;gūs sa&shy;vo oru&shy;mu ir tei&shy;sė&shy;mis.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-lt-1.html b/layout/reftests/text/auto-hyphenation-lt-1.html
new file mode 100644
index 0000000000..3c896a5655
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-lt-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="lt">
+Visi žmonės gimsta laisvi ir lygūs savo orumu ir teisėmis.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ml-1-ref.html b/layout/reftests/text/auto-hyphenation-ml-1-ref.html
new file mode 100644
index 0000000000..4d8dc4619a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ml-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="ml" style="width:0; hyphens:manual;">
+മനു&shy;ഷ്യ&shy;രെ&shy;ല്ലാ&shy;വ&shy;രും തു&shy;ല്യാ&shy;വ&shy;കാ&shy;ശ&shy;ങ്ങ&shy;ളോ&shy;ടും അന്ത&shy;സ്സോ&shy;ടും സ്വാ&shy;ത&shy;ന്ത്ര്യ&shy;ത്തോ&shy;ടും&shy;കൂ&shy;ടി ജനി&shy;ച്ചി&shy;ട്ടു&shy;ള്ള&shy;വ&shy;രാ&shy;ണ്‌.
diff --git a/layout/reftests/text/auto-hyphenation-ml-1.html b/layout/reftests/text/auto-hyphenation-ml-1.html
new file mode 100644
index 0000000000..c5d421824c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ml-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="ml" style="width:0; hyphens:auto;">
+മനുഷ്യരെല്ലാവരും തുല്യാവകാശങ്ങളോടും അന്തസ്സോടും സ്വാതന്ത്ര്യത്തോടുംകൂടി ജനിച്ചിട്ടുള്ളവരാണ്‌.
diff --git a/layout/reftests/text/auto-hyphenation-mn-1-ref.html b/layout/reftests/text/auto-hyphenation-mn-1-ref.html
new file mode 100644
index 0000000000..d2a3db12ba
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-mn-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="mn">
+Хүн бүр төрж мэнд&shy;лэ&shy;хэд эрх чө&shy;лөө&shy;тэй, адил&shy;хан нэр төр&shy;тэй, ижил эрх&shy;тэй бай&shy;даг
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-mn-1.html b/layout/reftests/text/auto-hyphenation-mn-1.html
new file mode 100644
index 0000000000..e00d43c253
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-mn-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="mn">
+Хүн бүр төрж мэндлэхэд эрх чөлөөтэй, адилхан нэр төртэй, ижил эрхтэй байдаг
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nb-1-ref.html b/layout/reftests/text/auto-hyphenation-nb-1-ref.html
new file mode 100644
index 0000000000..6604655498
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nb-1-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="nb">
+Alle men&shy;nes&shy;ker er født frie og med sam&shy;me men&shy;neske&shy;verd og men&shy;neske&shy;ret&shy;tig&shy;he&shy;ter.
+<p>
+<!-- words that differ in nb/nn locales -->
+at&shy;ten&shy;de
+be&shy;tre
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nb-1.html b/layout/reftests/text/auto-hyphenation-nb-1.html
new file mode 100644
index 0000000000..e64396a67b
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nb-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="nb">
+Alle mennesker er født frie og med samme menneskeverd og menneskerettigheter.
+<p>
+<!-- words that differ in nb/nn locales -->
+attende
+betre
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nl-1-ref.html b/layout/reftests/text/auto-hyphenation-nl-1-ref.html
new file mode 100644
index 0000000000..ca6d1f516c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nl-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="nl">
+Alle men&shy;sen wor&shy;den vrij en ge&shy;lijk in waar&shy;dig&shy;heid en rech&shy;ten ge&shy;bo&shy;ren
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nl-1.html b/layout/reftests/text/auto-hyphenation-nl-1.html
new file mode 100644
index 0000000000..e7cb9ab9e1
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nl-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="nl">
+Alle mensen worden vrij en gelijk in waardigheid en rechten geboren
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nn-1-ref.html b/layout/reftests/text/auto-hyphenation-nn-1-ref.html
new file mode 100644
index 0000000000..d20acf9e23
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nn-1-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="nn">
+Alle men&shy;nes&shy;ke er fød&shy;de til fri&shy;dom og med same men&shy;neske&shy;verd og men&shy;neske&shy;ret&shy;tar.
+<p>
+<!-- words that differ in nb/nn locales -->
+att&shy;en&shy;de
+bet&shy;re
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-nn-1.html b/layout/reftests/text/auto-hyphenation-nn-1.html
new file mode 100644
index 0000000000..405966c9c2
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-nn-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="nn">
+Alle menneske er fødde til fridom og med same menneskeverd og menneskerettar.
+<p>
+<!-- words that differ in nb/nn locales -->
+attende
+betre
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-pa-1-ref.html b/layout/reftests/text/auto-hyphenation-pa-1-ref.html
new file mode 100644
index 0000000000..e89d0bb371
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pa-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="pa" style="width:0; hyphens:manual;">
+ਸਾ&shy;ਰਾ ਮਨੁੱਖੀ ਪਰਿ&shy;ਵਾਰ ਆਪ&shy;ਣੀ ਮਹਿ&shy;ਮਾ, ਸ਼ਾਨ ਅਤੇ ਹੱਕਾਂ ਦੇ ਪੱਖੋਂ ਜਨਮ ਤੋਂ ਹੀ ਆਜ਼ਾਦ ਹੈ ਅਤੇ ਸੁ&shy;ਤੇ ਸਿੱਧ ਸਾ&shy;ਰੇ ਲੋਕ ਬਰਾ&shy;ਬਰ ਹਨ ।
diff --git a/layout/reftests/text/auto-hyphenation-pa-1.html b/layout/reftests/text/auto-hyphenation-pa-1.html
new file mode 100644
index 0000000000..ab932b8510
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pa-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="pa" style="width:0; hyphens:auto;">
+ਸਾਰਾ ਮਨੁੱਖੀ ਪਰਿਵਾਰ ਆਪਣੀ ਮਹਿਮਾ, ਸ਼ਾਨ ਅਤੇ ਹੱਕਾਂ ਦੇ ਪੱਖੋਂ ਜਨਮ ਤੋਂ ਹੀ ਆਜ਼ਾਦ ਹੈ ਅਤੇ ਸੁਤੇ ਸਿੱਧ ਸਾਰੇ ਲੋਕ ਬਰਾਬਰ ਹਨ ।
diff --git a/layout/reftests/text/auto-hyphenation-pl-1-ref.html b/layout/reftests/text/auto-hyphenation-pl-1-ref.html
new file mode 100644
index 0000000000..6ed72f2717
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pl-1-ref.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html lang="pl">
+<head>
+<meta charset="utf-8">
+<title>Polish hyphenation test</title>
+<style>
+body {
+ font-family: "Times New Roman", serif; /* prefer TNR to Times (default) on OS X... */
+ font-feature-settings: 'kern' off;
+}
+</style>
+</head>
+<body>
+<div style="white-space:pre-wrap;">Unikod
+przy-
+pi-
+su-
+je
+uni-
+kal-
+ny
+nu-
+mer
+każ-
+de-
+mu
+zna-
+ko-
+wi,
+nie-
+za-
+leż-
+ny
+od
+uży-
+wa-
+nej
+plat-
+for-
+my,
+pro-
+gra-
+mu
+czy
+ję-
+zy-
+ka.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-pl-1.html b/layout/reftests/text/auto-hyphenation-pl-1.html
new file mode 100644
index 0000000000..55fddc07b0
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pl-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html lang="pl">
+<head>
+<meta charset="utf-8">
+<title>Polish hyphenation test</title>
+<style>
+body {
+ font-family: "Times New Roman", serif; /* prefer TNR to Times (default) on OS X... */
+ font-feature-settings: 'kern' off;
+}
+</style>
+</head>
+<body>
+<div style="width:0pt; hyphens:auto">
+Unikod przypisuje unikalny numer każdemu znakowi,
+niezależny od używanej platformy,
+programu czy języka.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-pt-1-ref.html b/layout/reftests/text/auto-hyphenation-pt-1-ref.html
new file mode 100644
index 0000000000..b40616ef3c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pt-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="pt">
+Todos os se&shy;res hu&shy;ma&shy;nos nas&shy;cem li&shy;vres e iguais em dig&shy;ni&shy;da&shy;de e em di&shy;rei&shy;tos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-pt-1.html b/layout/reftests/text/auto-hyphenation-pt-1.html
new file mode 100644
index 0000000000..d2b3a1c647
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-pt-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="pt">
+Todos os seres humanos nascem livres e iguais em dignidade e em direitos
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ru-1-ref.html b/layout/reftests/text/auto-hyphenation-ru-1-ref.html
new file mode 100644
index 0000000000..6686b2c1a6
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ru-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="ru">
+Все лю&shy;ди рож&shy;да&shy;ют&shy;ся сво&shy;бод&shy;ны&shy;ми и рав&shy;ны&shy;ми в сво&shy;ем до&shy;сто&shy;ин&shy;стве и пра&shy;вах.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ru-1.html b/layout/reftests/text/auto-hyphenation-ru-1.html
new file mode 100644
index 0000000000..859acd5237
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ru-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="ru">
+Все люди рождаются свободными и равными в своем достоинстве и правах.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sh-1-ref.html b/layout/reftests/text/auto-hyphenation-sh-1-ref.html
new file mode 100644
index 0000000000..dd183b26b5
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sh-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual; font-size:5px" lang="sh">
+Сва људ&shy;ска би&shy;ћа ра&shy;ђа&shy;ју се сло&shy;бод&shy;на и јед&shy;на&shy;ка у до&shy;сто&shy;јан&shy;ству и пра&shy;ви&shy;ма.
+<p>
+Sva ljud&shy;ska bi&shy;ća ra&shy;đa&shy;ju se slo&shy;bod&shy;na i jed&shy;na&shy;ka u do&shy;sto&shy;jan&shy;stvu i pra&shy;vi&shy;ma.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sh-1.html b/layout/reftests/text/auto-hyphenation-sh-1.html
new file mode 100644
index 0000000000..4b1c835415
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sh-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto; font-size:5px" lang="sh">
+Сва људска бића рађају се слободна и једнака у достојанству и правима.
+<p>
+Sva ljudska bića rađaju se slobodna i jednaka u dostojanstvu i pravima.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sl-1-ref.html b/layout/reftests/text/auto-hyphenation-sl-1-ref.html
new file mode 100644
index 0000000000..760b51ec7a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sl-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="sl">
+Vsi lju&shy;dje se ro&shy;di&shy;jo svo&shy;bo&shy;dni in ima&shy;jo ena&shy;ko do&shy;sto&shy;jan&shy;stvo in ena&shy;ke pra&shy;vi&shy;ce
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sl-1.html b/layout/reftests/text/auto-hyphenation-sl-1.html
new file mode 100644
index 0000000000..e59192aaa4
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sl-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="sl">
+Vsi ljudje se rodijo svobodni in imajo enako dostojanstvo in enake pravice
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sr-1-ref.html b/layout/reftests/text/auto-hyphenation-sr-1-ref.html
new file mode 100644
index 0000000000..a23fb56f0e
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sr-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual; font-size:5px" lang="sr">
+Сва људ&shy;ска би&shy;ћа ра&shy;ђа&shy;ју се сло&shy;бод&shy;на и јед&shy;на&shy;ка у до&shy;сто&shy;јан&shy;ству и пра&shy;ви&shy;ма.
+<p>
+Sva ljud&shy;ska bi&shy;ća ra&shy;đa&shy;ju se slo&shy;bod&shy;na i jed&shy;na&shy;ka u do&shy;sto&shy;jan&shy;stvu i pra&shy;vi&shy;ma.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sr-1.html b/layout/reftests/text/auto-hyphenation-sr-1.html
new file mode 100644
index 0000000000..1560fe9d3c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sr-1.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto; font-size:5px" lang="sr">
+Сва људска бића рађају се слободна и једнака у достојанству и правима.
+<p>
+Sva ljudska bića rađaju se slobodna i jednaka u dostojanstvu i pravima.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sv-1-notref.html b/layout/reftests/text/auto-hyphenation-sv-1-notref.html
new file mode 100644
index 0000000000..02986a88de
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sv-1-notref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="en-US">
+Alla människor äro födda fria och lika i värde och rättigheter
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sv-1-ref.html b/layout/reftests/text/auto-hyphenation-sv-1-ref.html
new file mode 100644
index 0000000000..78ad51d406
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sv-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="sv">
+Alla män&shy;ni&shy;skor äro föd&shy;da fria och li&shy;ka i vär&shy;de och rät&shy;tig&shy;he&shy;ter
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-sv-1.html b/layout/reftests/text/auto-hyphenation-sv-1.html
new file mode 100644
index 0000000000..a2096ee6f4
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-sv-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="sv">
+Alla människor äro födda fria och lika i värde och rättigheter
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-ta-1-ref.html b/layout/reftests/text/auto-hyphenation-ta-1-ref.html
new file mode 100644
index 0000000000..9b6c1cba76
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ta-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="ta" style="width:0; hyphens:manual;">
+மனி&shy;தப் பி&shy;றி&shy;வி&shy;யி&shy;னர் சக&shy;ல&shy;ரும் சு&shy;தந்&shy;தி&shy;ர&shy;மா&shy;க&shy;வே பி&shy;றக்&shy;கின்&shy;றனர்; அவர்&shy;கள் மதிப்&shy;பி&shy;லும், உரி&shy;மை&shy;க&shy;ளி&shy;லும் சம&shy;மா&shy;ன&shy;வர்&shy;கள், அவர்&shy;கள் நி&shy;யா&shy;யத்&shy;தை&shy;யும் மனச்&shy;சாட்&shy;சி&shy;யை&shy;யும் இயற்&shy;பண்&shy;பா&shy;கப் பெற்&shy;ற&shy;வர்&shy;கள்.
diff --git a/layout/reftests/text/auto-hyphenation-ta-1.html b/layout/reftests/text/auto-hyphenation-ta-1.html
new file mode 100644
index 0000000000..230192528c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-ta-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="ta" style="width:0; hyphens:auto;">
+மனிதப் பிறிவியினர் சகலரும் சுதந்திரமாகவே பிறக்கின்றனர்; அவர்கள் மதிப்பிலும், உரிமைகளிலும் சமமானவர்கள், அவர்கள் நியாயத்தையும் மனச்சாட்சியையும் இயற்பண்பாகப் பெற்றவர்கள்.
diff --git a/layout/reftests/text/auto-hyphenation-te-1-ref.html b/layout/reftests/text/auto-hyphenation-te-1-ref.html
new file mode 100644
index 0000000000..9069d85def
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-te-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="te" style="width:0; hyphens:manual;">
+ప్ర&shy;తి&shy;ప&shy;త్తి&shy;స్వ&shy;త్వ&shy;ముల వి&shy;ష&shy;య&shy;మున మా&shy;న&shy;వు&shy;లె&shy;ల్ల&shy;రు&shy;ను జన్మ&shy;తః స్వ&shy;తం&shy;త్రు&shy;లు&shy;ను సమా&shy;ను&shy;లు&shy;ను నగు&shy;దు&shy;రు.
diff --git a/layout/reftests/text/auto-hyphenation-te-1.html b/layout/reftests/text/auto-hyphenation-te-1.html
new file mode 100644
index 0000000000..c1c75312d6
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-te-1.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<div lang="te" style="width:0; hyphens:auto;">
+ప్రతిపత్తిస్వత్వముల విషయమున మానవులెల్లరును జన్మతః స్వతంత్రులును సమానులును నగుదురు.
diff --git a/layout/reftests/text/auto-hyphenation-tr-1-ref.html b/layout/reftests/text/auto-hyphenation-tr-1-ref.html
new file mode 100644
index 0000000000..f5827c0e9a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-tr-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="tr">
+Bütün in&shy;san&shy;lar hür, hay&shy;si&shy;yet ve hak&shy;lar ba&shy;kı&shy;mın&shy;dan eşit do&shy;ğar&shy;lar.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-tr-1.html b/layout/reftests/text/auto-hyphenation-tr-1.html
new file mode 100644
index 0000000000..fc6437182d
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-tr-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="tr">
+Bütün insanlar hür, haysiyet ve haklar bakımından eşit doğarlar.
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-transformed-1-ref.html b/layout/reftests/text/auto-hyphenation-transformed-1-ref.html
new file mode 100644
index 0000000000..dc13355076
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-transformed-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="de">
+<head>
+<meta charset="utf-8">
+<title>Test for auto hyphenation with text-transform</title>
+</head>
+<body>
+<div style="width:0px;">
+mas&shy;se<br>ma&shy;ße
+</div>
+<div style="width:0px;">
+MAS&shy;SE<br>MA&shy;SSE
+</div>
+<div style="width:0px;">
+Mas&shy;se<br>Ma&shy;ße
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-transformed-1.html b/layout/reftests/text/auto-hyphenation-transformed-1.html
new file mode 100644
index 0000000000..181c33b1d2
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-transformed-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html lang="de">
+<head>
+<meta charset="utf-8">
+<title>Test for auto hyphenation with text-transform</title>
+</head>
+<body>
+<div style="width:0px; hyphens:auto">
+masse<br>maße
+</div>
+<div style="width:0px; hyphens:auto; text-transform:uppercase">
+masse<br>maße
+</div>
+<div style="width:0px; hyphens:auto; text-transform:capitalize">
+masse<br>maße
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-uk-1-ref.html b/layout/reftests/text/auto-hyphenation-uk-1-ref.html
new file mode 100644
index 0000000000..7c99e28d01
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-uk-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:manual;" lang="uk">
+Всі лю&shy;ди на&shy;ро&shy;джу&shy;ю&shy;ться віль&shy;ни&shy;ми і рів&shy;ни&shy;ми у сво&shy;їй гі&shy;дно&shy;сті та пра&shy;вах
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-uk-1.html b/layout/reftests/text/auto-hyphenation-uk-1.html
new file mode 100644
index 0000000000..0f3c72ce16
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-uk-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+</head>
+<body>
+<div style="width:1em; hyphens:auto;" lang="uk">
+Всі люди народжуються вільними і рівними у своїй гідності та правах
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-1.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-1.xhtml
new file mode 100644
index 0000000000..b102f63151
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-1.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- simple test for automatic hyphenation -->
+<body xml:lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-10.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-10.xhtml
new file mode 100644
index 0000000000..9ae2f056fe
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-10.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-11a.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-11a.xhtml
new file mode 100644
index 0000000000..eab1a7011c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-11a.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that xml:lang beats lang -->
+<body xml:lang="en-us" lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-11b.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-11b.xhtml
new file mode 100644
index 0000000000..e243bc2c4f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-11b.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that xml:lang beats lang -->
+<body lang="x-unknown-language" xml:lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-12a.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-12a.xhtml
new file mode 100644
index 0000000000..18c8846473
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-12a.xhtml
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that xml:lang beats lang -->
+<!-- check that hyphenation is not applied to unknown language -->
+<body xml:lang="x-unknown-language" lang="en-us">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-12b.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-12b.xhtml
new file mode 100644
index 0000000000..602e59b27c
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-12b.xhtml
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that xml:lang beats lang -->
+<!-- check that hyphenation is not applied to unknown language -->
+<body lang="en-us" xml:lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-13a.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-13a.xhtml
new file mode 100644
index 0000000000..10488ad8fa
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-13a.xhtml
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that innermost beats xml:lang vs. lang difference -->
+<body lang="x-unknown-language">
+<div xml:lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-13b.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-13b.xhtml
new file mode 100644
index 0000000000..ef231cf855
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-13b.xhtml
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that innermost beats xml:lang vs. lang difference -->
+<body xml:lang="x-unknown-language">
+<div lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+</div>
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-14a.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-14a.xhtml
new file mode 100644
index 0000000000..124a6e127d
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-14a.xhtml
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that innermost beats xml:lang vs. lang difference -->
+<!-- check that hyphenation is not applied to unknown language -->
+<body lang="en-us">
+<div xml:lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-14b.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-14b.xhtml
new file mode 100644
index 0000000000..a4fd52b704
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-14b.xhtml
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that innermost beats xml:lang vs. lang difference -->
+<!-- check that hyphenation is not applied to unknown language -->
+<body xml:lang="en-us">
+<div lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-1a.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-1a.xhtml
new file mode 100644
index 0000000000..77a3c3b56f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-1a.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- adding random <span>s should not affect hyphenation -->
+<body xml:lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+super<span>cali</span>frag<span>ili</span>sti<span>cex</span>pialidoc<span>i</span>ous
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-2.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-2.xhtml
new file mode 100644
index 0000000000..382deafe4a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-2.xhtml
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- mixed languages in a word should inhibit automatic hyphenation -->
+<body xml:lang="en-us">
+<div style="width: 5em; hyphens: auto; font-family:sans-serif;">
+supercalifragilisticexpialidocious
+super<span xml:lang="foo">cali</span>fragilisticexpialidocious
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-3.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-3.xhtml
new file mode 100644
index 0000000000..1560f9e6b9
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-3.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that hyphens:none prevents break at &shy; -->
+<body xml:lang="en-us">
+<div style="width: 5em; hyphens: none;">
+su&#173;per&#173;cal&#173;ifrag&#173;ilis&#173;tic&#173;ex&#173;pi&#173;ali&#173;do&#173;cious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-4.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-4.xhtml
new file mode 100644
index 0000000000..4a453f628b
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-4.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that hyphenation is not applied to unknown language -->
+<body xml:lang="x-unknown-language">
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-5.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-5.xhtml
new file mode 100644
index 0000000000..dce0ee03f8
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-5.xhtml
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<style type="text/css">
+div {
+ margin: 10px;
+ width: 10px;
+ font-family: monospace;
+ hyphens: auto;
+}
+</style>
+</head>
+<!-- test some hyphenations that involve overlapping patterns -->
+<body xml:lang="en-us">
+<div>
+photo
+</div>
+<div>
+photograph
+</div>
+<div>
+photographer
+</div>
+<div>
+photographical
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-6.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-6.xhtml
new file mode 100644
index 0000000000..6a9bf1bd92
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-6.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- style changes don't break hyphenation -->
+<body xml:lang="en-us">
+<div style="width: 0; hyphens: auto;">
+hy<span style="color:red">phen</span>ation
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-7.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-7.xhtml
new file mode 100644
index 0000000000..81333df42a
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-7.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- style changes don't break hyphenation -->
+<body xml:lang="en-us">
+<div style="width: 0; hyphens: auto;">
+h<span style="color:red">yphena</span>tion
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-8.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-8.xhtml
new file mode 100644
index 0000000000..97ce7fcd9d
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-8.xhtml
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/auto-hyphenation-xmllang-9.xhtml b/layout/reftests/text/auto-hyphenation-xmllang-9.xhtml
new file mode 100644
index 0000000000..18a8bc862f
--- /dev/null
+++ b/layout/reftests/text/auto-hyphenation-xmllang-9.xhtml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="iso-8859-1" ?>
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head><title>Hyphenation test</title></head>
+<!-- check that hyphenation is not applied when language is not specified -->
+<body>
+<div style="width: 5em; hyphens: auto;">
+supercalifragilisticexpialidocious
+</div>
+</body>
+</html>
+
diff --git a/layout/reftests/text/cgj-01-ref.html b/layout/reftests/text/cgj-01-ref.html
new file mode 100644
index 0000000000..20c211bdab
--- /dev/null
+++ b/layout/reftests/text/cgj-01-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<!-- U+034F Combining Grapheme Joiner test #1.
+ The CGJ should not be visible,
+ nor affect the width of the first cluster. -->
+<html>
+ <head>
+ <title>CGJ test</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ body {
+ font-size: 35px;
+ line-height: 100px;
+ /* prefer Calibri on Win7 to avoid visible CGJ glyph */
+ font-family: Calibri, sans-serif;
+ }
+ </style>
+ </head>
+ <body lang="fr">
+ <p>a&#x300;b</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/cgj-01.html b/layout/reftests/text/cgj-01.html
new file mode 100644
index 0000000000..bea39f5704
--- /dev/null
+++ b/layout/reftests/text/cgj-01.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<!-- U+034F Combining Grapheme Joiner test #1.
+ The CGJ should not be visible,
+ nor affect the width of the first cluster. -->
+<html>
+ <head>
+ <title>CGJ test</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ body {
+ font-size: 35px;
+ line-height: 100px;
+ /* prefer Calibri on Win7 to avoid visible CGJ glyph */
+ font-family: Calibri, sans-serif;
+ }
+ </style>
+ </head>
+ <body lang="fr">
+ <p>a&#x300;&#x34f;b</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/color-opacity-rtl-1-ref.html b/layout/reftests/text/color-opacity-rtl-1-ref.html
new file mode 100644
index 0000000000..afe96a51d1
--- /dev/null
+++ b/layout/reftests/text/color-opacity-rtl-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Mozilla bug 1318539</title>
+<style>
+.ref {
+ font-family: Twemoji Mozilla, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, sans-serif;
+ font-size: 48px;
+ opacity: 0.5;
+ text-align: right;
+}
+</style>
+</head>
+<body class="ref">
+(&#x1f602;&#x1f601;&#x1f600;)
+</body>
+</html>
diff --git a/layout/reftests/text/color-opacity-rtl-1.html b/layout/reftests/text/color-opacity-rtl-1.html
new file mode 100644
index 0000000000..ee6e09090c
--- /dev/null
+++ b/layout/reftests/text/color-opacity-rtl-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Mozilla bug 1318539</title>
+<style>
+.test {
+ font-family: Twemoji Mozilla, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, sans-serif;
+ font-size: 48px;
+ opacity: 0.5;
+}
+</style>
+</head>
+<body dir=rtl class="test">
+(&#x1f600;&#x1f601;&#x1f602;)
+</body>
+</html>
diff --git a/layout/reftests/text/color-opacity-rtl-2-ref.html b/layout/reftests/text/color-opacity-rtl-2-ref.html
new file mode 100644
index 0000000000..88ee708431
--- /dev/null
+++ b/layout/reftests/text/color-opacity-rtl-2-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Mozilla bug 1318539</title>
+<style>
+.ref {
+ font-family: Twemoji Mozilla, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, sans-serif;
+ font-size: 48px;
+ opacity: 0.5;
+ unicode-bidi: bidi-override;
+ direction: ltr;
+}
+</style>
+</head>
+<body class="ref">
+&#x5d1;&#x1f600;&#x5d0;
+</body>
+</html>
diff --git a/layout/reftests/text/color-opacity-rtl-2.html b/layout/reftests/text/color-opacity-rtl-2.html
new file mode 100644
index 0000000000..1a9b0f4c10
--- /dev/null
+++ b/layout/reftests/text/color-opacity-rtl-2.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Mozilla bug 1318539</title>
+<style>
+.test {
+ font-family: Twemoji Mozilla, Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji, sans-serif;
+ font-size: 48px;
+ opacity: 0.5;
+}
+</style>
+</head>
+<body class="test">
+&#x5d0;&#x1f600;&#x5d1;
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-01-notref.html b/layout/reftests/text/control-chars-01-notref.html
new file mode 100644
index 0000000000..3b7735d33b
--- /dev/null
+++ b/layout/reftests/text/control-chars-01-notref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<textarea style="-moz-appearance:none; width:300px; height:300px;">
+foobar
+</textarea>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-01a.html b/layout/reftests/text/control-chars-01a.html
new file mode 100644
index 0000000000..1dbd34ba66
--- /dev/null
+++ b/layout/reftests/text/control-chars-01a.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<textarea style="-moz-appearance:none; width:300px; height:300px;">
+foo&#x01;bar
+</textarea>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-01b.html b/layout/reftests/text/control-chars-01b.html
new file mode 100644
index 0000000000..19e08552da
--- /dev/null
+++ b/layout/reftests/text/control-chars-01b.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<textarea style="-moz-appearance:none; width:300px; height:300px;">
+foo&#x1f;bar
+</textarea>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-01c.html b/layout/reftests/text/control-chars-01c.html
new file mode 100644
index 0000000000..28504d4f43
--- /dev/null
+++ b/layout/reftests/text/control-chars-01c.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<textarea style="-moz-appearance:none; width:300px; height:300px;">
+foo&#x7f;bar
+</textarea>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-01d.html b/layout/reftests/text/control-chars-01d.html
new file mode 100644
index 0000000000..561489b259
--- /dev/null
+++ b/layout/reftests/text/control-chars-01d.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<textarea style="-moz-appearance:none; width:300px; height:300px;">
+foo&#x8f;bar
+</textarea>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-02-notref.html b/layout/reftests/text/control-chars-02-notref.html
new file mode 100644
index 0000000000..fe88d751b6
--- /dev/null
+++ b/layout/reftests/text/control-chars-02-notref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body style="-moz-control-character-visibility:visible">
+foobar
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-02.html b/layout/reftests/text/control-chars-02.html
new file mode 100644
index 0000000000..63210d20e8
--- /dev/null
+++ b/layout/reftests/text/control-chars-02.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body style="-moz-control-character-visibility:visible">
+foo&#x01;bar
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-03-ref.html b/layout/reftests/text/control-chars-03-ref.html
new file mode 100644
index 0000000000..2fecd054f9
--- /dev/null
+++ b/layout/reftests/text/control-chars-03-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+foobar
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-03a.html b/layout/reftests/text/control-chars-03a.html
new file mode 100644
index 0000000000..27fa168f18
--- /dev/null
+++ b/layout/reftests/text/control-chars-03a.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body style="-moz-control-character-visibility:hidden">
+foo&#x01;bar
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-03b.html b/layout/reftests/text/control-chars-03b.html
new file mode 100644
index 0000000000..488e5e7513
--- /dev/null
+++ b/layout/reftests/text/control-chars-03b.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body style="-moz-control-character-visibility:visible">
+<span id="s">foo&#x01;bar</span>
+<script>
+var x = s.getBoundingClientRect().width;
+document.body.setAttribute("style", "-moz-control-character-visibility:hidden");
+</script>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-04-notref.html b/layout/reftests/text/control-chars-04-notref.html
new file mode 100644
index 0000000000..97509ce967
--- /dev/null
+++ b/layout/reftests/text/control-chars-04-notref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<div>
+foobar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-04a.html b/layout/reftests/text/control-chars-04a.html
new file mode 100644
index 0000000000..9a8e3332db
--- /dev/null
+++ b/layout/reftests/text/control-chars-04a.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<div>
+foo&#x01;bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-04b.html b/layout/reftests/text/control-chars-04b.html
new file mode 100644
index 0000000000..48e24b0385
--- /dev/null
+++ b/layout/reftests/text/control-chars-04b.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<div>
+foo&#x1f;bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-04c.html b/layout/reftests/text/control-chars-04c.html
new file mode 100644
index 0000000000..fd5f892c94
--- /dev/null
+++ b/layout/reftests/text/control-chars-04c.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<div>
+foo&#x7f;bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/control-chars-04d.html b/layout/reftests/text/control-chars-04d.html
new file mode 100644
index 0000000000..94623baeb6
--- /dev/null
+++ b/layout/reftests/text/control-chars-04d.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+</head>
+<body>
+<div>
+foo&#x8f;bar
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-01-notref.html b/layout/reftests/text/emoji-01-notref.html
new file mode 100644
index 0000000000..8c5c479705
--- /dev/null
+++ b/layout/reftests/text/emoji-01-notref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that emoji char renders something visible (bug 715798, bug 779042)</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<div>
+U+1F603:
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-01.html b/layout/reftests/text/emoji-01.html
new file mode 100644
index 0000000000..53082b913d
--- /dev/null
+++ b/layout/reftests/text/emoji-01.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that emoji char renders something visible (bug 715798, bug 779042)</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<div>
+U+1F603: &#x1F603;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-02-notref.html b/layout/reftests/text/emoji-02-notref.html
new file mode 100644
index 0000000000..e9fc9fe6b0
--- /dev/null
+++ b/layout/reftests/text/emoji-02-notref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that HUGE emoji char renders something visible (bug 715798, bug 779042)</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 600px;
+}
+</style>
+</head>
+<body>
+<div>
+U+1F633: <span style="font-size:400px">&nbsp;</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-02.html b/layout/reftests/text/emoji-02.html
new file mode 100644
index 0000000000..099b184712
--- /dev/null
+++ b/layout/reftests/text/emoji-02.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Check that HUGE emoji char renders something visible (bug 715798, bug 779042)</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 600px;
+}
+</style>
+</head>
+<body>
+<div>
+<!-- If the emoji size is too big, skia will fail to render it. 250 seems to be the max -->
+U+1F633: <span style="font-size:250px">&#x1F633;</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-03-notref.html b/layout/reftests/text/emoji-03-notref.html
new file mode 100644
index 0000000000..56a521afa1
--- /dev/null
+++ b/layout/reftests/text/emoji-03-notref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Emoji rendering should be affected by VS15/VS16</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0f;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-03-ref.html b/layout/reftests/text/emoji-03-ref.html
new file mode 100644
index 0000000000..b82fbe9f80
--- /dev/null
+++ b/layout/reftests/text/emoji-03-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Emoji rendering should be affected by VS15/VS16</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0e;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-03.html b/layout/reftests/text/emoji-03.html
new file mode 100644
index 0000000000..7c2d71de4f
--- /dev/null
+++ b/layout/reftests/text/emoji-03.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Emoji rendering should be affected by VS15/VS16</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-04-ref.html b/layout/reftests/text/emoji-04-ref.html
new file mode 100644
index 0000000000..354df991e6
--- /dev/null
+++ b/layout/reftests/text/emoji-04-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Emoji-style glyph should ignore color</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+ color: blue;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0f;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-04.html b/layout/reftests/text/emoji-04.html
new file mode 100644
index 0000000000..87a02555a1
--- /dev/null
+++ b/layout/reftests/text/emoji-04.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Emoji-style glyph should ignore color</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+ color: green;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0f;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-05-notref.html b/layout/reftests/text/emoji-05-notref.html
new file mode 100644
index 0000000000..574d30a6b1
--- /dev/null
+++ b/layout/reftests/text/emoji-05-notref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Text-style glyph should respect color</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+ color: blue;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0e;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/emoji-05.html b/layout/reftests/text/emoji-05.html
new file mode 100644
index 0000000000..7401d1c1bc
--- /dev/null
+++ b/layout/reftests/text/emoji-05.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<title>Text-style glyph should respect color</title>
+<style type="text/css">
+body {
+ margin: 10px;
+ font-size: 40px;
+ line-height: 2em;
+ color: green;
+}
+</style>
+</head>
+<body>
+<div>
+&#x2764;&#xfe0e;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/ethiopic-wordspace-ref.html b/layout/reftests/text/ethiopic-wordspace-ref.html
new file mode 100644
index 0000000000..39c289b5e6
--- /dev/null
+++ b/layout/reftests/text/ethiopic-wordspace-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Reference: Testcase for bug 815077</title>
+</head>
+<body>
+
+<p>
+የሰው፡<br>ልጅ፡<br>ሁሉ፡<br>ሲወለድ፡<br>ነጻና፡<br>በክብርና፡<br>በመብትም፡<br>እኩልነት፡<br>ያለው፡<br>ነው።፡<br>የተፈጥሮ፡<br>ማስተዋልና፡<br>ሕሊና፡<br>ስላለው፡<br>አንዱ፡<br>ሌላውን፡<br>በወንድማማችነት፡<br>መንፈስ፡<br>መመልከት፡<br>ይገባዋል።
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/ethiopic-wordspace.html b/layout/reftests/text/ethiopic-wordspace.html
new file mode 100644
index 0000000000..912374e34e
--- /dev/null
+++ b/layout/reftests/text/ethiopic-wordspace.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 815077</title>
+</head>
+<body>
+
+<p style="width:0">
+የሰው፡ልጅ፡ሁሉ፡ሲወለድ፡ነጻና፡በክብርና፡በመብትም፡እኩልነት፡ያለው፡ነው።፡የተፈጥሮ፡ማስተዋልና፡ሕሊና፡ስላለው፡አንዱ፡ሌላውን፡በወንድማማችነት፡መንፈስ፡መመልከት፡ይገባዋል።
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/fallback-01-ref.xhtml b/layout/reftests/text/fallback-01-ref.xhtml
new file mode 100644
index 0000000000..4894469eb6
--- /dev/null
+++ b/layout/reftests/text/fallback-01-ref.xhtml
@@ -0,0 +1,19 @@
+<?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"
+ [<!ENTITY first "!"><!ENTITY fallback "&#x00e6;">]>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!-- U+00E6 is expected to be found in Arial and DejaVu Sans, but not
+ Devanagari MT, FrankRuehl, nor Standard Symbols L.
+ "!" is chosen as it is expected to be found in the first font found. -->
+ <head>
+ <style>
+ p { font-size: 16.6px;
+ font-family: Devanagari MT, FrankRuehl, Standard Symbols L, Arial, DejaVu Sans; serif }
+ .fallback { font-family: Arial, DejaVu Sans, serif; }
+ </style>
+ </head>
+ <body>
+ <p><span class="fallback">&fallback;&fallback;</span>&first;<span class="fallback">&fallback;</span>&first;<span class="fallback">&fallback;</span>&first;<span class="fallback">&fallback;</span></p>
+ </body>
+</html>
diff --git a/layout/reftests/text/fallback-01.xhtml b/layout/reftests/text/fallback-01.xhtml
new file mode 100644
index 0000000000..804fb04730
--- /dev/null
+++ b/layout/reftests/text/fallback-01.xhtml
@@ -0,0 +1,19 @@
+<?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"
+ [<!ENTITY first "!"><!ENTITY fallback "&#x00e6;">]>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!-- U+00E6 is expected to be found in Arial and DejaVu Sans, but not
+ Devanagari MT, FrankRuehl, nor Standard Symbols L.
+ "!" is chosen as it is expected to be found in the first font found. -->
+ <head>
+ <style>
+ p { font-size: 16.6px;
+ font-family: Devanagari MT, FrankRuehl, Standard Symbols L, Arial, DejaVu Sans; serif }
+ .fallback { font-family: Arial, DejaVu Sans, serif; }
+ </style>
+ </head>
+ <body>
+ <p>&fallback;&fallback;&first;&fallback;&first;&fallback;&first;<span class="fallback">&fallback;</span></p>
+ </body>
+</html>
diff --git a/layout/reftests/text/fallback-mark-stacking-1-notref.html b/layout/reftests/text/fallback-mark-stacking-1-notref.html
new file mode 100644
index 0000000000..85df2ebd16
--- /dev/null
+++ b/layout/reftests/text/fallback-mark-stacking-1-notref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ /* Note that this font has no OpenType layout tables: */
+ src: url(../fonts/sil/GenR102.ttf);
+}
+body {
+ font-family: test;
+}
+.test {
+ font-size: 100px;
+ line-height: 2;
+}
+</style>
+</head>
+<body>
+These examples should NOT look the same:
+<div class=test>x&#x303;&#x302; x&#x302;&#x303;</div>
+</body>
diff --git a/layout/reftests/text/fallback-mark-stacking-1.html b/layout/reftests/text/fallback-mark-stacking-1.html
new file mode 100644
index 0000000000..2a6138f8f9
--- /dev/null
+++ b/layout/reftests/text/fallback-mark-stacking-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: test;
+ /* Note that this font has no OpenType layout tables: */
+ src: url(../fonts/sil/GenR102.ttf);
+}
+body {
+ font-family: test;
+}
+.test {
+ font-size: 100px;
+ line-height: 2;
+}
+</style>
+</head>
+<body>
+These examples should NOT look the same:
+<div class=test>x&#x302;&#x303; x&#x303;&#x302;</div>
+</body>
diff --git a/layout/reftests/text/font-selection-by-lang-01-ref.html b/layout/reftests/text/font-selection-by-lang-01-ref.html
new file mode 100644
index 0000000000..6e962fb5a7
--- /dev/null
+++ b/layout/reftests/text/font-selection-by-lang-01-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>test for font selection by language reference</title>
+ <!-- A unique name is included in font-family
+ to force a new cache entry for each element.
+ -->
+ <style type="text/css">
+ p.a {
+ font-family: sans-serif, font-selection-by-lang-1;
+ }
+ p.b {
+ font-family: sans-serif, font-selection-by-lang-2;
+ }
+ </style>
+</head>
+<body>
+ <p class="a" lang="ja">0123456789<p>
+ <p class="b" lang="en">0123456789<p>
+</body>
+</html>
diff --git a/layout/reftests/text/font-selection-by-lang-01.html b/layout/reftests/text/font-selection-by-lang-01.html
new file mode 100644
index 0000000000..a88310d3d0
--- /dev/null
+++ b/layout/reftests/text/font-selection-by-lang-01.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>test for font selection by language</title>
+ <!-- Checks that caches do not cause the lang="ja" font to be used for
+ the lang="en" element.
+ -->
+ <style type="text/css">
+ p {
+ font-family: sans-serif;
+ }
+ </style>
+</head>
+<body>
+ <p lang="ja">0123456789<p>
+ <p lang="en">0123456789<p>
+</body>
+</html>
diff --git a/layout/reftests/text/font-selection-fallback-1-ref.html b/layout/reftests/text/font-selection-fallback-1-ref.html
new file mode 100644
index 0000000000..5e0fb11633
--- /dev/null
+++ b/layout/reftests/text/font-selection-fallback-1-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+ <title>Reference for test that language support doesn't override
+ specified family - Bug 678561</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+ @font-face {
+ font-family: "MarkB";
+ src: url(../fonts/markB.ttf);
+ }
+ @font-face {
+ font-family: "DejaVu Sans Mono";
+ src: url(../fonts/DejaVuSansMono.otf);
+ }
+
+ .c1 { font-family: MarkA; }
+ .c2 { font-family: MarkB; }
+ .c3 { font-family: DejaVu Sans Mono; }
+
+ /* to ensure the same vertical positioning of the text */
+ .spacer { line-height: 3em }
+ </style>
+</head>
+<body>
+
+<p><span class="c1">A</span></p>
+<p><span class="c2">B</span><span class="spacer"></span></p>
+<p><span class="c3">C</span><span class="spacer"></span></p>
+
+<p class="c3">A</p>
+<p class="c3">B</p>
+<p class="c3">C</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/font-selection-fallback-1.html b/layout/reftests/text/font-selection-fallback-1.html
new file mode 100644
index 0000000000..0f6700ec12
--- /dev/null
+++ b/layout/reftests/text/font-selection-fallback-1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en">
+<head>
+ <title>Test that language support doesn't override specified family - Bug 678561</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+ @font-face {
+ font-family: "MarkB";
+ src: url(../fonts/markB.ttf);
+ }
+ @font-face {
+ font-family: "DejaVu Sans Mono";
+ src: url(../fonts/DejaVuSansMono.otf);
+ }
+
+ .c1 { font-family: MarkA, MarkB, DejaVu Sans Mono; }
+
+ .c2 { font-family: DejaVu Sans Mono, MarkA, MarkB; }
+
+ /* to ensure the same vertical positioning of the text */
+ .spacer { line-height: 3em }
+ </style>
+</head>
+<body>
+
+<p><span class="c1">A</span></p>
+<p><span class="c1">B</span><span class="spacer"></span></p>
+<p><span class="c1">C</span><span class="spacer"></span></p>
+
+<p class="c2">A</p>
+<p class="c2">B</p>
+<p class="c2">C</p>
+
+</body>
+</html>
diff --git a/layout/reftests/text/font-selection-generic-1-ref.html b/layout/reftests/text/font-selection-generic-1-ref.html
new file mode 100644
index 0000000000..dfb7645a9d
--- /dev/null
+++ b/layout/reftests/text/font-selection-generic-1-ref.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+
+ .c1 { font-family: sans-serif; }
+ .c2 { font-family: serif; }
+ .c3 { font-family: monospace, fantasy; }
+ .c4 { font-family: fantasy; }
+ .c5 { font-family: cursive; }
+
+ .c11 { font-family: MarkA, serif; }
+ .c12 { font-family: MarkA, monospace; }
+ .c13 { font-family: MarkA, sans-serif; }
+ .c14 { font-family: MarkA, cursive; }
+ .c15 { font-family: MarkA, fantasy; }
+
+ /* to ensure the same vertical positioning of the text */
+ .spacer { line-height: 3em }
+ </style>
+</head>
+<body>
+
+<p class="c1">AB</p>
+<p class="c2">AB</p>
+<p class="c3">AB</p>
+<!-- Rev3 Fedora 12 test machines don't have fantasy or cursive,
+ and WINNT 5.2 machines don't have fantasy.
+<p class="c4">AB</p>
+<p class="c5">AB</p>
+-->
+
+<p class="c11">A</p>
+<p><span class="c1">B</span><span class="spacer"></span></p>
+<p class="c12">A</p>
+<p><span class="c2">B</span><span class="spacer"></span></p>
+<p class="c13">A</p>
+<p><span class="c3">B</span><span class="spacer"></span></p>
+<!--
+<p class="c14">A</p>
+<p class="c4">B</p>
+<p class="c15">A</p>
+<p class="c5">B</p>
+-->
+
+</body>
+</html>
diff --git a/layout/reftests/text/font-selection-generic-1.html b/layout/reftests/text/font-selection-generic-1.html
new file mode 100644
index 0000000000..fc08ebd98b
--- /dev/null
+++ b/layout/reftests/text/font-selection-generic-1.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.ttf);
+ }
+
+ .c1 { font-family: sans-serif, MarkA; }
+ .c2 { font-family: serif, MarkA; }
+ .c3 { font-family: monospace, MarkA; }
+ .c4 { font-family: fantasy, MarkA; }
+ .c5 { font-family: cursive, MarkA; }
+
+ .c11 { font-family: MarkA, sans-serif; }
+ .c12 { font-family: MarkA, serif; }
+ .c13 { font-family: MarkA, monospace; }
+ .c14 { font-family: MarkA, fantasy; }
+ .c15 { font-family: MarkA, cursive; }
+
+ /* to ensure the same vertical positioning of the text */
+ .spacer { line-height: 3em }
+ </style>
+</head>
+<body>
+
+<p class="c1">AB</p>
+<p class="c2">AB</p>
+<p class="c3">AB</p>
+<!-- Rev3 Fedora 12 test machines don't have fantasy or cursive,
+ and WINNT 5.2 machines don't have fantasy.
+<p class="c4">AB</p>
+<p class="c5">AB</p>
+-->
+
+<p class="c11">A</p>
+<p><span class="c11">B</span><span class="spacer"></span></p>
+<p class="c12">A</p>
+<p><span class="c12">B</span><span class="spacer"></span></p>
+<p class="c13">A</p>
+<p><span class="c13">B</span><span class="spacer"></span></p>
+<!--
+<p class="c14">A</p>
+<p class="c14">B</p>
+<p class="c15">A</p>
+<p class="c15">B</p>
+-->
+
+</body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-01-ref.html b/layout/reftests/text/font-size-adjust-01-ref.html
new file mode 100644
index 0000000000..2e198fe6c3
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-01-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ p { font-family: sans-serif; font-size: 24pt; }
+ </style>
+ <body>
+ <p>hello</p>
+ <p>small</p>
+ <p>world</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-01.html b/layout/reftests/text/font-size-adjust-01.html
new file mode 100644
index 0000000000..4da5d882ae
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-01.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ p { font-family: sans-serif; font-size: 24pt; }
+ .small { font-size-adjust: 0.25; }
+ .large { font-size-adjust: 0.9; }
+ </style>
+ <body>
+ <p>hello</p>
+ <p class="small">small</p>
+ <p class="large">world</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-02-ref.html b/layout/reftests/text/font-size-adjust-02-ref.html
new file mode 100644
index 0000000000..340e3fd822
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-02-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ .big { font-family: sans-serif; font-size: 40pt; }
+ .a { font-family: sans-serif; font-size: 15pt; font-size-adjust: 0.8; }
+ .b { font-family: sans-serif; font-size: 30pt; font-size-adjust: 0.4; }
+ </style>
+ <body>
+ <p class="big">1. <span class="a">lines should be the same size</span></p>
+ <p class="big">2. <span class="b">lines should be the same size</span></p>
+ </body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-02.html b/layout/reftests/text/font-size-adjust-02.html
new file mode 100644
index 0000000000..23e9c5f12c
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-02.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ .big { font-family: sans-serif; font-size: 40pt; }
+ .a { font-family: sans-serif; font-size: 15pt; font-size-adjust: 0.8; }
+ .b { font-family: sans-serif; font-size: 30pt; font-size-adjust: 0.4; }
+ </style>
+ <body>
+ <p class="big">1. <span class="b">lines should be the same size</span></p>
+ <p class="big">2. <span class="a">lines should be the same size</span></p>
+ </body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-03-ref.html b/layout/reftests/text/font-size-adjust-03-ref.html
new file mode 100644
index 0000000000..1958f7d7d7
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-03-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ .a { font-family: sans-serif; font-size: 15pt; font-size-adjust: 0.8; }
+ .b { font-family: sans-serif; font-size: 30pt; font-size-adjust: 0.4; }
+ </style>
+ <body>
+ <p class="b">lines should be the same size</p>
+ <p class="a">lines should be the same size</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/font-size-adjust-03.html b/layout/reftests/text/font-size-adjust-03.html
new file mode 100644
index 0000000000..5188b48749
--- /dev/null
+++ b/layout/reftests/text/font-size-adjust-03.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ </head>
+ <style>
+ .a { font-family: sans-serif; font-size: 15pt; font-size-adjust: 0.8; }
+ .b { font-family: sans-serif; font-size: 30pt; font-size-adjust: 0.4; }
+ </style>
+ <body>
+ <p class="a">lines should be the same size</p>
+ <p class="b">lines should be the same size</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/glyph-decomposition-graphite-ref.html b/layout/reftests/text/glyph-decomposition-graphite-ref.html
new file mode 100644
index 0000000000..0ffe73917e
--- /dev/null
+++ b/layout/reftests/text/glyph-decomposition-graphite-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>test rendering with decomposition (bug 772640)</title>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: test;
+ font-size: 40px;
+ text-align: left;
+}
+</style>
+</head>
+<body>
+<div>
+<!-- with graphite enabled, this will display ThisIsGraphite to confirm it's working -->
+ThisIsNotGraphite:<br>
+<!-- U+0622 should render identically to U+0627,U+0653 -->
+RTL: <span dir="rtl">a&#x0627;&#x0653;z</span><br>
+LTR: <span dir="ltr" style="unicode-bidi: bidi-override">a&#x0627;&#x0653;z</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/glyph-decomposition-graphite.html b/layout/reftests/text/glyph-decomposition-graphite.html
new file mode 100644
index 0000000000..365923c4f6
--- /dev/null
+++ b/layout/reftests/text/glyph-decomposition-graphite.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>test rendering with decomposition (bug 772640)</title>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: test;
+ font-size: 40px;
+ text-align: left;
+}
+</style>
+</head>
+<body>
+<div>
+<!-- with graphite enabled, this will display ThisIsGraphite to confirm it's working -->
+ThisIsNotGraphite:<br>
+<!-- U+0622 should render identically to U+0627,U+0653 -->
+RTL: <span dir="rtl">a&#x0622;z</span><br>
+LTR: <span dir="ltr" style="unicode-bidi: bidi-override">a&#x0622;z</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/glyph-decomposition-opentype-ref.html b/layout/reftests/text/glyph-decomposition-opentype-ref.html
new file mode 100644
index 0000000000..0ffe73917e
--- /dev/null
+++ b/layout/reftests/text/glyph-decomposition-opentype-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>test rendering with decomposition (bug 772640)</title>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: test;
+ font-size: 40px;
+ text-align: left;
+}
+</style>
+</head>
+<body>
+<div>
+<!-- with graphite enabled, this will display ThisIsGraphite to confirm it's working -->
+ThisIsNotGraphite:<br>
+<!-- U+0622 should render identically to U+0627,U+0653 -->
+RTL: <span dir="rtl">a&#x0627;&#x0653;z</span><br>
+LTR: <span dir="ltr" style="unicode-bidi: bidi-override">a&#x0627;&#x0653;z</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/glyph-decomposition-opentype.html b/layout/reftests/text/glyph-decomposition-opentype.html
new file mode 100644
index 0000000000..365923c4f6
--- /dev/null
+++ b/layout/reftests/text/glyph-decomposition-opentype.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<title>test rendering with decomposition (bug 772640)</title>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: test;
+ font-size: 40px;
+ text-align: left;
+}
+</style>
+</head>
+<body>
+<div>
+<!-- with graphite enabled, this will display ThisIsGraphite to confirm it's working -->
+ThisIsNotGraphite:<br>
+<!-- U+0622 should render identically to U+0627,U+0653 -->
+RTL: <span dir="rtl">a&#x0622;z</span><br>
+LTR: <span dir="ltr" style="unicode-bidi: bidi-override">a&#x0622;z</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-01-ref.html b/layout/reftests/text/graphite-01-ref.html
new file mode 100644
index 0000000000..6e8b3ab508
--- /dev/null
+++ b/layout/reftests/text/graphite-01-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: PigLatin;
+ src: url(../fonts/sil/PigLatin-nographite.ttf);
+}
+
+body {
+ font: 34px PigLatin;
+ width: 5em;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<p>
+Igpay
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-01.html b/layout/reftests/text/graphite-01.html
new file mode 100644
index 0000000000..aa8b13fce6
--- /dev/null
+++ b/layout/reftests/text/graphite-01.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: PigLatin;
+ src: url(../fonts/sil/PigLatinBenchmark_v3.ttf);
+}
+
+body {
+ font: 34px PigLatin;
+ width: 5em;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<p>
+Pig
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-02-ref.html b/layout/reftests/text/graphite-02-ref.html
new file mode 100644
index 0000000000..2e00202bc9
--- /dev/null
+++ b/layout/reftests/text/graphite-02-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: PigLatin;
+ src: url(../fonts/sil/PigLatin-nographite.ttf);
+}
+
+body {
+ font: 34px PigLatin;
+ width: 5em;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<p>
+Igpay<br>Atinlay
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-02.html b/layout/reftests/text/graphite-02.html
new file mode 100644
index 0000000000..0842dff7bf
--- /dev/null
+++ b/layout/reftests/text/graphite-02.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: PigLatin;
+ src: url(../fonts/sil/PigLatinBenchmark_v3.ttf);
+}
+
+body {
+ font: 34px PigLatin;
+ width: 5em;
+ line-height: 2em;
+}
+</style>
+</head>
+<body>
+<p>
+Pig Latin
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-03-notref.html b/layout/reftests/text/graphite-03-notref.html
new file mode 100644
index 0000000000..32f8aaea3a
--- /dev/null
+++ b/layout/reftests/text/graphite-03-notref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+@font-face {
+ font-family: padauk;
+ src: url(../fonts/sil/Padauk.ttf);
+}
+
+body {
+ font: 34px padauk;
+}
+</style>
+</head>
+<body>
+<p lang="my"><!-- default (Burmese) behavior of Padauk -->
+ပှၤလၢအတလဲၤဘၣ်ဝဲလၢ ပှၤတတီတလိၤဘၣ်အ ကူၣ်ထီၣ်ဖးလီၤတၢ်အပူၤ, ဒီးတဆၢထၢၣ်ဘၣ်ဝဲလၢ ပှၤမၤတၢ်ဒဲးဘးအကျဲ, ဒီးတဆ့ၣ်နီၤဘၣ်ဝဲလၢ ပှၤ ဒုၣ်ဒွဲၣ်တၢ်အလီၢ်ဆ့ၣ်နီၤဘၣ်န့ၣ် ဘၣ်ဆိၣ်ဂ့ၤဝဲလီၤ.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-03a.html b/layout/reftests/text/graphite-03a.html
new file mode 100644
index 0000000000..6577b443a5
--- /dev/null
+++ b/layout/reftests/text/graphite-03a.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+@font-face {
+ font-family: padauk;
+ src: url(../fonts/sil/Padauk.ttf);
+}
+
+body {
+ font: 34px padauk;
+}
+</style>
+</head>
+<body>
+<p lang="ksw"><!-- check that changing language affects the rendering:
+ this modifies the shape of a couple of lower diacritics -->
+ပှၤလၢအတလဲၤဘၣ်ဝဲလၢ ပှၤတတီတလိၤဘၣ်အ ကူၣ်ထီၣ်ဖးလီၤတၢ်အပူၤ, ဒီးတဆၢထၢၣ်ဘၣ်ဝဲလၢ ပှၤမၤတၢ်ဒဲးဘးအကျဲ, ဒီးတဆ့ၣ်နီၤဘၣ်ဝဲလၢ ပှၤ ဒုၣ်ဒွဲၣ်တၢ်အလီၢ်ဆ့ၣ်နီၤဘၣ်န့ၣ် ဘၣ်ဆိၣ်ဂ့ၤဝဲလီၤ.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-03b.html b/layout/reftests/text/graphite-03b.html
new file mode 100644
index 0000000000..c584612e24
--- /dev/null
+++ b/layout/reftests/text/graphite-03b.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+@font-face {
+ font-family: padauk;
+ src: url(../fonts/sil/Padauk.ttf);
+}
+
+body {
+ font: 34px padauk;
+ font-feature-settings: "kdot" on;
+ /* check that setting an optional graphite feature affects rendering:
+ * this adds "dots" to the ends of a number of curved strokes
+ */
+}
+</style>
+</head>
+<body>
+<p lang="my">
+ပှၤလၢအတလဲၤဘၣ်ဝဲလၢ ပှၤတတီတလိၤဘၣ်အ ကူၣ်ထီၣ်ဖးလီၤတၢ်အပူၤ, ဒီးတဆၢထၢၣ်ဘၣ်ဝဲလၢ ပှၤမၤတၢ်ဒဲးဘးအကျဲ, ဒီးတဆ့ၣ်နီၤဘၣ်ဝဲလၢ ပှၤ ဒုၣ်ဒွဲၣ်တၢ်အလီၢ်ဆ့ၣ်နီၤဘၣ်န့ၣ် ဘၣ်ဆိၣ်ဂ့ၤဝဲလီၤ.
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-fa.html b/layout/reftests/text/graphite-04-fa.html
new file mode 100644
index 0000000000..2155c8661f
--- /dev/null
+++ b/layout/reftests/text/graphite-04-fa.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="fa">
+<!-- Persian (Farsi) should be the same as English-tagged -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-ref.html b/layout/reftests/text/graphite-04-ref.html
new file mode 100644
index 0000000000..72e5cdb8af
--- /dev/null
+++ b/layout/reftests/text/graphite-04-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="en">
+<!-- for testing Graphite language support we'll use the Eastern Arabic-Indic digits;
+ default rendering will have the Persian forms -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-sd.html b/layout/reftests/text/graphite-04-sd.html
new file mode 100644
index 0000000000..85ebe2c3e8
--- /dev/null
+++ b/layout/reftests/text/graphite-04-sd.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="sd">
+<!-- Sindhi - digits 6 and 7 have different forms -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-snd.html b/layout/reftests/text/graphite-04-snd.html
new file mode 100644
index 0000000000..3bd776f230
--- /dev/null
+++ b/layout/reftests/text/graphite-04-snd.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="snd">
+<!-- Sindhi incorrectly tagged with iso-639-3 code instead of bcp47/iso-639-1;
+ rendering should therefore match the default "en", NOT the correctly-tagged "sd" version -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-ur.html b/layout/reftests/text/graphite-04-ur.html
new file mode 100644
index 0000000000..579b2ab8aa
--- /dev/null
+++ b/layout/reftests/text/graphite-04-ur.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="ur">
+<!-- in Urdu, the digit 4 should differ from Sindhi,
+ and 6 and 7 also differ from Persian -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-04-urd.html b/layout/reftests/text/graphite-04-urd.html
new file mode 100644
index 0000000000..33599b4cd9
--- /dev/null
+++ b/layout/reftests/text/graphite-04-urd.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: schz-gr;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+}
+body {
+ font-family: schz-gr;
+ font-size: 40px;
+}
+</style>
+</head>
+<body lang="urd">
+<!-- incorrectly-tagged Urdu should match the default rendering -->
+&#x6f0;&#x6f1;&#x6f2;&#x6f3;&#x6f4;&#x6f5;&#x6f6;&#x6f7;&#x6f8;&#x6f9;
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-badlang.html b/layout/reftests/text/graphite-05-badlang.html
new file mode 100644
index 0000000000..933e8332c3
--- /dev/null
+++ b/layout/reftests/text/graphite-05-badlang.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-langfeat.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p lang="fra">PaSs</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-fail.html b/layout/reftests/text/graphite-05-fail.html
new file mode 100644
index 0000000000..27995b9a0a
--- /dev/null
+++ b/layout/reftests/text/graphite-05-fail.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-ot-only.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-feat.html b/layout/reftests/text/graphite-05-feat.html
new file mode 100644
index 0000000000..f4082dde08
--- /dev/null
+++ b/layout/reftests/text/graphite-05-feat.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-langfeat.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+ font-feature-settings: "TST1", "FTP2";
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-lang.html b/layout/reftests/text/graphite-05-lang.html
new file mode 100644
index 0000000000..c4a8cb0ddc
--- /dev/null
+++ b/layout/reftests/text/graphite-05-lang.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-langfeat.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+ font-feature-settings: "TST1";
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p lang="fr">FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-multipass.html b/layout/reftests/text/graphite-05-multipass.html
new file mode 100644
index 0000000000..b3e2522cde
--- /dev/null
+++ b/layout/reftests/text/graphite-05-multipass.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-multipass.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+ font-feature-settings: "TST1";
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-ot-only.html b/layout/reftests/text/graphite-05-ot-only.html
new file mode 100644
index 0000000000..ae4d046cab
--- /dev/null
+++ b/layout/reftests/text/graphite-05-ot-only.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-ot-only.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+ font-feature-settings: "TST1";
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-ref.html b/layout/reftests/text/graphite-05-ref.html
new file mode 100644
index 0000000000..aafa87cc1a
--- /dev/null
+++ b/layout/reftests/text/graphite-05-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-ref.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>PaSs</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-05-simple.html b/layout/reftests/text/graphite-05-simple.html
new file mode 100644
index 0000000000..aa126ede85
--- /dev/null
+++ b/layout/reftests/text/graphite-05-simple.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url(../fonts/graphite/grtest-simple.ttf);
+}
+
+body {
+ margin: 20px;
+ font: 100px test;
+ font-feature-settings: "TST1";
+}
+p { margin: 0; padding: 0; }
+</style>
+</head>
+<body>
+<p>FAIL</p>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-bidi-1-ref.html b/layout/reftests/text/graphite-bidi-1-ref.html
new file mode 100644
index 0000000000..0523cf33cb
--- /dev/null
+++ b/layout/reftests/text/graphite-bidi-1-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-BidiBug.woff");
+}
+div {
+ width: 5em;
+ border: 1px solid silver;
+ font-family: test;
+ font-size: 40px;
+ text-align: center;
+}
+.b {
+ background: yellow;
+}
+</style>
+</head>
+<body>
+<div><span class=b>abc</span></div>
+</html>
diff --git a/layout/reftests/text/graphite-bidi-1.html b/layout/reftests/text/graphite-bidi-1.html
new file mode 100644
index 0000000000..74c5d6c90c
--- /dev/null
+++ b/layout/reftests/text/graphite-bidi-1.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+@font-face {
+ font-family: test;
+ src: url("../fonts/sil/Scheherazade-BidiBug.woff");
+}
+div {
+ width: 5em;
+ border: 1px solid silver;
+ font-family: test;
+ font-size: 40px;
+ text-align: center;
+}
+.a {
+ color: transparent;
+}
+.b {
+ background: yellow;
+}
+</style>
+</head>
+<body>
+<div><span class=a>"</span><span class=b>abc</span><span class=a>"</span></div>
+</html>
diff --git a/layout/reftests/text/graphite-surrogate-selection-ref.html b/layout/reftests/text/graphite-surrogate-selection-ref.html
new file mode 100644
index 0000000000..5d2c88cb72
--- /dev/null
+++ b/layout/reftests/text/graphite-surrogate-selection-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Bug 1260825 reference</title>
+<meta charset="utf-8">
+<style>
+@font-face { font-family: test; src: url(../fonts/MiaoUnicode-Regular.ttf); }
+#test { font-family: test, serif; font-size: 60px; }
+.sel { background: cyan; }
+.inv { color: transparent; }
+</style>
+</head>
+<body>
+All lines should show the same single glyph &amp; background area:
+<div id="test">
+<span class="sel">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><br>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/graphite-surrogate-selection.html b/layout/reftests/text/graphite-surrogate-selection.html
new file mode 100644
index 0000000000..f086b3fa4f
--- /dev/null
+++ b/layout/reftests/text/graphite-surrogate-selection.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Bug 1260825 testcase</title>
+<meta charset="utf-8">
+<style>
+@font-face { font-family: test; src: url(../fonts/MiaoUnicode-Regular.ttf); }
+#test { font-family: test, serif; font-size: 60px; }
+.sel { background: cyan; }
+.inv { color: transparent; }
+</style>
+</head>
+<body>
+All lines should show the same single glyph &amp; background area:
+<div id="test">
+<span class="sel">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><span class="inv">&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><span class="inv">&#x16f50;&#x16f50;</span><br>
+<span class="sel">&#x16f50;</span><span class="inv">&#x16f0a;</span><br>
+<span class="sel">&#x16f50;</span><span class="inv">&#x16f0a;&#x16f6a;</span><br>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-caps-1-ref.html b/layout/reftests/text/hyphenation-caps-1-ref.html
new file mode 100644
index 0000000000..8fd0a78e9a
--- /dev/null
+++ b/layout/reftests/text/hyphenation-caps-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+div { font: 16px/24px serif; width: 8em; float: left; font-kerning: none; }
+p { margin: 1em 0; }
+</style>
+<script>
+for (const lang of ["en-US", "en"]) {
+ document.write("<div lang='" + lang + "'>" + lang +
+ ":<p>in-<br>ter-<br>caps</p><p>Intercaps</p><p>interCaps</p></div>");
+}
+for (const lang of ["de", "de-DE", "de-1901", "de-1996"]) {
+ document.write("<div lang='" + lang + "'>" + lang +
+ ":<p>in-<br>ter-<br>caps</p><p>In-<br>ter-<br>caps</p><p>interCaps</p></div>");
+}
+</script>
diff --git a/layout/reftests/text/hyphenation-caps-1.html b/layout/reftests/text/hyphenation-caps-1.html
new file mode 100644
index 0000000000..4c1b5e5cab
--- /dev/null
+++ b/layout/reftests/text/hyphenation-caps-1.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+div { font: 16px/24px serif; width: 8em; float: left; font-kerning: none; }
+p { hyphens: auto; width: 2em; margin: 1em 0; }
+</style>
+<script>
+for (const lang of ["en-US", "en", "de", "de-DE", "de-1901", "de-1996"]) {
+ document.write("<div lang='" + lang + "'>" + lang +
+ ":<p>intercaps</p><p>Intercaps</p><p>interCaps</p></div>");
+}
+</script>
diff --git a/layout/reftests/text/hyphenation-control-1-ref.html b/layout/reftests/text/hyphenation-control-1-ref.html
new file mode 100644
index 0000000000..5b26063a8b
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-1-ref.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display: block;
+ hyphens: manual;
+ border: 1px solid black;
+ /* Prefer Courier New if available, as otherwise Menlo may be used,
+ and its HYPHEN and HYPHEN-MINUS glyphs don't match. */
+ font-family: Courier New, Courier, monospace;
+}
+</style>
+</head>
+<body lang="en-us">
+<!--
+ Hyphenation opportunities of the texts in this test are as follows,
+
+ frag[A]ilis[A]tic[C]ex[A]pi[A]ali
+
+ where [A] is an automatic hyphen, and [C] is a conditional hyphen.
+
+ In this test, we set width to somewhere between every pair of adjacent hyphenations,
+ then we see if lines break correctly.
+-->
+<code style="width:4ch;">
+frag-<br />ilis-<br />tic-<br />ex-<br />pi-<br />ali
+</code>
+<br />
+<code style="width:5ch;">
+frag-<br />ilis-<br />tic-<br />expi-<br />ali
+</code>
+<br />
+<code style="width:9ch;">
+fragilis-<br />tic-<br />expiali
+</code>
+<br />
+<code style="width:12ch;">
+fragilistic-<br />expiali
+</code>
+<br />
+<code style="width:14ch;">
+fragilistic-<br />expiali
+</code>
+<br />
+<code style="width:16ch;">
+fragilistic-<br />expiali
+</code>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-1.html b/layout/reftests/text/hyphenation-control-1.html
new file mode 100644
index 0000000000..3ab7510dc1
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display: block;
+ hyphens: auto;
+ border: 1px solid black;
+ /* Prefer Courier New if available, as otherwise Menlo may be used,
+ and its HYPHEN and HYPHEN-MINUS glyphs don't match. */
+ font-family: Courier New, Courier, monospace;
+}
+</style>
+</head>
+<body lang="en-us">
+<!--
+ Hyphenation opportunities of the texts in this test are as follows,
+
+ frag[A]ilis[A]tic[C]ex[A]pi[A]ali
+
+ where [A] is an automatic hyphen, and [C] is a conditional hyphen.
+
+ In this test, we set width to somewhere between every pair of adjacent hyphenations,
+ then we see if lines break correctly.
+-->
+<code style="width:4ch;">
+fragilistic&shy;expiali
+</code>
+<br />
+<code style="width:5ch;">
+fragilistic&shy;expiali
+</code>
+<br />
+<code style="width:9ch;">
+fragilistic&shy;expiali
+</code>
+<br />
+<code style="width:12ch;">
+fragilistic&shy;expiali
+</code>
+<br />
+<code style="width:14ch;">
+fragilistic&shy;expiali
+</code>
+<br />
+<code style="width:16ch;">
+fragilistic&shy;expiali
+</code>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-2-ref.html b/layout/reftests/text/hyphenation-control-2-ref.html
new file mode 100644
index 0000000000..6f48c8bd8b
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-2-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display:block;
+ hyphens:manual;
+ border: 1px solid black;
+}
+</style>
+</head>
+<body lang="en-us">
+<code style="width:15ch;">
+Supercali-<br />fragilistic-<br />expialidocious
+</code>
+<br />
+<code style="width:15ch;">
+Supercali&#x2010;<br />fragilistic&#x2010;<br />expialidocious
+</code>
+<br />
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-2.html b/layout/reftests/text/hyphenation-control-2.html
new file mode 100644
index 0000000000..7cbb3ec457
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-2.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display:block;
+ hyphens:auto;
+ border: 1px solid black;
+}
+</style>
+</head>
+<body lang="en-us">
+<!--
+ Test checks that automatic hyphenation opportunities within a word
+ must be ignored if the word contains an explicit hyphen (U+2010) or hyphen-minus (U+002D),
+ in favor of the conditional hyphen(s)
+-->
+<code style="width:15ch;">
+Supercali-fragilistic-expialidocious
+</code>
+<br />
+<code style="width:15ch;">
+Supercali&#x2010;fragilistic&#x2010;expialidocious
+</code>
+<br />
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-3-ref.html b/layout/reftests/text/hyphenation-control-3-ref.html
new file mode 100644
index 0000000000..46a6b60d6e
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-3-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display: block;
+ hyphens: manual;
+ border: 1px solid black;
+ /* Prefer Courier New if available, as otherwise Menlo may be used,
+ and its HYPHEN and HYPHEN-MINUS glyphs don't match. */
+ font-family: Courier New, Courier, monospace;
+}
+</style>
+</head>
+<body lang="en-us">
+<code style="width:100ch;">
+abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu-<br />vwxyzsupercalifragilisticexpialidocious-<br />abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+</code>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-3.html b/layout/reftests/text/hyphenation-control-3.html
new file mode 100644
index 0000000000..c96a1e3e7b
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-3.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+code {
+ display: block;
+ hyphens: auto;
+ border: 1px solid black;
+ /* Prefer Courier New if available, as otherwise Menlo may be used,
+ and its HYPHEN and HYPHEN-MINUS glyphs don't match. */
+ font-family: Courier New, Courier, monospace;
+}
+</style>
+</head>
+<body lang="en-us">
+<!--
+ Test checks that automatic hyphenation opportunities should honor
+ manual hyphenation opportunities even if they are within an extreme long word.
+-->
+<code style="width:100ch;">
+abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzsuper&shy;cali&shy;fragi&shy;listic&shy;expiali&shy;docious&shy;abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz
+</code>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-4-ref.html b/layout/reftests/text/hyphenation-control-4-ref.html
new file mode 100644
index 0000000000..440be641e9
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-4-ref.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8">
+</head>
+<body>
+<!--
+ Test checks that hyphenation breaks should not be affected if there are multiple inline
+ elements inside a paragraph.
+-->
+<p style="width:60ch;font-family:monospace;hyphens:auto" lang="de">
+Dem Vernehmen nach wandten sich auch Kabelnetzbetreiber und Telekommunikationsfirmen
+gegen den Plan: Die Regierung hatte – genauso wie die EU –
+das 5,9-GHz-Frequenzband für die "Car-to-Car-Communication" reserviert,
+das die Branche lieber für breitbandiges mobiles Internet nutzen will.
+Den Mobilfunkern stieß zudem übel auf, dass die Autoindustrie vorrangig
+das Spektrum hätte nutzen können. Die EU-Kommission hat voriges Jahr eine
+Strategie für "kooperative intelligente Transportsysteme" auf den Weg gebracht.
+Bis 2019 sollen demnach auf dem alten Kontinent die Grundlagen stehen,
+damit vernetzte Autos untereinander und mit der Verkehrsinfrastruktur
+kommunizieren können. Diese zweite Komponente der
+"Vehicle-to-Infrastructure"-Kommunikation war der US-Regierung
+von Anfang an zu teuer ersch
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-4.html b/layout/reftests/text/hyphenation-control-4.html
new file mode 100644
index 0000000000..a4502d70e5
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-4.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><meta charset="utf-8">
+</head>
+<body>
+<!--
+ Test checks that hyphenation breaks should not be affected if there are multiple inline
+ elements inside a paragraph.
+-->
+<p style="width:60ch;font-family:monospace;hyphens:auto" lang="de">
+Dem Vernehmen nach wandten sich auch Kabelnetzbetreiber und Telekommunikationsfirmen
+gegen den Plan: Die Regierung hatte – <span>genauso</span> wie die EU –
+das 5,9-GHz-Frequenzband für die "Car-to-Car-Communication" reserviert,
+das die Branche lieber für breitbandiges mobiles Internet nutzen will.
+Den Mobilfunkern stieß zudem übel auf, dass die Autoindustrie vorrangig
+das Spektrum hätte nutzen können. Die EU-Kommission hat voriges Jahr eine
+Strategie für "kooperative intelligente Transportsysteme" auf den Weg gebracht.
+Bis 2019 sollen demnach auf dem alten Kontinent die Grundlagen stehen,
+damit vernetzte Autos untereinander und mit der Verkehrsinfrastruktur
+kommunizieren können. Diese zweite Komponente der
+"Vehicle-to-Infrastructure"-Kommunikation war der US-Regierung
+von Anfang an zu teuer ersch
+</p>
+</body>
+</html>
diff --git a/layout/reftests/text/hyphenation-control-5-ref.html b/layout/reftests/text/hyphenation-control-5-ref.html
new file mode 100644
index 0000000000..66548a1dff
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-5-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="utf-8">
+<style>
+body { columns: 3; }
+p { margin: 0 0 1em 0; }
+</style>
+<body>
+<p>hard-<br>hit
+<p>hard-<br>hit-<br>ting
+<p>hard-<br>est-<br>hit
+<p>hard-<br>est-<br>hit-<br>ting
+
+<p><b>hard</b>-<br>hit
+<p><b>hard</b>-<br>hit-<br>ting
+<p><b>hard-<br>est</b>-<br>hit
+<p><b>hard-<br>est</b>-<br>hit-<br>ting
+
+<p>hard-<br><b>hit</b>
+<p>hard-<br><b>hit-<br>ting</b>
+<p>hard-<br>est-<br><b>hit</b>
+<p>hard-<br>est-<br><b>hit-<br>ting</b>
diff --git a/layout/reftests/text/hyphenation-control-5.html b/layout/reftests/text/hyphenation-control-5.html
new file mode 100644
index 0000000000..e21a53dfee
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-5.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="utf-8">
+<style>
+body { columns: 3; }
+p { margin: 0 0 1em 0; width:0; hyphens:auto; }
+</style>
+<body>
+<p>hard-hit
+<p>hard-hitting
+<p>hardest-hit
+<p>hardest-hitting
+
+<p><b>hard</b>-hit
+<p><b>hard</b>-hitting
+<p><b>hardest</b>-hit
+<p><b>hardest</b>-hitting
+
+<p>hard-<b>hit</b>
+<p>hard-<b>hitting</b>
+<p>hardest-<b>hit</b>
+<p>hardest-<b>hitting</b>
diff --git a/layout/reftests/text/hyphenation-control-6-ref.html b/layout/reftests/text/hyphenation-control-6-ref.html
new file mode 100644
index 0000000000..6eceb0f2c7
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-6-ref.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="utf-8">
+<style>
+.test { hyphens:auto; font:10px Ubuntu Mono, Courier New, Courier, monospace; border: 1px solid silver; }
+</style>
+<body>
+<p>All the columns should appear identical:</p>
+<div id="outer" style="columns:6">
+<script>
+let outer = document.getElementById("outer");
+for (i = 1; i <= 6; ++i) {
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "0ch";
+ div.innerHTML = "the<br>flow-<br>rel-<br>a-<br>tive";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "2ch";
+ div.innerHTML = "the<br>flow-<br>rel-<br>a-<br>tive";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "4ch";
+ div.innerHTML = "the<br>flow-<br>rel-<br>a-<br>tive";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "6ch";
+ div.innerHTML = "the<br>flow-<br>rela-<br>tive";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "8ch";
+ div.innerHTML = "the<br>flow-<br>relative";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "10ch";
+ div.innerHTML = "the flow-<br>relative";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "12ch";
+ div.innerHTML = "the flow-<br>relative";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "14ch";
+ div.innerHTML = "the flow-<br>relative";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "16ch";
+ div.innerHTML = "the flow-<br>relative";
+ outer.appendChild(div);
+
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = "18ch";
+ div.innerHTML = "the flow-relative";
+ outer.appendChild(div);
+}
+</script>
diff --git a/layout/reftests/text/hyphenation-control-6.html b/layout/reftests/text/hyphenation-control-6.html
new file mode 100644
index 0000000000..103ba91aea
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-6.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<meta charset="utf-8">
+<style>
+.test { hyphens:auto; font:10px Ubuntu Mono, Courier New, Courier, monospace; border: 1px solid silver; }
+</style>
+<body>
+<p>All the columns should appear identical:</p>
+<div id="outer" style="columns:6">
+<script>
+let outer = document.getElementById("outer");
+for (i = 1; i <= 6; ++i) {
+ for (j = 0; j <= 18; j += 2) {
+ div = document.createElement("div");
+ div.className = "test";
+ div.style.width = j + "ch";
+ div.textContent = "the" + " ".repeat(i) + "flow-relative";
+ outer.appendChild(div);
+ }
+}
+</script>
diff --git a/layout/reftests/text/hyphenation-control-7-ref.html b/layout/reftests/text/hyphenation-control-7-ref.html
new file mode 100644
index 0000000000..b2a3feab55
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-7-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta "charset=utf-8">
+ <style>
+ p {
+ background: yellow;
+ margin: 0 0 1em 0;
+ font-family: monospace;
+ }
+ </style>
+<body>
+<h3>The columns should appear identical; "relative" should never be hyphenated</h3>
+<div style="columns:2">
+<p style="width: 16ch">the flow-<br>relative flow-<br>relative flow-<br>relative flow-<br>relative flow-<br>relative</p>
+<p style="width: 20ch">the flow-relative<br>flow-relative flow-<br>relative flow-<br>relative flow-<br>relative</p>
+<p style="width: 24ch">the flow-relative flow-<br>relative flow-relative<br>flow-relative flow-<br>relative</p>
+<p style="width: 41ch">the flow-relative flow-relative flow-<br>relative flow-relative flow-relative</p>
+<p style="width: 50ch">the flow-relative flow-relative flow-relative<br>flow-relative flow-relative</p>
+
+<p style="width: 16ch">the flow-<br>relative flow-<br>relative flow-<br>relative flow-<br>relative flow-<br>relative</p>
+<p style="width: 20ch">the flow-relative<br>flow-relative flow-<br>relative flow-<br>relative flow-<br>relative</p>
+<p style="width: 24ch">the flow-relative flow-<br>relative flow-relative<br>flow-relative flow-<br>relative</p>
+<p style="width: 41ch">the flow-relative flow-relative flow-<br>relative flow-relative flow-relative</p>
+<p style="width: 50ch">the flow-relative flow-relative flow-relative<br>flow-relative flow-relative</p>
diff --git a/layout/reftests/text/hyphenation-control-7.html b/layout/reftests/text/hyphenation-control-7.html
new file mode 100644
index 0000000000..7b48271fa6
--- /dev/null
+++ b/layout/reftests/text/hyphenation-control-7.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta "charset=utf-8">
+ <style>
+ p {
+ background: yellow;
+ margin: 0 0 1em 0;
+ font-family: monospace;
+ hyphens: auto;
+ }
+ </style>
+<body>
+<h3>The columns should appear identical; "relative" should never be hyphenated</h3>
+<div style="columns:2">
+<p style="width: 16ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 20ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 24ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 41ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 50ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+
+<p style="width: 16ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 20ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 24ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 41ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
+<p style="width: 50ch">the flow-relative flow-relative flow-relative flow-relative flow-relative</p>
diff --git a/layout/reftests/text/initial-zwj-1-ref.html b/layout/reftests/text/initial-zwj-1-ref.html
new file mode 100644
index 0000000000..e4d867bbfb
--- /dev/null
+++ b/layout/reftests/text/initial-zwj-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="ar">
+<head>
+<title>Bug 978313</title>
+<meta charset="utf-8">
+<style>
+body {
+ font-family: Arial, DejaVu Sans, Droid Sans Arabic, Droid Arabic Naskh;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+&zwj;ی&zwj;ت
+</body>
+</html>
diff --git a/layout/reftests/text/initial-zwj-1.html b/layout/reftests/text/initial-zwj-1.html
new file mode 100644
index 0000000000..fd039c5831
--- /dev/null
+++ b/layout/reftests/text/initial-zwj-1.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html lang="ar">
+<head>
+<title>Bug 978313</title>
+<meta charset="utf-8">
+<style>
+body {
+ font-family: Arial, DejaVu Sans, Droid Sans Arabic, Droid Arabic Naskh;
+ font-size: 36px;
+}
+</style>
+</head>
+<body>
+&zwj;یت
+</body>
+</html>
diff --git a/layout/reftests/text/justification-1-ref.html b/layout/reftests/text/justification-1-ref.html
new file mode 100644
index 0000000000..a89222d414
--- /dev/null
+++ b/layout/reftests/text/justification-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<html>
+<body style="font-family:monospace; line-height:1.5em; width:14ch; text-align:justify; border:1px solid black; overflow:hidden;">
+
+<p>I am the very model of a modern major-general.</p>
+<p style="width:100ch;">I am the very model of a modern major-general.</p>
+<p style="width:100ch;">I &nbsp;am the<br>very model of a modern major-general.</p>
+<p>I&nbsp;&nbsp;am the<br>very model of a modern major-general.</p>
+<p>I am the<br>very model of a modern major-general.</p>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-1.html b/layout/reftests/text/justification-1.html
new file mode 100644
index 0000000000..a12544fc19
--- /dev/null
+++ b/layout/reftests/text/justification-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<body style="font-family:monospace; line-height:1.5em; width:14ch; text-align:justify; border:1px solid black; overflow:hidden;">
+
+<!-- Test which white-space values are allowed to take justification -->
+
+<p style="white-space:normal;">I am the
+very model of a modern major-general.</p>
+<p style="white-space:nowrap;">I am the
+very model of a modern major-general.</p>
+<p style="white-space:pre;">I am the
+very model of a modern major-general.</p>
+<p style="white-space:pre-wrap;">I am the
+very model of a modern major-general.</p>
+<p style="white-space:pre-line;">I am the
+very model of a modern major-general.</p>
+</body></html>
diff --git a/layout/reftests/text/justification-2-ref.html b/layout/reftests/text/justification-2-ref.html
new file mode 100644
index 0000000000..70443e6820
--- /dev/null
+++ b/layout/reftests/text/justification-2-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:100px; height:10px; background:yellow; }
+</style>
+</head>
+<body>
+<span></span><span style="background:none;"></span><span></span><br>
+<span></span>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-2a.html b/layout/reftests/text/justification-2a.html
new file mode 100644
index 0000000000..2711eef658
--- /dev/null
+++ b/layout/reftests/text/justification-2a.html
@@ -0,0 +1,14 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:100px; height:10px; background:yellow; }
+</style>
+</head>
+<!-- Test that justify actually works. 3 spans won't fit on a line so there will be
+ two spans plus 100px of justification space on the first line. -->
+<body style="text-align:justify; width:300px;">
+<span></span> <span></span>
+<span></span>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-2b.html b/layout/reftests/text/justification-2b.html
new file mode 100644
index 0000000000..5ff414ff52
--- /dev/null
+++ b/layout/reftests/text/justification-2b.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:100px; height:10px; background:yellow; }
+</style>
+</head>
+<!-- Test that text-align is taken from the containing block only -->
+<body style="text-align:justify; width:300px;">
+<span></span><span style="display:inline; text-align:left; background:none"> <span></span>
+<span></span>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-2c.html b/layout/reftests/text/justification-2c.html
new file mode 100644
index 0000000000..1179aff6d7
--- /dev/null
+++ b/layout/reftests/text/justification-2c.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:100px; height:10px; background:yellow; }
+</style>
+</head>
+<!-- Test that &nbsp; has justification space added. -->
+<body style="text-align:justify; width:300px;">
+<span></span>&nbsp;<span></span>
+<span></span>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-2d.html b/layout/reftests/text/justification-2d.html
new file mode 100644
index 0000000000..d4f54f4884
--- /dev/null
+++ b/layout/reftests/text/justification-2d.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:100px; height:10px; background:yellow; }
+</style>
+</head>
+<!-- Test that U+2007 FIGURE SPACE does not have justification space added. -->
+<body style="text-align:justify; width:300px;">
+<span></span>&#x2007;<span></span>
+<span></span>
+</body>
+</html>
diff --git a/layout/reftests/text/justification-cjk-extension-ref.html b/layout/reftests/text/justification-cjk-extension-ref.html
new file mode 100644
index 0000000000..565c7556f3
--- /dev/null
+++ b/layout/reftests/text/justification-cjk-extension-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+<meta charset="utf-8">
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/gw432047.ttf);
+}
+div {
+ font:16px test;
+ width:200px;
+ border:1px solid red;
+ text-align-last:justify;
+}
+span {
+ color: transparent;
+}
+</style>
+<div lang="zh">&#x4e00;&#x845b;<span>&#x4e00;&#x845b;</span>&#x4e00;&#x845b;
diff --git a/layout/reftests/text/justification-cjk-extension.html b/layout/reftests/text/justification-cjk-extension.html
new file mode 100644
index 0000000000..d15bd99404
--- /dev/null
+++ b/layout/reftests/text/justification-cjk-extension.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+<meta charset="utf-8">
+<style>
+@font-face {
+ font-family: test;
+ src: url(../fonts/gw432047.ttf);
+}
+div {
+ font:16px test;
+ width:200px;
+ border:1px solid red;
+ text-align-last:justify;
+}
+span {
+ color: transparent;
+}
+</style>
+<div lang="zh">&#x4e00;&#x845b;<span>&#x20b9f;&#x20b9f;</span>&#x4e00;&#x845b;
diff --git a/layout/reftests/text/justification-space-diacritic-ref.html b/layout/reftests/text/justification-space-diacritic-ref.html
new file mode 100644
index 0000000000..39ac355941
--- /dev/null
+++ b/layout/reftests/text/justification-space-diacritic-ref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<meta charset="utf-8">
+<style>
+div {
+ font-family:monospace;
+ width:200px;
+ border:1px solid red;
+ text-align-last:justify;
+}
+span {
+ display:inline-block;
+}
+</style>
+<!-- The <space> or <nbsp> characters that carry combining marks
+ should NOT be stretched by justification. -->
+<div>
+<p><span>Hello &#x308; &#x308; &#x308;</span> world
+<p><span>Hello&nbsp;&#x308;&nbsp;&#x308;&nbsp;&#x308;</span> world
+<p><span>Hello&nbsp;&#x308;</span> <span>&nbsp;&#x301;&nbsp;&#x300;world</span>
+<p><span>Hello&nbsp;&#x202d;&#x308;&#x202c;</span>‬ <span>&nbsp;&#x202d;&#x302;&#x202c;world</span>
diff --git a/layout/reftests/text/justification-space-diacritic.html b/layout/reftests/text/justification-space-diacritic.html
new file mode 100644
index 0000000000..e55168fdf5
--- /dev/null
+++ b/layout/reftests/text/justification-space-diacritic.html
@@ -0,0 +1,21 @@
+<!DOCTYPE HTML>
+<html>
+<meta charset="utf-8">
+<style>
+div {
+ font-family:monospace;
+ width:200px;
+ border:1px solid red;
+ text-align-last:justify;
+}
+span {
+ display:inline-block;
+}
+</style>
+<!-- The <space> or <nbsp> characters that carry combining marks
+ should NOT be stretched by justification. -->
+<div>
+<p>Hello &#x308; &#x308; &#x308; world
+<p>Hello&nbsp;&#x308;&nbsp;&#x308;&nbsp;&#x308; world
+<p>Hello&nbsp;&#x308; &nbsp;&#x301;&nbsp;&#x300;world
+<p>Hello&nbsp;&#x202d;&#x308;&#x202c;‬ &nbsp;&#x202d;&#x302;&#x202c;world
diff --git a/layout/reftests/text/kerning-01-notref.html b/layout/reftests/text/kerning-01-notref.html
new file mode 100644
index 0000000000..43df5e4d69
--- /dev/null
+++ b/layout/reftests/text/kerning-01-notref.html
@@ -0,0 +1,25 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: mplus;
+ src: url(../fonts/mplus/mplus-1p-regular-no-OT.ttf);
+ /* a copy of M+ with OpenType tables removed, so only legacy 'kern' is present */
+}
+
+body {
+ text-rendering: optimizeLegibility;
+ font-size: 40px;
+ font-family: mplus;
+}
+span {
+ font-family: serif;
+}
+</style>
+</head>
+<body>
+<!-- the ZWNJ characters with font change should prevent kerning at those positions;
+ if the testcase looks the same, then kerning failed altogether -->
+AVA<span>&zwnj;</span>V<span>&zwnj;</span>A
+</body>
+</html>
diff --git a/layout/reftests/text/kerning-01.html b/layout/reftests/text/kerning-01.html
new file mode 100644
index 0000000000..55cf986700
--- /dev/null
+++ b/layout/reftests/text/kerning-01.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: mplus;
+ src: url(../fonts/mplus/mplus-1p-regular-no-OT.ttf);
+ /* a copy of M+ with OpenType tables removed, so only legacy 'kern' is present */
+}
+
+body {
+ text-rendering: optimizeLegibility;
+ font-size: 40px;
+ font-family: mplus;
+}
+</style>
+</head>
+<body>
+AVAVA
+</body>
+</html>
diff --git a/layout/reftests/text/letter-spacing-nolig-1-ref.html b/layout/reftests/text/letter-spacing-nolig-1-ref.html
new file mode 100644
index 0000000000..615df75960
--- /dev/null
+++ b/layout/reftests/text/letter-spacing-nolig-1-ref.html
@@ -0,0 +1,13 @@
+<style>
+.a {
+ font: 32px/2 Times;
+}
+.b {
+ font: 32px/2 Times;
+ letter-spacing: 1em;
+}
+</style>
+
+<div class="a">office
+
+<div class="b">off&zwnj;ice
diff --git a/layout/reftests/text/letter-spacing-nolig-1.html b/layout/reftests/text/letter-spacing-nolig-1.html
new file mode 100644
index 0000000000..9dfc5d72a4
--- /dev/null
+++ b/layout/reftests/text/letter-spacing-nolig-1.html
@@ -0,0 +1,13 @@
+<style>
+.a {
+ font: 32px/2 Times;
+}
+.b {
+ font: 32px/2 Times;
+ letter-spacing: 1em;
+}
+</style>
+
+<div class="a">office
+
+<div class="b">office
diff --git a/layout/reftests/text/letter-spacing-nolig-2-ref.html b/layout/reftests/text/letter-spacing-nolig-2-ref.html
new file mode 100644
index 0000000000..2ad7d4ea36
--- /dev/null
+++ b/layout/reftests/text/letter-spacing-nolig-2-ref.html
@@ -0,0 +1,17 @@
+<style>
+@font-face {
+ font-family: libertine;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+.a {
+ font: 32px/2 libertine;
+}
+.b {
+ font: 32px/2 libertine;
+ letter-spacing: 1em;
+}
+</style>
+
+<div class="a">office
+
+<div class="b">of&zwnj;f&zwnj;ice
diff --git a/layout/reftests/text/letter-spacing-nolig-2.html b/layout/reftests/text/letter-spacing-nolig-2.html
new file mode 100644
index 0000000000..e97f114f70
--- /dev/null
+++ b/layout/reftests/text/letter-spacing-nolig-2.html
@@ -0,0 +1,17 @@
+<style>
+@font-face {
+ font-family: libertine;
+ src: url(../fonts/LinLibertine_Re-4.7.5.woff);
+}
+.a {
+ font: 32px/2 libertine;
+}
+.b {
+ font: 32px/2 libertine;
+ letter-spacing: 1em;
+}
+</style>
+
+<div class="a">office
+
+<div class="b">office
diff --git a/layout/reftests/text/ligature-with-space-1.html b/layout/reftests/text/ligature-with-space-1.html
new file mode 100644
index 0000000000..9526db6237
--- /dev/null
+++ b/layout/reftests/text/ligature-with-space-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkAB-spaceliga";
+ src: url(../fonts/markAB-spaceliga.otf);
+ }
+
+ body { font-family: MarkAB-spaceliga; }
+ </style>
+</head>
+<body>
+B A;
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1-ref.html b/layout/reftests/text/line-editing-1-ref.html
new file mode 100644
index 0000000000..8941e0b4ff
--- /dev/null
+++ b/layout/reftests/text/line-editing-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<!-- using padding to avoid possible reftest failures
+ due to antialiasing pixels not being refreshed,
+ see bugs 475968, 476927 -->
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+Line 7
+Line 8
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1a.html b/layout/reftests/text/line-editing-1a.html
new file mode 100644
index 0000000000..31c42103b0
--- /dev/null
+++ b/layout/reftests/text/line-editing-1a.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<script>
+function doTest() {
+ var text = document.body.firstChild;
+ // Delete a line, then make a change after it
+ text.deleteData(8, 7);
+ text.replaceData(55, 1, "8");
+ document.documentElement.removeAttribute('class');
+}
+document.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</head>
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 2
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+Line 7
+Line X
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1b.html b/layout/reftests/text/line-editing-1b.html
new file mode 100644
index 0000000000..35c5fe4e71
--- /dev/null
+++ b/layout/reftests/text/line-editing-1b.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<script>
+function doTest() {
+ var text = document.body.firstChild;
+ // Insert a line, then make a change after it
+ text.insertData(8, "Line 2\n");
+ text.replaceData(55, 1, "8");
+ document.documentElement.removeAttribute('class');
+}
+document.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</head>
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 3
+Line 4
+Line 5
+Line 6
+Line 7
+Line X
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1c.html b/layout/reftests/text/line-editing-1c.html
new file mode 100644
index 0000000000..ceaf095317
--- /dev/null
+++ b/layout/reftests/text/line-editing-1c.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<script>
+function doTest() {
+ var text = document.body.firstChild;
+ // Just make a change
+ text.replaceData(55, 1, "8");
+ document.documentElement.removeAttribute('class');
+}
+document.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</head>
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 2
+Line 3
+Line 4
+Line 5
+Line 6
+Line 7
+Line X
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1d.html b/layout/reftests/text/line-editing-1d.html
new file mode 100644
index 0000000000..a3ce054631
--- /dev/null
+++ b/layout/reftests/text/line-editing-1d.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<script>
+function doTest() {
+ var text = document.body.firstChild;
+ // Replace three lines with two lines (but not at line boundaries)
+ text.replaceData(34, 21, "5\nLine 6\nLine ");
+ document.documentElement.removeAttribute('class');
+}
+document.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</head>
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 2
+Line 3
+Line 4
+Line X
+Line X
+Line X
+Line 7
+Line 8
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/line-editing-1e.html b/layout/reftests/text/line-editing-1e.html
new file mode 100644
index 0000000000..d149957c0a
--- /dev/null
+++ b/layout/reftests/text/line-editing-1e.html
@@ -0,0 +1,24 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait">
+<head>
+<script>
+function doTest() {
+ var text = document.body.firstChild;
+ // Replace two lines with three lines (but not at line boundaries)
+ text.replaceData(34, 7, "5\nLine 6\nLine ");
+ document.documentElement.removeAttribute('class');
+}
+document.addEventListener("MozReftestInvalidate", doTest);
+</script>
+</head>
+<body style="white-space:pre; padding: 2px; font-family: sans-serif;">
+Line 1
+Line 2
+Line 3
+Line 4
+Line X
+Line 7
+Line 8
+Line 9
+</body>
+</html>
diff --git a/layout/reftests/text/lineheight-metrics-1-ref.html b/layout/reftests/text/lineheight-metrics-1-ref.html
new file mode 100644
index 0000000000..756b705329
--- /dev/null
+++ b/layout/reftests/text/lineheight-metrics-1-ref.html
@@ -0,0 +1,17 @@
+<title>Reference, bug 643781</title>
+<style>
+html { background: white; }
+body {
+ padding: 1px;
+ background: blue;
+ width: 100px;
+ font-size: 0px; /* remove the effect of the strut ascent and descent */
+}
+div {
+ background: aqua;
+ height: 33px;
+}
+</style>
+<body>
+<div></div>
+</body>
diff --git a/layout/reftests/text/lineheight-metrics-1.html b/layout/reftests/text/lineheight-metrics-1.html
new file mode 100644
index 0000000000..76f4482412
--- /dev/null
+++ b/layout/reftests/text/lineheight-metrics-1.html
@@ -0,0 +1,31 @@
+<title>Testcase, bug 643781</title>
+<style>
+html { background: white; }
+@font-face {
+ font-family: "MarkA-lineheight1500";
+ src: url(../fonts/markA-lineheight1500.ttf);
+}
+body {
+ padding: 1px;
+ background: blue;
+ width: 100px;
+ height: 33px;
+ font-size: 0px; /* remove the effect of the strut ascent and descent */
+}
+div {
+ background: aqua;
+}
+/*
+MarkA-lineheight1500 at 22 pixel em-size has a line height that is an --
+integer number of pixels but the components (ascent/descent/leading) are not
+integer. This test checks that the line-height remains accurate.
+*/
+span {
+ color: transparent;
+ font-family: MarkA-lineheight1500;
+ font-size: 22px;
+}
+</style>
+<body>
+<div><span>A</span></div>
+</body>
diff --git a/layout/reftests/text/lineheight-metrics-2-ref.html b/layout/reftests/text/lineheight-metrics-2-ref.html
new file mode 100644
index 0000000000..ecf9fbf1ca
--- /dev/null
+++ b/layout/reftests/text/lineheight-metrics-2-ref.html
@@ -0,0 +1,17 @@
+<title>Testcase, bug 947650 and 598900</title>
+<style>
+html { background: white; }
+body {
+ padding: 1px;
+ background: blue;
+ width: 100px;
+ font-size: 0px; /* remove the effect of the strut ascent and descent */
+}
+div {
+ background: aqua;
+ height: 27px;
+}
+</style>
+<body>
+<div></div>
+</body>
diff --git a/layout/reftests/text/lineheight-metrics-2a.html b/layout/reftests/text/lineheight-metrics-2a.html
new file mode 100644
index 0000000000..1d4e00129c
--- /dev/null
+++ b/layout/reftests/text/lineheight-metrics-2a.html
@@ -0,0 +1,29 @@
+<title>Testcase, bug 947650 and 598900</title>
+<style>
+html { background: white; }
+@font-face {
+ font-family: "MarkA-lineheight6000-typolineheight2700";
+ src: url(../fonts/markA-lineheight6000-typolineheight2700.otf);
+}
+body {
+ padding: 1px;
+ background: blue;
+ width: 100px;
+ height: 27px;
+ font-size: 0px; /* remove the effect of the strut ascent and descent */
+}
+div {
+ background: aqua;
+}
+span {
+ /* Choose 10px so that all the metrics are integers and we avoid rounding
+ issues. See lineheight-metrics-1.html for a test with non-integer values.
+ */
+ color: transparent;
+ font-family: MarkA-lineheight6000-typolineheight2700;
+ font-size: 10px;
+}
+</style>
+<body>
+<div><span>A</span></div>
+</body>
diff --git a/layout/reftests/text/lineheight-metrics-2b.html b/layout/reftests/text/lineheight-metrics-2b.html
new file mode 100644
index 0000000000..4859211823
--- /dev/null
+++ b/layout/reftests/text/lineheight-metrics-2b.html
@@ -0,0 +1,29 @@
+<title>Testcase, bug 947650 and 598900</title>
+<style>
+html { background: white; }
+@font-face {
+ font-family: "MarkA-lineheight6000-typolineheight2700";
+ src: url(../fonts/markA-lineheight6000-typolineheight2700.ttf);
+}
+body {
+ padding: 1px;
+ background: blue;
+ width: 100px;
+ height: 27px;
+ font-size: 0px; /* remove the effect of the strut ascent and descent */
+}
+div {
+ background: aqua;
+}
+span {
+ /* Choose 10px so that all the metrics are integers and we avoid rounding
+ issues. See lineheight-metrics-1.html for a test with non-integer values.
+ */
+ color: transparent;
+ font-family: MarkA-lineheight6000-typolineheight2700;
+ font-size: 10px;
+}
+</style>
+<body>
+<div><span>A</span></div>
+</body>
diff --git a/layout/reftests/text/lineheight-percentage-1-ref.html b/layout/reftests/text/lineheight-percentage-1-ref.html
new file mode 100644
index 0000000000..bf834f59e2
--- /dev/null
+++ b/layout/reftests/text/lineheight-percentage-1-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<body style="font-size: 50px">
+<p style="line-height: 20.5px">20.5px
diff --git a/layout/reftests/text/lineheight-percentage-1.html b/layout/reftests/text/lineheight-percentage-1.html
new file mode 100644
index 0000000000..346ef24314
--- /dev/null
+++ b/layout/reftests/text/lineheight-percentage-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<body style="font-size: 50px">
+<p style="line-height: 41%">
+<script>
+document.write(window.getComputedStyle(document.getElementsByTagName("p")[0]).lineHeight);
+</script>
diff --git a/layout/reftests/text/long-1.html b/layout/reftests/text/long-1.html
new file mode 100644
index 0000000000..f65e7e763a
--- /dev/null
+++ b/layout/reftests/text/long-1.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <pre style="font-size:20px;">
+Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems.
+Very long textruns may cause problems.
+ </pre>
+ </body>
+</html>
diff --git a/layout/reftests/text/long-ref.html b/layout/reftests/text/long-ref.html
new file mode 100644
index 0000000000..3db6e454c9
--- /dev/null
+++ b/layout/reftests/text/long-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <pre style="font-size:20px;">
+Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems. Very long textruns may cause problems.<br>Very long textruns may cause problems.
+ </pre>
+ </body>
+</html>
diff --git a/layout/reftests/text/negative-letter-spacing-1-ref.html b/layout/reftests/text/negative-letter-spacing-1-ref.html
new file mode 100644
index 0000000000..3411c34a1f
--- /dev/null
+++ b/layout/reftests/text/negative-letter-spacing-1-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<head>
+ <style>
+ div {
+ float: left;
+ border: 1px solid black;
+ }
+ </style>
+</head>
+<body>
+ <div><span>same</span><span>line?</span></div>
diff --git a/layout/reftests/text/negative-letter-spacing-1.html b/layout/reftests/text/negative-letter-spacing-1.html
new file mode 100644
index 0000000000..69c1f6fa4b
--- /dev/null
+++ b/layout/reftests/text/negative-letter-spacing-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<meta charset=utf-8>
+<head>
+ <style>
+ div {
+ /* This letter-spacing value only impacts a single space character. */
+ letter-spacing: -60px;
+ float: left;
+ border: 1px solid black;
+ }
+ span {
+ letter-spacing: 0;
+ }
+ </style>
+</head>
+<body>
+ <div><span>same</span> <span>line?</span></div>
diff --git a/layout/reftests/text/osx-font-smoothing-2-notref.html b/layout/reftests/text/osx-font-smoothing-2-notref.html
new file mode 100644
index 0000000000..3cf80f8d71
--- /dev/null
+++ b/layout/reftests/text/osx-font-smoothing-2-notref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<!-- testcase for https://bugzilla.mozilla.org/show_bug.cgi?id=900975 -->
+<html>
+<head>
+<style type="text/css">
+p {
+ margin: 20px;
+ font-family: Arial, sans-serif;
+ background-color: black;
+ color: white;
+}
+.smoothing-gray {
+ -moz-osx-font-smoothing: grayscale;
+}
+.smoothing-auto {
+ -moz-osx-font-smoothing: auto;
+}
+</style>
+</head>
+<body lang="en">
+<p class="smoothing-auto"><span>foo</span> <span>bar</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text/osx-font-smoothing-2-ref.html b/layout/reftests/text/osx-font-smoothing-2-ref.html
new file mode 100644
index 0000000000..fc7ca44af1
--- /dev/null
+++ b/layout/reftests/text/osx-font-smoothing-2-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML>
+<!-- testcase for https://bugzilla.mozilla.org/show_bug.cgi?id=900975 -->
+<html>
+<head>
+<style type="text/css">
+p {
+ margin: 20px;
+ font-family: Arial, sans-serif;
+ background-color: black;
+ color: white;
+}
+.smoothing-gray {
+ -moz-osx-font-smoothing: grayscale;
+}
+.smoothing-auto {
+ -moz-osx-font-smoothing: auto;
+}
+span {
+ display: inline-block;
+}
+</style>
+</head>
+<body lang="en">
+<p class="smoothing-auto"><span>foo</span> <span class="smoothing-gray">bar</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text/osx-font-smoothing-2.html b/layout/reftests/text/osx-font-smoothing-2.html
new file mode 100644
index 0000000000..2ef3b3ff48
--- /dev/null
+++ b/layout/reftests/text/osx-font-smoothing-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<!-- testcase for https://bugzilla.mozilla.org/show_bug.cgi?id=900975 -->
+<html>
+<head>
+<style type="text/css">
+p {
+ margin: 20px;
+ font-family: Arial, sans-serif;
+ background-color: black;
+ color: white;
+}
+.smoothing-gray {
+ -moz-osx-font-smoothing: grayscale;
+}
+.smoothing-auto {
+ -moz-osx-font-smoothing: auto;
+}
+</style>
+</head>
+<body lang="en">
+<p class="smoothing-auto"><span>foo</span> <span class="smoothing-gray">bar</span></p>
+</body>
+</html>
diff --git a/layout/reftests/text/osx-font-smoothing-ref.html b/layout/reftests/text/osx-font-smoothing-ref.html
new file mode 100644
index 0000000000..4fb59bdec1
--- /dev/null
+++ b/layout/reftests/text/osx-font-smoothing-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+body {
+ margin: 20px;
+ font-family: Futura, Helvetica, Arial, sans-serif;
+ background-color: black;
+ color: white;
+}
+p {
+ margin: 0;
+ line-height: 1.3em;
+}
+</style>
+</head>
+<body lang="en">
+<p style="font-size: 9px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 10px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 11px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 12px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 13px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 14px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 15px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 16px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 17px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 18px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 19px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 20px;">I have stood still and stopped the sound of feet.</p>
+</body>
+</html>
diff --git a/layout/reftests/text/osx-font-smoothing.html b/layout/reftests/text/osx-font-smoothing.html
new file mode 100644
index 0000000000..46a4c85451
--- /dev/null
+++ b/layout/reftests/text/osx-font-smoothing.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+body {
+ margin: 20px;
+ font-family: Futura, Helvetica, Arial, sans-serif;
+ background-color: black;
+ color: white;
+}
+p {
+ margin: 0;
+ line-height: 1.3em;
+ -moz-osx-font-smoothing: grayscale;
+}
+</style>
+</head>
+<body lang="en">
+<p style="font-size: 9px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 10px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 11px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 12px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 13px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 14px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 15px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 16px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 17px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 18px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 19px;">I have stood still and stopped the sound of feet.</p>
+<p style="font-size: 20px;">I have stood still and stopped the sound of feet.</p>
+</body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-04.html b/layout/reftests/text/overflowwrap-04.html
new file mode 100644
index 0000000000..8552310dca
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-04.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<!-- Test setting overflow-wrap: break-word dynamically -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Overflowwrap</title>
+ <script type="text/javascript">
+function SwapStyle()
+{
+ par = document.getElementById("pp");
+ par.style.overflowWrap = "break-word";
+}
+ </script>
+ </head>
+ <body onload="SwapStyle()">
+ <p id="pp" style="width: 100px; overflow-wrap: normal;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-05.html b/layout/reftests/text/overflowwrap-05.html
new file mode 100644
index 0000000000..4b5b11e658
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-05.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<!-- Test unsetting overflow-wrap: break-word dynamically -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Overflowwrap</title>
+ <script type="text/javascript">
+function SwapStyle()
+{
+ par = document.getElementById("pp");
+ par.style.overflowWrap = "normal";
+}
+ </script>
+ </head>
+ <body onload="SwapStyle()">
+ <p id="pp" style="width: 100px; overflow-wrap: break-word;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-06.html b/layout/reftests/text/overflowwrap-06.html
new file mode 100644
index 0000000000..899585b138
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-06.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>http://www.mozilla.org/projects/minefield/</title>
+ <style type="text/css">
+#viewsource {
+ font-family: -moz-fixed;
+ font-weight: normal;
+ font-size: 16px;
+ color: black;
+ white-space: pre;
+}
+#viewsource.wrap {
+ white-space: pre-wrap;
+ overflow-wrap: break-word;
+}
+pre {
+ font: inherit;
+ color: inherit;
+ white-space: inherit;
+ margin: 0;
+ width: 475px;
+}
+.attribute-name {
+ color: black;
+ font-weight: bold;
+}
+.attribute-value {
+ color: blue;
+ font-weight: normal;
+}
+ </style>
+ </head>
+ <body id="viewsource" class="wrap">
+ <pre id="line1"><span class="attribute-name">href</span>=<span class="attribute-value">"../../css/cavendish/content.css" </span><span class="attribute-name">title</span>=<span class="attribute-value">"Cavendish"</span></pre>
+ </body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-07.html b/layout/reftests/text/overflowwrap-07.html
new file mode 100644
index 0000000000..d84347837f
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-07.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+div { width: 0px; overflow-wrap: break-word; }
+ </style>
+ <title>Test Overflowwrap</title>
+ </head>
+ <body>
+ <div><em>Hello</em>Kitty</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-09.html b/layout/reftests/text/overflowwrap-09.html
new file mode 100644
index 0000000000..b190228fa2
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-09.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; overflow-wrap: normal; }
+ </style>
+ <title>Test Overflowwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/overflowwrap-10.html b/layout/reftests/text/overflowwrap-10.html
new file mode 100644
index 0000000000..249097b6dc
--- /dev/null
+++ b/layout/reftests/text/overflowwrap-10.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Test - overflow-wrap: break-word should respect clusters</title>
+ </head>
+ <body>
+ <div style="width:0px; overflow-wrap:break-word">
+ abc
+ d&#x0325;e&#x0315;f&#x0323;
+ &#x10400;&#x10401;&#x10402;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/pre-line-1-ref.html b/layout/reftests/text/pre-line-1-ref.html
new file mode 100644
index 0000000000..c290c91a20
--- /dev/null
+++ b/layout/reftests/text/pre-line-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { background:yellow; }
+.float { float:left; background:orange; }
+.outer { overflow:auto; margin:1em; }
+</style>
+</head>
+<body>
+
+<div class="outer">My name is<br><br>Fred.</div>
+<div class="outer"><span>My name is<br><br>Fred.</span></div>
+
+<div class="outer"><div class="float">My name is<br><br>Fred.</div></div>
+<div class="outer"><div class="float"><span class="preline">My name is<br><br>Fred.</span></div></div>
+
+<div class="outer"><div style="width:0;"><div class="float">My name is<br><br>Fred.</div></div></div>
+<div class="outer"><div style="width:0;"><div class="float"><span>My name is<br><br>Fred.</span></div></div></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-1.html b/layout/reftests/text/pre-line-1.html
new file mode 100644
index 0000000000..0dfbef12e7
--- /dev/null
+++ b/layout/reftests/text/pre-line-1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+.preline { white-space:pre-line; }
+span { background:yellow; }
+.float { float:left; background:orange; }
+.outer { overflow:auto; margin:1em; }
+</style>
+</head>
+<body>
+
+
+
+<!-- Note, in the following tests there are trailing spaces after "is" and on the second
+ blank line. -->
+
+<div class="outer"><div class="preline">My name is
+
+ Fred.</div></div>
+<div class="outer"><span class="preline">My name is
+
+ Fred.</span></div>
+
+
+
+
+
+<div class="outer"><div class="preline float">My name is
+
+ Fred.</div></div>
+<div class="outer"><div class="float"><span class="preline">My name is
+
+ Fred.</span></div></div>
+
+
+
+
+
+<div class="outer"><div style="width:0;"><div class="preline float">My name is
+
+ Fred.</div></div></div>
+<div class="outer"><div style="width:0;"><div class="float"><span class="preline">My name is
+
+ Fred.</span></div></div></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-2-ref.html b/layout/reftests/text/pre-line-2-ref.html
new file mode 100644
index 0000000000..70242146d8
--- /dev/null
+++ b/layout/reftests/text/pre-line-2-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+Hello
+<div style="height:100px;"></div>
+<br>
+<div style="height:100px;"></div>
+Kitty
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-2.html b/layout/reftests/text/pre-line-2.html
new file mode 100644
index 0000000000..48fde61d90
--- /dev/null
+++ b/layout/reftests/text/pre-line-2.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+
+<!-- Check that a pre-line newline inhibits margin collapsing -->
+
+<div style="margin-bottom:100px;">Hello</div>
+<span style="white-space:pre-line;">
+</span>
+<div style="margin-top:100px;">Kitty</div>
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-3-ref.html b/layout/reftests/text/pre-line-3-ref.html
new file mode 100644
index 0000000000..d79ddfaea7
--- /dev/null
+++ b/layout/reftests/text/pre-line-3-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body style="white-space:pre-line; color:black;">
+Hello
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-3.html b/layout/reftests/text/pre-line-3.html
new file mode 100644
index 0000000000..b5f7f235f3
--- /dev/null
+++ b/layout/reftests/text/pre-line-3.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+body::first-letter { color:white; }
+</style>
+</head>
+<!-- Check that a pre-line newline stops first-letter processing -->
+<body style="white-space:pre-line; color:black;">
+Hello
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-4-ref.html b/layout/reftests/text/pre-line-4-ref.html
new file mode 100644
index 0000000000..d4da208db8
--- /dev/null
+++ b/layout/reftests/text/pre-line-4-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<html>
+<!-- pre-line: check lines are broken at \A -->
+<body>
+<p style="white-space:pre-line;">Hello<br>Kitty</p>
+</body>
+</html>
diff --git a/layout/reftests/text/pre-line-4.html b/layout/reftests/text/pre-line-4.html
new file mode 100644
index 0000000000..af410ba1ab
--- /dev/null
+++ b/layout/reftests/text/pre-line-4.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<html>
+<!-- pre-line: check lines are broken at \A -->
+<body>
+<p style="white-space:pre-line;">Hello&#xA;Kitty</p>
+</body>
+</html>
diff --git a/layout/reftests/text/pre-space-1-ref.html b/layout/reftests/text/pre-space-1-ref.html
new file mode 100644
index 0000000000..b2c82820c4
--- /dev/null
+++ b/layout/reftests/text/pre-space-1-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+p { font: 16px monospace; white-space: pre; }
+span { background-color: lime }
+</style>
+<p><span>a b</span></p>
+<p><span>a b</span></p>
+<p><span>a b</span></p>
+<p><span> a b </span></p>
+<p><span>a </span></p>
+<p><span> </span></p>
+<p><span> </span></p>
+<p><span>. </span></p>
+<p><span>a b</span></p>
+<p><span>a b</span></p>
+<p><span> a b </span></p>
+<p><span>a </span></p>
+<p><span> </span></p>
+<p><span> </span></p>
+<p><span>. </span></p>
diff --git a/layout/reftests/text/pre-space-1.html b/layout/reftests/text/pre-space-1.html
new file mode 100644
index 0000000000..b1adad2fd8
--- /dev/null
+++ b/layout/reftests/text/pre-space-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+p { font: 16px monospace; white-space: -moz-pre-space; }
+span { background-color: lime }
+</style>
+<p><span>a b</span></p>
+<p><span>a&#xA;b</span></p>
+<p><span>a &#xA; b</span></p>
+<p><span>&#xA; a&#xA; b&#xA;</span></p>
+<p><span>a </span></p>
+<p><span>&#xA;&#xA;&#xA;</span></p>
+<p><span> &#xA;&#xA;&#xA; </span></p>
+<p><span>. &#xA;</span></p>
+<p><span>a&#x9;b</span></p>
+<p><span>a &#x9; b</span></p>
+<p><span>&#x9; a&#x9; b&#x9;</span></p>
+<p><span>a </span></p>
+<p><span>&#x9;&#x9;&#x9;</span></p>
+<p><span> &#x9;&#x9;&#x9; </span></p>
+<p><span>. &#x9;</span></p>
diff --git a/layout/reftests/text/pre-wrap-1-ref.html b/layout/reftests/text/pre-wrap-1-ref.html
new file mode 100644
index 0000000000..7cda9fba13
--- /dev/null
+++ b/layout/reftests/text/pre-wrap-1-ref.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>test for bug 1008019</title>
+<style>
+#test {
+ white-space: pre;
+ font-family: monospace;
+ width: 16ch;
+ border: 1px solid blue;
+ padding: 3px;
+}
+</style>
+</head>
+<body>
+<div id="test">ab c d e f
+g h i
+j k
+l m
+n o
+p
+q
+r
+s</div>
+</body>
+</html>
diff --git a/layout/reftests/text/pre-wrap-1.html b/layout/reftests/text/pre-wrap-1.html
new file mode 100644
index 0000000000..782acc146c
--- /dev/null
+++ b/layout/reftests/text/pre-wrap-1.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>test for bug 1008019</title>
+<style>
+#test {
+ white-space: pre-wrap;
+ font-family: monospace;
+ width: 16ch;
+ border: 1px solid blue;
+ padding: 3px;
+}
+</style>
+</head>
+<body>
+<div id="test">ab c d e f g h i j k<!--
+--> l m n o p<!--
+--> q r s</div>
+</body>
+</html>
diff --git a/layout/reftests/text/reftest.list b/layout/reftests/text/reftest.list
new file mode 100644
index 0000000000..9280099438
--- /dev/null
+++ b/layout/reftests/text/reftest.list
@@ -0,0 +1,364 @@
+# Font-dependent reftests may fail intermittently/transiently due to asynch fallback,
+# so we disable the async mechanism for this directory.
+defaults pref(gfx.font_rendering.fallback.async,false)
+
+fails-if(Android) == fallback-01.xhtml fallback-01-ref.xhtml
+== font-selection-by-lang-01.html font-selection-by-lang-01-ref.html
+== font-selection-fallback-1.html font-selection-fallback-1-ref.html
+== font-selection-generic-1.html font-selection-generic-1-ref.html
+!= font-size-adjust-01.html font-size-adjust-01-ref.html
+# The following test passes consistently only on Mac OS X;
+# both Windows and Linux give results that vary depending on the font size/zoom factor used,
+# because hinting affects the metrics used to compute the font size adjustment. See bug 429605.
+random-if(!cocoaWidget) == font-size-adjust-02.html font-size-adjust-02-ref.html
+# This currently fails because line spacing does not respect font-size-adjust
+# in the "obvious" way, but it is unclear what the behavior should really be;
+# see bug #366138 for some (inconclusive) discussion
+# == font-size-adjust-03.html font-size-adjust-03-ref.html
+== justification-1.html justification-1-ref.html
+== justification-2a.html justification-2-ref.html
+== justification-2b.html justification-2-ref.html
+== justification-2c.html justification-2-ref.html
+!= justification-2d.html justification-2-ref.html
+== justification-cjk-extension.html justification-cjk-extension-ref.html
+== justification-space-diacritic.html justification-space-diacritic-ref.html
+load ligature-with-space-1.html
+== line-editing-1a.html line-editing-1-ref.html
+== line-editing-1b.html line-editing-1-ref.html
+== line-editing-1c.html line-editing-1-ref.html
+== line-editing-1d.html line-editing-1-ref.html
+== line-editing-1e.html line-editing-1-ref.html
+fails-if(cocoaWidget) == lineheight-metrics-1.html lineheight-metrics-1-ref.html # bug 657864
+== lineheight-metrics-2a.html lineheight-metrics-2-ref.html
+== lineheight-metrics-2b.html lineheight-metrics-2-ref.html
+== lineheight-percentage-1.html lineheight-percentage-1-ref.html
+== long-1.html long-ref.html
+fuzzy-if(Android,0-255,0-325) == pre-line-1.html pre-line-1-ref.html
+== pre-line-2.html pre-line-2-ref.html
+== pre-line-3.html pre-line-3-ref.html
+== pre-line-4.html pre-line-4-ref.html
+== pre-space-1.html pre-space-1-ref.html
+== pre-wrap-1.html pre-wrap-1-ref.html
+== soft-hyphens-1a.html soft-hyphens-1-ref.html
+== soft-hyphens-1b.html soft-hyphens-1-ref.html
+== soft-hyphens-1c.html soft-hyphens-1-ref.html
+== soft-hyphens-break-word-1a.html soft-hyphens-break-word-1-ref.html
+== soft-hyphens-break-word-1b.html soft-hyphens-break-word-1-ref.html
+== soft-hyphens-break-word-1c.html soft-hyphens-break-word-1-ref.html
+# Tests for soft hyphens in table cells, bug 418975
+!= soft-hyphen-in-table-1.html soft-hyphen-in-table-1-notref.html
+== soft-hyphen-in-table-1.html soft-hyphen-in-table-1-ref.html
+== soft-hyphen-in-table-2.html soft-hyphen-in-table-2-ref.html
+# Cairo's FreeType and GDI backends snap glyphs to pixels, while Mac (usually),
+# D2D, and Skia have subpixel positioning. The tests for pixel-snapping assume that
+# 1 CSS pixel == 1 device pixel
+skip == subpixel-glyphs-x-1a.html subpixel-glyphs-x-1b.html
+# Platforms with subpixel positioning already have inconsistent glyphs by
+# design, but that is considered more tolerable because they are subpixel
+# inconsistencies. On those platforms we just test that glyph positions are
+# subpixel.
+# D2D/DirectWrite results depend on the rendering mode chosen, so considering this as random for now.
+skip-if(!(d2d||cocoaWidget)) random-if(d2d) != subpixel-glyphs-x-2a.html subpixel-glyphs-x-2b.html
+== subpixel-glyphs-x-3a.html subpixel-glyphs-x-3b.html
+# No platforms do subpixel positioning vertically
+fuzzy-if(Android,0-19,0-2) == subpixel-glyphs-y-1a.html subpixel-glyphs-y-1b.html
+fuzzy-if(Android,0-231,0-653) == subpixel-lineheight-1a.html subpixel-lineheight-1b.html
+== swash-1.html swash-1-ref.html
+!= synthetic-bold-metrics-01.html synthetic-bold-metrics-01-notref.html
+== synthetic-bold-papyrus-01.html synthetic-bold-papyrus-01-ref.html
+== synthetic-bold-zero-width-01.html synthetic-bold-zero-width-01-ref.html
+== text-align-left-in-rtl-block.html text-align-left-in-rtl-block-ref.html
+== variation-selector-unsupported-1.html variation-selector-unsupported-1-ref.html
+== white-space-1a.html white-space-1-ref.html
+== white-space-1b.html white-space-1-ref.html
+== white-space-2.html white-space-2-ref.html
+== white-space-3.html white-space-3-ref.html
+== wordbreak-1.html wordbreak-1-ref.html
+== wordbreak-3.html wordbreak-3-ref.html
+== wordbreak-4b.html wordbreak-4b-ref.html
+== wordbreak-5.html wordbreak-5-ref.html
+fails-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)) == wordbreak-6.html wordbreak-6-ref.html # Bug 1258239
+== wordbreak-7a.html wordbreak-7a-ref.html
+fails == wordbreak-7b.html wordbreak-7b-ref.html # bug 479829
+== wordbreak-8.html wordbreak-8-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) == wordbreak-9.html wordbreak-9-ref.html
+== wordbreak-dynamic-1.html wordbreak-dynamic-1-ref.html
+== wordwrap-01.html wordwrap-01-ref.html
+fuzzy-if(Android,0-1,0-1) == wordwrap-02.html wordwrap-02-ref.html # bug 1363940
+fuzzy(0-1,0-50) == wordwrap-03.html wordwrap-03-ref.html # Fuzzy on Linux because the native textbox gradient is painted in a slightly different position depending on the invalid area.
+== wordwrap-04.html wordwrap-04-ref.html
+== overflowwrap-04.html wordwrap-04-ref.html
+== wordwrap-05.html wordwrap-05-ref.html
+== overflowwrap-05.html wordwrap-05-ref.html
+== wordwrap-06.html wordwrap-06-ref.html
+== overflowwrap-06.html wordwrap-06-ref.html
+== wordwrap-07.html wordwrap-07-ref.html
+== overflowwrap-07.html wordwrap-07-ref.html
+!= wordwrap-08.html wordwrap-01-ref.html
+== wordwrap-08.html wordwrap-08-ref.html
+!= wordwrap-09.html wordwrap-01-ref.html
+!= overflowwrap-09.html wordwrap-01-ref.html
+== wordwrap-09.html wordwrap-09-ref.html
+== overflowwrap-09.html wordwrap-09-ref.html
+== wordwrap-10.html wordwrap-10-ref.html # bug 752459
+== overflowwrap-10.html wordwrap-10-ref.html
+== word-spacing-01.html word-spacing-01-ref.html
+# the following will fail when rendering with Core Text (see bug 389074) due to what appears to be
+# an Apple bug: the presence of ZWNJ disturbs the positioning of an adjacent glyph. rdar://6427865
+random-if(cocoaWidget) random-if(gtkWidget) == zwnj-01.xhtml zwnj-01-ref.xhtml # gtkWidget:bug 1309113
+== zwnj-02.xhtml zwnj-02-ref.xhtml
+!= zwnj-01.html zwnj-01-notref.html
+== initial-zwj-1.html initial-zwj-1-ref.html
+== cgj-01.html cgj-01-ref.html
+== 444656.html 444656-ref.html
+fuzzy-if(geckoview,0-4,0-1) == 449555-1.html 449555-1-ref.html
+== 467722.html 467722-ref.html
+fuzzy(0-1,0-600) == 475092-sub.html 475092-ref.html
+fails-if(Android) fuzzy-if(!Android,0-90,0-3100) fuzzy-if(cocoaWidget,72-72,353-353) == 475092-pos.html 475092-sub.html # bug 482596
+== 476378-soft-hyphen-fallback.html 476378-soft-hyphen-fallback-ref.html
+# Test for bug 484954
+== rgba-text.html rgba-text-ref.html
+# Test for bug 575695, 'kern' table support
+!= kerning-01.html kerning-01-notref.html
+# Test for bug 577380, support for AAT layout (on OS X only)
+random-if(!cocoaWidget) == 577380.html 577380-ref.html
+# Test for OpenType Arabic shaping support
+== arabic-shaping-1.html arabic-shaping-1-ref.html
+# check ligature in Arial Bold on Windows, for bug 644184; may fail on other platforms depending on fonts
+random-if(!winWidget) == arial-bold-lam-alef-1.html arial-bold-lam-alef-1-ref.html
+# Fallback (presentation-forms) shaping with a font that lacks GSUB/GPOS
+== arabic-fallback-1.html arabic-fallback-1-ref.html
+== arabic-fallback-2.html arabic-fallback-2-ref.html
+== arabic-fallback-3.html arabic-fallback-3-ref.html
+== arabic-fallback-4.html arabic-fallback-4-ref.html
+== arabic-marks-1.html arabic-marks-1-ref.html
+== arabic-final-ligature-spacing.html arabic-final-ligature-spacing-ref.html
+# harfbuzz fallback mark stacking in the absence of GPOS:
+!= fallback-mark-stacking-1.html fallback-mark-stacking-1-notref.html
+
+== 726392-1.html 726392-1-ref.html
+== 726392-2.html 726392-2-ref.html
+== 726392-3.html 726392-3-ref.html
+== 745555-1.html 745555-1-ref.html
+== 745555-2.html 745555-2-ref.html
+== 820255.html 820255-ref.html
+!= 1170688.html 1170688-ref.html
+fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == 1320665-cmap-format-13.html 1320665-cmap-format-13-ref.html # see bug 1320665 comments 8-9
+== 1331339-script-extensions-shaping-1.html 1331339-script-extensions-shaping-1-ref.html
+skip-if(!cocoaWidget) != 1349308-1.html 1349308-notref.html # macOS-specific test for -apple-system glyph metrics
+fuzzy-if(Android,0-128,0-233) == 1463020-letter-spacing-text-transform-1.html 1463020-letter-spacing-text-transform-1-ref.html
+fails-if(Android) == 1463020-letter-spacing-text-transform-2.html 1463020-letter-spacing-text-transform-2-ref.html # missing font coverage on Android
+== 1507661-spurious-hyphenation-after-explicit.html 1507661-spurious-hyphenation-after-explicit-ref.html
+fuzzy-if(useDrawSnapshot,255-255,50-50) == 1522857-1.html 1522857-1-ref.html # antialiasing fuzz in non-webrender cases
+!= 1637405-pua-shaping-1.html 1637405-pua-shaping-1-notref.html
+fuzzy-if(useDrawSnapshot,255-255,50-50) == 1655364-1.html 1655364-1-ref.html
+== 1670581-1.html 1670581-1-ref.html
+== 1673098-1.html 1673098-1-ref.html
+
+# ensure emoji chars don't render blank (bug 715798, bug 779042);
+# should at least render hexboxes if there's no font support
+random-if(geckoview) != emoji-01.html emoji-01-notref.html
+!= emoji-02.html emoji-02-notref.html
+
+# Bug 727276: tests with variation selectors 15 and 16 to control emoji rendering style
+== emoji-03.html emoji-03-ref.html
+# the next two will fail on OS X 10.6 because no color emoji font is present,
+# and also on Android platforms until we have color emoji fonts there.
+# Tests rely on bundled Twemoji Mozilla to pass on Windows <8.1 and Linux.
+!= emoji-03.html emoji-03-notref.html
+== emoji-04.html emoji-04-ref.html
+!= emoji-05.html emoji-05-notref.html
+
+# check that Graphite shaping (bug 631479) is working
+pref(gfx.font_rendering.graphite.enabled,true) == graphite-01.html graphite-01-ref.html
+# Test 02 (using Pig Latin) is fuzzy on Win7 because glyph positioning is not guaranteed to match exactly
+# between a sequence of simple glyphs rendered individually, and the same sequence treated as a single cluster.
+fuzzy-if(winWidget,0-49,0-220) pref(gfx.font_rendering.graphite.enabled,true) == graphite-02.html graphite-02-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) != graphite-03a.html graphite-03-notref.html
+pref(gfx.font_rendering.graphite.enabled,true) != graphite-03b.html graphite-03-notref.html
+pref(gfx.font_rendering.graphite.enabled,false) != graphite-01.html graphite-01-ref.html
+pref(gfx.font_rendering.graphite.enabled,false) != graphite-02.html graphite-02-ref.html
+# test 03a (lang setting in Padauk font) now works in opentype/harfbuzz as well
+pref(gfx.font_rendering.graphite.enabled,false) != graphite-03a.html graphite-03-notref.html
+pref(gfx.font_rendering.graphite.enabled,false) == graphite-03b.html graphite-03-notref.html
+
+# tests for graphite rendering with valid and invalid lang tags
+pref(gfx.font_rendering.graphite.enabled,true) == graphite-04-fa.html graphite-04-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) != graphite-04-sd.html graphite-04-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) == graphite-04-snd.html graphite-04-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) != graphite-04-ur.html graphite-04-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) == graphite-04-urd.html graphite-04-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) != graphite-04-sd.html graphite-04-ur.html
+
+# tests to compare graphite to opentype (will trivially pass when graphite not enabled)
+== graphite-05-ot-only.html graphite-05-ref.html
+!= graphite-05-ot-only.html graphite-05-fail.html
+== graphite-05-simple.html graphite-05-ref.html
+== graphite-05-multipass.html graphite-05-ref.html
+== graphite-05-lang.html graphite-05-ref.html
+== graphite-05-badlang.html graphite-05-ref.html
+== graphite-05-feat.html graphite-05-ref.html
+
+# comparing composed and decomposed characters that should render identically
+# under both OpenType and Graphite shaping
+pref(gfx.font_rendering.graphite.enabled,false) == glyph-decomposition-opentype.html glyph-decomposition-opentype-ref.html
+pref(gfx.font_rendering.graphite.enabled,true) == glyph-decomposition-graphite.html glyph-decomposition-graphite-ref.html
+
+# test for bidi bug in graphite 1.3.2, fixed in 1.3.3 (bug 1207061)
+== graphite-bidi-1.html graphite-bidi-1-ref.html
+
+== graphite-surrogate-selection.html graphite-surrogate-selection-ref.html
+
+# Tests for hyphenation with hyphens property
+== auto-hyphenation-1.html auto-hyphenation-1-ref.html
+!= auto-hyphenation-1.html auto-hyphenation-1-notref.html
+== auto-hyphenation-1a.html auto-hyphenation-1-ref.html
+== auto-hyphenation-2.html auto-hyphenation-2-ref.html
+== auto-hyphenation-3.html auto-hyphenation-3-ref.html
+== auto-hyphenation-4.html auto-hyphenation-4-ref.html
+== auto-hyphenation-5.html auto-hyphenation-5-ref.html
+== auto-hyphenation-6.html auto-hyphenation-6-ref.html
+== auto-hyphenation-7.html auto-hyphenation-7-ref.html
+== auto-hyphenation-8.html auto-hyphenation-8-ref.html
+== auto-hyphenation-9.html auto-hyphenation-9-ref.html
+== auto-hyphenation-10.html auto-hyphenation-10-ref.html
+== auto-hyphenation-xmllang-1.xhtml auto-hyphenation-1-ref.html
+!= auto-hyphenation-xmllang-1.xhtml auto-hyphenation-1-notref.html
+== auto-hyphenation-xmllang-1a.xhtml auto-hyphenation-1-ref.html
+== auto-hyphenation-xmllang-2.xhtml auto-hyphenation-2-ref.html
+== auto-hyphenation-xmllang-3.xhtml auto-hyphenation-3-ref.html
+== auto-hyphenation-xmllang-4.xhtml auto-hyphenation-4-ref.html
+== auto-hyphenation-xmllang-5.xhtml auto-hyphenation-5-ref.html
+== auto-hyphenation-xmllang-6.xhtml auto-hyphenation-6-ref.html
+== auto-hyphenation-xmllang-7.xhtml auto-hyphenation-7-ref.html
+== auto-hyphenation-xmllang-8.xhtml auto-hyphenation-8-ref.html
+== auto-hyphenation-xmllang-9.xhtml auto-hyphenation-9-ref.html
+== auto-hyphenation-xmllang-10.xhtml auto-hyphenation-10-ref.html
+== auto-hyphenation-xmllang-11a.xhtml auto-hyphenation-1-ref.html
+== auto-hyphenation-xmllang-11b.xhtml auto-hyphenation-1-ref.html
+== auto-hyphenation-xmllang-12a.xhtml auto-hyphenation-4-ref.html
+== auto-hyphenation-xmllang-12b.xhtml auto-hyphenation-4-ref.html
+== auto-hyphenation-xmllang-13a.xhtml auto-hyphenation-1-ref.html
+== auto-hyphenation-xmllang-13b.xhtml auto-hyphenation-1-ref.html
+== auto-hyphenation-xmllang-14a.xhtml auto-hyphenation-4-ref.html
+== auto-hyphenation-xmllang-14b.xhtml auto-hyphenation-4-ref.html
+== auto-hyphenation-af-1.html auto-hyphenation-af-1-ref.html
+== auto-hyphenation-bg-1.html auto-hyphenation-bg-1-ref.html
+== auto-hyphenation-ca-1.html auto-hyphenation-ca-1-ref.html
+== auto-hyphenation-cy-1.html auto-hyphenation-cy-1-ref.html
+== auto-hyphenation-da-1.html auto-hyphenation-da-1-ref.html
+== auto-hyphenation-de-1901-1.html auto-hyphenation-de-1901-1-ref.html
+== auto-hyphenation-de-1996-1.html auto-hyphenation-de-1996-1-ref.html
+!= auto-hyphenation-de-1901-1.html auto-hyphenation-de-1996-1.html
+== auto-hyphenation-de-ch-1.html auto-hyphenation-de-ch-1-ref.html
+== auto-hyphenation-eo-1.html auto-hyphenation-eo-1-ref.html
+== auto-hyphenation-es-1.html auto-hyphenation-es-1-ref.html
+== auto-hyphenation-et-1.html auto-hyphenation-et-1-ref.html
+== auto-hyphenation-fi-1.html auto-hyphenation-fi-1-ref.html
+== auto-hyphenation-fr-1.html auto-hyphenation-fr-1-ref.html
+== auto-hyphenation-gl-1.html auto-hyphenation-gl-1-ref.html
+== auto-hyphenation-hr-1.html auto-hyphenation-hr-1-ref.html
+== auto-hyphenation-hsb-1.html auto-hyphenation-hsb-1-ref.html
+== auto-hyphenation-hu-1.html auto-hyphenation-hu-1-ref.html
+== auto-hyphenation-ia-1.html auto-hyphenation-ia-1-ref.html
+== auto-hyphenation-is-1.html auto-hyphenation-is-1-ref.html
+== auto-hyphenation-it-1.html auto-hyphenation-it-1-ref.html
+== auto-hyphenation-kmr-1.html auto-hyphenation-kmr-1-ref.html
+== auto-hyphenation-la-1.html auto-hyphenation-la-1-ref.html
+== auto-hyphenation-lt-1.html auto-hyphenation-lt-1-ref.html
+== auto-hyphenation-mn-1.html auto-hyphenation-mn-1-ref.html
+== auto-hyphenation-nb-1.html auto-hyphenation-nb-1-ref.html
+== auto-hyphenation-nl-1.html auto-hyphenation-nl-1-ref.html
+== auto-hyphenation-nn-1.html auto-hyphenation-nn-1-ref.html
+== auto-hyphenation-pl-1.html auto-hyphenation-pl-1-ref.html
+== auto-hyphenation-pt-1.html auto-hyphenation-pt-1-ref.html
+== auto-hyphenation-ru-1.html auto-hyphenation-ru-1-ref.html
+== auto-hyphenation-sh-1.html auto-hyphenation-sh-1-ref.html
+== auto-hyphenation-sl-1.html auto-hyphenation-sl-1-ref.html
+== auto-hyphenation-sr-1.html auto-hyphenation-sr-1-ref.html
+== auto-hyphenation-sv-1.html auto-hyphenation-sv-1-ref.html # test swedish patterns
+!= auto-hyphenation-sv-1.html auto-hyphenation-sv-1-notref.html # verify swedish != english
+== auto-hyphenation-tr-1.html auto-hyphenation-tr-1-ref.html
+== auto-hyphenation-uk-1.html auto-hyphenation-uk-1-ref.html
+
+== auto-hyphenation-bn-1.html auto-hyphenation-bn-1-ref.html
+== auto-hyphenation-gu-1.html auto-hyphenation-gu-1-ref.html
+== auto-hyphenation-hi-1.html auto-hyphenation-hi-1-ref.html
+== auto-hyphenation-kn-1.html auto-hyphenation-kn-1-ref.html
+== auto-hyphenation-ml-1.html auto-hyphenation-ml-1-ref.html
+== auto-hyphenation-pa-1.html auto-hyphenation-pa-1-ref.html
+== auto-hyphenation-ta-1.html auto-hyphenation-ta-1-ref.html
+== auto-hyphenation-te-1.html auto-hyphenation-te-1-ref.html
+
+== auto-hyphenation-transformed-1.html auto-hyphenation-transformed-1-ref.html
+
+== hyphenation-caps-1.html hyphenation-caps-1-ref.html
+
+== hyphenation-control-1.html hyphenation-control-1-ref.html
+== hyphenation-control-2.html hyphenation-control-2-ref.html
+== hyphenation-control-3.html hyphenation-control-3-ref.html
+== hyphenation-control-4.html hyphenation-control-4-ref.html
+fuzzy-if(Android,0-64,0-18) fuzzy-if(winWidget,0-56,0-6) == hyphenation-control-5.html hyphenation-control-5-ref.html
+== hyphenation-control-6.html hyphenation-control-6-ref.html
+== hyphenation-control-7.html hyphenation-control-7-ref.html
+
+# osx-font-smoothing - with and without subpixel AA, only under OSX
+fails-if(!cocoaWidget) != osx-font-smoothing.html osx-font-smoothing-ref.html
+fails-if(!cocoaWidget) != osx-font-smoothing-2.html osx-font-smoothing-2-notref.html
+== osx-font-smoothing-2.html osx-font-smoothing-2-ref.html
+
+# stray control chars should be visible by default, bug 1099557
+pref(layout.css.moz-control-character-visibility.enabled,true) != control-chars-01a.html control-chars-01-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) != control-chars-01b.html control-chars-01-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) != control-chars-01c.html control-chars-01-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) != control-chars-01d.html control-chars-01-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) != control-chars-02.html control-chars-02-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) == control-chars-03a.html control-chars-03-ref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) == control-chars-03b.html control-chars-03-ref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) pref(layout.css.control-characters.visible,true) != control-chars-04a.html control-chars-04-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) pref(layout.css.control-characters.visible,true) != control-chars-04b.html control-chars-04-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) pref(layout.css.control-characters.visible,true) != control-chars-04c.html control-chars-04-notref.html
+pref(layout.css.moz-control-character-visibility.enabled,true) pref(layout.css.control-characters.visible,true) != control-chars-04d.html control-chars-04-notref.html
+
+# font fallback for <space> when not supported in the primary font family - bug 970891
+== space-font-1.html space-font-1-ref.html
+
+# handling of highly negative letter-spacing and intrinsic width
+== negative-letter-spacing-1.html negative-letter-spacing-1-ref.html
+== segment-break-transformation-1.html segment-break-transformation-1-ref.html
+
+# color glyphs, opacity, and RTL runs - bug 1318539
+== color-opacity-rtl-1.html color-opacity-rtl-1-ref.html
+== color-opacity-rtl-2.html color-opacity-rtl-2-ref.html
+
+== letter-spacing-nolig-1.html letter-spacing-nolig-1-ref.html
+== letter-spacing-nolig-2.html letter-spacing-nolig-2.html
+
+== ethiopic-wordspace.html ethiopic-wordspace-ref.html
+
+# sub and sup elements should be influenced by their container's line-height - bug 1524897
+== sub-sup-and-line-height.html sub-sup-and-line-height-ref.html
+
+# Basic rendering tests for the (nonstandard/compatibility) -webkit-text-security property.
+== webkit-text-security-1.html?test#none webkit-text-security-1.html?ref#none
+!= webkit-text-security-1.html?test#none webkit-text-security-1.html?ref#square
+== webkit-text-security-1.html?test#circle webkit-text-security-1.html?ref#circle
+== webkit-text-security-1.html?test#disc webkit-text-security-1.html?ref#disc
+== webkit-text-security-1.html?test#square webkit-text-security-1.html?ref#square
+!= webkit-text-security-1.html?test#circle webkit-text-security-1.html?ref#square
+# Exact matching to a reference is trickier for these, but we can mismatch-test that the property has an effect.
+!= webkit-text-security-2.html?circle webkit-text-security-2.html?none
+!= webkit-text-security-2.html?disc webkit-text-security-2.html?circle
+!= webkit-text-security-2.html?square webkit-text-security-2.html?circle
+!= webkit-text-security-3.html?circle webkit-text-security-3.html?none
+!= webkit-text-security-3.html?disc webkit-text-security-3.html?circle
+!= webkit-text-security-3.html?square webkit-text-security-3.html?circle
+!= webkit-text-security-4.html?circle webkit-text-security-4.html?none
+!= webkit-text-security-4.html?disc webkit-text-security-4.html?circle
+!= webkit-text-security-4.html?square webkit-text-security-4.html?circle
+!= webkit-text-security-5.html?circle webkit-text-security-5.html?none
+!= webkit-text-security-5.html?disc webkit-text-security-5.html?circle
+!= webkit-text-security-5.html?square webkit-text-security-5.html?circle
+
+# Reset default prefs.
+defaults
diff --git a/layout/reftests/text/rgba-text-ref.html b/layout/reftests/text/rgba-text-ref.html
new file mode 100644
index 0000000000..8bf7036eb5
--- /dev/null
+++ b/layout/reftests/text/rgba-text-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background: #000">
+ <!-- A regular old red box -->
+ <div style="background: red; position:absolute; top:30px; left:0px; padding:50px"></div>
+</body>
+</html>
diff --git a/layout/reftests/text/rgba-text.html b/layout/reftests/text/rgba-text.html
new file mode 100644
index 0000000000..a482ed76ee
--- /dev/null
+++ b/layout/reftests/text/rgba-text.html
@@ -0,0 +1,12 @@
+<!DOCTYPE HTML>
+<html>
+<body style="background: #000">
+ <div style="color: rgba(255, 255, 255, 0.2); font-size:48px;">_</div>
+ <!-- the red box should totally obscure the drawn portion of the text
+ however if the text is painted as a box instead of an underscore it
+ will show above the top of the red box.
+ This test would have caught bug 484954
+ -->
+ <div style="background: red; position:absolute; top:30px; left:0px; padding:50px"></div>
+</body>
+</html>
diff --git a/layout/reftests/text/segment-break-transformation-1-ref.html b/layout/reftests/text/segment-break-transformation-1-ref.html
new file mode 100644
index 0000000000..824fd97065
--- /dev/null
+++ b/layout/reftests/text/segment-break-transformation-1-ref.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style type="text/css">
+div { border:1px solid black; }
+b { font-weight:normal; background-color:yellow; font-size: 16px; line-height: 16px;}
+</style>
+</head>
+<body>
+<div>
+<p><b><span>&#x65b7;&#x884c;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;<br>
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;<br>
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;<br>
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>Hello Kitty</span></b>
+<p><b><span>HelloKitty</span></b>
+<p><b><span>HelloKitty</span></b>
+<p><b><span>HelloKitty</span></b>
+<!-- test surrogates handling -->
+<p><b><span>&#x20000;&#x20001;&#x20002;&#x20003;</span></b>
+<p><b><span>&#x20000;&#x6e2c;&#x20002;&#x20003;</span></b>
+<p><b><span>&#x20000;&#x20001;&#x6e2c;&#x20003;</span></b>
+<!-- test emoji handling -->
+<p><b><span>&#x65b7;&#x1f600; &#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c; &#x1f601;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x1f600; &#x1f601;&#x8a66;</span></b>
+<p><b><span>Hello&#x1f600; &#x1f601;Kitty</span></b>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/segment-break-transformation-1.html b/layout/reftests/text/segment-break-transformation-1.html
new file mode 100644
index 0000000000..a11ba6b1c1
--- /dev/null
+++ b/layout/reftests/text/segment-break-transformation-1.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<style type="text/css">
+div { border:1px solid black; }
+b { font-weight:normal; background-color:yellow; font-size: 16px; line-height: 16px;}
+.nowrap { white-space:nowrap; }
+.pre { white-space:pre; }
+.prewrap { white-space:pre-wrap; }
+.preline { white-space:pre-line; }
+</style>
+</head>
+<body>
+<div>
+<p><b><span>&#x65b7;&#x884c;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x200B;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;
+&#x200B;&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;&#x200B;
+&#x200B;&#x6e2c;&#x8a66;</span></b>
+<p><b><span class="nowrap">&#x65b7;&#x884c;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span class="pre">&#x65b7;&#x884c;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span class="prewrap">&#x65b7;&#x884c;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span class="preline">&#x65b7;&#x884c;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>Hello
+Kitty</span></b>
+<p><b><span>Hello&#x200B;
+Kitty</span></b>
+<p><b><span>Hello
+&#x200B;Kitty</span></b>
+<p><b><span>Hello&#x200B;
+&#x200B;Kitty</span></b>
+<!-- test surrogates handling -->
+<p><b><span>&#x20000;&#x20001;
+&#x20002;&#x20003;</span></b>
+<p><b><span>&#x20000;&#x6e2c;
+&#x20002;&#x20003;</span></b>
+<p><b><span>&#x20000;&#x20001;
+&#x6e2c;&#x20003;</span></b>
+<!-- test emoji handling -->
+<p><b><span>&#x65b7;&#x1f600;
+&#x6e2c;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x884c;
+&#x1f601;&#x8a66;</span></b>
+<p><b><span>&#x65b7;&#x1f600;
+&#x1f601;&#x8a66;</span></b>
+<p><b><span>Hello&#x1f600;
+&#x1f601;Kitty</span></b>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphen-in-table-1-notref.html b/layout/reftests/text/soft-hyphen-in-table-1-notref.html
new file mode 100644
index 0000000000..d22c20da29
--- /dev/null
+++ b/layout/reftests/text/soft-hyphen-in-table-1-notref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+table {
+ border: 1px solid red;
+}
+</style>
+</head>
+
+<body>
+
+<table>
+<tr><td style="width:10em">supercalifragilisticexpialidocious</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphen-in-table-1-ref.html b/layout/reftests/text/soft-hyphen-in-table-1-ref.html
new file mode 100644
index 0000000000..905c9db3f5
--- /dev/null
+++ b/layout/reftests/text/soft-hyphen-in-table-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+table {
+ border: 1px solid red;
+}
+</style>
+</head>
+
+<body>
+
+<table>
+<tr><td style="width:10em">supercalifragilistic- expialidocious</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphen-in-table-1.html b/layout/reftests/text/soft-hyphen-in-table-1.html
new file mode 100644
index 0000000000..530a674b92
--- /dev/null
+++ b/layout/reftests/text/soft-hyphen-in-table-1.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+table {
+ border: 1px solid red;
+}
+</style>
+</head>
+
+<body>
+
+<table>
+<tr><td style="width:10em">supercalifragilistic&shy;expialidocious</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphen-in-table-2-ref.html b/layout/reftests/text/soft-hyphen-in-table-2-ref.html
new file mode 100644
index 0000000000..3e8ec5f985
--- /dev/null
+++ b/layout/reftests/text/soft-hyphen-in-table-2-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+table {
+ border: 1px solid red;
+}
+</style>
+</head>
+
+<body>
+
+<table>
+<tr><td style="width:1em">supercalifragilistic- expialidocious</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphen-in-table-2.html b/layout/reftests/text/soft-hyphen-in-table-2.html
new file mode 100644
index 0000000000..00de48b5ea
--- /dev/null
+++ b/layout/reftests/text/soft-hyphen-in-table-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css">
+table {
+ border: 1px solid red;
+}
+</style>
+</head>
+
+<body>
+
+<table>
+<tr><td style="width:1em">supercalifragilistic&shy;expialidocious</td></tr>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-1-ref.html b/layout/reftests/text/soft-hyphens-1-ref.html
new file mode 100644
index 0000000000..b405be7cfb
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-1-ref.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div>
+<p>Hy-<br>phen.
+<p>Hy-<br>phen.
+<p>Hy-<br>phen.
+<p>Hy-<br>phen.
+<p>Hy-<br>phen.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-1a.html b/layout/reftests/text/soft-hyphens-1a.html
new file mode 100644
index 0000000000..9f6decdb54
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-1a.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0;">
+<p>Hy&shy;phen.
+<p><span>H</span>y&shy;phen.
+<p><span>Hy</span>&shy;phen.
+<p><span>Hy&shy;</span>phen.
+<p><span>Hy&shy;p</span>hen.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-1b.html b/layout/reftests/text/soft-hyphens-1b.html
new file mode 100644
index 0000000000..eb537773ae
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-1b.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0;">
+<p>Hy&shy;&shy;phen.
+<p><span>Hy</span>&shy;&shy;phen.
+<p><span>Hy&shy;</span>&shy;phen.
+<p><span>Hy&shy;&shy;</span>phen.
+<p><span>Hy&shy;&shy;p</span>hen.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-1c.html b/layout/reftests/text/soft-hyphens-1c.html
new file mode 100644
index 0000000000..dad1766341
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-1c.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0;">
+<p><span>H</span><span>y&shy;phen</span>.
+<p><span>Hy</span><span>&shy;phen</span>.
+<p><span>Hy</span>&shy;<span>phen</span>.
+<p><span>Hy&shy;</span><span>phen</span>.
+<p><span>Hy&shy;p</span><span>hen</span>.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-break-word-1-ref.html b/layout/reftests/text/soft-hyphens-break-word-1-ref.html
new file mode 100644
index 0000000000..e33081021e
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-break-word-1-ref.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div>
+<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
+<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
+<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
+<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
+<p>H<br>y-<br>p<br>h<br>e<br>n<br>.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-break-word-1a.html b/layout/reftests/text/soft-hyphens-break-word-1a.html
new file mode 100644
index 0000000000..fd5a8099b3
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-break-word-1a.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0; word-wrap:break-word;">
+<p>Hy&shy;phen.
+<p><span>H</span>y&shy;phen.
+<p><span>Hy</span>&shy;phen.
+<p><span>Hy&shy;</span>phen.
+<p><span>Hy&shy;p</span>hen.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-break-word-1b.html b/layout/reftests/text/soft-hyphens-break-word-1b.html
new file mode 100644
index 0000000000..74d58cc6a2
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-break-word-1b.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0; word-wrap:break-word;">
+<p>Hy&shy;&shy;phen.
+<p><span>Hy</span>&shy;&shy;phen.
+<p><span>Hy&shy;</span>&shy;phen.
+<p><span>Hy&shy;&shy;</span>phen.
+<p><span>Hy&shy;&shy;p</span>hen.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/soft-hyphens-break-word-1c.html b/layout/reftests/text/soft-hyphens-break-word-1c.html
new file mode 100644
index 0000000000..130f0c26b1
--- /dev/null
+++ b/layout/reftests/text/soft-hyphens-break-word-1c.html
@@ -0,0 +1,13 @@
+<html>
+<body>
+
+<div style="width:0; word-wrap:break-word;">
+<p><span>H</span><span>y&shy;phen</span>.
+<p><span>Hy</span><span>&shy;phen</span>.
+<p><span>Hy</span>&shy;<span>phen</span>.
+<p><span>Hy&shy;</span><span>phen</span>.
+<p><span>Hy&shy;p</span><span>hen</span>.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/space-font-1-ref.html b/layout/reftests/text/space-font-1-ref.html
new file mode 100644
index 0000000000..9d92b95a35
--- /dev/null
+++ b/layout/reftests/text/space-font-1-ref.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 970891</title>
+ <style type="text/css">
+ @font-face {
+ font-family: "test";
+ src: url(../fonts/markA-nospace.ttf);
+ }
+ div {
+ font-family: test, monospace;
+ font-size: 16px;
+ line-height: 32px;
+ }
+ span {
+ font-family: monospace;
+ }
+ </style>
+</head>
+
+<body>
+ <div><b>A</b><span> </span><b>A</b><span> </span><i>A</i><span> </span><i>A</i></div>
+</body>
+
+</html>
diff --git a/layout/reftests/text/space-font-1.html b/layout/reftests/text/space-font-1.html
new file mode 100644
index 0000000000..e7cbd02271
--- /dev/null
+++ b/layout/reftests/text/space-font-1.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta charset="UTF-8">
+ <title>Bug 970891</title>
+ <style type="text/css">
+ @font-face {
+ font-family: "test";
+ src: url(../fonts/markA-nospace.ttf);
+ }
+ div {
+ font-family: test, monospace;
+ font-size: 16px;
+ line-height: 32px;
+ }
+ span {
+ font-family: monospace;
+ }
+ </style>
+</head>
+
+<body>
+ <!-- markA-nospace does not have a glyph for the <space> character,
+ so the spaces should fall back to 'monospace'. -->
+ <div><b>A</b> <b>A</b> <i>A</i> <i>A</i><span>&nbsp;</span></div>
+</body>
+
+</html>
diff --git a/layout/reftests/text/sub-sup-and-line-height-ref.html b/layout/reftests/text/sub-sup-and-line-height-ref.html
new file mode 100644
index 0000000000..168159b2a6
--- /dev/null
+++ b/layout/reftests/text/sub-sup-and-line-height-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <style>
+ p { line-height: 44px; }
+ sub, sup { vertical-align: top; }
+ </style>
+ </head>
+ <body>
+ <p>Test<sup style="line-height: inherit">Test</sup><sub style="line-height: inherit">Test</sub></p>
+ </body>
+</html>
+
+
diff --git a/layout/reftests/text/sub-sup-and-line-height.html b/layout/reftests/text/sub-sup-and-line-height.html
new file mode 100644
index 0000000000..2931246e79
--- /dev/null
+++ b/layout/reftests/text/sub-sup-and-line-height.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <style>
+ p { line-height: 44px; }
+ sub, sup { vertical-align: top; }
+ </style>
+ </head>
+ <body>
+ <p>Test<sup>Test</sup><sub>Test</sub></p>
+ </body>
+</html>
+
diff --git a/layout/reftests/text/subpixel-glyphs-x-1a.html b/layout/reftests/text/subpixel-glyphs-x-1a.html
new file mode 100644
index 0000000000..8d51b1c9d3
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-1a.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 13px;
+ }
+ div {
+ border: none;
+ padding: 0px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:9.6px">
+ <div style="font-family: DejaVu Sans, Tahoma, sans-serif">
+ oxoxoxoxoxoxox
+ </div>
+ <div style="font-family: DejaVu Sans, sans-serif">
+ rnrnrnrnrnrnrn
+ </div>
+ <div style="font-family: Tahoma, sans-serif">
+ zezezezezezeze
+ </div>
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-x-1b.html b/layout/reftests/text/subpixel-glyphs-x-1b.html
new file mode 100644
index 0000000000..504a51ccb8
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-1b.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 13px;
+ }
+ div {
+ border: none;
+ padding: 0px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10.4px">
+ <div style="font-family: DejaVu Sans, Tahoma, sans-serif">
+ oxoxoxoxoxoxox
+ </div>
+ <div style="font-family: DejaVu Sans, sans-serif">
+ rnrnrnrnrnrnrn
+ </div>
+ <div style="font-family: Tahoma, sans-serif">
+ zezezezezezeze
+ </div>
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-x-2a.html b/layout/reftests/text/subpixel-glyphs-x-2a.html
new file mode 100644
index 0000000000..cfa0f7b896
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-2a.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 13px;
+ }
+ div {
+ border: none;
+ padding: 0px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:9.6px">
+ o
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-x-2b.html b/layout/reftests/text/subpixel-glyphs-x-2b.html
new file mode 100644
index 0000000000..e79312b118
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-2b.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 13px;
+ }
+ div {
+ border: none;
+ padding: 0px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10.4px">
+ o
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-x-3a.html b/layout/reftests/text/subpixel-glyphs-x-3a.html
new file mode 100644
index 0000000000..34f8368d21
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-3a.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>Test for consistent kerning, bug 716402</title>
+ <style type="text/css">
+ @font-face {
+ font-family: mplus;
+ src: url(../fonts/mplus/mplus-1p-regular-no-OT.ttf);
+ /* a copy of M+ with OpenType tables removed,
+ so only legacy 'kern' is present */
+ }
+ body {
+ text-rendering: optimizeLegibility;
+ font-family: mplus;
+ font-size: 15px;
+ background: white;
+ color: black;
+ }
+ .right {
+ text-align: right;
+ }
+ </style>
+</head>
+<body>
+ <div>
+ AVAV
+ </div>
+ <div class="right">
+ AVAV
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-x-3b.html b/layout/reftests/text/subpixel-glyphs-x-3b.html
new file mode 100644
index 0000000000..83b5aa34db
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-x-3b.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <title>Reference for consistent kerning, bug 716402</title>
+ <style type="text/css">
+ @font-face {
+ font-family: mplus;
+ src: url(../fonts/mplus/mplus-1p-regular-no-OT.ttf);
+ /* a copy of M+ with OpenType tables removed,
+ so only legacy 'kern' is present */
+ }
+ body {
+ text-rendering: optimizeLegibility;
+ font-family: mplus;
+ font-size: 15px;
+ background: white;
+ color: black;
+ }
+ .right {
+ text-align: right;
+ }
+ span {
+ color: white;
+ }
+ </style>
+</head>
+<body>
+ <div>
+ AVAV<span>AV</span>
+ </div>
+ <div class="right">
+ <span>AV</span>AVAV
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-y-1a.html b/layout/reftests/text/subpixel-glyphs-y-1a.html
new file mode 100644
index 0000000000..3f55015f03
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-y-1a.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 14.5px;
+ }
+ div, span {
+ border: none;
+ padding: 0px;
+ }
+ span {
+ /* Offset the baseline by an integer number of pixels */
+ display: inline-block;
+ vertical-align: baseline;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10px; top:9.6px; font-family: sans-serif">
+ e&#x306;&#x327;<span></span>
+ </div>
+ <div style="position:fixed; left:100px; top:9.6px; font-family: serif">
+ e&#x306;&#x327;<span></span>
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-glyphs-y-1b.html b/layout/reftests/text/subpixel-glyphs-y-1b.html
new file mode 100644
index 0000000000..696efb26b3
--- /dev/null
+++ b/layout/reftests/text/subpixel-glyphs-y-1b.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 14.5px;
+ }
+ div, span {
+ border: none;
+ padding: 0px;
+ }
+ span {
+ /* Offset the baseline by an integer number of pixels */
+ display: inline-block;
+ vertical-align: baseline;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10px; top:10.4px; font-family: sans-serif">
+ e&#x306;&#x327<span></span>
+ </div>
+ <div style="position:fixed; left:100px; top:10.4px; font-family: serif">
+ e&#x306;&#x327<span></span>
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-lineheight-1a.html b/layout/reftests/text/subpixel-lineheight-1a.html
new file mode 100644
index 0000000000..4bd857beba
--- /dev/null
+++ b/layout/reftests/text/subpixel-lineheight-1a.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 14.5px;
+ }
+ div, span {
+ border: none;
+ padding: 0px;
+ }
+ span {
+ /* Offset the baseline by an integer number of pixels */
+ display: inline-block;
+ vertical-align: baseline;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10px; top:9.6px; font-family: sans-serif">
+ e<span></span><br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ </div>
+ <div style="position:fixed; left:100px; top:9.6px; font-family: serif">
+ e<span></span><br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ </div>
+</body>
diff --git a/layout/reftests/text/subpixel-lineheight-1b.html b/layout/reftests/text/subpixel-lineheight-1b.html
new file mode 100644
index 0000000000..a9c67093f3
--- /dev/null
+++ b/layout/reftests/text/subpixel-lineheight-1b.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+ <meta http-equiv="Content-Style-Type" content="text/css">
+ <style type="text/css">
+ body {
+ text-rendering: optimizeLegibility;
+ font-size: 14.5px;
+ }
+ div, span {
+ border: none;
+ padding: 0px;
+ }
+ span {
+ /* Offset the baseline by an integer number of pixels */
+ display: inline-block;
+ vertical-align: baseline;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <div style="position:fixed; left:10px; top:10.4px; font-family: sans-serif">
+ e<span></span><br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ </div>
+ <div style="position:fixed; left:100px; top:10.4px; font-family: serif">
+ e<span></span><br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ e<br>
+ </div>
+</body>
diff --git a/layout/reftests/text/swash-1-ref.html b/layout/reftests/text/swash-1-ref.html
new file mode 100644
index 0000000000..ee4c636baa
--- /dev/null
+++ b/layout/reftests/text/swash-1-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body style="font-family: 'Hoefler Text'; font-size: 200%;">
+<p><span style="font-style: italic;">Free<span style="color: transparent;">$</span></span></p>
+</body>
+</html>
diff --git a/layout/reftests/text/swash-1.html b/layout/reftests/text/swash-1.html
new file mode 100644
index 0000000000..5318840395
--- /dev/null
+++ b/layout/reftests/text/swash-1.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body style="font-family: 'Hoefler Text'; font-size: 200%;">
+<p><span style="font-style: italic;">Free<span style="font-size: 0;">$</span></span></p>
+</body>
+</html>
diff --git a/layout/reftests/text/synthetic-bold-metrics-01-notref.html b/layout/reftests/text/synthetic-bold-metrics-01-notref.html
new file mode 100644
index 0000000000..47964e6f09
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-metrics-01-notref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: dejavu;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+
+p {
+ font: 32px dejavu; /* family with only a single weight */
+}
+
+.test {
+ color: white; /* hide the text, we're only comparing metrics */
+}
+</style>
+</head>
+<body>
+<p>AbcdefghijklmnopqrstuvwxyZ</p>
+<p>A<span class="test">bcdefghijklmnopqrstuvwxy</span>Z</p>
+</body>
+</html>
diff --git a/layout/reftests/text/synthetic-bold-metrics-01.html b/layout/reftests/text/synthetic-bold-metrics-01.html
new file mode 100644
index 0000000000..a5331b5216
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-metrics-01.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style type="text/css">
+@font-face {
+ font-family: dejavu;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+}
+
+p {
+ font: 32px dejavu; /* family with only a single weight */
+}
+
+.test {
+ color: white; /* hide the text, we're only comparing metrics */
+ font-weight: bold; /* synthetic bold will be used */
+}
+</style>
+</head>
+<body>
+<p>AbcdefghijklmnopqrstuvwxyZ</p>
+<!-- the "test" span here uses synthetic bold, which should cause the following
+ 'Z' to appear further to the right -->
+<p>A<span class="test">bcdefghijklmnopqrstuvwxy</span>Z</p>
+</body>
+</html>
diff --git a/layout/reftests/text/synthetic-bold-papyrus-01-ref.html b/layout/reftests/text/synthetic-bold-papyrus-01-ref.html
new file mode 100644
index 0000000000..38c7dbc38d
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-papyrus-01-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<style type="text/css">
+ body {
+ margin: 50px;
+ font-size: 24px;
+ }
+
+ #test1 { font-family: Papyrus, serif; }
+
+</style>
+
+</head>
+
+<body>
+ <p id="test1">Test for Papyrus font <b>within a bold tag</b>.</p>
+</body>
+
+</html>
diff --git a/layout/reftests/text/synthetic-bold-papyrus-01.html b/layout/reftests/text/synthetic-bold-papyrus-01.html
new file mode 100644
index 0000000000..1784fc7073
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-papyrus-01.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Test</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<style type="text/css">
+ body {
+ margin: 50px;
+ font-size: 24px;
+ }
+
+ @font-face {
+ font-family: test;
+ src: local(Papyrus);
+ }
+
+ #test2 { font-family: test, serif; }
+
+</style>
+
+</head>
+
+<body>
+ <p id="test2">Test for Papyrus font <b>within a bold tag</b>.</p>
+</body>
+
+</html>
diff --git a/layout/reftests/text/synthetic-bold-zero-width-01-ref.html b/layout/reftests/text/synthetic-bold-zero-width-01-ref.html
new file mode 100644
index 0000000000..c95bb2d04c
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-zero-width-01-ref.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: Fira;
+ src: url(../fonts/fira/FiraSansOT-Regular.otf);
+}
+body {
+ font: 24px Apple Symbols, Segoe UI Symbol, Fira;
+}
+.bold {
+ font-weight: bold;
+}
+</style>
+<body>
+<div>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+</div>
+<div class=bold>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+ xx<br>
+</div>
diff --git a/layout/reftests/text/synthetic-bold-zero-width-01.html b/layout/reftests/text/synthetic-bold-zero-width-01.html
new file mode 100644
index 0000000000..027b419eb4
--- /dev/null
+++ b/layout/reftests/text/synthetic-bold-zero-width-01.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<style>
+@font-face {
+ font-family: Fira;
+ src: url(../fonts/fira/FiraSansOT-Regular.otf);
+}
+body {
+ /* We want a font that only has a single weight, and supports 'x' and zero-width U+0301.
+ * The Apple Symbols and Segoe UI Symbol fonts appear to meet this requirement on macOS
+ * and Win10 respectively.
+ * If they're not available, we use a single face of Fira loaded via @font-face.
+ */
+ font: 24px Apple Symbols, Segoe UI Symbol, Fira;
+}
+.bold {
+ font-weight: bold;
+}
+span {
+ color: transparent;
+}
+</style>
+<body>
+<!-- any number of zero-width characters should not result in any extra space between the 'x' glyphs ... -->
+<div>
+ xx<br>
+ x<span>&#x301;</span>x<br>
+ x<span>&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+</div>
+<!-- ... even when synthetic bold is in effect -->
+<div class=bold>
+ xx<br>
+ x<span>&#x301;</span>x<br>
+ x<span>&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+ x<span>&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;&#x301;</span>x<br>
+</div>
diff --git a/layout/reftests/text/text-align-left-in-rtl-block-iframe.html b/layout/reftests/text/text-align-left-in-rtl-block-iframe.html
new file mode 100644
index 0000000000..bee8ceee6e
--- /dev/null
+++ b/layout/reftests/text/text-align-left-in-rtl-block-iframe.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 806284</title>
+ <style type="text/css">
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+ body { text-align:left; }
+</style>
+</head>
+<body>
+<div dir="rtl">
+111111111111112222222222222233333333333334444444444
+</div>
+</body>
+</html>
diff --git a/layout/reftests/text/text-align-left-in-rtl-block-ref.html b/layout/reftests/text/text-align-left-in-rtl-block-ref.html
new file mode 100644
index 0000000000..8884c2a947
--- /dev/null
+++ b/layout/reftests/text/text-align-left-in-rtl-block-ref.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait"><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 806284</title>
+ <style type="text/css">
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+ #t { width:20em; border: 1px solid black; }
+ </style>
+</head>
+<body>
+<iframe id="t" src="text-align-left-in-rtl-block-iframe.html"></iframe>
+<script type="text/javascript">
+function test()
+{
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener("MozReftestInvalidate", test);
+</script>
+</body>
+</html>
diff --git a/layout/reftests/text/text-align-left-in-rtl-block.html b/layout/reftests/text/text-align-left-in-rtl-block.html
new file mode 100644
index 0000000000..57a790bce0
--- /dev/null
+++ b/layout/reftests/text/text-align-left-in-rtl-block.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html class="reftest-wait"><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 806284</title>
+ <style type="text/css">
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+ #t { width:10em; border: 1px solid black; }
+ </style>
+</head>
+<body>
+<iframe id="t" src="text-align-left-in-rtl-block-iframe.html"></iframe>
+<script type="text/javascript">
+function test()
+{
+ var t = document.getElementById('t');
+ t.style.width = '20em';
+ document.documentElement.removeAttribute("class");
+}
+document.addEventListener("MozReftestInvalidate", test);
+</script>
+</body>
+</html>
diff --git a/layout/reftests/text/variation-selector-unsupported-1-ref.html b/layout/reftests/text/variation-selector-unsupported-1-ref.html
new file mode 100644
index 0000000000..08832bef39
--- /dev/null
+++ b/layout/reftests/text/variation-selector-unsupported-1-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.otf);
+ }
+
+ body { font-family: MarkA; }
+ </style>
+</head>
+<body>
+A
+</body>
+</html>
diff --git a/layout/reftests/text/variation-selector-unsupported-1.html b/layout/reftests/text/variation-selector-unsupported-1.html
new file mode 100644
index 0000000000..98b028b4da
--- /dev/null
+++ b/layout/reftests/text/variation-selector-unsupported-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="en-US">
+<head>
+ <title></title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+
+ @font-face {
+ font-family: "MarkA";
+ src: url(../fonts/markA.otf);
+ }
+
+ body { font-family: MarkA; }
+ </style>
+</head>
+<body>
+A&#xFE00;
+</body>
+</html>
diff --git a/layout/reftests/text/webkit-text-security-1.html b/layout/reftests/text/webkit-text-security-1.html
new file mode 100644
index 0000000000..19ffaf5b49
--- /dev/null
+++ b/layout/reftests/text/webkit-text-security-1.html
@@ -0,0 +1,138 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+
+<style>
+ .test {
+ color: blue;
+ font: 13px monospace;
+ }
+ .init {
+ -webkit-text-security: initial;
+ }
+ .before::before {
+ content: "before text";
+ }
+
+ /* these classes are added/used only in reference mode */
+ .before.circle::before {
+ content: "\25E6\25E6\25E6\25E6\25E6\25E6\25E6\25E6\25E6\25E6\25E6";
+ }
+ .before.disc::before {
+ content: "\2022\2022\2022\2022\2022\2022\2022\2022\2022\2022\2022";
+ }
+ .before.square::before {
+ content: "\25A0\25A0\25A0\25A0\25A0\25A0\25A0\25A0\25A0\25A0\25A0";
+ }
+ ol.circle {
+ list-style-type: "\25E6\25E6\25E6";
+ }
+ ol.disc {
+ list-style-type: "\2022\2022\2022";
+ }
+ ol.square {
+ list-style-type: "\25A0\25A0\25A0";
+ }
+</style>
+
+<script>
+function go() {
+ // In test mode, we just apply the requested -webkit-text-security setting.
+ maskOption = document.location.hash.substr(1);
+ if (document.location.search == "?test") {
+ document.styleSheets[0].cssRules[0].style.webkitTextSecurity = maskOption;
+ return;
+ }
+
+ if (document.location.search != "?ref") {
+ console.warn("Expected either ?test or ?ref request");
+ return;
+ }
+
+ // In reference mode, edit the content to replace text with the masking symbol.
+ // (This is hacky and incomplete, just enough to handle the things present in this example.)
+ if (maskOption == "circle") {
+ maskChar = "\u25E6";
+ } else if (maskOption == "disc") {
+ maskChar = "\u2022";
+ } else if (maskOption == "square") {
+ maskChar = "\u25A0";
+ } else if (maskOption == "none") {
+ return;
+ } else {
+ console.warn("Unknown mask character option: " + maskOption);
+ return;
+ }
+
+ testElems = document.getElementsByClassName("test");
+ for (i = 0; i < testElems.length; ++i) {
+ e = testElems[i];
+ if (e.classList.contains("before") || e.tagName == "OL" || e.tagName == "UL") {
+ e.classList.add(maskOption);
+ }
+ if (e.tagName == "INPUT") {
+ if (e.type == "password") {
+ // leave untouched
+ continue;
+ }
+ e.value = e.value.replaceAll(/./g, maskChar);
+ continue;
+ }
+ function replaceInElem(elem) {
+ if (elem.classList && elem.classList.contains("init")) {
+ return;
+ }
+ if (elem.alt) {
+ elem.alt = elem.alt.replaceAll(/./g, maskChar);
+ }
+ if (elem.firstElementChild) {
+ for (c = elem.firstElementChild; c; c = c.nextElementSibling) {
+ replaceInElem(c);
+ }
+ return;
+ }
+ if (elem.textContent != " ") {
+ elem.textContent = elem.textContent.replaceAll(/./g, maskChar);
+ }
+ }
+ replaceInElem(e);
+ }
+}
+</script>
+
+<body onload="go()">
+div: <div class="test">a b c</div>
+div with single (collapsed-away) space character: <div class="test"> </div>
+div with nbsp: <div class="test">&nbsp;</div>
+div with ::before generated content text: <div class="test before"></div>
+implicitly inheriting into div: <div class="test"><div>div inherit</div></div>
+reset on child div: <div class="test"><div class="init">div reset</div></div>
+span: <span class="test">Hello</span><br>
+img with alt text and "title" hover-text:
+<img class="test" src="broken" alt="alt text" title="hover text"><br>
+Fieldset:
+<fieldset class="test"><legend>Legend</legend><span>Fieldset</span></fieldset>
+<h4>FORM FIELDS:</h4>
+button: <button class="test">Hello</button><br>
+input: <input class="test" value="Hello"><br>
+input type="password": <input class="test" type="password" value="please"><br>
+input type="submit": <input class="test" type="submit" value="Submit"><br>
+input type="reset": <input class="test" type="reset" value="Reset"><br>
+input type="button": <input class="test" type="button" value="button"><br>
+input type="tel": <input class="test" type="tel" value="12345"><br>
+<!-- skipping input types with browser-generated content that is hard to emulate
+ and can't just be overwritten with the masking character -->
+<!--input type="number": <input class="test" type="number" value="12345"><br>-->
+input type="search": <input class="test" type="search" value="12345"><br>
+input type="url": <input class="test" type="url" value="http://example.org"><br>
+input type="email": <input class="test" type="email" value="a@example.org"><br>
+<!--input type="date": <input class="test" type="date" value="2022-01-01"><br>-->
+<!--input type="time": <input class="test" type="time" value="12:00:00"><br>-->
+<!--input type="week": <input class="test" type="week" value="12:00:00"><br>-->
+<!--input type="file": <input class="test" type="file"><br>-->
+<!--input type="image": <input class="test" type="image"><br>-->
+select: <select class="test"><option>A</option><option>BB</option></select><br>
+SVG: <svg height="30px" class="test"><text y="20">SVG Text</text></svg><br>
+
+Ordered list, first item empty: <ol class="test"><li></li><li>a</li><li>bb</li></ol>
+<!-- unordered list is tricky because of the use of -moz-bullet-font for the markers -->
+<!--Unordered list, first item empty: <ul class="test"><li></li><li>a</li><li>bb</li></ul>-->
diff --git a/layout/reftests/text/webkit-text-security-2.html b/layout/reftests/text/webkit-text-security-2.html
new file mode 100644
index 0000000000..04987bb776
--- /dev/null
+++ b/layout/reftests/text/webkit-text-security-2.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+
+<style>
+ .test {
+ color: blue;
+ font: 13px monospace;
+ }
+</style>
+
+<script>
+function go() {
+ // Apply the requested -webkit-text-security setting.
+ maskOption = document.location.search.substr(1);
+ document.styleSheets[0].cssRules[0].style.webkitTextSecurity = maskOption;
+}
+</script>
+
+<body onload="go()">
+input type="number": <input class="test" type="number" value="12345">
diff --git a/layout/reftests/text/webkit-text-security-3.html b/layout/reftests/text/webkit-text-security-3.html
new file mode 100644
index 0000000000..1dcca393a9
--- /dev/null
+++ b/layout/reftests/text/webkit-text-security-3.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+
+<style>
+ .test {
+ color: blue;
+ font: 13px monospace;
+ }
+</style>
+
+<script>
+function go() {
+ // Apply the requested -webkit-text-security setting.
+ maskOption = document.location.search.substr(1);
+ document.styleSheets[0].cssRules[0].style.webkitTextSecurity = maskOption;
+}
+</script>
+
+<body onload="go()">
+input type="date": <input class="test" type="date" value="2023-12-31">
diff --git a/layout/reftests/text/webkit-text-security-4.html b/layout/reftests/text/webkit-text-security-4.html
new file mode 100644
index 0000000000..df2c60751f
--- /dev/null
+++ b/layout/reftests/text/webkit-text-security-4.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+
+<style>
+ .test {
+ color: blue;
+ font: 13px monospace;
+ }
+</style>
+
+<script>
+function go() {
+ // Apply the requested -webkit-text-security setting.
+ maskOption = document.location.search.substr(1);
+ document.styleSheets[0].cssRules[0].style.webkitTextSecurity = maskOption;
+}
+</script>
+
+<body onload="go()">
+input type="time": <input class="test" type="time" value="12:59">
diff --git a/layout/reftests/text/webkit-text-security-5.html b/layout/reftests/text/webkit-text-security-5.html
new file mode 100644
index 0000000000..49b1f90d4b
--- /dev/null
+++ b/layout/reftests/text/webkit-text-security-5.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+
+<style>
+ .test {
+ color: blue;
+ font: 13px monospace;
+ }
+</style>
+
+<script>
+function go() {
+ // Apply the requested -webkit-text-security setting.
+ maskOption = document.location.search.substr(1);
+ document.styleSheets[0].cssRules[0].style.webkitTextSecurity = maskOption;
+}
+</script>
+
+<body onload="go()">
+input type="file": <input class="test" type="file">
diff --git a/layout/reftests/text/white-space-1-ref.html b/layout/reftests/text/white-space-1-ref.html
new file mode 100644
index 0000000000..88351db062
--- /dev/null
+++ b/layout/reftests/text/white-space-1-ref.html
@@ -0,0 +1,64 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<!-- Reference -->
+<style>
+div { border:1px solid black; }
+.container { float:left; width:20%; border-color:cyan; }
+p { width:0; }
+b { font-weight:normal; background-color:yellow; white-space:pre; }
+</style>
+</head>
+<body>
+
+<div>
+<p><b>Hello
+Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello
+Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello
+Kitty</b>
+<p><b>Hello&nbsp;
+Kitty</b>
+<p><b>Hello
+Kitty</b>
+<p><b>Hello
+Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello
+ Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello
+ Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello
+Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello Kitty</b>
+<p><b>Hello
+Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello&nbsp;
+Kitty</b>
+<p><b>Hello&nbsp;
+Kitty</b>
+<p><b>Hello&nbsp;
+Kitty</b>
+<p><b>Hello
+Kitty</b>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-1a.html b/layout/reftests/text/white-space-1a.html
new file mode 100644
index 0000000000..4ae2034595
--- /dev/null
+++ b/layout/reftests/text/white-space-1a.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<!-- Testing all combinations of pre/nowrap/pre-wrap/normal space pairs -->
+<style>
+.nowrap { white-space:nowrap; }
+.pre { white-space:pre; }
+.prewrap { white-space:pre-wrap; }
+div { border:1px solid black; }
+.container { float:left; width:20%; border-color:cyan; }
+p { width:0; }
+b { font-weight:normal; background-color:yellow; }
+</style>
+</head>
+<body>
+
+<div>
+<p><b>Hello Kitty</b>
+<p><b>Hello<span class="pre"> </span>Kitty</b>
+<p><b>Hello<span class="nowrap"> </span>Kitty</b>
+<p><b>Hello<span class="prewrap"> </span>Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello Kitty</b>
+<p><b>Hello<span class="pre"> </span> Kitty</b>
+<p><b>Hello<span class="nowrap"> </span> Kitty</b>
+<p><b>Hello<span class="prewrap"> </span> Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello <span class="pre"> </span>Kitty</b>
+<p><b>Hello<span class="pre"> </span><span class="pre"> </span>Kitty</b>
+<p><b>Hello<span class="nowrap"> </span><span class="pre"> </span>Kitty</b>
+<p><b>Hello<span class="prewrap"> </span><span class="pre"> </span>Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello <span class="nowrap"> </span>Kitty</b>
+<p><b>Hello<span class="pre"> </span><span class="nowrap"> </span>Kitty</b>
+<p><b>Hello<span class="nowrap"> </span><span class="nowrap"> </span>Kitty</b>
+<p><b>Hello<span class="prewrap"> </span><span class="nowrap"> </span>Kitty</b>
+</div>
+
+<div class="container">
+<p><b>Hello <span class="prewrap"> </span>Kitty</b>
+<p><b>Hello<span class="pre"> </span><span class="prewrap"> </span>Kitty</b>
+<p><b>Hello<span class="nowrap"> </span><span class="prewrap"> </span>Kitty</b>
+<p><b>Hello<span class="prewrap"> </span>Kitty</b>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-1b.html b/layout/reftests/text/white-space-1b.html
new file mode 100644
index 0000000000..715d0b2e81
--- /dev/null
+++ b/layout/reftests/text/white-space-1b.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<!-- Adding extra span boundaries -->
+<style>
+.nowrap { white-space:nowrap; }
+.pre { white-space:pre; }
+.prewrap { white-space:pre-wrap; }
+div { border:1px solid black; }
+.container { float:left; width:20%; border-color:cyan; }
+p { width:0; }
+b { font-weight:normal; background-color:yellow; }
+</style>
+</head>
+<body>
+
+<div>
+<p><b><span>Hello<span> <span>Kitty</span></b>
+<p><b><span>Hello<span><span class="pre"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="nowrap"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="prewrap"> </span><span>Kitty</span></b>
+</div>
+
+<div class="container">
+<p><b><span>Hello<span> <span>Kitty</span></b>
+<p><b><span>Hello<span><span class="pre"> </span> <span>Kitty</span></b>
+<p><b><span>Hello<span><span class="nowrap"> </span> <span>Kitty</span></b>
+<p><b><span>Hello<span><span class="prewrap"> </span> <span>Kitty</span></b>
+</div>
+
+<div class="container">
+<p><b><span>Hello<span> <span class="pre"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="pre"> </span><span class="pre"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="nowrap"> </span><span class="pre"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="prewrap"> </span><span class="pre"> </span><span>Kitty</span></b>
+</div>
+
+<div class="container">
+<p><b><span>Hello<span> <span class="nowrap"> </span>Kitty</b>
+<p><b><span>Hello<span><span class="pre"> </span><span class="nowrap"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="nowrap"> </span><span class="nowrap"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="prewrap"> </span><span class="nowrap"> </span><span>Kitty</span></b>
+</div>
+
+<div class="container">
+<p><b><span>Hello<span> <span class="prewrap"> </span>Kitty</b>
+<p><b><span>Hello<span><span class="pre"> </span><span class="prewrap"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="nowrap"> </span><span class="prewrap"> </span><span>Kitty</span></b>
+<p><b><span>Hello<span><span class="prewrap"> </span><span class="prewrap"> </span><span>Kitty</span></b>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-2-ref.html b/layout/reftests/text/white-space-2-ref.html
new file mode 100644
index 0000000000..f452f43914
--- /dev/null
+++ b/layout/reftests/text/white-space-2-ref.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<!-- Reference -->
+<style>
+div { font:16px sans-serif; border:1px solid black; }
+.container { float:left; width:20%; border-color:cyan; }
+p { width:0; }
+b { font-weight:normal; background-color:yellow; white-space:pre; }
+.cell { display:table-cell; border:1px solid green; }
+.hang { display:inline-block; width:0; overflow:visible; }
+.hang span { display:inline; background-color:yellow; }
+.clip { overflow: hidden; }
+</style>
+</head>
+<body>
+
+<div>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello
+ Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell clip"><b>Hello<span class="hang"><span> </span></span>
+ Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello<span class="hang"><span> </span></span>
+Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="hang"><span> </span></span>
+Kitty</b></span>
+<p><span class="cell"><b>Hello
+Kitty</b></span>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-2.html b/layout/reftests/text/white-space-2.html
new file mode 100644
index 0000000000..84377c7fda
--- /dev/null
+++ b/layout/reftests/text/white-space-2.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<!-- Wrapping tests in table-cell to test min-width computation -->
+<style>
+div { font:16px sans-serif; border:1px solid black; }
+.container { float:left; width:20%; border-color:cyan; }
+p { width:0; }
+b { font-weight:normal; background-color:yellow; }
+.cell { display:table-cell; border:1px solid green; }
+.nowrap { white-space:nowrap; }
+.pre { white-space:pre; }
+.prewrap { white-space:pre-wrap; }
+</style>
+</head>
+<body>
+
+<div>
+<p><span class="cell"><b>Hello Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="pre"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="nowrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="prewrap"> </span>Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello <span>Kitty</span></b></span>
+<p><span class="cell"><b>Hello<span class="pre"> </span> Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="nowrap"> </span> Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="prewrap"> </span> Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello <span class="pre"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="pre"> </span><span class="pre"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="nowrap"> </span><span class="pre"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="prewrap"> </span><span class="pre"> </span>Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello <span class="nowrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="pre"> </span><span class="nowrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="nowrap"> </span><span class="nowrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="prewrap"> </span><span class="nowrap"> </span>Kitty</b></span>
+</div>
+
+<div class="container">
+<p><span class="cell"><b>Hello <span class="prewrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="pre"> </span><span class="prewrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="nowrap"> </span><span class="prewrap"> </span>Kitty</b></span>
+<p><span class="cell"><b>Hello<span class="prewrap"> </span><span class="prewrap"> </span>Kitty</b></span>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-3-ref.html b/layout/reftests/text/white-space-3-ref.html
new file mode 100644
index 0000000000..1bde6bffc0
--- /dev/null
+++ b/layout/reftests/text/white-space-3-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+div { font: 24px monospace; width: 0; white-space: pre; }
+b { font-weight: normal; background: yellow; }
+.cell { display: table-cell; border: 1px solid green; }
+</style>
+</head>
+<body>
+
+<p>There should be no red:</p>
+
+<div><span class="cell"><b>Hiya <br>Kitty</b></span></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/white-space-3.html b/layout/reftests/text/white-space-3.html
new file mode 100644
index 0000000000..1a413df09e
--- /dev/null
+++ b/layout/reftests/text/white-space-3.html
@@ -0,0 +1,19 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+div { font: 24px monospace; width: 0; }
+b { font-weight: normal; background: yellow; }
+.cell { display: table-cell; border: 1px solid green; background: red; }
+.nowrap { white-space: nowrap; }
+.prewrap { white-space: pre-wrap; }
+</style>
+</head>
+<body>
+
+<p>There should be no red:</p>
+
+<div><span class="cell"><b>Hiya<span class="prewrap"> </span><span class="nowrap"> </span>Kitty</b></span></div>
+
+</body>
+</html>
diff --git a/layout/reftests/text/word-spacing-01-ref.html b/layout/reftests/text/word-spacing-01-ref.html
new file mode 100644
index 0000000000..5bf7c331af
--- /dev/null
+++ b/layout/reftests/text/word-spacing-01-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style>
+span { display:inline-block; width:10ch; }
+/* first tab-position will be at 2 * (space-width + word-spacing), i.e. 22ch,
+ so to advance there after the 3-ch word "tab" we need 19ch of added space */
+span.tab { width: 19ch; }
+</style>
+</head>
+<body style="font-family: monospace; width: 433px; height: 590px;">
+
+<table border="1">
+<tr><td>space <span></span>.</td>
+<tr><td>nonbreaking-space&nbsp;<span></span>.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+<span></span>.</td>
+<tr><td>tab&#9;<span></span>.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:pre">
+<tr><td>space <span></span>.</td>
+<tr><td>nonbreaking-space&nbsp;<span></span>.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab<span class=tab></span>.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:nowrap">
+<tr><td>space <span></span>.</td>
+<tr><td>nonbreaking-space&nbsp;<span></span>.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline <span></span>.</td>
+<tr><td>tab&#9;<span></span>.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:pre-wrap">
+<tr><td>space <span></span>.</td>
+<tr><td>nonbreaking-space&nbsp;<span></span>.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab<span class=tab></span>.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/word-spacing-01.html b/layout/reftests/text/word-spacing-01.html
new file mode 100644
index 0000000000..7441e56381
--- /dev/null
+++ b/layout/reftests/text/word-spacing-01.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<html>
+<body style="font-family: monospace; word-spacing:10ch; -moz-tab-size: 2; width: 433px; height: 590px;">
+
+<table border="1">
+<tr><td>space .</td>
+<tr><td>nonbreaking-space&nbsp;.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab&#9;.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:pre">
+<tr><td>space .</td>
+<tr><td>nonbreaking-space&nbsp;.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab&#9;.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:nowrap">
+<tr><td>space .</td>
+<tr><td>nonbreaking-space&nbsp;.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab&#9;.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+<table border="1" style="white-space:pre-wrap">
+<tr><td>space .</td>
+<tr><td>nonbreaking-space&nbsp;.</td>
+<tr><td>ideographic-space&#x3000;.</td>
+<tr><td>newline
+.</td>
+<tr><td>tab&#9;.</td>
+<tr><td>form-feed&#12;.</td>
+</table>
+
+</body>
+</html>
diff --git a/layout/reftests/text/wordbreak-1-ref.html b/layout/reftests/text/wordbreak-1-ref.html
new file mode 100644
index 0000000000..4311f225cf
--- /dev/null
+++ b/layout/reftests/text/wordbreak-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Test - word-break: break-all</title>
+ </head>
+ <body>
+ <div>f<br/>o<br/>x<br/>f<br/>-<br/>o<br/></div><br/>
+ <div>fox<br/>f-o</div><br/>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-1.html b/layout/reftests/text/wordbreak-1.html
new file mode 100644
index 0000000000..6994b70f72
--- /dev/null
+++ b/layout/reftests/text/wordbreak-1.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all</title>
+ </head>
+ <body>
+ <div class="breakall">fox f-o</div><br />
+ <div class="keepall">fox f-o</div><br />
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-3-ref.html b/layout/reftests/text/wordbreak-3-ref.html
new file mode 100644
index 0000000000..8bc5e4bf5e
--- /dev/null
+++ b/layout/reftests/text/wordbreak-3-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ </style>
+ <title>Test - word-break: break-all with clusters</title>
+ </head>
+ <body>
+ <div>&#x0935;&#x093F;<br/>&#x0915;&#x093F;<br/>&#x092A;&#x0940;<br/>&#x0921;&#x093F;<br/>&#x092F;&#x093E;</div><br/>
+ <div>&#x0935;&#x093F;&#x0915;&#x093F;&#x092A;&#x0940;&#x0921;&#x093F;&#x092F;&#x093E;</div><br/>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-3.html b/layout/reftests/text/wordbreak-3.html
new file mode 100644
index 0000000000..9b5cad7015
--- /dev/null
+++ b/layout/reftests/text/wordbreak-3.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with clusters</title>
+ </head>
+ <body>
+ <div class="breakall">&#x0935;&#x093F;&#x0915;&#x093F;&#x092A;&#x0940;&#x0921;&#x093F;&#x092F;&#x093E;</div><br />
+ <div class="keepall">&#x0935;&#x093F;&#x0915;&#x093F;&#x092A;&#x0940;&#x0921;&#x093F;&#x092F;&#x093E;</div><br />
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-4b-ref.html b/layout/reftests/text/wordbreak-4b-ref.html
new file mode 100644
index 0000000000..946c407b91
--- /dev/null
+++ b/layout/reftests/text/wordbreak-4b-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ </style>
+ <title>Test - word-break: break-all with Hangul syllables</title>
+ </head>
+ <body>
+ <div>&#xC560;<br/>&#xAE30;<br/>&#xD310;<br/>&#xB2E4;</div><br/>
+ <div>&#xC560;&#xAE30;&#xD310;&#xB2E4;</div><br/>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-4b.html b/layout/reftests/text/wordbreak-4b.html
new file mode 100644
index 0000000000..296f96dd93
--- /dev/null
+++ b/layout/reftests/text/wordbreak-4b.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with Hangul syllables</title>
+ </head>
+ <body>
+ <div class="breakall">&#xC560;&#xAE30;&#xD310;&#xB2E4;</div><br />
+ <div class="keepall">&#xC560;&#xAE30;&#xD310;&#xB2E4;</div><br />
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-5-ref.html b/layout/reftests/text/wordbreak-5-ref.html
new file mode 100644
index 0000000000..5466d255dd
--- /dev/null
+++ b/layout/reftests/text/wordbreak-5-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ </style>
+ <title>Test - word-break: break-all with supplementary characters</title>
+ </head>
+ <body>
+ <div>&#x10911;<br/>&#x10903;<br/>&#x10909;<br/>&#x10912;<br/>&#x10901;<br/>&#x10900;<br/>&#x1090C;<br/>&#x1090D;<br/>&#x10915;<br/>&#x10905;<br/>&#x10909;<br/>&#x10907;<br/>&#x10909;<br/>&#x10904;</div><br/>
+ <div>&#x10911;&#x10903;&#x10909;&#x10912;<br/>&#x10901;&#x10900;&#x1090C;&#x1090D;&#x10915;&#x10905;<br/>&#x10909;&#x10907;&#x10909;&#x10904;</div><br/>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-5.html b/layout/reftests/text/wordbreak-5.html
new file mode 100644
index 0000000000..9f20ed3e9b
--- /dev/null
+++ b/layout/reftests/text/wordbreak-5.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with supplementary characters</title>
+ </head>
+ <body>
+ <div class="breakall">&#x10911;&#x10903;&#x10909;&#x10912; &#x10901;&#x10900;&#x1090C;&#x1090D;&#x10915;&#x10905; &#x10909;&#x10907;&#x10909;&#x10904;</div><br />
+ <div class="keepall">&#x10911;&#x10903;&#x10909;&#x10912; &#x10901;&#x10900;&#x1090C;&#x1090D;&#x10915;&#x10905; &#x10909;&#x10907;&#x10909;&#x10904;</div><br />
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-6-ref.html b/layout/reftests/text/wordbreak-6-ref.html
new file mode 100644
index 0000000000..3422ec686c
--- /dev/null
+++ b/layout/reftests/text/wordbreak-6-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ </style>
+ <title>Test - word-break: break-all with supplementary characters</title>
+ </head>
+ <body>
+ <div>&#x10a24;<br/>&#x10a2a;&#x10a0c;<br/>&#x10a2a;&#x10a3f;<br/>&#x10a17;&#x10a38;&#x10a05;&#x10a0c;&#x10a0f;</div><br/>
+ <div>&#x10a24;&#x10a2a;&#x10a0c;&#x10a2a;&#x10a3f;&#x10a17;&#x10a38;&#x10a05;&#x10a0c;&#x10a0f;</div><br/>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-6.html b/layout/reftests/text/wordbreak-6.html
new file mode 100644
index 0000000000..26ea950d80
--- /dev/null
+++ b/layout/reftests/text/wordbreak-6.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with kharoshthi characters</title>
+ </head>
+ <body>
+ <div class="breakall">&#x10a24;&#x10a2a;&#x10a0c;&#x10a2a;&#x10a3f;&#x10a17;&#x10a38;&#x10a05;&#x10a0c;&#x10a0f;</div><br />
+ <div class="keepall">&#x10a24;&#x10a2a;&#x10a0c;&#x10a2a;&#x10a3f;&#x10a17;&#x10a38;&#x10a05;&#x10a0c;&#x10a0f;</div><br />
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-7-ref.html b/layout/reftests/text/wordbreak-7-ref.html
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7-ref.html
diff --git a/layout/reftests/text/wordbreak-7.html b/layout/reftests/text/wordbreak-7.html
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7.html
diff --git a/layout/reftests/text/wordbreak-7a-ref.html b/layout/reftests/text/wordbreak-7a-ref.html
new file mode 100644
index 0000000000..4f1d1d882e
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7a-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+ }
+ body {
+ font-family: test;
+ line-height: 1.5em;
+ }
+ </style>
+ <title>Test - word-break: break-all with rtl and diacritics, no ligatures</title>
+ </head>
+ <body>
+ <div>
+ &#x0627;<br>&#xFEDF;<br>&#xFECC;<br>&#xFEAE;<br>&#xFE91;<br>&#xFEF2;<br>
+ &#x0627;<br>&#xFEDF;<br>&#xFEC0;&#x064E;&#x0651;<br>&#xFE8E;<br>&#xFEDF;&#x0650;&#x0651;<br>&#xFEF4;<br>&#xFEE6;&#x064E;
+ </div>
+ <br>
+ <div>
+ &#x0627;&#x0644;&#x0639;&#x0631;&#x0628;&#x064A;<br>
+ &#x0627;&#x0644;&#x0636;&#x064E;&#x0651;&#x0627;&#x0644;&#x0650;&#x0651;&#x064A;&#x0646;&#x064E;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-7a.html b/layout/reftests/text/wordbreak-7a.html
new file mode 100644
index 0000000000..7e22e1d6c4
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7a.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+ }
+ body {
+ font-family: test;
+ line-height: 1.5em;
+ }
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with rtl and diacritics, no ligatures</title>
+ </head>
+ <body>
+ <div class="breakall">
+ &#x0627;&#x0644;&#x0639;&#x0631;&#x0628;&#x064A;
+ &#x0627;&#x0644;&#x0636;&#x064E;&#x0651;&#x0627;&#x0644;&#x0650;&#x0651;&#x064A;&#x0646;&#x064E;
+ </div>
+ <br>
+ <div class="keepall">
+ &#x0627;&#x0644;&#x0639;&#x0631;&#x0628;&#x064A;
+ &#x0627;&#x0644;&#x0636;&#x064E;&#x0651;&#x0627;&#x0644;&#x0650;&#x0651;&#x064A;&#x0646;&#x064E;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-7b-ref.html b/layout/reftests/text/wordbreak-7b-ref.html
new file mode 100644
index 0000000000..8b734c8f52
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7b-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+ }
+ body {
+ font-family: test;
+ line-height: 1.5em;
+ }
+ </style>
+ <title>Test - word-break: break-all with rtl and diacritics, including ligatures</title>
+ </head>
+ <body>
+ <div>
+ &#x0648;&#x064E;<br>&#xFEDF;&#x064E;<br>&#xFE8E;<br>
+ &#x0627;<br>&#xFEDF;<br>&#xFEB4;&#x0651;&#x064E;<br>&#xFEE0;&#x064E;<br>&#xFE8E;<br>&#x0645;&#x064F;<br>
+ &#xFECB;&#x064E;<br>&#xFEE0;&#x064E;<br>&#xFEF4;&#x0652;<br>&#xFEDC;&#x064F;<br>&#xFEE2;&#x0652;
+ </div>
+ <br>
+ <div>
+ &#x0648;&#x064E;&#x0644;&#x064E;&#x0627;<br>
+ &#x0627;&#x0644;&#x0633;&#x0651;&#x064E;&#x0644;&#x064E;&#x0627;&#x0645;&#x064F;<br>
+ &#x0639;&#x064E;&#x0644;&#x064E;&#x064A;&#x0652;&#x0643;&#x064F;&#x0645;&#x0652;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-7b.html b/layout/reftests/text/wordbreak-7b.html
new file mode 100644
index 0000000000..ee25cc7ff2
--- /dev/null
+++ b/layout/reftests/text/wordbreak-7b.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: test;
+ src: url(../fonts/dejavu-sans/DejaVuSans.ttf);
+ }
+ body {
+ font-family: test;
+ line-height: 1.5em;
+ }
+ div.breakall { width: 0px; word-break: break-all; }
+ div.keepall { width: 0px; word-break: keep-all; }
+ </style>
+ <title>Test - word-break: break-all with rtl and diacritics, including ligatures</title>
+ </head>
+ <body>
+ <div class="breakall">
+ &#x0648;&#x064E;&#x0644;&#x064E;&#x0627;
+ &#x0627;&#x0644;&#x0633;&#x0651;&#x064E;&#x0644;&#x064E;&#x0627;&#x0645;&#x064F;
+ &#x0639;&#x064E;&#x0644;&#x064E;&#x064A;&#x0652;&#x0643;&#x064F;&#x0645;&#x0652;
+ </div>
+ <br>
+ <div class="keepall">
+ &#x0648;&#x064E;&#x0644;&#x064E;&#x0627;
+ &#x0627;&#x0644;&#x0633;&#x0651;&#x064E;&#x0644;&#x064E;&#x0627;&#x0645;&#x064F;
+ &#x0639;&#x064E;&#x0644;&#x064E;&#x064A;&#x0652;&#x0643;&#x064F;&#x0645;&#x0652;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-8-ref.html b/layout/reftests/text/wordbreak-8-ref.html
new file mode 100644
index 0000000000..b51019e989
--- /dev/null
+++ b/layout/reftests/text/wordbreak-8-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ .lc { text-transform: lowercase; }
+ .uc { text-transform: uppercase; }
+ </style>
+ <title>Test - word-break:break-all with text-transform and clusters</title>
+ </head>
+ <body>
+ <div class="lc">f<br>o<br>x<br>f<br>o&#x0325;<br>x&#x0307;</div><br>
+ <div class="lc">fox<br>fo&#x0325;x&#x0307;</div><br>
+ <div class="uc">f<br>o<br>x<br>f<br>o&#x0325;<br>x&#x0307;</div><br>
+ <div class="uc">fox<br>fo&#x0325;x&#x0307;</div><br>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-8.html b/layout/reftests/text/wordbreak-8.html
new file mode 100644
index 0000000000..9a85f61070
--- /dev/null
+++ b/layout/reftests/text/wordbreak-8.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ .breakall { width: 0px; word-break: break-all; }
+ .keepall { width: 0px; word-break: keep-all; }
+ .lc { text-transform: lowercase; }
+ .uc { text-transform: uppercase; }
+ </style>
+ <title>Test - word-break:break-all with text-transform and clusters</title>
+ </head>
+ <body>
+ <div class="breakall lc">fox fo&#x0325;x&#x0307;</div><br>
+ <div class="keepall lc">fox fo&#x0325;x&#x0307;</div><br>
+ <div class="breakall uc">fox fo&#x0325;x&#x0307;</div><br>
+ <div class="keepall uc">fox fo&#x0325;x&#x0307;</div><br>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-9-ref.html b/layout/reftests/text/wordbreak-9-ref.html
new file mode 100644
index 0000000000..bd70c084d5
--- /dev/null
+++ b/layout/reftests/text/wordbreak-9-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: latin;
+ src: url("../fonts/sil/GenR102.ttf");
+ }
+ @font-face {
+ font-family: arabic;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+ }
+ body {
+ font-family: latin, arabic, sans-serif;
+ font-size: 24px;
+ line-height: 2em;
+ }
+ </style>
+ <title>Test - word-break:break-all across font fallback</title>
+ </head>
+ <body>
+ <!-- the arabic diacritics here will fall back to font 'arabic', which
+ is a graphite-enabled arabic font, and be shaped separately;
+ nevertheless, they must remain clustered with the preceding letters,
+ no additional line-breaks are allowed before them (bug 833297) -->
+ <div>f<br>o&#x064c;<br>o&#x0650;<br>b<br>a&#x0654;<br>r</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-9.html b/layout/reftests/text/wordbreak-9.html
new file mode 100644
index 0000000000..5186e9a6e1
--- /dev/null
+++ b/layout/reftests/text/wordbreak-9.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+ @font-face {
+ font-family: latin;
+ src: url("../fonts/sil/GenR102.ttf");
+ }
+ @font-face {
+ font-family: arabic;
+ src: url("../fonts/sil/Scheherazade-R 2012-07-03c.ttf");
+ }
+ body {
+ font-family: latin, arabic, sans-serif;
+ font-size: 24px;
+ line-height: 2em;
+ }
+ div {
+ width: 0px;
+ word-break: break-all;
+ }
+ </style>
+ <title>Test - word-break:break-all across font fallback</title>
+ </head>
+ <body>
+ <!-- the arabic diacritics here will fall back to font 'arabic', which
+ is a graphite-enabled arabic font, and be shaped separately;
+ nevertheless, they must remain clustered with the preceding letters,
+ no additional line-breaks are allowed before them (bug 833297) -->
+ <div>fo&#x064c;o&#x0650;ba&#x0654;r</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordbreak-dynamic-1-ref.html b/layout/reftests/text/wordbreak-dynamic-1-ref.html
new file mode 100644
index 0000000000..f8feb44cbf
--- /dev/null
+++ b/layout/reftests/text/wordbreak-dynamic-1-ref.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset="UTF-8">
+ <title>Reference - word-break: break-all with dynamic change</title>
+ <style>
+ div {
+ font-family: monospace;
+ width: 3ch;
+ background: pink;
+ word-break: break-all;
+ }
+ </style>
+</head>
+<body>
+ <div>a bcdef</div>
+</body>
+</html>
diff --git a/layout/reftests/text/wordbreak-dynamic-1.html b/layout/reftests/text/wordbreak-dynamic-1.html
new file mode 100644
index 0000000000..930ba6efb5
--- /dev/null
+++ b/layout/reftests/text/wordbreak-dynamic-1.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <meta charset="UTF-8">
+ <title>Test - word-break: break-all with dynamic change</title>
+ <style>
+ div {
+ font-family: monospace;
+ width: 3ch;
+ background: pink;
+ word-break: break-all;
+ }
+ </style>
+</head>
+<body>
+ <div>a bcdef<div></div></div>
+ <script>
+ document.addEventListener("DOMContentLoaded", function() {
+ document.body.offsetHeight;
+ document.querySelector('div > div').style.display = 'none';
+ document.documentElement.classList.remove('reftest-wait');
+ });
+ </script>
+</body>
+</html>
diff --git a/layout/reftests/text/wordwrap-01-ref.html b/layout/reftests/text/wordwrap-01-ref.html
new file mode 100644
index 0000000000..8f88fae973
--- /dev/null
+++ b/layout/reftests/text/wordwrap-01-ref.html
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's
+lipsmackinthirstquen
+chinacetastinmotivat
+ingoodbuzzincooltalk
+inhighwalkinfastlivi
+nevergivincoolfizzin
+Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-01.html b/layout/reftests/text/wordwrap-01.html
new file mode 100644
index 0000000000..da2d6c56a5
--- /dev/null
+++ b/layout/reftests/text/wordwrap-01.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-02-ref.html b/layout/reftests/text/wordwrap-02-ref.html
new file mode 100644
index 0000000000..760eb1efd9
--- /dev/null
+++ b/layout/reftests/text/wordwrap-02-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<!-- tests that Arabic characters shape across word breaks -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+@font-face {
+ font-family: dvm;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+textarea {
+ font-family: dvm;
+ line-height: 1.5em;
+ overflow: scroll;
+}
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20" dir="rtl">ذهعقروبلجيكا،الموسوﻋ
+ﺔكل,تمبوابةاقتصاديةﻫ
+ﺬه.ضمنهاالروسوحرماﻧﺒ
+ﻠﻌﺪد,يكنجسيمةلإعادةلم
+.يكنوالحلفاءبالقناﺑﻠ
+ﻬﻮ,بحثخسائرالدفاعباﻟ
+ﻬﺠﻮمعن.فرنسيةمارشاﻟﺒ
+ﻴﻨﻴﺘﻮدحرثم,وصلبشريةا
+لرايخبالحربتم.</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-02.html b/layout/reftests/text/wordwrap-02.html
new file mode 100644
index 0000000000..8dcac75ecb
--- /dev/null
+++ b/layout/reftests/text/wordwrap-02.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<!-- tests that Arabic characters shape across word breaks -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+@font-face {
+ font-family: dvm;
+ src: url(../fonts/DejaVuSansMono.woff);
+}
+textarea {
+ font-family: dvm;
+ line-height: 1.5em;
+ overflow: scroll;
+}
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <!-- spellcheck="false" added as a workaround to our maximum length of words for the spell checker -->
+ <textarea spellcheck="false" rows="10" cols="20" dir="rtl">ذهعقروبلجيكا،الموسوعةكل,تمبوابةاقتصاديةهذه.ضمنهاالروسوحرمانبلعدد,يكنجسيمةلإعادةلم.يكنوالحلفاءبالقنابلهو,بحثخسائرالدفاعبالهجومعن.فرنسيةمارشالبينيتودحرثم,وصلبشريةالرايخبالحربتم.</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-03-ref.html b/layout/reftests/text/wordwrap-03-ref.html
new file mode 100644
index 0000000000..66cc0089e8
--- /dev/null
+++ b/layout/reftests/text/wordwrap-03-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<!-- tests that words don't break in mid-cluster -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+@font-face { font-family: dvm; src: url(../fonts/DejaVuSansMono.woff); }
+textarea { font-family: dvm, monospace; font-size: 12px; overflow: scroll; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="27">It's
+lipsmackinthirstquenchinace&#x300;
+tastinmotivatingoodbuzzinco&#x301;
+oltalkinhighwalkinfastlivin&#x303;
+evergivincoolfizzin
+Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-03.html b/layout/reftests/text/wordwrap-03.html
new file mode 100644
index 0000000000..453e013846
--- /dev/null
+++ b/layout/reftests/text/wordwrap-03.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<!-- tests that words don't break in mid-cluster -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+@font-face { font-family: dvm; src: url(../fonts/DejaVuSansMono.woff); }
+textarea { font-family: dvm, monospace; font-size: 12px; overflow: scroll; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="27">It's lipsmackinthirstquenchinace&#x300;tastinmotivatingoodbuzzinco&#x301;oltalkinhighwalkinfastlivin&#x303;evergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-04-ref.html b/layout/reftests/text/wordwrap-04-ref.html
new file mode 100644
index 0000000000..4be06cef64
--- /dev/null
+++ b/layout/reftests/text/wordwrap-04-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <p style="width: 100px; word-wrap: break-word;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-04.html b/layout/reftests/text/wordwrap-04.html
new file mode 100644
index 0000000000..b35fcbdf98
--- /dev/null
+++ b/layout/reftests/text/wordwrap-04.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<!-- Test setting word-wrap: break-word dynamically -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Wordwrap</title>
+ <script type="text/javascript">
+function SwapStyle()
+{
+ par = document.getElementById("pp");
+ par.style.wordWrap = "break-word";
+}
+ </script>
+ </head>
+ <body onload="SwapStyle()">
+ <p id="pp" style="width: 100px; word-wrap: normal;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-05-ref.html b/layout/reftests/text/wordwrap-05-ref.html
new file mode 100644
index 0000000000..b0b397eb17
--- /dev/null
+++ b/layout/reftests/text/wordwrap-05-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <p style="width: 100px;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-05.html b/layout/reftests/text/wordwrap-05.html
new file mode 100644
index 0000000000..56c03a7f2a
--- /dev/null
+++ b/layout/reftests/text/wordwrap-05.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<!-- Test unsetting word-wrap: break-word dynamically -->
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Wordwrap</title>
+ <script type="text/javascript">
+function SwapStyle()
+{
+ par = document.getElementById("pp");
+ par.style.wordWrap = "normal";
+}
+ </script>
+ </head>
+ <body onload="SwapStyle()">
+ <p id="pp" style="width: 100px; word-wrap: break-word;">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-06-ref.html b/layout/reftests/text/wordwrap-06-ref.html
new file mode 100644
index 0000000000..3294803185
--- /dev/null
+++ b/layout/reftests/text/wordwrap-06-ref.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>http://www.mozilla.org/projects/minefield/</title>
+ <style type="text/css">
+#viewsource {
+ font-family: -moz-fixed;
+ font-weight: normal;
+ font-size: 16px;
+ color: black;
+ white-space: pre;
+}
+pre {
+ font: inherit;
+ color: inherit;
+ white-space: inherit;
+ margin: 0;
+ width: 475px;
+}
+.attribute-name {
+ color: black;
+ font-weight: bold;
+}
+.attribute-value {
+ color: blue;
+ font-weight: normal;
+}
+ </style>
+ </head>
+ <body id="viewsource">
+ <pre id="line1"><span class="attribute-name">href</span>=<span class="attribute-value">"../../css/cavendish/content.css" </span>
+<span class="attribute-name">title</span>=<span class="attribute-value">"Cavendish"</span></pre>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text/wordwrap-06.html b/layout/reftests/text/wordwrap-06.html
new file mode 100644
index 0000000000..a299a0a08e
--- /dev/null
+++ b/layout/reftests/text/wordwrap-06.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>http://www.mozilla.org/projects/minefield/</title>
+ <style type="text/css">
+#viewsource {
+ font-family: -moz-fixed;
+ font-weight: normal;
+ font-size: 16px;
+ color: black;
+ white-space: pre;
+}
+#viewsource.wrap {
+ white-space: pre-wrap;
+ word-wrap: break-word;
+}
+pre {
+ font: inherit;
+ color: inherit;
+ white-space: inherit;
+ margin: 0;
+ width: 475px;
+}
+.attribute-name {
+ color: black;
+ font-weight: bold;
+}
+.attribute-value {
+ color: blue;
+ font-weight: normal;
+}
+ </style>
+ </head>
+ <body id="viewsource" class="wrap">
+ <pre id="line1"><span class="attribute-name">href</span>=<span class="attribute-value">"../../css/cavendish/content.css" </span><span class="attribute-name">title</span>=<span class="attribute-value">"Cavendish"</span></pre>
+ </body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/text/wordwrap-07-ref.html b/layout/reftests/text/wordwrap-07-ref.html
new file mode 100644
index 0000000000..c6cae567b5
--- /dev/null
+++ b/layout/reftests/text/wordwrap-07-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <div><em>H<br>e<br>l<br>l<br>o</em><br>K<br>i<br>t<br>t<br>y</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-07.html b/layout/reftests/text/wordwrap-07.html
new file mode 100644
index 0000000000..b0259d68ef
--- /dev/null
+++ b/layout/reftests/text/wordwrap-07.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+div { width: 0px; word-wrap: break-word; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <div><em>Hello</em>Kitty</div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-08-ref.html b/layout/reftests/text/wordwrap-08-ref.html
new file mode 100644
index 0000000000..d0c5bded39
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; white-space: pre}
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's&nbsp;lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin&nbsp;Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-08.html b/layout/reftests/text/wordwrap-08.html
new file mode 100644
index 0000000000..d9b02b83f0
--- /dev/null
+++ b/layout/reftests/text/wordwrap-08.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll}
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20" wrap="off">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-09-ref.html b/layout/reftests/text/wordwrap-09-ref.html
new file mode 100644
index 0000000000..a6dcbe642f
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; white-space: pre; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's
+lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin
+Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-09.html b/layout/reftests/text/wordwrap-09.html
new file mode 100644
index 0000000000..033a8f2691
--- /dev/null
+++ b/layout/reftests/text/wordwrap-09.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="content-type" content="text/html; charset=UTF-8">
+ <style type="text/css">
+textarea { overflow: scroll; word-wrap: normal; }
+ </style>
+ <title>Test Wordwrap</title>
+ </head>
+ <body>
+ <textarea rows="10" cols="20">It's lipsmackinthirstquenchinacetastinmotivatingoodbuzzincooltalkinhighwalkinfastlivinevergivincoolfizzin Firefox!</textarea>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-10-ref.html b/layout/reftests/text/wordwrap-10-ref.html
new file mode 100644
index 0000000000..1c370bc4c7
--- /dev/null
+++ b/layout/reftests/text/wordwrap-10-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Test - word-wrap: break-word should respect clusters</title>
+ </head>
+ <body>
+ <div>
+ a<br>b<br>c<br>
+ d&#x0325;<br>e&#x0315;<br>f&#x0323;<br>
+ &#x10400;<br>&#x10401;<br>&#x10402;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/wordwrap-10.html b/layout/reftests/text/wordwrap-10.html
new file mode 100644
index 0000000000..5a892c6adf
--- /dev/null
+++ b/layout/reftests/text/wordwrap-10.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <title>Test - word-wrap: break-word should respect clusters</title>
+ </head>
+ <body>
+ <div style="width:0px; word-wrap:break-word">
+ abc
+ d&#x0325;e&#x0315;f&#x0323;
+ &#x10400;&#x10401;&#x10402;
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/text/zwnj-01-notref.html b/layout/reftests/text/zwnj-01-notref.html
new file mode 100644
index 0000000000..20a642b624
--- /dev/null
+++ b/layout/reftests/text/zwnj-01-notref.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<!-- Reference rendering for zwnj-02.html. No spans, no ZWNJs. Everything
+ should connect -->
+<html>
+ <head>
+ <title>ZWNJ test</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ body {
+ font-size: 36px;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p>&#x647;&#x641;&#x62A;&#x647;&#x647;&#x627;</p>
+ <p>&#x645;&#x648;&#x632;&#x647;&#x647;&#x627;</p>
+ <p>&#x633;&#x647;&#x634;&#x646;&#x628;&#x647;</p>
+ <p>&#x631;&#x627;&#x647;&#x622;&#x647;&#x646;</p>
+ <p>&#x646;&#x631;&#x645;&#x627;&#x641;&#x632;&#x627;&#x631;</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/zwnj-01-ref.html b/layout/reftests/text/zwnj-01-ref.html
new file mode 100644
index 0000000000..a7b77f46df
--- /dev/null
+++ b/layout/reftests/text/zwnj-01-ref.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<!-- Reference rendering for zwnj-01.html. This uses spans with
+ display:inline-block to prevent the letters from connecting -->
+<html>
+ <head>
+ <title>ZWNJ test</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ body {
+ font-size: 36px;
+ }
+ span {
+ display: inline-block;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p><span>&#x647;&#x627;</span><span>&#x647;&#x641;&#x62A;&#x647;</span></p>
+ <p><span>&#x647;&#x627;</span><span>&#x645;&#x648;&#x632;&#x647;</span></p>
+ <p><span>&#x634;&#x646;&#x628;&#x647;</span><span>&#x633;&#x647;</span></p>
+ <p><span>&#x622;&#x647;&#x646;</span><span>&#x631;&#x627;&#x647;</span></p>
+ <p><span>&#x627;&#x641;&#x632;&#x627;&#x631;</span><span>&#x646;&#x631;&#x645;</span></p>
+ </body>
+</html>
diff --git a/layout/reftests/text/zwnj-01-ref.xhtml b/layout/reftests/text/zwnj-01-ref.xhtml
new file mode 100644
index 0000000000..deb3382dba
--- /dev/null
+++ b/layout/reftests/text/zwnj-01-ref.xhtml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1">
+
+ <!-- use an empty g to force filters.svg to load before onload -->
+ <use xlink:href="../filters.svg#empty" />
+
+ <foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
+ x="0" y="0" height="100%" width="100%">
+<!-- Reference rendering for zwnj-01.html. This uses spans with
+ display:inline-block to prevent the letters from connecting -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>ZWNJ test</title>
+ <style type="text/css">
+ body {
+ font-size: 36px;
+ background: white;
+ color: black;
+ }
+ span {
+ display: inline-block;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p><span>&#x647;&#x627;</span><span>&#x647;&#x641;&#x62A;&#x647;</span></p>
+ <p><span>&#x647;&#x627;</span><span>&#x645;&#x648;&#x632;&#x647;</span></p>
+ <p><span>&#x634;&#x646;&#x628;&#x647;</span><span>&#x633;&#x647;</span></p>
+ <p><span>&#x622;&#x647;&#x646;</span><span>&#x631;&#x627;&#x647;</span></p>
+ <p><span>&#x627;&#x641;&#x632;&#x627;&#x631;</span><span>&#x646;&#x631;&#x645;</span></p>
+ </body>
+</html>
+</foreignObject>
+</svg>
diff --git a/layout/reftests/text/zwnj-01.html b/layout/reftests/text/zwnj-01.html
new file mode 100644
index 0000000000..03b1715957
--- /dev/null
+++ b/layout/reftests/text/zwnj-01.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<!-- ZWNJ test #1. Persian words containing a ZWNJ (copied from
+ http://www.unics.uni-hannover.de/nhtcapri/bidirectional-text.html) -->
+<html>
+ <head>
+ <title>ZWNJ test</title>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <style type="text/css">
+ body {
+ font-size: 36px;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p>&#x647;&#x641;&#x62A;&#x647;&#x200C;&#x647;&#x627;</p>
+ <p>&#x645;&#x648;&#x632;&#x647;&#x200C;&#x647;&#x627;</p>
+ <p>&#x633;&#x647;&#x200C;&#x634;&#x646;&#x628;&#x647;</p>
+ <p>&#x631;&#x627;&#x647;&#x200C;&#x622;&#x647;&#x646;</p>
+ <p>&#x646;&#x631;&#x645;&#x200C;&#x627;&#x641;&#x632;&#x627;&#x631;</p>
+ </body>
+</html>
diff --git a/layout/reftests/text/zwnj-01.xhtml b/layout/reftests/text/zwnj-01.xhtml
new file mode 100644
index 0000000000..25cec48356
--- /dev/null
+++ b/layout/reftests/text/zwnj-01.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1">
+
+ <!-- use an empty g to force filters.svg to load before onload -->
+ <use xlink:href="../filters.svg#empty" />
+
+ <foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
+ x="0" y="0" height="100%" width="100%">
+<!-- ZWNJ test #1. Persian words containing a ZWNJ (copied from
+ http://www.unics.uni-hannover.de/nhtcapri/bidirectional-text.html) -->
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>ZWNJ test</title>
+ <style type="text/css">
+ body {
+ font-size: 36px;
+ background: white;
+ color: black;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p>&#x647;&#x641;&#x62A;&#x647;&#x200C;&#x647;&#x627;</p>
+ <p>&#x645;&#x648;&#x632;&#x647;&#x200C;&#x647;&#x627;</p>
+ <p>&#x633;&#x647;&#x200C;&#x634;&#x646;&#x628;&#x647;</p>
+ <p>&#x631;&#x627;&#x647;&#x200C;&#x622;&#x647;&#x646;</p>
+ <p>&#x646;&#x631;&#x645;&#x200C;&#x627;&#x641;&#x632;&#x627;&#x631;</p>
+ </body>
+</html>
+</foreignObject>
+</svg>
diff --git a/layout/reftests/text/zwnj-02-ref.xhtml b/layout/reftests/text/zwnj-02-ref.xhtml
new file mode 100644
index 0000000000..bc0b434590
--- /dev/null
+++ b/layout/reftests/text/zwnj-02-ref.xhtml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1">
+
+ <!-- use an empty g to force filters.svg to load before onload -->
+ <use xlink:href="../filters.svg#empty" />
+
+ <foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
+ x="0" y="0" height="100%" width="100%">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!-- Reference rendering for zwnj-02.html. No spans, no ZWNJs. Everything
+ should connect -->
+ <head>
+ <title>ZWNJ test</title>
+ <style type="text/css">
+ html, body { margin: 0; background: white; color: black; height: 100%; width: 100%; }
+ body {
+ font-size: 36px;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p>&#x647;&#x641;&#x62A;&#x647;&#x647;&#x627;</p>
+ <p>&#x645;&#x648;&#x632;&#x647;&#x647;&#x627;</p>
+ <p>&#x633;&#x647;&#x634;&#x646;&#x628;&#x647;</p>
+ <p>&#x631;&#x627;&#x647;&#x622;&#x647;&#x646;</p>
+ <p>&#x646;&#x631;&#x645;&#x627;&#x641;&#x632;&#x627;&#x631;</p>
+ </body>
+</html>
+</foreignObject>
+</svg>
diff --git a/layout/reftests/text/zwnj-02.xhtml b/layout/reftests/text/zwnj-02.xhtml
new file mode 100644
index 0000000000..7a1b37633a
--- /dev/null
+++ b/layout/reftests/text/zwnj-02.xhtml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ version="1.1">
+
+ <!-- use an empty g to force filters.svg to load before onload -->
+ <use xlink:href="../filters.svg#empty" />
+
+ <foreignObject filter="url(../filters.svg#NonWhiteToBlack)"
+ x="0" y="0" height="100%" width="100%">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<!-- ZWNJ test #2. The words from zwnj-01.html with the ZWNJs replaced by
+ span boundaries. Correct behaviour is for the letters to connect across the
+ spans -->
+ <head>
+ <title>ZWNJ test</title>
+ <style type="text/css">
+ html, body { margin: 0; background: white; color: black; height: 100%; width: 100%; }
+ body {
+ font-size: 36px;
+ }
+ </style>
+ </head>
+ <body lang="ar">
+ <p><span>&#x647;&#x641;&#x62A;&#x647;</span><span>&#x647;&#x627;</span></p>
+ <p><span>&#x645;&#x648;&#x632;&#x647;</span><span>&#x647;&#x627;</span></p>
+ <p><span>&#x633;&#x647;</span><span>&#x634;&#x646;&#x628;&#x647;</span></p>
+ <p><span>&#x631;&#x627;&#x647;</span><span>&#x622;&#x647;&#x646;</span></p>
+ <p><span>&#x646;&#x631;&#x645;</span><span>&#x627;&#x641;&#x632;&#x627;&#x631;</span></p>
+ </body>
+</html>
+</foreignObject>
+</svg>