summaryrefslogtreecommitdiffstats
path: root/layout/reftests/line-breaking
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /layout/reftests/line-breaking
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/line-breaking')
-rw-r--r--layout/reftests/line-breaking/between-whitespaces-ref.html32
-rw-r--r--layout/reftests/line-breaking/between-whitespaces.html31
-rw-r--r--layout/reftests/line-breaking/chemical-1-ref.html12
-rw-r--r--layout/reftests/line-breaking/chemical-1.html12
-rw-r--r--layout/reftests/line-breaking/conservative-range-1-ref.html68
-rw-r--r--layout/reftests/line-breaking/conservative-range-1.html69
-rw-r--r--layout/reftests/line-breaking/conservative-range-2-ref.html34
-rw-r--r--layout/reftests/line-breaking/conservative-range-2.html35
-rw-r--r--layout/reftests/line-breaking/currency-1-ref.html62
-rw-r--r--layout/reftests/line-breaking/currency-1.html62
-rw-r--r--layout/reftests/line-breaking/currency-2-ref.html62
-rw-r--r--layout/reftests/line-breaking/currency-2.html62
-rw-r--r--layout/reftests/line-breaking/datetime-1-ref.html22
-rw-r--r--layout/reftests/line-breaking/datetime-1.html22
-rw-r--r--layout/reftests/line-breaking/emoji-1-ref.html36
-rw-r--r--layout/reftests/line-breaking/emoji-1.html36
-rw-r--r--layout/reftests/line-breaking/emoji-2-ref.html30
-rw-r--r--layout/reftests/line-breaking/emoji-2.html24
-rw-r--r--layout/reftests/line-breaking/hyphens-1-ref.html41
-rw-r--r--layout/reftests/line-breaking/hyphens-1.html41
-rw-r--r--layout/reftests/line-breaking/hyphens-2-ref.html33
-rw-r--r--layout/reftests/line-breaking/hyphens-2.html33
-rw-r--r--layout/reftests/line-breaking/ja-1-ref.html15
-rw-r--r--layout/reftests/line-breaking/ja-1.html15
-rw-r--r--layout/reftests/line-breaking/ja-2-ref.html15
-rw-r--r--layout/reftests/line-breaking/ja-2.html15
-rw-r--r--layout/reftests/line-breaking/ja-3-ref.html16
-rw-r--r--layout/reftests/line-breaking/ja-3.html16
-rw-r--r--layout/reftests/line-breaking/khmer-1-ref.html11
-rw-r--r--layout/reftests/line-breaking/khmer-1.html11
-rw-r--r--layout/reftests/line-breaking/leaders-1-ref.html26
-rw-r--r--layout/reftests/line-breaking/leaders-1.html26
-rw-r--r--layout/reftests/line-breaking/markup-src-1-ref.html15
-rw-r--r--layout/reftests/line-breaking/markup-src-1.html15
-rw-r--r--layout/reftests/line-breaking/non-breakable-1-ref.html36
-rw-r--r--layout/reftests/line-breaking/non-breakable-1.html36
-rw-r--r--layout/reftests/line-breaking/non-breakable-2-ref.html36
-rw-r--r--layout/reftests/line-breaking/non-breakable-2.html36
-rw-r--r--layout/reftests/line-breaking/numerics-1-ref.html24
-rw-r--r--layout/reftests/line-breaking/numerics-1.html24
-rw-r--r--layout/reftests/line-breaking/parentheses-1-ref.html34
-rw-r--r--layout/reftests/line-breaking/parentheses-1.html34
-rw-r--r--layout/reftests/line-breaking/punctuation-open-1-ref.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-1.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-2-ref.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-2.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-3-ref.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-3.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-4-ref.html27
-rw-r--r--layout/reftests/line-breaking/punctuation-open-4.html27
-rw-r--r--layout/reftests/line-breaking/quotationmarks-1-ref.html19
-rw-r--r--layout/reftests/line-breaking/quotationmarks-1.html19
-rw-r--r--layout/reftests/line-breaking/quotationmarks-cjk-1-ref.html18
-rw-r--r--layout/reftests/line-breaking/quotationmarks-cjk-1.html19
-rw-r--r--layout/reftests/line-breaking/reftest.list45
-rw-r--r--layout/reftests/line-breaking/smileys-1-ref.html27
-rw-r--r--layout/reftests/line-breaking/smileys-1.html27
-rw-r--r--layout/reftests/line-breaking/smileys-2-ref.html27
-rw-r--r--layout/reftests/line-breaking/smileys-2.html27
-rw-r--r--layout/reftests/line-breaking/space-cluster-1-ref.html4
-rw-r--r--layout/reftests/line-breaking/space-cluster-1.html5
-rw-r--r--layout/reftests/line-breaking/space-cluster-2-ref.html4
-rw-r--r--layout/reftests/line-breaking/space-cluster-2.html4
-rw-r--r--layout/reftests/line-breaking/surrogates-1-ref.html20
-rw-r--r--layout/reftests/line-breaking/surrogates-1.html23
-rw-r--r--layout/reftests/line-breaking/surrogates-2-ref.html20
-rw-r--r--layout/reftests/line-breaking/surrogates-2.html23
-rw-r--r--layout/reftests/line-breaking/surrogates-3-ref.html20
-rw-r--r--layout/reftests/line-breaking/surrogates-3.html23
-rw-r--r--layout/reftests/line-breaking/surrogates-4-ref.html20
-rw-r--r--layout/reftests/line-breaking/surrogates-4.html23
-rw-r--r--layout/reftests/line-breaking/url-1-ref.html16
-rw-r--r--layout/reftests/line-breaking/url-1.html16
-rw-r--r--layout/reftests/line-breaking/url-2-ref.html21
-rw-r--r--layout/reftests/line-breaking/url-2.html21
-rw-r--r--layout/reftests/line-breaking/url-3-ref.html14
-rw-r--r--layout/reftests/line-breaking/url-3.html14
-rw-r--r--layout/reftests/line-breaking/winpath-1-ref.html22
-rw-r--r--layout/reftests/line-breaking/winpath-1.html22
-rw-r--r--layout/reftests/line-breaking/zwnbsp-1-ref.html44
-rw-r--r--layout/reftests/line-breaking/zwnbsp-1.html44
81 files changed, 2182 insertions, 0 deletions
diff --git a/layout/reftests/line-breaking/between-whitespaces-ref.html b/layout/reftests/line-breaking/between-whitespaces-ref.html
new file mode 100644
index 0000000000..167f8ce228
--- /dev/null
+++ b/layout/reftests/line-breaking/between-whitespaces-ref.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Line breaks between white spaces</title>
+<style>
+div {
+ width: 0px;
+ border: 1px solid blue;
+ white-space: nowrap;
+}
+</style>
+</head>
+<body>
+<table>
+<tr><th>U+0009</th><td><div>&#x0009;&#x0009;</div></td></tr>
+<tr><th>U+000D</th><td><div>&#x000D;&#x000D;</div></td></tr>
+<tr><th>U+0020</th><td><div>&#x0020;&#x0020;</div></td></tr>
+<tr><th>U+2000</th><td><div>&#x2000;&#x2000;</div></td></tr>
+<tr><th>U+2001</th><td><div>&#x2000;&#x2001;</div></td></tr>
+<tr><th>U+2002</th><td><div>&#x2000;&#x2002;</div></td></tr>
+<tr><th>U+2003</th><td><div>&#x2000;&#x2003;</div></td></tr>
+<tr><th>U+2004</th><td><div>&#x2000;&#x2004;</div></td></tr>
+<tr><th>U+2005</th><td><div>&#x2000;&#x2005;</div></td></tr>
+<tr><th>U+2006</th><td><div>&#x2000;&#x2006;</div></td></tr>
+<tr><th>U+2008</th><td><div>&#x2000;&#x2008;</div></td></tr>
+<tr><th>U+2009</th><td><div>&#x2000;&#x2009;</div></td></tr>
+<tr><th>U+200A</th><td><div>&#x2000;&#x200A;</div></td></tr>
+<tr><th>U+200B</th><td><div>&#x2000;&#x200B;</div></td></tr>
+<tr><th>U+3000</th><td><div>&#x3000;&#x3000;</div></td></tr>
+</table>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/line-breaking/between-whitespaces.html b/layout/reftests/line-breaking/between-whitespaces.html
new file mode 100644
index 0000000000..2233a461cf
--- /dev/null
+++ b/layout/reftests/line-breaking/between-whitespaces.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Line breaks between white spaces</title>
+<style>
+div {
+ width: 0px;
+ border: 1px solid blue;
+}
+</style>
+</head>
+<body>
+<table>
+<tr><th>U+0009</th><td><div>&#x0009;&#x0009;</div></td></tr>
+<tr><th>U+000D</th><td><div>&#x000D;&#x000D;</div></td></tr>
+<tr><th>U+0020</th><td><div>&#x0020;&#x0020;</div></td></tr>
+<tr><th>U+2000</th><td><div>&#x2000;&#x2000;</div></td></tr>
+<tr><th>U+2001</th><td><div>&#x2000;&#x2001;</div></td></tr>
+<tr><th>U+2002</th><td><div>&#x2000;&#x2002;</div></td></tr>
+<tr><th>U+2003</th><td><div>&#x2000;&#x2003;</div></td></tr>
+<tr><th>U+2004</th><td><div>&#x2000;&#x2004;</div></td></tr>
+<tr><th>U+2005</th><td><div>&#x2000;&#x2005;</div></td></tr>
+<tr><th>U+2006</th><td><div>&#x2000;&#x2006;</div></td></tr>
+<tr><th>U+2008</th><td><div>&#x2000;&#x2008;</div></td></tr>
+<tr><th>U+2009</th><td><div>&#x2000;&#x2009;</div></td></tr>
+<tr><th>U+200A</th><td><div>&#x2000;&#x200A;</div></td></tr>
+<tr><th>U+200B</th><td><div>&#x2000;&#x200B;</div></td></tr>
+<tr><th>U+3000</th><td><div>&#x3000;&#x3000;</div></td></tr>
+</table>
+</body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/line-breaking/chemical-1-ref.html b/layout/reftests/line-breaking/chemical-1-ref.html
new file mode 100644
index 0000000000..724d115b48
--- /dev/null
+++ b/layout/reftests/line-breaking/chemical-1-ref.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>6-Bromo-<br>2,4,5-<br>trichlorophenol<p>
+<p>2,3,5,6-<br>Tetrafluorophenol</p>
+<p>4-Bromo-<br>2-fluoro-<br>6-nitrophenol</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/chemical-1.html b/layout/reftests/line-breaking/chemical-1.html
new file mode 100644
index 0000000000..aa68fcf08f
--- /dev/null
+++ b/layout/reftests/line-breaking/chemical-1.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>6-Bromo-2,4,5-trichlorophenol<p>
+<p>2,3,5,6-Tetrafluorophenol</p>
+<p>4-Bromo-2-fluoro-6-nitrophenol</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/conservative-range-1-ref.html b/layout/reftests/line-breaking/conservative-range-1-ref.html
new file mode 100644
index 0000000000..d50f65a9f7
--- /dev/null
+++ b/layout/reftests/line-breaking/conservative-range-1-ref.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug 809020</title>
+<style>
+p {
+ font-family: monospace;
+ margin: .5em 0;
+}
+.break {
+ color: green;
+}
+.nobreak {
+ color: red;
+}
+</style>
+</head>
+<body>
+The green examples should break at all their hyphens; the red ones should not.
+<p class="nobreak">
+T-shirt
+</p>
+<p class="nobreak">
+billy-o
+</p>
+<p class="break">
+tally-<br>ho
+</p>
+<p class="break">
+co-<br>author
+</p>
+<p class="break">
+hi-<br>de-<br>hi
+</p>
+<p class="break">
+far-<br>sighted
+</p>
+<p class="break">
+hocus-<br>pocus
+</p>
+<p class="break">
+Nanki-<br>Poo
+</p>
+<p class="break">
+Miami-<br>Dade
+</p>
+<p class="break">
+Wells-<br>next-<br>the-<br>Sea
+</p>
+<p class="break">
+Lee-<br>on-<br>the-<br>Solent
+</p>
+<p class="nobreak">
+\\/^-_-^\//
+</p>
+<p class="nobreak">
+(''')-.-(''')
+<p class="nobreak">
+:-"&gt;
+<p class="nobreak">
+&lt;{^-^}&gt;
+</p>
+<p class="nobreak">
+:-D
+</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/conservative-range-1.html b/layout/reftests/line-breaking/conservative-range-1.html
new file mode 100644
index 0000000000..bec33b5b27
--- /dev/null
+++ b/layout/reftests/line-breaking/conservative-range-1.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug 809020</title>
+<style>
+p {
+ font-family: monospace;
+ margin: .5em 0;
+ width:0;
+}
+.break {
+ color: green;
+}
+.nobreak {
+ color: red;
+}
+</style>
+</head>
+<body>
+The green examples should break at all their hyphens; the red ones should not.
+<p class="nobreak">
+T-shirt
+</p>
+<p class="nobreak">
+billy-o
+</p>
+<p class="break">
+tally-ho
+</p>
+<p class="break">
+co-author
+</p>
+<p class="break">
+hi-de-hi
+</p>
+<p class="break">
+far-sighted
+</p>
+<p class="break">
+hocus-pocus
+</p>
+<p class="break">
+Nanki-Poo
+</p>
+<p class="break">
+Miami-Dade
+</p>
+<p class="break">
+Wells-next-the-Sea
+</p>
+<p class="break">
+Lee-on-the-Solent
+</p>
+<p class="nobreak">
+\\/^-_-^\//
+</p>
+<p class="nobreak">
+(''')-.-(''')
+<p class="nobreak">
+:-"&gt;
+<p class="nobreak">
+&lt;{^-^}&gt;
+</p>
+<p class="nobreak">
+:-D
+</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/conservative-range-2-ref.html b/layout/reftests/line-breaking/conservative-range-2-ref.html
new file mode 100644
index 0000000000..565d086289
--- /dev/null
+++ b/layout/reftests/line-breaking/conservative-range-2-ref.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug 809020</title>
+<style>
+p {
+ font-family: monospace;
+ margin: 1em 0;
+}
+</style>
+</head>
+<body>
+
+Line breaks should always occur before a '/' character,
+and no fragment should be less than 6 chars long.
+
+<p>/a/a</p>
+<p>/a/a/a</p>
+<p>/a/a/a/a</p>
+<p>/a/a/a/a/a</p>
+<p>/a/a/a<br>/a/a/a</p>
+
+<p>/aa/aa<br>/aa/aa<br>/aa/aa/aa</p>
+<p>/aaa/aaa<br>/aaa/aaa/aaa</p>
+<p>/aaaa/aaaa<br>/aaaa/aaaa</p>
+<p>/aaaaa<br>/aaaaa<br>/aaaaa</p>
+<p>/aaaaaa<br>/aaaaaa<br>/aaaaaa</p>
+
+<p>/a/ab/abc<br>/abcd/abcde<br>/abcdef<br>/abcdefg</p>
+<p>/abcdefg<br>/abcdef<br>/abcde<br>/abcd/abc/ab/a</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/conservative-range-2.html b/layout/reftests/line-breaking/conservative-range-2.html
new file mode 100644
index 0000000000..c652eb57d8
--- /dev/null
+++ b/layout/reftests/line-breaking/conservative-range-2.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug 809020</title>
+<style>
+p {
+ font-family: monospace;
+ margin: 1em 0;
+ width:0;
+}
+</style>
+</head>
+<body>
+
+Line breaks should always occur before a '/' character,
+and no fragment should be less than 6 chars long.
+
+<p>/a/a</p>
+<p>/a/a/a</p>
+<p>/a/a/a/a</p>
+<p>/a/a/a/a/a</p>
+<p>/a/a/a/a/a/a</p>
+
+<p>/aa/aa/aa/aa/aa/aa/aa</p>
+<p>/aaa/aaa/aaa/aaa/aaa</p>
+<p>/aaaa/aaaa/aaaa/aaaa</p>
+<p>/aaaaa/aaaaa/aaaaa</p>
+<p>/aaaaaa/aaaaaa/aaaaaa</p>
+
+<p>/a/ab/abc/abcd/abcde/abcdef/abcdefg</p>
+<p>/abcdefg/abcdef/abcde/abcd/abc/ab/a</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/currency-1-ref.html b/layout/reftests/line-breaking/currency-1-ref.html
new file mode 100644
index 0000000000..9cfe0a4d60
--- /dev/null
+++ b/layout/reftests/line-breaking/currency-1-ref.html
@@ -0,0 +1,62 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>______$123,456-</p>
+<p>123,456$______</p>
+
+<!-- BACK SLASH is used for YEN SIGN and WON SIGN in Japan and Korea -->
+<p>______\123,456-</p>
+<p>123,456\______</p>
+
+<p>______&euro;123,456-</p>
+<p>123,456&euro;______</p>
+
+<p>______&cent;;123,456-</p>
+<p>123,456&cent;______</p>
+
+<p>______&pound;123,456-</p>
+<p>123,456&pound;______</p>
+
+<p>______&curren;123,456-</p>
+<p>123,456&curren;______</p>
+
+<p>______&yen;123,456-</p>
+<p>123,456&yen;______</p>
+
+<!-- EURO-CURRENCY SIGN -->
+<p>______&#x20A0;123,456-</p>
+<p>123,456&#x20A0;______</p>
+
+<!-- COLON SIGN -->
+<p>______&#x20A1;123,456-</p>
+<p>123,456&#x20A1;______</p>
+
+<!-- CRUZEIRO SIGN -->
+<p>______&#x20A2;123,456-</p>
+<p>123,456&#x20A2;______</p>
+
+<!-- FRENCH FRANC SIGN -->
+<p>______&#x20A3;123,456-</p>
+<p>123,456&#x20A3;______</p>
+
+<!-- LIRA SIGN -->
+<p>______&#x20A4;123,456-</p>
+<p>123,456&#x20A4;______</p>
+
+<!-- MILL SIGN -->
+<p>______&#x20A5;123,456-</p>
+<p>123,456&#x20A5;______</p>
+
+<!-- NAIRA SIGN -->
+<p>______&#x20A6;123,456-</p>
+<p>123,456&#x20A6;______</p>
+
+<!-- PESETA SIGN -->
+<p>______&#x20A7;123,456-</p>
+<p>123,456&#x20A7;______</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/currency-1.html b/layout/reftests/line-breaking/currency-1.html
new file mode 100644
index 0000000000..9b7edfcefb
--- /dev/null
+++ b/layout/reftests/line-breaking/currency-1.html
@@ -0,0 +1,62 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>______$123,456-</p>
+<p>123,456$______</p>
+
+<!-- BACK SLASH is used for YEN SIGN and WON SIGN in Japan and Korea -->
+<p>______\123,456-</p>
+<p>123,456\______</p>
+
+<p>______&euro;123,456-</p>
+<p>123,456&euro;______</p>
+
+<p>______&cent;;123,456-</p>
+<p>123,456&cent;______</p>
+
+<p>______&pound;123,456-</p>
+<p>123,456&pound;______</p>
+
+<p>______&curren;123,456-</p>
+<p>123,456&curren;______</p>
+
+<p>______&yen;123,456-</p>
+<p>123,456&yen;______</p>
+
+<!-- EURO-CURRENCY SIGN -->
+<p>______&#x20A0;123,456-</p>
+<p>123,456&#x20A0;______</p>
+
+<!-- COLON SIGN -->
+<p>______&#x20A1;123,456-</p>
+<p>123,456&#x20A1;______</p>
+
+<!-- CRUZEIRO SIGN -->
+<p>______&#x20A2;123,456-</p>
+<p>123,456&#x20A2;______</p>
+
+<!-- FRENCH FRANC SIGN -->
+<p>______&#x20A3;123,456-</p>
+<p>123,456&#x20A3;______</p>
+
+<!-- LIRA SIGN -->
+<p>______&#x20A4;123,456-</p>
+<p>123,456&#x20A4;______</p>
+
+<!-- MILL SIGN -->
+<p>______&#x20A5;123,456-</p>
+<p>123,456&#x20A5;______</p>
+
+<!-- NAIRA SIGN -->
+<p>______&#x20A6;123,456-</p>
+<p>123,456&#x20A6;______</p>
+
+<!-- PESETA SIGN -->
+<p>______&#x20A7;123,456-</p>
+<p>123,456&#x20A7;______</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/currency-2-ref.html b/layout/reftests/line-breaking/currency-2-ref.html
new file mode 100644
index 0000000000..8d7f1d7a0a
--- /dev/null
+++ b/layout/reftests/line-breaking/currency-2-ref.html
@@ -0,0 +1,62 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<!-- RUPEE SIGN -->
+<p>______&#x20A8;123,456-</p>
+<p>123,456&#x20A8;______</p>
+
+<!-- WON SIGN -->
+<p>______&#x20A9;123,456-</p>
+<p>123,456&#x20A9;______</p>
+
+<!-- NEW SHEQEL SIGN -->
+<p>______&#x20AA;123,456-</p>
+<p>123,456&#x20AA;______</p>
+
+<!-- DONG SIGN -->
+<p>______&#x20AB;123,456-</p>
+<p>123,456&#x20AB;______</p>
+
+<!-- U+20AC is EURO SIGN -->
+
+<!-- KIP SIGN -->
+<p>______&#x20AD;123,456-</p>
+<p>123,456&#x20AD;______</p>
+
+<!-- TUGRIK SIGN -->
+<p>______&#x20AE;123,456-</p>
+<p>123,456&#x20AE;______</p>
+
+<!-- DRACHMA SIGN -->
+<p>______&#x20AF;123,456-</p>
+<p>123,456&#x20AF;______</p>
+
+<!-- GERMAN PENNY SIGN -->
+<p>______&#x20B0;123,456-</p>
+<p>123,456&#x20B0;______</p>
+
+<!-- PESO SIGN -->
+<p>______&#x20B1;123,456-</p>
+<p>123,456&#x20B1;______</p>
+
+<!-- GUARANI SIGN -->
+<p>______&#x20B2;123,456-</p>
+<p>123,456&#x20B2;______</p>
+
+<!-- AUSTRAL SIGN -->
+<p>______&#x20B3;123,456-</p>
+<p>123,456&#x20B3;______</p>
+
+<!-- HRYVNIA SIGN -->
+<p>______&#x20B4;123,456-</p>
+<p>123,456&#x20B4;______</p>
+
+<!-- CEDI SIGN -->
+<p>______&#x20B5;123,456-</p>
+<p>123,456&#x20B5;______</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/currency-2.html b/layout/reftests/line-breaking/currency-2.html
new file mode 100644
index 0000000000..887561833f
--- /dev/null
+++ b/layout/reftests/line-breaking/currency-2.html
@@ -0,0 +1,62 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<!-- RUPEE SIGN -->
+<p>______&#x20A8;123,456-</p>
+<p>123,456&#x20A8;______</p>
+
+<!-- WON SIGN -->
+<p>______&#x20A9;123,456-</p>
+<p>123,456&#x20A9;______</p>
+
+<!-- NEW SHEQEL SIGN -->
+<p>______&#x20AA;123,456-</p>
+<p>123,456&#x20AA;______</p>
+
+<!-- DONG SIGN -->
+<p>______&#x20AB;123,456-</p>
+<p>123,456&#x20AB;______</p>
+
+<!-- U+20AC is EURO SIGN -->
+
+<!-- KIP SIGN -->
+<p>______&#x20AD;123,456-</p>
+<p>123,456&#x20AD;______</p>
+
+<!-- TUGRIK SIGN -->
+<p>______&#x20AE;123,456-</p>
+<p>123,456&#x20AE;______</p>
+
+<!-- DRACHMA SIGN -->
+<p>______&#x20AF;123,456-</p>
+<p>123,456&#x20AF;______</p>
+
+<!-- GERMAN PENNY SIGN -->
+<p>______&#x20B0;123,456-</p>
+<p>123,456&#x20B0;______</p>
+
+<!-- PESO SIGN -->
+<p>______&#x20B1;123,456-</p>
+<p>123,456&#x20B1;______</p>
+
+<!-- GUARANI SIGN -->
+<p>______&#x20B2;123,456-</p>
+<p>123,456&#x20B2;______</p>
+
+<!-- AUSTRAL SIGN -->
+<p>______&#x20B3;123,456-</p>
+<p>123,456&#x20B3;______</p>
+
+<!-- HRYVNIA SIGN -->
+<p>______&#x20B4;123,456-</p>
+<p>123,456&#x20B4;______</p>
+
+<!-- CEDI SIGN -->
+<p>______&#x20B5;123,456-</p>
+<p>123,456&#x20B5;______</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/datetime-1-ref.html b/layout/reftests/line-breaking/datetime-1-ref.html
new file mode 100644
index 0000000000..5c1088702b
--- /dev/null
+++ b/layout/reftests/line-breaking/datetime-1-ref.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>2007-01-01</p>
+<p>2007-<br>Jan-01</p>
+<p>Jan-01-2007</p>
+<p>2007-01-01&nbsp;00:00:00</p>
+<p>2007-<br>Jan-01&nbsp;00:00:00</p>
+<p>Jan-01-2007&nbsp;00:00:00</p>
+
+<p>2007/01/01</p>
+<p>2007/Jan/01</p>
+<p>Jan/01/2007</p>
+<p>2007/01/01&nbsp;00:00:00</p>
+<p>2007/Jan/01&nbsp;00:00:00</p>
+<p>Jan/01/2007&nbsp;00:00:00</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/datetime-1.html b/layout/reftests/line-breaking/datetime-1.html
new file mode 100644
index 0000000000..ce6a84bcf5
--- /dev/null
+++ b/layout/reftests/line-breaking/datetime-1.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>2007-01-01</p>
+<p>2007-Jan-01</p>
+<p>Jan-01-2007</p>
+<p>2007-01-01&nbsp;00:00:00</p>
+<p>2007-Jan-01&nbsp;00:00:00</p>
+<p>Jan-01-2007&nbsp;00:00:00</p>
+
+<p>2007/01/01</p>
+<p>2007/Jan/01</p>
+<p>Jan/01/2007</p>
+<p>2007/01/01&nbsp;00:00:00</p>
+<p>2007/Jan/01&nbsp;00:00:00</p>
+<p>Jan/01/2007&nbsp;00:00:00</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/emoji-1-ref.html b/layout/reftests/line-breaking/emoji-1-ref.html
new file mode 100644
index 0000000000..871f2cf00d
--- /dev/null
+++ b/layout/reftests/line-breaking/emoji-1-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+.test {
+ width: 6em;
+ border: 1px solid silver;
+ margin: 1em;
+ padding: 2px;
+}
+.wrapped {
+ word-wrap: break-word;
+}
+</style>
+</head>
+<body>
+The emoji should wrap within the box in both cases:
+<div class="test">
+abcde fghij klmno pqrst uvw xyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603; &#x1f604;&#x1f605;&#x1f606;&#x1f607;
+&#x1f608;&#x1f609;&#x1f60a;&#x1f60b; &#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+abcdefghijklmnopqrstuvwxyz
+<span class="wrapped">&#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;</span>
+</div>
+<div class="test wrapped">
+abcde fghij klmno pqrst uvw xyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603; &#x1f604;&#x1f605;&#x1f606;&#x1f607;
+&#x1f608;&#x1f609;&#x1f60a;&#x1f60b; &#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+abcdefghijklmnopqrstuvwxyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/emoji-1.html b/layout/reftests/line-breaking/emoji-1.html
new file mode 100644
index 0000000000..fba190921c
--- /dev/null
+++ b/layout/reftests/line-breaking/emoji-1.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+.test {
+ width: 6em;
+ border: 1px solid silver;
+ margin: 1em;
+ padding: 2px;
+}
+.wrapped {
+ word-wrap: break-word;
+}
+</style>
+</head>
+<body>
+The emoji should wrap within the box in both cases:
+<div class=test>
+abcde fghij klmno pqrst uvw xyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603; &#x1f604;&#x1f605;&#x1f606;&#x1f607;
+&#x1f608;&#x1f609;&#x1f60a;&#x1f60b; &#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+abcdefghijklmnopqrstuvwxyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+</div>
+<div class="test wrapped">
+abcde fghij klmno pqrst uvw xyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603; &#x1f604;&#x1f605;&#x1f606;&#x1f607;
+&#x1f608;&#x1f609;&#x1f60a;&#x1f60b; &#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+abcdefghijklmnopqrstuvwxyz
+&#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/emoji-2-ref.html b/layout/reftests/line-breaking/emoji-2-ref.html
new file mode 100644
index 0000000000..8aaca9548b
--- /dev/null
+++ b/layout/reftests/line-breaking/emoji-2-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+.test {
+ width: 5em;
+ border: 1px solid silver;
+ margin: 1em;
+ padding: 2px;
+}
+.wrapped {
+ word-wrap: break-word;
+}
+.nowrap {
+ white-space: nowrap;
+}
+</style>
+</head>
+<body>
+The emoji faces should wrap within the box; the series of flags should not wrap.
+<div class="test">
+ <span class="wrapped">&#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;</span><!--
+--><span class="nowrap">&#x1f1ef;&#x1f1f5;&#x1f1f0;&#x1f1f7;&#x1f1e9;&#x1f1ea;&#x1f1e8;&#x1f1f3;<!--
+-->&#x1f1fa;&#x1f1f8;&#x1f1eb;&#x1f1f7;&#x1f1ea;&#x1f1f8;&#x1f1ee;&#x1f1f9;<!--
+-->&#x1f1f7;&#x1f1fa;&#x1f1ec;&#x1f1e7;</span>
+</div>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/emoji-2.html b/layout/reftests/line-breaking/emoji-2.html
new file mode 100644
index 0000000000..d5fab8b228
--- /dev/null
+++ b/layout/reftests/line-breaking/emoji-2.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<style>
+.test {
+ width: 5em;
+ border: 1px solid silver;
+ margin: 1em;
+ padding: 2px;
+}
+</style>
+</head>
+<body>
+The emoji faces should wrap within the box; the series of flags should not wrap.
+<div class=test>
+ &#x1f600;&#x1f601;&#x1f602;&#x1f603;&#x1f604;&#x1f605;&#x1f606;&#x1f607;<!--
+-->&#x1f608;&#x1f609;&#x1f60a;&#x1f60b;&#x1f60c;&#x1f60d;&#x1f60e;&#x1f60f;<!--
+-->&#x1f1ef;&#x1f1f5;&#x1f1f0;&#x1f1f7;&#x1f1e9;&#x1f1ea;&#x1f1e8;&#x1f1f3;<!--
+-->&#x1f1fa;&#x1f1f8;&#x1f1eb;&#x1f1f7;&#x1f1ea;&#x1f1f8;&#x1f1ee;&#x1f1f9;<!--
+-->&#x1f1f7;&#x1f1fa;&#x1f1ec;&#x1f1e7;
+</div>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/hyphens-1-ref.html b/layout/reftests/line-breaking/hyphens-1-ref.html
new file mode 100644
index 0000000000..a77f8c0079
--- /dev/null
+++ b/layout/reftests/line-breaking/hyphens-1-ref.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>ab-<br>ab</p>
+<p>a-ab</p>
+<p>ab-a</p>
+<p>abcdef--<br>abcdef</p>
+<p>------abcdef<p>
+
+<!-- U+058A is ARMENIAN HYPHEN -->
+<p>ab&#x058A;<br>ab</p>
+<p>a&#x058A;ab</p>
+<p>ab&#x058A;a</p>
+<p>abcdef&#x058A;&#x058A;<br>abcdef</p>
+<p>&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;abcdef<p>
+
+<!-- U+2010 is HYPHEN -->
+<p>ab&#x2010;<br>ab</p>
+<p>a&#x2010;ab</p>
+<p>ab&#x2010;a</p>
+<p>abcdef&#x2010;&#x2010;<br>abcdef</p>
+<p>&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;abcdef<p>
+
+<!-- U+2012 is FIGURE DASH -->
+<p>ab&#x2012;<br>ab</p>
+<p>a&#x2012;ab</p>
+<p>ab&#x2012;a</p>
+<p>abcdef&#x2012;&#x2012;<br>abcdef</p>
+<p>&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;abcdef<p>
+
+<p>ab&ndash;<br>ab</p>
+<p>a&ndash;ab</p>
+<p>ab&ndash;a</p>
+<p>abcdef&ndash;&ndash;<br>abcdef</p>
+<p>&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;abcdef<p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/hyphens-1.html b/layout/reftests/line-breaking/hyphens-1.html
new file mode 100644
index 0000000000..d836b7c09d
--- /dev/null
+++ b/layout/reftests/line-breaking/hyphens-1.html
@@ -0,0 +1,41 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>ab-ab</p>
+<p>a-ab</p>
+<p>ab-a</p>
+<p>abcdef--abcdef</p>
+<p>------abcdef<p>
+
+<!-- U+058A is ARMENIAN HYPHEN -->
+<p>ab&#x058A;ab</p>
+<p>a&#x058A;ab</p>
+<p>ab&#x058A;a</p>
+<p>abcdef&#x058A;&#x058A;abcdef</p>
+<p>&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;abcdef<p>
+
+<!-- U+2010 is HYPHEN -->
+<p>ab&#x2010;ab</p>
+<p>a&#x2010;ab</p>
+<p>ab&#x2010;a</p>
+<p>abcdef&#x2010;&#x2010;abcdef</p>
+<p>&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;abcdef<p>
+
+<!-- U+2012 is FIGURE DASH -->
+<p>ab&#x2012;ab</p>
+<p>a&#x2012;ab</p>
+<p>ab&#x2012;a</p>
+<p>abcdef&#x2012;&#x2012;abcdef</p>
+<p>&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;abcdef<p>
+
+<p>ab&ndash;ab</p>
+<p>a&ndash;ab</p>
+<p>ab&ndash;a</p>
+<p>abcdef&ndash;&ndash;abcdef</p>
+<p>&ndash;&ndash;&ndash;&ndash;&ndash;&ndash;abcdef<p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/hyphens-2-ref.html b/layout/reftests/line-breaking/hyphens-2-ref.html
new file mode 100644
index 0000000000..e06e764a9d
--- /dev/null
+++ b/layout/reftests/line-breaking/hyphens-2-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p { margin: 5px 1em; }
+</style>
+</head>
+<body>
+
+<!-- bug 827779:
+ Allow break after hyphen even when there is adjacent closing punctuation
+ before the hyphen, or opening punctuation after it. -->
+<p>
+ extra-<br>“special”<br>
+ “extra”-<br>special<br>
+ “extra”-<br>“special”<br>
+ extra-<br>«special»<br>
+ «extra»-<br>special<br>
+ «extra»-<br>«special»<br>
+ extra-<br>(special)<br>
+ (extra)-<br>special<br>
+ (extra)-<br>(special)
+</p>
+
+<!-- but not in variants such as these: -->
+<p>
+ (extra-)special<br>
+ extra(-special)
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/hyphens-2.html b/layout/reftests/line-breaking/hyphens-2.html
new file mode 100644
index 0000000000..edcbde22da
--- /dev/null
+++ b/layout/reftests/line-breaking/hyphens-2.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p { margin: 5px 1em; width: 0px; }
+</style>
+</head>
+<body>
+
+<!-- bug 827779:
+ Allow break after hyphen even when there is adjacent closing punctuation
+ before the hyphen, or opening punctuation after it. -->
+<p>
+ extra-“special”<br>
+ “extra”-special<br>
+ “extra”-“special”<br>
+ extra-«special»<br>
+ «extra»-special<br>
+ «extra»-«special»<br>
+ extra-(special)<br>
+ (extra)-special<br>
+ (extra)-(special)
+</p>
+
+<!-- but not in variants such as these: -->
+<p>
+ (extra-)special<br>
+ extra(-special)
+</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-1-ref.html b/layout/reftests/line-breaking/ja-1-ref.html
new file mode 100644
index 0000000000..8c066b6124
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-1-ref.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body lang="ja">
+
+<p>&#x3042;<br>&#x3044;<br>&#x3046;</p>
+<p>&#x4E0A;<br>&#x4E2D;<br>&#x4E0B;</p>
+<p>&#x3042;&#x3001;<br>&#x3044;&#x3002;<br>&#x3046;&#x3002;&#x3002;&#x3002;</p>
+<p>&#x3042;&#x3063;&#x3063;&#x3063;&#x3063;<br>&#x3044;</p>
+<p>&#x304D;&#x3083;<br>&#x304D;&#x3085;<br>&#x304D;&#x3087;</p>
+<p>&#x3041;&#x3043;&#x3045;&#x3047;&#x3049;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-1.html b/layout/reftests/line-breaking/ja-1.html
new file mode 100644
index 0000000000..40475dbc7d
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-1.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body lang="ja">
+
+<p>&#x3042;&#x3044;&#x3046;</p>
+<p>&#x4E0A;&#x4E2D;&#x4E0B;</p>
+<p>&#x3042;&#x3001;&#x3044;&#x3002;&#x3046;&#x3002;&#x3002;&#x3002;</p>
+<p>&#x3042;&#x3063;&#x3063;&#x3063;&#x3063;&#x3044;</p>
+<p>&#x304D;&#x3083;&#x304D;&#x3085;&#x304D;&#x3087;</p>
+<p>&#x3041;&#x3043;&#x3045;&#x3047;&#x3049;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-2-ref.html b/layout/reftests/line-breaking/ja-2-ref.html
new file mode 100644
index 0000000000..5344c92ac9
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-2-ref.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body lang="ja">
+
+<p>&#x3042;<br>&#x300C;&#x3044;&#x300D;<br>&#x3046;</p>
+<p>&#x3042;<br>&#x300E;&#x3044;&#x300F;<br>&#x3046;</p>
+<p>&#x3042;<br>&#x300C;&#x3044;&#x3002;&#x300D;<br>&#x3046;</p>
+<p>&#x3042;<br>&#x300E;&#x3044;&#x3002;&#x300F;<br>&#x3046;</p>
+<p>&#x3042;<br>&#x300C;&#x300E;&#x3044;&#x3002;&#x300F;&#x300D;<br>&#x3046;</p>
+<p>&#x300C;&#x3042;<br>&#x3044;&#x300D;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-2.html b/layout/reftests/line-breaking/ja-2.html
new file mode 100644
index 0000000000..c5ce5bf785
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-2.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body lang="ja">
+
+<p>&#x3042;&#x300C;&#x3044;&#x300D;&#x3046;</p>
+<p>&#x3042;&#x300E;&#x3044;&#x300F;&#x3046;</p>
+<p>&#x3042;&#x300C;&#x3044;&#x3002;&#x300D;&#x3046;</p>
+<p>&#x3042;&#x300E;&#x3044;&#x3002;&#x300F;&#x3046;</p>
+<p>&#x3042;&#x300C;&#x300E;&#x3044;&#x3002;&#x300F;&#x300D;&#x3046;</p>
+<p>&#x300C;&#x3042;&#x3044;&#x300D;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-3-ref.html b/layout/reftests/line-breaking/ja-3-ref.html
new file mode 100644
index 0000000000..0eac869bce
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-3-ref.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body lang="ja">
+
+<p>&#xFF71;<br>&#xFF72;<br>&#xFF73;</p>
+<p>&#xFF71;&#xFF64;<br>&#xFF72;&#xFF61;<br>&#xFF73;&#xFF61;&#xFF61;&#xFF61;</p>
+<p>&#xFF71;&#xFF6F;&#xFF6F;&#xFF6F;&#xFF6F;<br>&#xFF72;</p>
+<p>&#xFF77;&#xFF6C;<br>&#xFF77;&#xFF6D;<br>&#xFF77;&#xFF6E;</p>
+<p>&#xFF67;&#xFF68;&#xFF69;&#xFF6A;&#xFF6B;</p>
+<p>&#xFF76;&#xFF9E;<br>&#xFF77;&#xFF9E;<br>&#xFF78;&#xFF9E;</p>
+<p>&#xFF8A;&#xFF9F;<br>&#xFF8B;&#xFF9F;<br>&#xFF8C;&#xFF9F;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/ja-3.html b/layout/reftests/line-breaking/ja-3.html
new file mode 100644
index 0000000000..3d1b1087fd
--- /dev/null
+++ b/layout/reftests/line-breaking/ja-3.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body lang="ja">
+
+<p>&#xFF71;&#xFF72;&#xFF73;</p>
+<p>&#xFF71;&#xFF64;&#xFF72;&#xFF61;&#xFF73;&#xFF61;&#xFF61;&#xFF61;</p>
+<p>&#xFF71;&#xFF6F;&#xFF6F;&#xFF6F;&#xFF6F;&#xFF72;</p>
+<p>&#xFF77;&#xFF6C;&#xFF77;&#xFF6D;&#xFF77;&#xFF6E;</p>
+<p>&#xFF67;&#xFF68;&#xFF69;&#xFF6A;&#xFF6B;</p>
+<p>&#xFF76;&#xFF9E;&#xFF77;&#xFF9E;&#xFF78;&#xFF9E;</p>
+<p>&#xFF8A;&#xFF9F;&#xFF8B;&#xFF9F;&#xFF8C;&#xFF9F;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/khmer-1-ref.html b/layout/reftests/line-breaking/khmer-1-ref.html
new file mode 100644
index 0000000000..24f1a14056
--- /dev/null
+++ b/layout/reftests/line-breaking/khmer-1-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css"> div { width: 1em; } </style>
+ </head>
+ <body lang="km">
+ <div>aaaaaaaaaa&#x17D8;<br>bbbbbbbbbb</div>
+ <div>aaaaaaaaaa&#x17DA;<br>bbbbbbbbbb</div>
+ </body>
+</html>
diff --git a/layout/reftests/line-breaking/khmer-1.html b/layout/reftests/line-breaking/khmer-1.html
new file mode 100644
index 0000000000..9c63293228
--- /dev/null
+++ b/layout/reftests/line-breaking/khmer-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+ <style type="text/css"> div { width: 1em; } </style>
+ </head>
+ <body lang="km">
+ <div>aaaaaaaaaa&#x17D8;bbbbbbbbbb</div>
+ <div>aaaaaaaaaa&#x17DA;bbbbbbbbbb</div>
+ </body>
+</html>
diff --git a/layout/reftests/line-breaking/leaders-1-ref.html b/layout/reftests/line-breaking/leaders-1-ref.html
new file mode 100644
index 0000000000..6cf8286c0c
--- /dev/null
+++ b/layout/reftests/line-breaking/leaders-1-ref.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<!-- U+2024 is ONE DOT LEADER -->
+<p>abcdef&#x2024;&#x2024;&#x2024;<br>abcdef</p>
+<p>abcdef&#x2024;<br>abcdef</p>
+<p>abcdef&#x2024; <br>abcdef</p>
+<p>abcdef <br>&#x2024;abcdef</p>
+
+<!-- U+2025 is TWO DOT LEADER -->
+<p>abcdef&#x2025;&#x2025;&#x2025;<br>abcdef</p>
+<p>abcdef&#x2025;<br>abcdef</p>
+<p>abcdef&#x2025; <br>abcdef</p>
+<p>abcdef <br>&#x2025;abcdef</p>
+
+<!-- U+2026 is HORIZONTAL ELLIPSIS -->
+<p>abcdef&#x2026;&#x2026;&#x2026;<br>abcdef</p>
+<p>abcdef&#x2026;<br>abcdef</p>
+<p>abcdef&#x2026; <br>abcdef</p>
+<p>abcdef <br>&#x2026;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/leaders-1.html b/layout/reftests/line-breaking/leaders-1.html
new file mode 100644
index 0000000000..2e8933b1b5
--- /dev/null
+++ b/layout/reftests/line-breaking/leaders-1.html
@@ -0,0 +1,26 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<!-- U+2024 is ONE DOT LEADER -->
+<p>abcdef&#x2024;&#x2024;&#x2024;abcdef</p>
+<p>abcdef&#x2024;abcdef</p>
+<p>abcdef&#x2024; abcdef</p>
+<p>abcdef &#x2024;abcdef</p> <!-- no break after the leader in this case -->
+
+<!-- U+2025 is TWO DOT LEADER -->
+<p>abcdef&#x2025;&#x2025;&#x2025;abcdef</p>
+<p>abcdef&#x2025;abcdef</p>
+<p>abcdef&#x2025; abcdef</p>
+<p>abcdef &#x2025;abcdef</p> <!-- no break after the leader in this case -->
+
+<!-- U+2026 is HORIZONTAL ELLIPSIS -->
+<p>abcdef&#x2026;&#x2026;&#x2026;abcdef</p>
+<p>abcdef&#x2026;abcdef</p>
+<p>abcdef&#x2026; abcdef</p>
+<p>abcdef &#x2026;abcdef</p> <!-- no break after the ellipsis in this case -->
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/markup-src-1-ref.html b/layout/reftests/line-breaking/markup-src-1-ref.html
new file mode 100644
index 0000000000..e56a1d225b
--- /dev/null
+++ b/layout/reftests/line-breaking/markup-src-1-ref.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>&lt;table&gt;<br>&lt;tr&gt;&lt;td&gt;<br>&lt;/td&gt;&lt;/tr&gt;<br>&lt;/table&gt;</p>
+<p>&lt;a<br> href=&quot;abcdef&quot;&gt;<br>&lt;span&gt;abcdef&lt;img<br> src=&quot;abcdef&quot;<br> /&gt;&lt;/span&gt;&lt;/a&gt;</p>
+<p>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
+<p>&amp;#123456;&amp;#123456;&amp;#123456;&amp;#123456;</p>
+<p>&amp;#x00FF;&amp;#x00FF;&amp;#x00FF;&amp;#x00FF;</p>
+<p>abcdef&lt;!--<br> abcdef<br> --&gt;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/markup-src-1.html b/layout/reftests/line-breaking/markup-src-1.html
new file mode 100644
index 0000000000..af7907acfd
--- /dev/null
+++ b/layout/reftests/line-breaking/markup-src-1.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</p>
+<p>&lt;a href=&quot;abcdef&quot;&gt;&lt;span&gt;abcdef&lt;img src=&quot;abcdef&quot; /&gt;&lt;/span&gt;&lt;/a&gt;</p>
+<p>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;</p>
+<p>&amp;#123456;&amp;#123456;&amp;#123456;&amp;#123456;</p>
+<p>&amp;#x00FF;&amp;#x00FF;&amp;#x00FF;&amp;#x00FF;</p>
+<p>abcdef&lt;!-- abcdef --&gt;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/non-breakable-1-ref.html b/layout/reftests/line-breaking/non-breakable-1-ref.html
new file mode 100644
index 0000000000..b8a1fb87b8
--- /dev/null
+++ b/layout/reftests/line-breaking/non-breakable-1-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } p > span { background-color: silver; } </style>
+</head>
+<body>
+
+<p>abcdef&nbsp;abcdef</p>
+<p>abcdef)&nbsp;(abcdef</p>
+<p>abcdef<br>&nbsp;abcdef</p>
+<p><span>abcdef&nbsp;<br>abcdef</span></p>
+<p>abcdef&nbsp;&nbsp;&nbsp;abcdef</p>
+
+<!-- U+2007 is FIGURE SPACE -->
+<p>abcdef&#x2007;abcdef</p>
+<p>abcdef)&#x2007;(abcdef</p>
+<p>abcdef<br>&#x2007;abcdef</p>
+<p><span>abcdef&#x2007;<br>abcdef</span></p>
+<p>abcdef&#x2007;&#x2007;&#x2007;abcdef</p>
+
+<!-- U+2011 is NON-BREAKING HYPHEN -->
+<p>abcdef&#x2011;abcdef</p>
+<p>abcdef)&#x2011;(abcdef</p>
+<p>abcdef<br>&#x2011;abcdef</p>
+<p>abcdef&#x2011;<br>abcdef</p>
+<p>abcdef&#x2011;&#x2011;&#x2011;abcdef</p>
+
+<!-- U+202F is NARROW NO-BREAK SPACE -->
+<p>abcdef&#x202F;abcdef</p>
+<p>abcdef)&#x202F;(abcdef</p>
+<p>abcdef<br>&#x202F;abcdef</p>
+<p><span>abcdef&#x202F;<br>abcdef</span></p>
+<p>abcdef&#x202F;&#x202F;&#x202F;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/non-breakable-1.html b/layout/reftests/line-breaking/non-breakable-1.html
new file mode 100644
index 0000000000..3ee9222c68
--- /dev/null
+++ b/layout/reftests/line-breaking/non-breakable-1.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } p > span { background-color: silver; } </style>
+</head>
+<body>
+
+<p>abcdef&nbsp;abcdef</p>
+<p>abcdef)&nbsp;(abcdef</p>
+<p>abcdef &nbsp;abcdef</p>
+<p><span>abcdef&nbsp; abcdef</span></p>
+<p>abcdef&nbsp;&nbsp;&nbsp;abcdef</p>
+
+<!-- U+2007 is FIGURE SPACE -->
+<p>abcdef&#x2007;abcdef</p>
+<p>abcdef)&#x2007;(abcdef</p>
+<p>abcdef &#x2007;abcdef</p>
+<p><span>abcdef&#x2007; abcdef</span></p>
+<p>abcdef&#x2007;&#x2007;&#x2007;abcdef</p>
+
+<!-- U+2011 is NON-BREAKING HYPHEN -->
+<p>abcdef&#x2011;abcdef</p>
+<p>abcdef)&#x2011;(abcdef</p>
+<p>abcdef &#x2011;abcdef</p>
+<p>abcdef&#x2011; abcdef</p>
+<p>abcdef&#x2011;&#x2011;&#x2011;abcdef</p>
+
+<!-- U+202F is NARROW NO-BREAK SPACE -->
+<p>abcdef&#x202F;abcdef</p>
+<p>abcdef)&#x202F;(abcdef</p>
+<p>abcdef &#x202F;abcdef</p>
+<p><span>abcdef&#x202F; abcdef</span></p>
+<p>abcdef&#x202F;&#x202F;&#x202F;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/non-breakable-2-ref.html b/layout/reftests/line-breaking/non-breakable-2-ref.html
new file mode 100644
index 0000000000..3e8302de11
--- /dev/null
+++ b/layout/reftests/line-breaking/non-breakable-2-ref.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css"> body {text-rendering: optimizeLegibility;} p { margin: 5px 1em; width: 0; white-space: nowrap; } p > span { background-color: silver; } </style>
+</head>
+<body>
+
+<p>abcdef&nbsp;abcdef</p>
+<p>abcdef)&nbsp;(abcdef</p>
+<p>abcdef<br>&nbsp;abcdef</p>
+<p><span>abcdef&nbsp;<br>abcdef</span></p>
+<p>abcdef&nbsp;&nbsp;&nbsp;abcdef</p>
+
+<!-- U+2007 is FIGURE SPACE -->
+<p>abcdef&#x2007;abcdef</p>
+<p>abcdef)&#x2007;(abcdef</p>
+<p>abcdef<br>&#x2007;abcdef</p>
+<p><span>abcdef&#x2007;<br>abcdef</span></p>
+<p>abcdef&#x2007;&#x2007;&#x2007;abcdef</p>
+
+<!-- U+2011 is NON-BREAKING HYPHEN -->
+<p>abcdef&#x2011;abcdef</p>
+<p>abcdef)&#x2011;(abcdef</p>
+<p>abcdef<br>&#x2011;abcdef</p>
+<p>abcdef&#x2011;<br>abcdef</p>
+<p>abcdef&#x2011;&#x2011;&#x2011;abcdef</p>
+
+<!-- U+202F is NARROW NO-BREAK SPACE -->
+<p>abcdef&#x202F;abcdef</p>
+<p>abcdef)&#x202F;(abcdef</p>
+<p>abcdef<br>&#x202F;abcdef</p>
+<p><span>abcdef&#x202F;<br>abcdef</span></p>
+<p>abcdef&#x202F;&#x202F;&#x202F;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/non-breakable-2.html b/layout/reftests/line-breaking/non-breakable-2.html
new file mode 100644
index 0000000000..8bc301bbcb
--- /dev/null
+++ b/layout/reftests/line-breaking/non-breakable-2.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<style type="text/css"> body {text-rendering: optimizeLegibility;} p { margin: 5px 1em; width: 0; } p > span { background-color: silver; } </style>
+</head>
+<body>
+
+<p>abcdef&nbsp;abcdef</p>
+<p>abcdef)&nbsp;(abcdef</p>
+<p>abcdef &nbsp;abcdef</p>
+<p><span>abcdef&nbsp; abcdef</span></p>
+<p>abcdef&nbsp;&nbsp;&nbsp;abcdef</p>
+
+<!-- U+2007 is FIGURE SPACE -->
+<p>abcdef&#x2007;abcdef</p>
+<p>abcdef)&#x2007;(abcdef</p>
+<p>abcdef &#x2007;abcdef</p>
+<p><span>abcdef&#x2007; abcdef</span></p>
+<p>abcdef&#x2007;&#x2007;&#x2007;abcdef</p>
+
+<!-- U+2011 is NON-BREAKING HYPHEN -->
+<p>abcdef&#x2011;abcdef</p>
+<p>abcdef)&#x2011;(abcdef</p>
+<p>abcdef &#x2011;abcdef</p>
+<p>abcdef&#x2011; abcdef</p>
+<p>abcdef&#x2011;&#x2011;&#x2011;abcdef</p>
+
+<!-- U+202F is NARROW NO-BREAK SPACE -->
+<p>abcdef&#x202F;abcdef</p>
+<p>abcdef)&#x202F;(abcdef</p>
+<p>abcdef &#x202F;abcdef</p>
+<p><span>abcdef&#x202F; abcdef</span></p>
+<p>abcdef&#x202F;&#x202F;&#x202F;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/numerics-1-ref.html b/layout/reftests/line-breaking/numerics-1-ref.html
new file mode 100644
index 0000000000..9d8990f2fc
--- /dev/null
+++ b/layout/reftests/line-breaking/numerics-1-ref.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>01234567890123456789</p>
+<p>01,234,567,890,123,456,789</p>
+<p>01.234.567.890.123.456.789</p>
+
+<p>-01234567890123456789</p>
+<p>-01,234,567,890,123,456,789</p>
+<p>-01.234.567.890.123.456.789</p>
+
+<p>+01234567890123456789</p>
+<p>+01,234,567,890,123,456,789</p>
+<p>+01.234.567.890.123.456.789</p>
+
+<p>&#xB1;01234567890123456789</p>
+<p>&#xB1;01,234,567,890,123,456,789</p>
+<p>&#xB1;01.234.567.890.123.456.789</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/numerics-1.html b/layout/reftests/line-breaking/numerics-1.html
new file mode 100644
index 0000000000..470ff4491d
--- /dev/null
+++ b/layout/reftests/line-breaking/numerics-1.html
@@ -0,0 +1,24 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>01234567890123456789</p>
+<p>01,234,567,890,123,456,789</p>
+<p>01.234.567.890.123.456.789</p>
+
+<p>-01234567890123456789</p>
+<p>-01,234,567,890,123,456,789</p>
+<p>-01.234.567.890.123.456.789</p>
+
+<p>+01234567890123456789</p>
+<p>+01,234,567,890,123,456,789</p>
+<p>+01.234.567.890.123.456.789</p>
+
+<p>&#xB1;01234567890123456789</p>
+<p>&#xB1;01,234,567,890,123,456,789</p>
+<p>&#xB1;01.234.567.890.123.456.789</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/parentheses-1-ref.html b/layout/reftests/line-breaking/parentheses-1-ref.html
new file mode 100644
index 0000000000..a5812ef1fa
--- /dev/null
+++ b/layout/reftests/line-breaking/parentheses-1-ref.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef(abcdef)abcdef</p>
+<p>abcde),</p>
+<p>abcde).</p>
+<p>abcde)!</p>
+<p>abcde)?</p>
+
+<p>abcdef[abcdef]abcdef</p>
+<p>abcde],</p>
+<p>abcde].</p>
+<p>abcde]!</p>
+<p>abcde]?</p>
+
+<p>abcdef{abcdef}abcdef</p>
+<p>abcde},</p>
+<p>abcde}.</p>
+<p>abcde}!</p>
+<p>abcde}?</p>
+
+<p>abcdef&lt;abcdef&gt;abcdef</p>
+<p>abcde&gt;,</p>
+<p>abcde&gt;.</p>
+<p>abcde&gt;!</p>
+<p>abcde&gt;?</p>
+
+<p>abcdef(abcd)<br>[abcd]<br>{abcd}<br>&lt;abcd&gt;<br>(abcd)<br>(abcd)<br>[abcd]<br>[abcd]<br>{abcd}<br>{abcd}<br>&lt;abcd&gt;<br>&lt;abcd&gt;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/parentheses-1.html b/layout/reftests/line-breaking/parentheses-1.html
new file mode 100644
index 0000000000..598be9d76f
--- /dev/null
+++ b/layout/reftests/line-breaking/parentheses-1.html
@@ -0,0 +1,34 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef(abcdef)abcdef</p>
+<p>abcde),</p>
+<p>abcde).</p>
+<p>abcde)!</p>
+<p>abcde)?</p>
+
+<p>abcdef[abcdef]abcdef</p>
+<p>abcde],</p>
+<p>abcde].</p>
+<p>abcde]!</p>
+<p>abcde]?</p>
+
+<p>abcdef{abcdef}abcdef</p>
+<p>abcde},</p>
+<p>abcde}.</p>
+<p>abcde}!</p>
+<p>abcde}?</p>
+
+<p>abcdef&lt;abcdef&gt;abcdef</p>
+<p>abcde&gt;,</p>
+<p>abcde&gt;.</p>
+<p>abcde&gt;!</p>
+<p>abcde&gt;?</p>
+
+<p>abcdef(abcd)[abcd]{abcd}&lt;abcd&gt;(abcd)(abcd)[abcd][abcd]{abcd}{abcd}&lt;abcd&gt;&lt;abcd&gt;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-1-ref.html b/layout/reftests/line-breaking/punctuation-open-1-ref.html
new file mode 100644
index 0000000000..5b9640e217
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-1-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef,<br>(abcdef</p>
+<p>abcdef,<br>[abcdef</p>
+<p>abcdef,<br>{abcdef</p>
+<p>abcdef,<br>{abcdef</p>
+<p>abcdef,<br>&#xFF62;abcdef</p>
+<p>abcdef,<br>&#xFF08;abcdef</p>
+<p>abcdef,<br>&#xFF3B;abcdef</p>
+<p>abcdef,<br>&#xFF5B;abcdef</p>
+<p>abcdef,<br>&#x300C;abcdef</p>
+
+<p>abcdef.<br>(abcdef</p>
+<p>abcdef.<br>[abcdef</p>
+<p>abcdef.<br>{abcdef</p>
+<p>abcdef.<br>&#xFF62;abcdef</p>
+<p>abcdef.<br>&#xFF08;abcdef</p>
+<p>abcdef.<br>&#xFF3B;abcdef</p>
+<p>abcdef.<br>&#xFF5B;abcdef</p>
+<p>abcdef.<br>&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-1.html b/layout/reftests/line-breaking/punctuation-open-1.html
new file mode 100644
index 0000000000..6eecc17bf1
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-1.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef,(abcdef</p>
+<p>abcdef,[abcdef</p>
+<p>abcdef,{abcdef</p>
+<p>abcdef,{abcdef</p>
+<p>abcdef,&#xFF62;abcdef</p>
+<p>abcdef,&#xFF08;abcdef</p>
+<p>abcdef,&#xFF3B;abcdef</p>
+<p>abcdef,&#xFF5B;abcdef</p>
+<p>abcdef,&#x300C;abcdef</p>
+
+<p>abcdef.(abcdef</p>
+<p>abcdef.[abcdef</p>
+<p>abcdef.{abcdef</p>
+<p>abcdef.&#xFF62;abcdef</p>
+<p>abcdef.&#xFF08;abcdef</p>
+<p>abcdef.&#xFF3B;abcdef</p>
+<p>abcdef.&#xFF5B;abcdef</p>
+<p>abcdef.&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-2-ref.html b/layout/reftests/line-breaking/punctuation-open-2-ref.html
new file mode 100644
index 0000000000..74cedd5805
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-2-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF64;<br>(abcdef</p>
+<p>abcdef&#xFF64;<br>[abcdef</p>
+<p>abcdef&#xFF64;<br>{abcdef</p>
+<p>abcdef&#xFF64;<br>{abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF64;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF64;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#xFF61;<br>(abcdef</p>
+<p>abcdef&#xFF61;<br>[abcdef</p>
+<p>abcdef&#xFF61;<br>{abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF61;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF61;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-2.html b/layout/reftests/line-breaking/punctuation-open-2.html
new file mode 100644
index 0000000000..ae65acfac1
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-2.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF64;(abcdef</p>
+<p>abcdef&#xFF64;[abcdef</p>
+<p>abcdef&#xFF64;{abcdef</p>
+<p>abcdef&#xFF64;{abcdef</p>
+<p>abcdef&#xFF64;&#xFF62;abcdef</p>
+<p>abcdef&#xFF64;&#xFF08;abcdef</p>
+<p>abcdef&#xFF64;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF64;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF64;&#x300C;abcdef</p>
+
+<p>abcdef&#xFF61;(abcdef</p>
+<p>abcdef&#xFF61;[abcdef</p>
+<p>abcdef&#xFF61;{abcdef</p>
+<p>abcdef&#xFF61;&#xFF62;abcdef</p>
+<p>abcdef&#xFF61;&#xFF08;abcdef</p>
+<p>abcdef&#xFF61;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF61;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF61;&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-3-ref.html b/layout/reftests/line-breaking/punctuation-open-3-ref.html
new file mode 100644
index 0000000000..782900a9f3
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-3-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF0C;<br>(abcdef</p>
+<p>abcdef&#xFF0C;<br>[abcdef</p>
+<p>abcdef&#xFF0C;<br>{abcdef</p>
+<p>abcdef&#xFF0C;<br>{abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0C;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#xFF0E;<br>(abcdef</p>
+<p>abcdef&#xFF0E;<br>[abcdef</p>
+<p>abcdef&#xFF0E;<br>{abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF62;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF08;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0E;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-3.html b/layout/reftests/line-breaking/punctuation-open-3.html
new file mode 100644
index 0000000000..985d098231
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-3.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#xFF0C;(abcdef</p>
+<p>abcdef&#xFF0C;[abcdef</p>
+<p>abcdef&#xFF0C;{abcdef</p>
+<p>abcdef&#xFF0C;{abcdef</p>
+<p>abcdef&#xFF0C;&#xFF62;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF08;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0C;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0C;&#x300C;abcdef</p>
+
+<p>abcdef&#xFF0E;(abcdef</p>
+<p>abcdef&#xFF0E;[abcdef</p>
+<p>abcdef&#xFF0E;{abcdef</p>
+<p>abcdef&#xFF0E;&#xFF62;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF08;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF3B;abcdef</p>
+<p>abcdef&#xFF0E;&#xFF5B;abcdef</p>
+<p>abcdef&#xFF0E;&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-4-ref.html b/layout/reftests/line-breaking/punctuation-open-4-ref.html
new file mode 100644
index 0000000000..718f2be433
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-4-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef&#x3001;<br>(abcdef</p>
+<p>abcdef&#x3001;<br>[abcdef</p>
+<p>abcdef&#x3001;<br>{abcdef</p>
+<p>abcdef&#x3001;<br>{abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF62;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF08;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#x3001;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#x3001;<br>&#x300C;abcdef</p>
+
+<p>abcdef&#x3002;<br>(abcdef</p>
+<p>abcdef&#x3002;<br>[abcdef</p>
+<p>abcdef&#x3002;<br>{abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF62;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF08;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF3B;abcdef</p>
+<p>abcdef&#x3002;<br>&#xFF5B;abcdef</p>
+<p>abcdef&#x3002;<br>&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/punctuation-open-4.html b/layout/reftests/line-breaking/punctuation-open-4.html
new file mode 100644
index 0000000000..6c2a8912ac
--- /dev/null
+++ b/layout/reftests/line-breaking/punctuation-open-4.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef&#x3001;(abcdef</p>
+<p>abcdef&#x3001;[abcdef</p>
+<p>abcdef&#x3001;{abcdef</p>
+<p>abcdef&#x3001;{abcdef</p>
+<p>abcdef&#x3001;&#xFF62;abcdef</p>
+<p>abcdef&#x3001;&#xFF08;abcdef</p>
+<p>abcdef&#x3001;&#xFF3B;abcdef</p>
+<p>abcdef&#x3001;&#xFF5B;abcdef</p>
+<p>abcdef&#x3001;&#x300C;abcdef</p>
+
+<p>abcdef&#x3002;(abcdef</p>
+<p>abcdef&#x3002;[abcdef</p>
+<p>abcdef&#x3002;{abcdef</p>
+<p>abcdef&#x3002;&#xFF62;abcdef</p>
+<p>abcdef&#x3002;&#xFF08;abcdef</p>
+<p>abcdef&#x3002;&#xFF3B;abcdef</p>
+<p>abcdef&#x3002;&#xFF5B;abcdef</p>
+<p>abcdef&#x3002;&#x300C;abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/quotationmarks-1-ref.html b/layout/reftests/line-breaking/quotationmarks-1-ref.html
new file mode 100644
index 0000000000..b07a0f3504
--- /dev/null
+++ b/layout/reftests/line-breaking/quotationmarks-1-ref.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef"abc'abc`abc&#x2018;abc&#x2019;abc&#x201A;abc&#x201B;abc&#x201C;abc&#x201D;abc&#x201E;abc&#x201F;abcdef</p>
+<p>abcdef,"abc,'abc,`abc,&#x2018;abc,&#x2019;abc,&#x201A;abc,&#x201B;abc,&#x201C;abc,&#x201D;abc,&#x201E;abc,&#x201F;abcdef</p>
+<p>abcdef."abc.'abc.`abc.&#x2018;abc.&#x2019;abc.&#x201A;abc.&#x201B;abc.&#x201C;abc.&#x201D;abc.&#x201E;abc.&#x201F;abcdef</p>
+<p>abcdef..."abc...'abc...`abc...&#x2018;abc...&#x2019;abc...&#x201A;abc...&#x201B;abc...&#x201C;abc...&#x201D;abc...&#x201E;abc...&#x201F;abcdef</p>
+<p>abcdef!"abc!'abc!`abc!&#x2018;abc!&#x2019;abc!&#x201A;abc!&#x201B;abc!&#x201C;abc!&#x201D;abc!&#x201E;abc!&#x201F;abcdef</p>
+<p>abcdef?"abc?'abc?`abc?&#x2018;abc?&#x2019;abc?&#x201A;abc?&#x201B;abc?&#x201C;abc?&#x201D;abc?&#x201E;abc?&#x201F;abcdef</p>
+<p>abcdef",abc',abc`,abc&#x2018;,abc&#x2019;,abc&#x201A;,abc&#x201B;,abc&#x201C;,abc&#x201D;,abc&#x201E;,abc&#x201F;,abcdef</p>
+<p>abcdef".abc'.abc`.abc&#x2018;.abc&#x2019;.abc&#x201A;.abc&#x201B;.abc&#x201C;.abc&#x201D;.abc&#x201E;.abc&#x201F;.abcdef</p>
+<p>abcdef"!abc'!abc`!abc&#x2018;!abc&#x2019;!abc&#x201A;!abc&#x201B;!abc&#x201C;!abc&#x201D;!abc&#x201E;!abc&#x201F;!abcdef</p>
+<p>abcdef"?abc'?abc`?abc&#x2018;?abc&#x2019;?abc&#x201A;?abc&#x201B;?abc&#x201C;?abc&#x201D;?abc&#x201E;?abc&#x201F;?abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/quotationmarks-1.html b/layout/reftests/line-breaking/quotationmarks-1.html
new file mode 100644
index 0000000000..ad273cb4ee
--- /dev/null
+++ b/layout/reftests/line-breaking/quotationmarks-1.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef"abc'abc`abc&#x2018;abc&#x2019;abc&#x201A;abc&#x201B;abc&#x201C;abc&#x201D;abc&#x201E;abc&#x201F;abcdef</p>
+<p>abcdef,"abc,'abc,`abc,&#x2018;abc,&#x2019;abc,&#x201A;abc,&#x201B;abc,&#x201C;abc,&#x201D;abc,&#x201E;abc,&#x201F;abcdef</p>
+<p>abcdef."abc.'abc.`abc.&#x2018;abc.&#x2019;abc.&#x201A;abc.&#x201B;abc.&#x201C;abc.&#x201D;abc.&#x201E;abc.&#x201F;abcdef</p>
+<p>abcdef..."abc...'abc...`abc...&#x2018;abc...&#x2019;abc...&#x201A;abc...&#x201B;abc...&#x201C;abc...&#x201D;abc...&#x201E;abc...&#x201F;abcdef</p>
+<p>abcdef!"abc!'abc!`abc!&#x2018;abc!&#x2019;abc!&#x201A;abc!&#x201B;abc!&#x201C;abc!&#x201D;abc!&#x201E;abc!&#x201F;abcdef</p>
+<p>abcdef?"abc?'abc?`abc?&#x2018;abc?&#x2019;abc?&#x201A;abc?&#x201B;abc?&#x201C;abc?&#x201D;abc?&#x201E;abc?&#x201F;abcdef</p>
+<p>abcdef",abc',abc`,abc&#x2018;,abc&#x2019;,abc&#x201A;,abc&#x201B;,abc&#x201C;,abc&#x201D;,abc&#x201E;,abc&#x201F;,abcdef</p>
+<p>abcdef".abc'.abc`.abc&#x2018;.abc&#x2019;.abc&#x201A;.abc&#x201B;.abc&#x201C;.abc&#x201D;.abc&#x201E;.abc&#x201F;.abcdef</p>
+<p>abcdef"!abc'!abc`!abc&#x2018;!abc&#x2019;!abc&#x201A;!abc&#x201B;!abc&#x201C;!abc&#x201D;!abc&#x201E;!abc&#x201F;!abcdef</p>
+<p>abcdef"?abc'?abc`?abc&#x2018;?abc&#x2019;?abc&#x201A;?abc&#x201B;?abc&#x201C;?abc&#x201D;?abc&#x201E;?abc&#x201F;?abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/quotationmarks-cjk-1-ref.html b/layout/reftests/line-breaking/quotationmarks-cjk-1-ref.html
new file mode 100644
index 0000000000..b20854168b
--- /dev/null
+++ b/layout/reftests/line-breaking/quotationmarks-cjk-1-ref.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>&#x5B57;<br>&#x2018;&#x5B57;&#x2019;<br>&#x5B57;<br>&#x201C;&#x5B57;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF0C;<br>&#x2018;&#x5B57;&#xFF0C;&#x2019;<br>&#x5B57;&#xFF0C;<br>&#x201C;&#x5B57;&#xFF0C;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF0E;<br>&#x2018;&#x5B57;&#xFF0E;&#x2019;<br>&#x5B57;&#xFF0E;<br>&#x201C;&#x5B57;&#xFF0E;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF1A;<br>&#x2018;&#x5B57;&#xFF1A;&#x2019;<br>&#x5B57;&#xFF1A;<br>&#x201C;&#x5B57;&#xFF1A;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF1B;<br>&#x2018;&#x5B57;&#xFF1B;&#x2019;<br>&#x5B57;&#xFF1B;<br>&#x201C;&#x5B57;&#xFF1B;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF01;<br>&#x2018;&#x5B57;&#xFF01;&#x2019;<br>&#x5B57;&#xFF01;<br>&#x201C;&#x5B57;&#xFF01;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;&#xFF1F;<br>&#x2018;&#x5B57;&#xFF1F;&#x2019;<br>&#x5B57;&#xFF1F;<br>&#x201C;&#x5B57;&#xFF1F;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;<br>&#x2018;&#xFF08;&#x5B57;&#xFF09;&#x2019;<br>&#x5B57;<br>&#x201C;&#xFF08;&#x5B57;&#xFF09;&#x201D;<br>&#x5B57;</p>
+<p>&#x5B57;<br>&#xFF08;&#x2018;&#x5B57;&#x2019;&#xFF09;<br>&#x5B57;<br>&#xFF08;&#x201C;&#x5B57;&#x201D;&#xFF09;<br>&#x5B57;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/quotationmarks-cjk-1.html b/layout/reftests/line-breaking/quotationmarks-cjk-1.html
new file mode 100644
index 0000000000..b033f5ee82
--- /dev/null
+++ b/layout/reftests/line-breaking/quotationmarks-cjk-1.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+<meta content-type="text/html" charset="utf8">
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>&#x5B57;&#x2018;&#x5B57;&#x2019;&#x5B57;&#x201C;&#x5B57;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF0C;&#x2018;&#x5B57;&#xFF0C;&#x2019;&#x5B57;&#xFF0C;&#x201C;&#x5B57;&#xFF0C;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF0E;&#x2018;&#x5B57;&#xFF0E;&#x2019;&#x5B57;&#xFF0E;&#x201C;&#x5B57;&#xFF0E;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF1A;&#x2018;&#x5B57;&#xFF1A;&#x2019;&#x5B57;&#xFF1A;&#x201C;&#x5B57;&#xFF1A;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF1B;&#x2018;&#x5B57;&#xFF1B;&#x2019;&#x5B57;&#xFF1B;&#x201C;&#x5B57;&#xFF1B;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF01;&#x2018;&#x5B57;&#xFF01;&#x2019;&#x5B57;&#xFF01;&#x201C;&#x5B57;&#xFF01;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF1F;&#x2018;&#x5B57;&#xFF1F;&#x2019;&#x5B57;&#xFF1F;&#x201C;&#x5B57;&#xFF1F;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#x2018;&#xFF08;&#x5B57;&#xFF09;&#x2019;&#x5B57;&#x201C;&#xFF08;&#x5B57;&#xFF09;&#x201D;&#x5B57;</p>
+<p>&#x5B57;&#xFF08;&#x2018;&#x5B57;&#x2019;&#xFF09;&#x5B57;&#xFF08;&#x201C;&#x5B57;&#x201D;&#xFF09;&#x5B57;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/reftest.list b/layout/reftests/line-breaking/reftest.list
new file mode 100644
index 0000000000..501f861627
--- /dev/null
+++ b/layout/reftests/line-breaking/reftest.list
@@ -0,0 +1,45 @@
+== between-whitespaces.html between-whitespaces-ref.html
+== chemical-1.html chemical-1-ref.html
+== conservative-range-1.html conservative-range-1-ref.html
+== conservative-range-2.html conservative-range-2-ref.html
+== currency-1.html currency-1-ref.html
+== currency-2.html currency-2-ref.html
+== datetime-1.html datetime-1-ref.html
+pref(gfx.font_rendering.fallback.async,false) == emoji-1.html emoji-1-ref.html
+pref(gfx.font_rendering.fallback.async,false) == emoji-2.html emoji-2-ref.html
+== hyphens-1.html hyphens-1-ref.html
+== hyphens-2.html hyphens-2-ref.html
+# The following three tests may fail if rendering with Core Text (see bug 389074)
+# due to subpixel glyph positioning differences between the reference cases with <br>
+# and the automatically-wrapped lines in the test file
+== ja-1.html ja-1-ref.html
+== ja-2.html ja-2-ref.html
+== ja-3.html ja-3-ref.html
+== khmer-1.html khmer-1-ref.html
+== leaders-1.html leaders-1-ref.html
+== markup-src-1.html markup-src-1-ref.html
+== non-breakable-1.html non-breakable-1-ref.html
+== non-breakable-2.html non-breakable-2-ref.html
+== numerics-1.html numerics-1-ref.html
+== parentheses-1.html parentheses-1-ref.html
+== punctuation-open-1.html punctuation-open-1-ref.html
+== punctuation-open-2.html punctuation-open-2-ref.html
+== punctuation-open-3.html punctuation-open-3-ref.html
+== punctuation-open-4.html punctuation-open-4-ref.html
+== quotationmarks-1.html quotationmarks-1-ref.html
+# The following is currently disabled on Linux because of a rendering issue with missing-glyph
+# representations on the test boxes. See bug #450088 for discussion.
+skip-if(gtkWidget) == quotationmarks-cjk-1.html quotationmarks-cjk-1-ref.html
+== smileys-1.html smileys-1-ref.html
+== smileys-2.html smileys-2-ref.html
+== space-cluster-1.html space-cluster-1-ref.html
+random-if(cocoaWidget) == space-cluster-2.html space-cluster-2-ref.html # harfbuzz vs coretext, different positioning of stray diacritics
+== surrogates-1.html surrogates-1-ref.html
+== surrogates-2.html surrogates-2-ref.html
+== surrogates-3.html surrogates-3-ref.html
+== surrogates-4.html surrogates-4-ref.html
+== url-1.html url-1-ref.html
+== url-2.html url-2-ref.html
+== url-3.html url-3-ref.html
+== winpath-1.html winpath-1-ref.html
+== zwnbsp-1.html zwnbsp-1-ref.html
diff --git a/layout/reftests/line-breaking/smileys-1-ref.html b/layout/reftests/line-breaking/smileys-1-ref.html
new file mode 100644
index 0000000000..01d1ae7bd6
--- /dev/null
+++ b/layout/reftests/line-breaking/smileys-1-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>:)</p>
+<p>;)</p>
+<p>:(</p>
+<p>:-)</p>
+<p>:-(</p>
+<p>:P</p>
+<p>:D</p>
+<p>:-D</p>
+<p>:^)</p>
+<p>:-/</p>
+<p>=^_^=</p>
+<p>\^_^/</p>
+<p>^-^</p>
+<p>^^;;</p>
+<p>o_O</p>
+<p>-__-;;</p>
+<p>&gt;_&lt;</p>
+<p>&gt;&lt;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/smileys-1.html b/layout/reftests/line-breaking/smileys-1.html
new file mode 100644
index 0000000000..e0b718a209
--- /dev/null
+++ b/layout/reftests/line-breaking/smileys-1.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>:)</p>
+<p>;)</p>
+<p>:(</p>
+<p>:-)</p>
+<p>:-(</p>
+<p>:P</p>
+<p>:D</p>
+<p>:-D</p>
+<p>:^)</p>
+<p>:-/</p>
+<p>=^_^=</p>
+<p>\^_^/</p>
+<p>^-^</p>
+<p>^^;;</p>
+<p>o_O</p>
+<p>-__-;;</p>
+<p>&gt;_&lt;</p>
+<p>&gt;&lt;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/smileys-2-ref.html b/layout/reftests/line-breaking/smileys-2-ref.html
new file mode 100644
index 0000000000..0de4d74cf2
--- /dev/null
+++ b/layout/reftests/line-breaking/smileys-2-ref.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>abcdef:)</p>
+<p>abcdef;)</p>
+<p>abcdef:(</p>
+<p>abcdef:-)</p>
+<p>abcdef:-(</p>
+<p>abcdef:P</p>
+<p>abcdef:D</p>
+<p>abcdef:-D</p>
+<p>abcdef:^)</p>
+<p>abcdef:-/</p>
+<p>abcdef=^_^=</p>
+<p>abcdef\^_^/</p>
+<p>abcdef^-^</p>
+<p>abcdef^^;;</p>
+<p>abcdefo_O</p>
+<p>abcdef-__-;;</p>
+<p>abcdef&gt;_&lt;</p>
+<p>abcdef&gt;&lt;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/smileys-2.html b/layout/reftests/line-breaking/smileys-2.html
new file mode 100644
index 0000000000..1dcd88be67
--- /dev/null
+++ b/layout/reftests/line-breaking/smileys-2.html
@@ -0,0 +1,27 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>abcdef:)</p>
+<p>abcdef;)</p>
+<p>abcdef:(</p>
+<p>abcdef:-)</p>
+<p>abcdef:-(</p>
+<p>abcdef:P</p>
+<p>abcdef:D</p>
+<p>abcdef:-D</p>
+<p>abcdef:^)</p>
+<p>abcdef:-/</p>
+<p>abcdef=^_^=</p>
+<p>abcdef\^_^/</p>
+<p>abcdef^-^</p>
+<p>abcdef^^;;</p>
+<p>abcdefo_O</p>
+<p>abcdef-__-;;</p>
+<p>abcdef&gt;_&lt;</p>
+<p>abcdef&gt;&lt;</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/space-cluster-1-ref.html b/layout/reftests/line-breaking/space-cluster-1-ref.html
new file mode 100644
index 0000000000..73f65d3862
--- /dev/null
+++ b/layout/reftests/line-breaking/space-cluster-1-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<body style="line-height: 1.5em">
+there<br>should<br>be<br>one<br>word<br>per<br>line
+</body>
diff --git a/layout/reftests/line-breaking/space-cluster-1.html b/layout/reftests/line-breaking/space-cluster-1.html
new file mode 100644
index 0000000000..511f7381df
--- /dev/null
+++ b/layout/reftests/line-breaking/space-cluster-1.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<body style="width: 0; line-height: 1.5em">
+<!-- none of these control codes should inhibit line breaking at the spaces -->
+there&zwj; should &zwj;be&zwnj; one &zwnj;word&#x34f; per &#x34f;line
+</body>
diff --git a/layout/reftests/line-breaking/space-cluster-2-ref.html b/layout/reftests/line-breaking/space-cluster-2-ref.html
new file mode 100644
index 0000000000..c7fb7ac99e
--- /dev/null
+++ b/layout/reftests/line-breaking/space-cluster-2-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<body>
+Each diacritic should be on a separate line:
+<div style="margin: 1em; line-height: 1.5em; font-family: monospace;">&#x302;<br>&#x304;<br>&#x305;<br>&#x306;<br>&#x307;
diff --git a/layout/reftests/line-breaking/space-cluster-2.html b/layout/reftests/line-breaking/space-cluster-2.html
new file mode 100644
index 0000000000..a1eb7f9e3f
--- /dev/null
+++ b/layout/reftests/line-breaking/space-cluster-2.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<body>
+Each diacritic should be on a separate line:
+<div style="width: 0; margin: 1em; line-height: 1.5em; font-family: monospace;">&#x302; &#x304; &#x305; &#x306; &#x307;
diff --git a/layout/reftests/line-breaking/surrogates-1-ref.html b/layout/reftests/line-breaking/surrogates-1-ref.html
new file mode 100644
index 0000000000..9a4cbcadaf
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-1-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef<br>&#x2018;&#x6587;&#x2019;<br>abcdef</p>
+<p class="supp">abcdef<br>&#x2018;&#x2000B;&#x2019;<br>abcdef</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-1.html b/layout/reftests/line-breaking/surrogates-1.html
new file mode 100644
index 0000000000..3c8252c5c9
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-1.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+p {
+ width:0;
+}
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef &#x2018;&#x6587;&#x2019; abcdef</p>
+<p class="supp">abcdef &#x2018;&#x2000B;&#x2019; abcdef</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-2-ref.html b/layout/reftests/line-breaking/surrogates-2-ref.html
new file mode 100644
index 0000000000..f00c5e9fbe
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-2-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef<br>&#x2018;&#x6587;&#x2019;abcdef</p>
+<p class="supp">abcdef<br>&#x2018;&#x2000B;&#x2019;abcdef</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-2.html b/layout/reftests/line-breaking/surrogates-2.html
new file mode 100644
index 0000000000..7de30dcb5b
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-2.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+p {
+ width:0;
+}
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef&#x2018;&#x6587;&#x2019;abcdef</p>
+<p class="supp">abcdef&#x2018;&#x2000B;&#x2019;abcdef</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-3-ref.html b/layout/reftests/line-breaking/surrogates-3-ref.html
new file mode 100644
index 0000000000..5bfb9d960c
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-3-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef<br>&#x2018;&#x6587;&#x2019;<br>abcdef</p>
+<p class="supp">&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;<br>&#x2018;&#x2000B;&#x2019;<br>&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-3.html b/layout/reftests/line-breaking/surrogates-3.html
new file mode 100644
index 0000000000..7bb11ae6b6
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-3.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+p {
+ width:0;
+}
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef &#x2018;&#x6587;&#x2019; abcdef</p>
+<p class="supp">&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d; &#x2018;&#x2000B;&#x2019; &#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-4-ref.html b/layout/reftests/line-breaking/surrogates-4-ref.html
new file mode 100644
index 0000000000..f191559ed6
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-4-ref.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef<br>&#x2018;&#x6587;&#x2019;abcdef</p>
+<p class="supp">&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;<br>&#x2018;&#x2000B;&#x2019;&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/surrogates-4.html b/layout/reftests/line-breaking/surrogates-4.html
new file mode 100644
index 0000000000..8aa3cd776d
--- /dev/null
+++ b/layout/reftests/line-breaking/surrogates-4.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<title>Bug xxxx</title>
+<style>
+p {
+ width:0;
+}
+.bmp {
+ color: green;
+}
+.supp {
+ color: blue;
+}
+</style>
+</head>
+<body>
+Line-breaking in the green (BMP) and blue (supplementary-plane) examples should match.
+<p class="bmp">abcdef&#x2018;&#x6587;&#x2019;abcdef</p>
+<p class="supp">&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;&#x2018;&#x2000B;&#x2019;&#x10408;&#x10409;&#x1040a;&#x1040b;&#x1040c;&#x1040d;</p>
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-1-ref.html b/layout/reftests/line-breaking/url-1-ref.html
new file mode 100644
index 0000000000..9c3e233862
--- /dev/null
+++ b/layout/reftests/line-breaking/url-1-ref.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>http://www.mozilla.org/</p>
+<p>http://www.mozilla.org/abcd</p>
+<p>http://www.mozilla.org<br>/abcde</p>
+<p>http://www.mozilla.org<br>/abcdef/</p>
+<p>http://www.mozilla.org<br>/abcd/abcd<br>/abcde<br>/index.html</p>
+<p>http://www.mozilla.org<br>/index.cgi?abcdef=abcdef&amp;<br>abcdef=abcdef</p>
+<p>http://www.mozilla.org<br>/index.cgi?abcdef=abcdef;<br>abcdef=abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-1.html b/layout/reftests/line-breaking/url-1.html
new file mode 100644
index 0000000000..c727d0d205
--- /dev/null
+++ b/layout/reftests/line-breaking/url-1.html
@@ -0,0 +1,16 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>http://www.mozilla.org/</p>
+<p>http://www.mozilla.org/abcd</p>
+<p>http://www.mozilla.org/abcde</p>
+<p>http://www.mozilla.org/abcdef/</p>
+<p>http://www.mozilla.org/abcd/abcd/abcde/index.html</p>
+<p>http://www.mozilla.org/index.cgi?abcdef=abcdef&amp;abcdef=abcdef</p>
+<p>http://www.mozilla.org/index.cgi?abcdef=abcdef;abcdef=abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-2-ref.html b/layout/reftests/line-breaking/url-2-ref.html
new file mode 100644
index 0000000000..d1d6281eb0
--- /dev/null
+++ b/layout/reftests/line-breaking/url-2-ref.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>/abcde<br>/abcde</p>
+<p>/abcd/abcde</p>
+<p>/abcde/abcd</p>
+<p>abc/de<br>/abcde</p>
+<p>abc/de/abcd</p>
+<p>../../..</p>
+<p>../../../..</p>
+<p>../../..<br>/../..</p>
+<p>../../..<br>/abcde</p>
+<p>abc/de<br>/abcde.abcdef</p>
+<p>index.cgi?abcdef=abcdef&amp;<br>abcdef=abcdef</p>
+<p>index.cgi?abcdef=abcdef;<br>abcdef=abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-2.html b/layout/reftests/line-breaking/url-2.html
new file mode 100644
index 0000000000..0d1f377614
--- /dev/null
+++ b/layout/reftests/line-breaking/url-2.html
@@ -0,0 +1,21 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>/abcde/abcde</p>
+<p>/abcd/abcde</p>
+<p>/abcde/abcd</p>
+<p>abc/de/abcde</p>
+<p>abc/de/abcd</p>
+<p>../../..</p>
+<p>../../../..</p>
+<p>../../../../..</p>
+<p>../../../abcde</p>
+<p>abc/de/abcde.abcdef</p>
+<p>index.cgi?abcdef=abcdef&amp;abcdef=abcdef</p>
+<p>index.cgi?abcdef=abcdef;abcdef=abcdef</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-3-ref.html b/layout/reftests/line-breaking/url-3-ref.html
new file mode 100644
index 0000000000..a940e970ef
--- /dev/null
+++ b/layout/reftests/line-breaking/url-3-ref.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>index.cgi?abcdef=<br>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA<br>%9E&amp;<br>abcdef=<br>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA%9E</p>
+<p>index.cgi?abcdef=<br>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA<br>%9E;<br>abcdef=<br>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA%9E</p>
+<p>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA%9E</p>
+<p>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA%9Eab</p>
+<p>%E6%97<br>%A5%E6<br>%9C%AC<br>%E8%AA<br>%9Eabc</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/url-3.html b/layout/reftests/line-breaking/url-3.html
new file mode 100644
index 0000000000..44c955b448
--- /dev/null
+++ b/layout/reftests/line-breaking/url-3.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>index.cgi?abcdef=%E6%97%A5%E6%9C%AC%E8%AA%9E&amp;abcdef=%E6%97%A5%E6%9C%AC%E8%AA%9E</p>
+<p>index.cgi?abcdef=%E6%97%A5%E6%9C%AC%E8%AA%9E;abcdef=%E6%97%A5%E6%9C%AC%E8%AA%9E</p>
+<p>%E6%97%A5%E6%9C%AC%E8%AA%9E</p>
+<p>%E6%97%A5%E6%9C%AC%E8%AA%9Eab</p>
+<p>%E6%97%A5%E6%9C%AC%E8%AA%9Eabc</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/winpath-1-ref.html b/layout/reftests/line-breaking/winpath-1-ref.html
new file mode 100644
index 0000000000..efa51605b4
--- /dev/null
+++ b/layout/reftests/line-breaking/winpath-1-ref.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; white-space: nowrap; } </style>
+</head>
+<body>
+
+<p>\abcde<br>\abcde</p>
+<p>\abcd\abcde</p>
+<p>\abcde\abcd</p>
+<p>abc\de<br>\abcde</p>
+<p>abc\de\abcd</p>
+<p>..\..\..</p>
+<p>..\..\..\..</p>
+<p>..\..\..<br>\..\..</p>
+<p>..\..\..<br>\abcde</p>
+<p>abc\de<br>\abcde.abcdef</p>
+<p>\\abcd<br>\abcde</p>
+<p>\\abc\abcde</p>
+<p>\\abcd\abcd</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/winpath-1.html b/layout/reftests/line-breaking/winpath-1.html
new file mode 100644
index 0000000000..d3dce3702e
--- /dev/null
+++ b/layout/reftests/line-breaking/winpath-1.html
@@ -0,0 +1,22 @@
+<html>
+<head>
+<style type="text/css"> p { margin: 5px 1em; width: 0; } </style>
+</head>
+<body>
+
+<p>\abcde\abcde</p>
+<p>\abcd\abcde</p>
+<p>\abcde\abcd</p>
+<p>abc\de\abcde</p>
+<p>abc\de\abcd</p>
+<p>..\..\..</p>
+<p>..\..\..\..</p>
+<p>..\..\..\..\..</p>
+<p>..\..\..\abcde</p>
+<p>abc\de\abcde.abcdef</p>
+<p>\\abcd\abcde</p>
+<p>\\abc\abcde</p>
+<p>\\abcd\abcd</p>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/zwnbsp-1-ref.html b/layout/reftests/line-breaking/zwnbsp-1-ref.html
new file mode 100644
index 0000000000..34cc31aec8
--- /dev/null
+++ b/layout/reftests/line-breaking/zwnbsp-1-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p { margin: 5px 1em; line-height: 1.5; }
+</style>
+</head>
+<body>
+
+<div style="float:left; width: 15em;">
+<!-- U+FEFF is (deprecated) ZERO-WIDTH NO-BREAK SPACE -->
+<p>abcdefabcdef</p>
+<p>abcdef)(abcdef</p>
+<p>abcdef<br>abcdef</p>
+<p>abcdef<br>abcdef</p>
+<p>abcdefabcdef</p>
+
+<p>コ<br>ミュ<br>ニ</p>
+<p>コ&#xfeff;ミ&#xfeff;ュ&#xfeff;ニ</p>
+
+<p>你<br>好<br>吗?</p>
+<p>你好<br>吗?</p>
+<p>你好吗?</p>
+</div>
+
+<div style="float:left; width: 15em;">
+<!-- U+2060 is WORD JOINER -->
+<p>abcdefabcdef</p>
+<p>abcdef)(abcdef</p>
+<p>abcdef<br>abcdef</p>
+<p>abcdef<br>abcdef</p>
+<p>abcdefabcdef</p>
+
+<p>コ<br>ミュ<br>ニ</p>
+<p>コ&#x2060;ミ&#x2060;ュ&#x2060;ニ</p>
+
+<p>你<br>好<br>吗?</p>
+<p>你好<br>吗?</p>
+<p>你好吗?</p>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/line-breaking/zwnbsp-1.html b/layout/reftests/line-breaking/zwnbsp-1.html
new file mode 100644
index 0000000000..1f8831cd57
--- /dev/null
+++ b/layout/reftests/line-breaking/zwnbsp-1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset="utf-8">
+<style type="text/css">
+p { margin: 5px 1em; line-height: 1.5; width: 0; }
+</style>
+</head>
+<body>
+
+<div style="float:left; width: 15em;">
+<!-- U+FEFF is (deprecated) ZERO-WIDTH NO-BREAK SPACE -->
+<p>abcdef&#xfeff;abcdef</p>
+<p>abcdef)&#xfeff;(abcdef</p>
+<p>abcdef &#xfeff;abcdef</p>
+<p>abcdef&#xfeff; abcdef</p>
+<p>abcdef&#xfeff;&#xfeff;&#xfeff;abcdef</p>
+
+<p>コミュニ</p>
+<p>コ&#xfeff;ミ&#xfeff;ュ&#xfeff;ニ</p>
+
+<p>你好吗?</p>
+<p>你&#xfeff;好吗?</p>
+<p>你&#xfeff;好&#xfeff;吗?</p>
+</div>
+
+<div style="float:left; width: 15em;">
+<!-- U+2060 is WORD JOINER -->
+<p>abcdef&#x2060;abcdef</p>
+<p>abcdef)&#x2060;(abcdef</p>
+<p>abcdef &#x2060;abcdef</p>
+<p>abcdef&#x2060; abcdef</p>
+<p>abcdef&#x2060;&#x2060;&#x2060;abcdef</p>
+
+<p>コミュニ</p>
+<p>コ&#x2060;ミ&#x2060;ュ&#x2060;ニ</p>
+
+<p>你好吗?</p>
+<p>你&#x2060;好吗?</p>
+<p>你&#x2060;好&#x2060;吗?</p>
+</div>
+
+</body>
+</html>