summaryrefslogtreecommitdiffstats
path: root/layout/reftests/line-breaking
diff options
context:
space:
mode:
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/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.html17
-rw-r--r--layout/reftests/line-breaking/leaders-1.html17
-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-stylo.list41
-rw-r--r--layout/reftests/line-breaking/reftest.list39
-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/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
70 files changed, 1821 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 000000000..834e13776
--- /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;<br>&#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 000000000..2233a461c
--- /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 000000000..724d115b4
--- /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 000000000..aa68fcf08
--- /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/currency-1-ref.html b/layout/reftests/line-breaking/currency-1-ref.html
new file mode 100644
index 000000000..9cfe0a4d6
--- /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 000000000..9b7edfcef
--- /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 000000000..8d7f1d7a0
--- /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 000000000..887561833
--- /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 000000000..d50ec5da3
--- /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-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/datetime-1.html b/layout/reftests/line-breaking/datetime-1.html
new file mode 100644
index 000000000..ce6a84bcf
--- /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 000000000..871f2cf00
--- /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 000000000..fba190921
--- /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 000000000..8aaca9548
--- /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 000000000..d5fab8b22
--- /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 000000000..91efcad1a
--- /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>abcde-<br>abcdef</p>
+<p>abcd-abcdef</p>
+<p>abcde-abcde</p>
+<p>abcdef--<br>abcdef</p>
+<p>------abcdef<p>
+
+<!-- U+058A is ARMENIAN HYPHEN -->
+<p>abcde&#x058A;<br>abcdef</p>
+<p>abcd&#x058A;abcdef</p>
+<p>abcde&#x058A;abcde</p>
+<p>abcde&#x058A;&#x058A;<br>abcdef</p>
+<p>&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;abcdef</p>
+
+<!-- U+2010 is HYPHEN -->
+<p>abcde&#x2010;<br>abcdef</p>
+<p>abcd&#x2010;abcdef</p>
+<p>abcde&#x2010;abcde</p>
+<p>abcde&#x2010;&#x2010;<br>abcdef</p>
+<p>&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;abcdef</p>
+
+<!-- U+2012 is FIGURE DASH -->
+<p>abcde&#x2012;<br>abcdef</p>
+<p>abcd&#x2012;abcdef</p>
+<p>abcde&#x2012;abcde</p>
+<p>abcde&#x2012;&#x2012;<br>abcdef</p>
+<p>&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;abcdef</p>
+
+<p>abcde&ndash;<br>abcdef</p>
+<p>abcd&ndash;abcdef</p>
+<p>abcde&ndash;abcde</p>
+<p>abcde&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 000000000..4dc8ecea4
--- /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>abcde-abcdef</p>
+<p>abcd-abcdef</p>
+<p>abcde-abcde</p>
+<p>abcdef--abcdef</p>
+<p>------abcdef<p>
+
+<!-- U+058A is ARMENIAN HYPHEN -->
+<p>abcde&#x058A;abcdef</p>
+<p>abcd&#x058A;abcdef</p>
+<p>abcde&#x058A;abcde</p>
+<p>abcde&#x058A;&#x058A;abcdef</p>
+<p>&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;&#x058A;abcdef</p>
+
+<!-- U+2010 is HYPHEN -->
+<p>abcde&#x2010;abcdef</p>
+<p>abcd&#x2010;abcdef</p>
+<p>abcde&#x2010;abcde</p>
+<p>abcde&#x2010;&#x2010;abcdef</p>
+<p>&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;&#x2010;abcdef</p>
+
+<!-- U+2012 is FIGURE DASH -->
+<p>abcde&#x2012;abcdef</p>
+<p>abcd&#x2012;abcdef</p>
+<p>abcde&#x2012;abcde</p>
+<p>abcde&#x2012;&#x2012;abcdef</p>
+<p>&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;&#x2012;abcdef</p>
+
+<p>abcde&ndash;abcdef</p>
+<p>abcd&ndash;abcdef</p>
+<p>abcde&ndash;abcde</p>
+<p>abcde&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 000000000..e06e764a9
--- /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 000000000..edcbde22d
--- /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 000000000..8c066b612
--- /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 000000000..40475dbc7
--- /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 000000000..5344c92ac
--- /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 000000000..c5ce5bf78
--- /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 000000000..0eac869bc
--- /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 000000000..3d1b1087f
--- /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 000000000..24f1a1405
--- /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 000000000..9c6329322
--- /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 000000000..c834b8e7a
--- /dev/null
+++ b/layout/reftests/line-breaking/leaders-1-ref.html
@@ -0,0 +1,17 @@
+<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;abcdef</p>
+
+<!-- U+2025 is TWO DOT LEADER -->
+<p>abcdef&#x2025;&#x2025;&#x2025;abcdef</p>
+
+<!-- U+2026 is HORIZONTAL ELLIPSIS -->
+<p>abcdef&#x2026;&#x2026;&#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 000000000..196e15250
--- /dev/null
+++ b/layout/reftests/line-breaking/leaders-1.html
@@ -0,0 +1,17 @@
+<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>
+
+<!-- U+2025 is TWO DOT LEADER -->
+<p>abcdef&#x2025;&#x2025;&#x2025;abcdef</p>
+
+<!-- U+2026 is HORIZONTAL ELLIPSIS -->
+<p>abcdef&#x2026;&#x2026;&#x2026;abcdef</p>
+
+</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 000000000..e56a1d225
--- /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 000000000..af7907acf
--- /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 000000000..b8a1fb87b
--- /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 000000000..3ee9222c6
--- /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 000000000..3e8302de1
--- /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 000000000..8bc301bbc
--- /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 000000000..9d8990f2f
--- /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 000000000..470ff4491
--- /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 000000000..a5812ef1f
--- /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 000000000..598be9d76
--- /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 000000000..5b9640e21
--- /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 000000000..6eecc17bf
--- /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 000000000..74cedd580
--- /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 000000000..ae65acfac
--- /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 000000000..782900a9f
--- /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 000000000..985d09823
--- /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 000000000..718f2be43
--- /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 000000000..6c2a8912a
--- /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 000000000..b07a0f350
--- /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 000000000..ad273cb4e
--- /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 000000000..b20854168
--- /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 000000000..b033f5ee8
--- /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-stylo.list b/layout/reftests/line-breaking/reftest-stylo.list
new file mode 100644
index 000000000..7b2576a40
--- /dev/null
+++ b/layout/reftests/line-breaking/reftest-stylo.list
@@ -0,0 +1,41 @@
+# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
+== between-whitespaces.html between-whitespaces.html
+== chemical-1.html chemical-1.html
+== currency-1.html currency-1.html
+== currency-2.html currency-2.html
+== datetime-1.html datetime-1.html
+== emoji-1.html emoji-1.html
+== emoji-2.html emoji-2.html
+== hyphens-1.html hyphens-1.html
+== hyphens-2.html hyphens-2.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
+random-if(cocoaWidget) == ja-1.html ja-1.html
+random-if(cocoaWidget) == ja-2.html ja-2.html
+random-if(cocoaWidget) == ja-3.html ja-3.html
+== khmer-1.html khmer-1.html
+== leaders-1.html leaders-1.html
+== markup-src-1.html markup-src-1.html
+== non-breakable-1.html non-breakable-1.html
+== non-breakable-2.html non-breakable-2.html
+== numerics-1.html numerics-1.html
+skip == parentheses-1.html parentheses-1.html
+== punctuation-open-1.html punctuation-open-1.html
+== punctuation-open-2.html punctuation-open-2.html
+== punctuation-open-3.html punctuation-open-3.html
+== punctuation-open-4.html punctuation-open-4.html
+== quotationmarks-1.html quotationmarks-1.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(B2G||Mulet) skip-if(gtkWidget) == quotationmarks-cjk-1.html quotationmarks-cjk-1.html
+# bug 773482
+# Initial mulet triage: parity with B2G/B2G Desktop
+== smileys-1.html smileys-1.html
+== smileys-2.html smileys-2.html
+== url-1.html url-1.html
+== url-2.html url-2.html
+== url-3.html url-3.html
+== winpath-1.html winpath-1.html
+skip-if(Mulet) == zwnbsp-1.html zwnbsp-1.html
+# MULET: Bug 1144079: Re-enable Mulet mochitests and reftests taskcluster-specific disables
diff --git a/layout/reftests/line-breaking/reftest.list b/layout/reftests/line-breaking/reftest.list
new file mode 100644
index 000000000..1fcfa2f4e
--- /dev/null
+++ b/layout/reftests/line-breaking/reftest.list
@@ -0,0 +1,39 @@
+== between-whitespaces.html between-whitespaces-ref.html
+== chemical-1.html chemical-1-ref.html
+== currency-1.html currency-1-ref.html
+== currency-2.html currency-2-ref.html
+== datetime-1.html datetime-1-ref.html
+== emoji-1.html emoji-1-ref.html
+== 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
+random-if(cocoaWidget) == ja-1.html ja-1-ref.html
+random-if(cocoaWidget) == ja-2.html ja-2-ref.html
+random-if(cocoaWidget) == 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
+== space-cluster-2.html space-cluster-2-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 000000000..01d1ae7bd
--- /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 000000000..e0b718a20
--- /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 000000000..0de4d74cf
--- /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 000000000..1dcd88be6
--- /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 000000000..73f65d386
--- /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 000000000..511f7381d
--- /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 000000000..c7fb7ac99
--- /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 000000000..a1eb7f9e3
--- /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/url-1-ref.html b/layout/reftests/line-breaking/url-1-ref.html
new file mode 100644
index 000000000..9c3e23386
--- /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 000000000..c727d0d20
--- /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 000000000..d1d6281eb
--- /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 000000000..0d1f37761
--- /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 000000000..f5db2d492
--- /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;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;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 000000000..44c955b44
--- /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 000000000..efa51605b
--- /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 000000000..d3dce3702
--- /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 000000000..34cc31aec
--- /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 000000000..1f8831cd5
--- /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>