summaryrefslogtreecommitdiffstats
path: root/layout/reftests/first-line
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--layout/reftests/first-line/287088-1-ref.html18
-rw-r--r--layout/reftests/first-line/287088-1.html18
-rw-r--r--layout/reftests/first-line/287088-2-ref.html14
-rw-r--r--layout/reftests/first-line/287088-2.html14
-rw-r--r--layout/reftests/first-line/403177-1-ref.html23
-rw-r--r--layout/reftests/first-line/403177-1.html23
-rw-r--r--layout/reftests/first-line/469227-2-ref.html4
-rw-r--r--layout/reftests/first-line/469227-2.html9
-rw-r--r--layout/reftests/first-line/469227-3-ref.html4
-rw-r--r--layout/reftests/first-line/469227-3.html9
-rw-r--r--layout/reftests/first-line/basic-1.html17
-rw-r--r--layout/reftests/first-line/basic-ref.html11
-rw-r--r--layout/reftests/first-line/border-not-apply-ref.html3
-rw-r--r--layout/reftests/first-line/border-not-apply.html17
-rw-r--r--layout/reftests/first-line/caption-insert-in-first-line-1.html20
-rw-r--r--layout/reftests/first-line/caption-insert-in-first-line-2.html20
-rw-r--r--layout/reftests/first-line/caption-insert-in-first-line-ref.html13
-rw-r--r--layout/reftests/first-line/first-line-in-columnset-1-ref.html8
-rw-r--r--layout/reftests/first-line/first-line-in-columnset-1.html8
-rw-r--r--layout/reftests/first-line/font-styles-nooverflow.html29
-rw-r--r--layout/reftests/first-line/font-styles-ref.html29
-rw-r--r--layout/reftests/first-line/font-styles.html29
-rw-r--r--layout/reftests/first-line/ib-split-1-ref.html9
-rw-r--r--layout/reftests/first-line/ib-split-1.html10
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-1.html10
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-10.html13
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-11.html11
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-12.html13
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-2.html12
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-3.html10
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-4.html12
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-5.html10
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-6.html12
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-7.html10
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-8.html12
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-9.html11
-rw-r--r--layout/reftests/first-line/insertion-in-first-line-ref.html5
-rw-r--r--layout/reftests/first-line/out-of-flow-1-ref.html12
-rw-r--r--layout/reftests/first-line/out-of-flow-1a.html18
-rw-r--r--layout/reftests/first-line/out-of-flow-1b.html17
-rw-r--r--layout/reftests/first-line/out-of-flow-1c.html21
-rw-r--r--layout/reftests/first-line/out-of-flow-1d.html27
-rw-r--r--layout/reftests/first-line/parent-style-1-ref.html16
-rw-r--r--layout/reftests/first-line/parent-style-1.html22
-rw-r--r--layout/reftests/first-line/parent-style-2-ref.html11
-rw-r--r--layout/reftests/first-line/parent-style-2.html18
-rw-r--r--layout/reftests/first-line/parent-style-3-ref.html11
-rw-r--r--layout/reftests/first-line/parent-style-3.html18
-rw-r--r--layout/reftests/first-line/reftest.list56
-rw-r--r--layout/reftests/first-line/restyle-inside-first-line-ref.html6
-rw-r--r--layout/reftests/first-line/restyle-inside-first-line.html11
-rw-r--r--layout/reftests/first-line/stress-1.html41
-rw-r--r--layout/reftests/first-line/stress-10.html5
-rw-r--r--layout/reftests/first-line/stress-11-ref.xhtml9
-rw-r--r--layout/reftests/first-line/stress-11.xhtml18
-rw-r--r--layout/reftests/first-line/stress-2-ref.html10
-rw-r--r--layout/reftests/first-line/stress-2.html26
-rw-r--r--layout/reftests/first-line/stress-3.html35
-rw-r--r--layout/reftests/first-line/stress-4.html27
-rw-r--r--layout/reftests/first-line/stress-5.html25
-rw-r--r--layout/reftests/first-line/stress-6.html45
-rw-r--r--layout/reftests/first-line/stress-7.html17
-rw-r--r--layout/reftests/first-line/stress-8-ref.html15
-rw-r--r--layout/reftests/first-line/stress-8.html18
-rw-r--r--layout/reftests/first-line/stress-9-ref.html14
-rw-r--r--layout/reftests/first-line/stress-9.html15
66 files changed, 1084 insertions, 0 deletions
diff --git a/layout/reftests/first-line/287088-1-ref.html b/layout/reftests/first-line/287088-1-ref.html
new file mode 100644
index 0000000000..0411b1a1a4
--- /dev/null
+++ b/layout/reftests/first-line/287088-1-ref.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style>
+div::first-line { color: red; background-color: blue; font-size: 200%; text-transform: uppercase; }
+</style>
+</head>
+<body>
+
+<div>
+Line number one.<br/>Line number two.<br/>Line number three.
+</div>
+
+<div style="height: 50000px;">
+<!-- to force a scrollbar -->
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/287088-1.html b/layout/reftests/first-line/287088-1.html
new file mode 100644
index 0000000000..3583b860d9
--- /dev/null
+++ b/layout/reftests/first-line/287088-1.html
@@ -0,0 +1,18 @@
+<html>
+<head>
+<style>
+div::first-line { color: red; background-color: blue; font-size: 200%; text-transform: uppercase; }
+</style>
+</head>
+<body>
+
+<div>
+<span>Line number one.<br/>Line number two.<br/>Line number three.</span>
+</div>
+
+<div style="height: 50000px;">
+<!-- to force a scrollbar -->
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/287088-2-ref.html b/layout/reftests/first-line/287088-2-ref.html
new file mode 100644
index 0000000000..862d6e309c
--- /dev/null
+++ b/layout/reftests/first-line/287088-2-ref.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<style>
+div::first-line { color: red; background-color: blue; font-size: 200%; text-transform: uppercase; }
+</style>
+</head>
+<body>
+
+<div>
+Line number one.<br/>Line number two.<br/>Line number three.
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/287088-2.html b/layout/reftests/first-line/287088-2.html
new file mode 100644
index 0000000000..9d470b13a2
--- /dev/null
+++ b/layout/reftests/first-line/287088-2.html
@@ -0,0 +1,14 @@
+<html>
+<head>
+<style>
+div::first-line { color: red; background-color: blue; font-size: 200%; text-transform: uppercase; }
+</style>
+</head>
+<body>
+
+<div>
+<span>Line number one.<br/>Line number two.<br/>Line number three.</span>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/403177-1-ref.html b/layout/reftests/first-line/403177-1-ref.html
new file mode 100644
index 0000000000..8fcfdaff75
--- /dev/null
+++ b/layout/reftests/first-line/403177-1-ref.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<style>
+
+.fl:first-line { color: #ff00ff; background: #ffccff; }
+
+.flWithContent:first-line { }
+
+</style>
+</head>
+
+<body onload="document.getElementById('inner').removeAttribute('class');">
+
+<div id="outer" class="fl">
+ a
+ <div id="inner" style="float: left;" class="flWithContent">
+ b
+ </div>
+ c
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/403177-1.html b/layout/reftests/first-line/403177-1.html
new file mode 100644
index 0000000000..3d376704f5
--- /dev/null
+++ b/layout/reftests/first-line/403177-1.html
@@ -0,0 +1,23 @@
+<html>
+<head>
+<style>
+
+.fl:first-line { color: #ff00ff; background: #ffccff; }
+
+.flWithContent:first-line { content: "generated"; }
+
+</style>
+</head>
+
+<body onload="document.getElementById('inner').removeAttribute('class');">
+
+<div id="outer" class="fl">
+ a
+ <div id="inner" style="float: left;" class="flWithContent">
+ b
+ </div>
+ c
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/469227-2-ref.html b/layout/reftests/first-line/469227-2-ref.html
new file mode 100644
index 0000000000..4e472dc3d9
--- /dev/null
+++ b/layout/reftests/first-line/469227-2-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<title>Testcase for issue in bug 469227 comment 9</title>
+<span style="border: medium solid green">Hello</span>
+<p>Hello</p>
diff --git a/layout/reftests/first-line/469227-2.html b/layout/reftests/first-line/469227-2.html
new file mode 100644
index 0000000000..ffaf2ed1c9
--- /dev/null
+++ b/layout/reftests/first-line/469227-2.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<title>Testcase for issue in bug 469227 comment 9</title>
+<style type="text/css">
+
+span, p::first-line { border: medium solid green; }
+
+</style>
+<span>Hello</span>
+<p>Hello</p>
diff --git a/layout/reftests/first-line/469227-3-ref.html b/layout/reftests/first-line/469227-3-ref.html
new file mode 100644
index 0000000000..cb39ac1742
--- /dev/null
+++ b/layout/reftests/first-line/469227-3-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE HTML>
+<title>Testcase for issue in bug 469227 comment 9</title>
+<p>Hello</p>
+<span style="border: medium solid green">Hello</span>
diff --git a/layout/reftests/first-line/469227-3.html b/layout/reftests/first-line/469227-3.html
new file mode 100644
index 0000000000..c4895f24d4
--- /dev/null
+++ b/layout/reftests/first-line/469227-3.html
@@ -0,0 +1,9 @@
+<!DOCTYPE HTML>
+<title>Testcase for issue in bug 469227 comment 9</title>
+<style type="text/css">
+
+span, p::first-line { border: medium solid green; }
+
+</style>
+<p>Hello</p>
+<span>Hello</span>
diff --git a/layout/reftests/first-line/basic-1.html b/layout/reftests/first-line/basic-1.html
new file mode 100644
index 0000000000..e63d8ae29e
--- /dev/null
+++ b/layout/reftests/first-line/basic-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+ <style>
+ body { color: red }
+ body::first-line { color: green; }
+ </style>
+ </head>
+ <body>
+ This should be green
+ </body>
+</html>
diff --git a/layout/reftests/first-line/basic-ref.html b/layout/reftests/first-line/basic-ref.html
new file mode 100644
index 0000000000..fb93056262
--- /dev/null
+++ b/layout/reftests/first-line/basic-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ body { color: green }
+ </style>
+ </head>
+ <body>
+ This should be green
+ </body>
+</html>
diff --git a/layout/reftests/first-line/border-not-apply-ref.html b/layout/reftests/first-line/border-not-apply-ref.html
new file mode 100644
index 0000000000..57cc100914
--- /dev/null
+++ b/layout/reftests/first-line/border-not-apply-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE HTML>
+<title>border should not apply to :first-line (bug 469227)</title>
+<p>Hello</p>
diff --git a/layout/reftests/first-line/border-not-apply.html b/layout/reftests/first-line/border-not-apply.html
new file mode 100644
index 0000000000..8665963f36
--- /dev/null
+++ b/layout/reftests/first-line/border-not-apply.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<title>border should not apply to :first-line (bug 469227)</title>
+<style type="text/css">
+
+p::first-line {
+ /* specify all the properties in nsStyleBorder */
+ border-inline-start: medium solid red ! important;
+ border-inline-end: medium solid red ! important;
+ border: medium solid red ! important;
+ border-image: none ! important;
+ -moz-float-edge: content-box ! important;
+ border-radius: 0 ! important;
+ box-shadow: none ! important;
+}
+
+</style>
+<p>Hello</p>
diff --git a/layout/reftests/first-line/caption-insert-in-first-line-1.html b/layout/reftests/first-line/caption-insert-in-first-line-1.html
new file mode 100644
index 0000000000..6c0eb7f768
--- /dev/null
+++ b/layout/reftests/first-line/caption-insert-in-first-line-1.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #table { display: inline-table; }
+ #caption { display: table-caption; }
+ #tbody { display: table-row-group; }
+</style>
+<div id="x">
+ <span id="table">
+ <span id="tbody">be green</span>
+ </span>
+</div>
+<script>
+ x.offsetWidth;
+ var caption = document.createElement("span");
+ caption.id = "caption";
+ caption.textContent = "This should";
+ table.appendChild(caption);
+</script>
diff --git a/layout/reftests/first-line/caption-insert-in-first-line-2.html b/layout/reftests/first-line/caption-insert-in-first-line-2.html
new file mode 100644
index 0000000000..90d25010d1
--- /dev/null
+++ b/layout/reftests/first-line/caption-insert-in-first-line-2.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #table { display: inline-table; }
+ #caption { display: table-caption; }
+ #tbody { display: table-row-group; }
+</style>
+<div id="x">
+ <span id="table">
+ <span id="tbody">be green</span>
+ </span>
+</div>
+<script>
+ x.offsetWidth;
+ var caption = document.createElement("span");
+ caption.id = "caption";
+ caption.textContent = "This should";
+ table.insertBefore(caption, tbody);
+</script>
diff --git a/layout/reftests/first-line/caption-insert-in-first-line-ref.html b/layout/reftests/first-line/caption-insert-in-first-line-ref.html
new file mode 100644
index 0000000000..010a81fe4e
--- /dev/null
+++ b/layout/reftests/first-line/caption-insert-in-first-line-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<style>
+ div { color: green; }
+ #table { display: inline-table; }
+ #caption { display: table-caption; }
+ #tbody { display: table-row-group; }
+</style>
+<div>
+ <span id="table">
+ <span id="caption">This should</span>
+ <span id="tbody">be green</span>
+ </span>
+</div>
diff --git a/layout/reftests/first-line/first-line-in-columnset-1-ref.html b/layout/reftests/first-line/first-line-in-columnset-1-ref.html
new file mode 100644
index 0000000000..903fdc9c4c
--- /dev/null
+++ b/layout/reftests/first-line/first-line-in-columnset-1-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; border: 10px solid green; column-count: 2 }
+ div::first-line { color: green; border: 10px solid red; }
+</style>
+<div>
+ <span style="border: 10px solid green">Some text</span>
+</div>
diff --git a/layout/reftests/first-line/first-line-in-columnset-1.html b/layout/reftests/first-line/first-line-in-columnset-1.html
new file mode 100644
index 0000000000..452f043198
--- /dev/null
+++ b/layout/reftests/first-line/first-line-in-columnset-1.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; border: 10px solid green; column-count: 2 }
+ div::first-line { color: green; border: 10px solid red; }
+</style>
+<div>
+ <span style="border: inherit">Some text</span>
+</div>
diff --git a/layout/reftests/first-line/font-styles-nooverflow.html b/layout/reftests/first-line/font-styles-nooverflow.html
new file mode 100644
index 0000000000..5cf63f1b5d
--- /dev/null
+++ b/layout/reftests/first-line/font-styles-nooverflow.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Simple first-line test</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<style type="text/css">
+html { overflow: hidden; }
+body {
+ margin: 20px;
+ font-family: serif;
+ font-size: 200%;
+ line-height: 1.5;
+ width: 400px;
+}
+
+div:first-line {
+ font-family: sans-serif;
+}
+
+.floatright {
+ float: right;
+}
+
+</style>
+
+</head>
+<body><div>sans-serif<br>serif <strong>bold serif <em>italic</em></strong><em><br>just italic<span class="floatright">italic too</span></em></div></body>
+</html>
diff --git a/layout/reftests/first-line/font-styles-ref.html b/layout/reftests/first-line/font-styles-ref.html
new file mode 100644
index 0000000000..d68b28a1d0
--- /dev/null
+++ b/layout/reftests/first-line/font-styles-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Simple first-line test</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<style type="text/css">
+
+body {
+ margin: 20px;
+ font-family: serif;
+ font-size: 200%;
+ line-height: 1.5;
+ width: 400px;
+}
+
+span.sansserif {
+ font-family: sans-serif;
+}
+
+.floatright {
+ float: right;
+}
+
+</style>
+
+</head>
+<body><div><span class="sansserif">sans-serif</span><br>serif <strong>bold serif <em>italic</em></strong><em><br>just italic<span class="floatright">italic too</span></em></div></body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/first-line/font-styles.html b/layout/reftests/first-line/font-styles.html
new file mode 100644
index 0000000000..a330f54e72
--- /dev/null
+++ b/layout/reftests/first-line/font-styles.html
@@ -0,0 +1,29 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<title>Simple first-line test</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+<style type="text/css">
+
+body {
+ margin: 20px;
+ font-family: serif;
+ font-size: 200%;
+ line-height: 1.5;
+ width: 400px;
+}
+
+div:first-line {
+ font-family: sans-serif;
+}
+
+.floatright {
+ float: right;
+}
+
+</style>
+
+</head>
+<body><div>sans-serif<br>serif <strong>bold serif <em>italic</em></strong><em><br>just italic<span class="floatright">italic too</span></em></div></body>
+</html> \ No newline at end of file
diff --git a/layout/reftests/first-line/ib-split-1-ref.html b/layout/reftests/first-line/ib-split-1-ref.html
new file mode 100644
index 0000000000..a60e9776dc
--- /dev/null
+++ b/layout/reftests/first-line/ib-split-1-ref.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+ #target { color: green; }
+</style>
+<div id="target">
+ <span>
+ <div>This should be green</div>
+ </span>
+</div>
diff --git a/layout/reftests/first-line/ib-split-1.html b/layout/reftests/first-line/ib-split-1.html
new file mode 100644
index 0000000000..5c2b2dd84f
--- /dev/null
+++ b/layout/reftests/first-line/ib-split-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ #target { color: green; }
+ #target::first-line { color: red; }
+</style>
+<div id="target">
+ <span>
+ <div>This should be green</div>
+ </span>
+</div>
diff --git a/layout/reftests/first-line/insertion-in-first-line-1.html b/layout/reftests/first-line/insertion-in-first-line-1.html
new file mode 100644
index 0000000000..2b2769724c
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-1.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"></div>
+<script>
+ x.offsetWidth;
+ x.appendChild(document.createTextNode('This should be green'));
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-10.html b/layout/reftests/first-line/insertion-in-first-line-10.html
new file mode 100644
index 0000000000..60f6898df5
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-10.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #y { display: inline-block; }
+</style>
+<div id="x"><span id="y">This should be </span></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'green';
+ y.appendChild(span);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-11.html b/layout/reftests/first-line/insertion-in-first-line-11.html
new file mode 100644
index 0000000000..cd27a622c0
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-11.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #y { display: inline-block; }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ y.insertBefore(document.createTextNode('This should be '), y.firstChild);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-12.html b/layout/reftests/first-line/insertion-in-first-line-12.html
new file mode 100644
index 0000000000..da797bbf78
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-12.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #y { display: inline-block; }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'This should be ';
+ y.insertBefore(span, y.firstChild);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-2.html b/layout/reftests/first-line/insertion-in-first-line-2.html
new file mode 100644
index 0000000000..95e695c9b4
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-2.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'This should be green';
+ x.appendChild(span);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-3.html b/layout/reftests/first-line/insertion-in-first-line-3.html
new file mode 100644
index 0000000000..81857453f6
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-3.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ x.insertBefore(document.createTextNode('This should be '), y);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-4.html b/layout/reftests/first-line/insertion-in-first-line-4.html
new file mode 100644
index 0000000000..316b6dd42e
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-4.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'This should be ';
+ x.insertBefore(span, y);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-5.html b/layout/reftests/first-line/insertion-in-first-line-5.html
new file mode 100644
index 0000000000..f54e84d24b
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-5.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">This should be </span></div>
+<script>
+ x.offsetWidth;
+ y.appendChild(document.createTextNode('green'));
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-6.html b/layout/reftests/first-line/insertion-in-first-line-6.html
new file mode 100644
index 0000000000..853bce0318
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-6.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">This should be </span></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'green';
+ y.appendChild(span);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-7.html b/layout/reftests/first-line/insertion-in-first-line-7.html
new file mode 100644
index 0000000000..903fd9a2c3
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-7.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ y.insertBefore(document.createTextNode('This should be '), y.firstChild);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-8.html b/layout/reftests/first-line/insertion-in-first-line-8.html
new file mode 100644
index 0000000000..ad20048ff6
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-8.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+</style>
+<div id="x"><span id="y">green</span></div>
+<script>
+ x.offsetWidth;
+ var span = document.createElement('span');
+ span.textContent = 'This should be ';
+ y.insertBefore(span, y.firstChild);
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-9.html b/layout/reftests/first-line/insertion-in-first-line-9.html
new file mode 100644
index 0000000000..0458047adb
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-9.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<style>
+ div { color: red; }
+ div::first-line { color: green }
+ #y { display: inline-block; }
+</style>
+<div id="x"><span id="y">This should be </span></div>
+<script>
+ x.offsetWidth;
+ y.appendChild(document.createTextNode('green'));
+</script>
diff --git a/layout/reftests/first-line/insertion-in-first-line-ref.html b/layout/reftests/first-line/insertion-in-first-line-ref.html
new file mode 100644
index 0000000000..c7babe0977
--- /dev/null
+++ b/layout/reftests/first-line/insertion-in-first-line-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<style>
+ div { color: green; }
+</style>
+<div>This should be green</div>
diff --git a/layout/reftests/first-line/out-of-flow-1-ref.html b/layout/reftests/first-line/out-of-flow-1-ref.html
new file mode 100644
index 0000000000..077268d7c3
--- /dev/null
+++ b/layout/reftests/first-line/out-of-flow-1-ref.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { color: green }
+ </style>
+ </head>
+ <body>
+ <div><span style="float: left">This should be green</span></div>
+ </body>
+</html>
+
diff --git a/layout/reftests/first-line/out-of-flow-1a.html b/layout/reftests/first-line/out-of-flow-1a.html
new file mode 100644
index 0000000000..5a4a824554
--- /dev/null
+++ b/layout/reftests/first-line/out-of-flow-1a.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+ <style>
+ div { color: green }
+ div::first-line { color: red }
+ </style>
+ </head>
+ <body>
+ <div><span style="float: left">This should be green</span></div>
+ </body>
+</html>
+
diff --git a/layout/reftests/first-line/out-of-flow-1b.html b/layout/reftests/first-line/out-of-flow-1b.html
new file mode 100644
index 0000000000..42d5b94881
--- /dev/null
+++ b/layout/reftests/first-line/out-of-flow-1b.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+ <style>
+ div { color: red }
+ div::first-line { color: green }
+ </style>
+ </head>
+ <body>
+ <div><span><span style="float: left">This should be green</span></span></div>
+ </body>
+</html>
diff --git a/layout/reftests/first-line/out-of-flow-1c.html b/layout/reftests/first-line/out-of-flow-1c.html
new file mode 100644
index 0000000000..23c7d5b0c9
--- /dev/null
+++ b/layout/reftests/first-line/out-of-flow-1c.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="dom" />
+ <style>
+ div { color: green }
+ div::first-line { color: red }
+ </style>
+ </head>
+ <body>
+ <div>
+ <span class="some value" style="float: left">
+ This should be green
+ </span>
+ </div>
+ </body>
+</html>
diff --git a/layout/reftests/first-line/out-of-flow-1d.html b/layout/reftests/first-line/out-of-flow-1d.html
new file mode 100644
index 0000000000..f674011fb9
--- /dev/null
+++ b/layout/reftests/first-line/out-of-flow-1d.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="dom" />
+ <style>
+ div { color: green }
+ div::first-line { color: red }
+ </style>
+ <script>
+ function runTest() {
+ var s = document.createElement("span");
+ s.setAttribute("style", "float: left");
+ s.appendChild(document.createTextNode("This should be green"));
+ var i = document.getElementById("i");
+ i.parentNode.insertBefore(s, i);
+ }
+ </script>
+ </head>
+ <body onload="runTest()">
+ <div><span id="i"></span></div>
+ </body>
+</html>
+
diff --git a/layout/reftests/first-line/parent-style-1-ref.html b/layout/reftests/first-line/parent-style-1-ref.html
new file mode 100644
index 0000000000..01b7bf4e7f
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-1-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+
+.a { overflow: scroll; }
+.b, .c { overflow: inherit; }
+
+</style>
+</head>
+<body>
+
+<div class="a"><span class="b"><div class="c"></div></span></div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/parent-style-1.html b/layout/reftests/first-line/parent-style-1.html
new file mode 100644
index 0000000000..bf61009f5a
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+<style>
+
+.a:first-line { }
+.a { overflow: scroll; }
+.b, .c { overflow: inherit; }
+
+</style>
+</head>
+<body>
+
+<div class="a"><span class="b"><div class="c"></div></span></div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/parent-style-2-ref.html b/layout/reftests/first-line/parent-style-2-ref.html
new file mode 100644
index 0000000000..00d335e35a
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-2-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { background: green; }
+ </style>
+ </head>
+ <body>
+ <div>OneTwo</div>
+ </body>
+</html>
diff --git a/layout/reftests/first-line/parent-style-2.html b/layout/reftests/first-line/parent-style-2.html
new file mode 100644
index 0000000000..a6266964b1
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-2.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+ <style>
+ div { background: green; }
+ div::first-line { background-color: red; }
+ span.one { background: inherit; }
+ span.two { background-color: inherit; }
+ </style>
+ </head>
+ <body>
+ <div><span class="one">One</span><span class="two">Two</span></div>
+ </body>
diff --git a/layout/reftests/first-line/parent-style-3-ref.html b/layout/reftests/first-line/parent-style-3-ref.html
new file mode 100644
index 0000000000..35a19e3e69
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-3-ref.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <style>
+ div { background: green; }
+ </style>
+ </head>
+ <body>
+ <div><p>OneTwo</p></div>
+ </body>
+</html>
diff --git a/layout/reftests/first-line/parent-style-3.html b/layout/reftests/first-line/parent-style-3.html
new file mode 100644
index 0000000000..dc7ad76386
--- /dev/null
+++ b/layout/reftests/first-line/parent-style-3.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>CSS 2.1 Test Suite: :first-line</title>
+ <link rel="author" title="Boris Zbarsky" href="mailto:bzbarsky@mit.edu" />
+ <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" />
+ <link rel="help" href="http://www.w3.org/TR/CSS21/selector.html#first-line"/>
+ <meta name="flags" content="" />
+ <style>
+ div, p { background: green; }
+ div::first-line, p::first-line { background-color: red; }
+ span.one { background: inherit; }
+ span.two { background-color: inherit; }
+ </style>
+ </head>
+ <body>
+ <div><p><span class="one">One</span><span class="two">Two</span></p></div>
+ </body>
diff --git a/layout/reftests/first-line/reftest.list b/layout/reftests/first-line/reftest.list
new file mode 100644
index 0000000000..5517711d33
--- /dev/null
+++ b/layout/reftests/first-line/reftest.list
@@ -0,0 +1,56 @@
+# basic functionality
+== basic-1.html basic-ref.html
+
+# handling of out-of-flows when ::first-line happens
+== out-of-flow-1a.html out-of-flow-1-ref.html
+== out-of-flow-1b.html out-of-flow-1-ref.html
+== out-of-flow-1c.html out-of-flow-1-ref.html
+== out-of-flow-1d.html out-of-flow-1-ref.html
+
+# parent computed style correct
+== parent-style-1.html parent-style-1-ref.html
+== parent-style-2.html parent-style-2-ref.html
+== parent-style-3.html parent-style-3-ref.html
+
+# stress-tests
+load stress-1.html # assertion test
+== stress-2.html stress-2-ref.html # assertion + rendering test
+load stress-3.html # assertion test
+load stress-4.html # assertion/crash test.
+load stress-5.html # assertion/crash test
+load stress-6.html # assertion/crash test
+load stress-7.html # assertion/crash test
+== stress-8.html stress-8-ref.html # assertion/crash test
+== stress-9.html stress-9-ref.html # assertion/crash test
+load stress-10.html # crash test
+== stress-11.xhtml stress-11-ref.xhtml
+
+== border-not-apply.html border-not-apply-ref.html
+== 287088-1.html 287088-1-ref.html
+== 287088-2.html 287088-2-ref.html
+== 403177-1.html 403177-1-ref.html
+== 469227-2.html 469227-2-ref.html
+== 469227-3.html 469227-3-ref.html
+
+random == restyle-inside-first-line.html restyle-inside-first-line-ref.html # bug 1523134
+== font-styles.html font-styles-ref.html
+== font-styles-nooverflow.html font-styles-ref.html
+
+== ib-split-1.html ib-split-1-ref.html
+
+== first-line-in-columnset-1.html first-line-in-columnset-1-ref.html
+
+== insertion-in-first-line-1.html insertion-in-first-line-ref.html
+== insertion-in-first-line-2.html insertion-in-first-line-ref.html
+== insertion-in-first-line-3.html insertion-in-first-line-ref.html
+== insertion-in-first-line-4.html insertion-in-first-line-ref.html
+== insertion-in-first-line-5.html insertion-in-first-line-ref.html
+== insertion-in-first-line-6.html insertion-in-first-line-ref.html
+== insertion-in-first-line-7.html insertion-in-first-line-ref.html
+== insertion-in-first-line-8.html insertion-in-first-line-ref.html
+== insertion-in-first-line-9.html insertion-in-first-line-ref.html
+== insertion-in-first-line-10.html insertion-in-first-line-ref.html
+== insertion-in-first-line-11.html insertion-in-first-line-ref.html
+== insertion-in-first-line-12.html insertion-in-first-line-ref.html
+== caption-insert-in-first-line-1.html caption-insert-in-first-line-ref.html
+== caption-insert-in-first-line-2.html caption-insert-in-first-line-ref.html
diff --git a/layout/reftests/first-line/restyle-inside-first-line-ref.html b/layout/reftests/first-line/restyle-inside-first-line-ref.html
new file mode 100644
index 0000000000..a2149cddc9
--- /dev/null
+++ b/layout/reftests/first-line/restyle-inside-first-line-ref.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<title>Test for bug 945105: direct restyling of element inside of a ::first-line that extends to the next line</title>
+<style>
+body { background-color: white; color: black; width: 400px; height: 400px; }
+</style>
+<div style="width: 0"><span style="color: purple">This</span> <span>is some text</span></div>
diff --git a/layout/reftests/first-line/restyle-inside-first-line.html b/layout/reftests/first-line/restyle-inside-first-line.html
new file mode 100644
index 0000000000..5e5333db9b
--- /dev/null
+++ b/layout/reftests/first-line/restyle-inside-first-line.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<title>Test for bug 945105: direct restyling of element inside of a ::first-line that extends to the next line</title>
+<style>
+body { background-color: white; color: black; width: 400px; height: 400px; }
+div::first-line { color: purple; }
+</style>
+<div style="width: 0"><span id="x" style="visibility: hidden">This is some text</span></div>
+<script>
+document.body.firstChild.offsetWidth;
+document.getElementById("x").style.visibility = "visible";
+</script>
diff --git a/layout/reftests/first-line/stress-1.html b/layout/reftests/first-line/stress-1.html
new file mode 100644
index 0000000000..1add82e89b
--- /dev/null
+++ b/layout/reftests/first-line/stress-1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+
+<style>
+ .fl:first-line { }
+ .inh { position: inherit; }
+ .abs { position: absolute; }
+ body { visibility: hidden; }
+</style>
+
+<script>
+
+function boom()
+{
+ x = document.getElementById("x");
+ y = document.getElementById("y");
+
+ x.setAttribute('class', "fl abs");
+ y.setAttribute('class', "inh");
+ setTimeout(boom2, 5);
+}
+
+function boom2()
+{
+ y.setAttribute('class', "abs");
+ document.body.offsetWidth;
+ document.documentElement.className = "";
+}
+
+</script>
+
+</head>
+
+<body onload="setTimeout(boom, 5);">
+<div id="x">
+ <p id="y">foo</p>
+</div>
+</body>
+
+</html>
diff --git a/layout/reftests/first-line/stress-10.html b/layout/reftests/first-line/stress-10.html
new file mode 100644
index 0000000000..79e6194187
--- /dev/null
+++ b/layout/reftests/first-line/stress-10.html
@@ -0,0 +1,5 @@
+<style>
+*::first-line { }
+*::before { content:"before text";}
+</style>
+<object style="position: fixed;column-count: 100;"><ol style="float: right;">
diff --git a/layout/reftests/first-line/stress-11-ref.xhtml b/layout/reftests/first-line/stress-11-ref.xhtml
new file mode 100644
index 0000000000..6249792a53
--- /dev/null
+++ b/layout/reftests/first-line/stress-11-ref.xhtml
@@ -0,0 +1,9 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<style>
+*::before { content:"--"; }
+</style>
+
+<caption></caption>
+<span></span>
+This should not crash Mozilla
+</html>
diff --git a/layout/reftests/first-line/stress-11.xhtml b/layout/reftests/first-line/stress-11.xhtml
new file mode 100644
index 0000000000..261250af26
--- /dev/null
+++ b/layout/reftests/first-line/stress-11.xhtml
@@ -0,0 +1,18 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<style>
+*::first-line { }
+*::before { content:"--"; }
+</style>
+<script>
+function doe() {
+document.getElementsByTagName('caption')[0].removeAttribute('style');
+document.documentElement.offsetHeight;
+document.getElementsByTagName('span')[0].removeAttribute('style');
+}
+window.onload=doe;
+</script>
+
+<caption style="float: left;"></caption>
+<span style="float: right;"></span>
+This should not crash Mozilla
+</html>
diff --git a/layout/reftests/first-line/stress-2-ref.html b/layout/reftests/first-line/stress-2-ref.html
new file mode 100644
index 0000000000..586010e092
--- /dev/null
+++ b/layout/reftests/first-line/stress-2-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html>
+<body>
+
+<div>
+ <b><span>Foo</span></b>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-2.html b/layout/reftests/first-line/stress-2.html
new file mode 100644
index 0000000000..5002007266
--- /dev/null
+++ b/layout/reftests/first-line/stress-2.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+
+<style>
+#fl:first-line { }
+</style>
+
+<script>
+function boom()
+{
+ document.getElementById("s").style.overflow = "auto";
+ document.body.offsetWidth;
+ document.documentElement.className = "";
+}
+</script>
+
+</head>
+<body onload="setTimeout(boom, 300);">
+
+<div id="fl">
+ <b><span id="s">Foo</span></b>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-3.html b/layout/reftests/first-line/stress-3.html
new file mode 100644
index 0000000000..8e43ca6882
--- /dev/null
+++ b/layout/reftests/first-line/stress-3.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html class="reftest-wait" id="fl" style="position: absolute">
+<head>
+
+<style>
+
+.flcounter:first-line { content: counter(egg); }
+
+#fl:first-line { }
+
+</style>
+
+<script>
+
+function boom()
+{
+ document.documentElement.appendChild(document.createTextNode("\n"));
+ document.getElementById("div").style.counterReset = "";
+ setTimeout(boom2, 20);
+}
+
+function boom2()
+{
+ document.body.removeAttribute("class");
+ document.body.offsetWidth;
+ document.documentElement.className = "";
+}
+
+</script>
+</head>
+
+<body style="position: inherit; float: left;" class="flcounter" onload="boom();">
+<div id="div" style="counter-reset: chicken;"></div>
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-4.html b/layout/reftests/first-line/stress-4.html
new file mode 100644
index 0000000000..566dfd7ebd
--- /dev/null
+++ b/layout/reftests/first-line/stress-4.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<style>
+#a:first-child::first-line { }
+</style>
+<script>
+ function runTest() {
+ document.getElementById("a").removeAttribute('style');
+ document.body.offsetWidth;
+ document.documentElement.className = "";
+ }
+</script>
+</head><body onload="runTest()">
+
+<div style="position:absolute;">
+ <span id="a" style="position:fixed;">
+ <span>
+ <span style="display:table;position:absolute;">
+ </span>
+ </span>
+ Loading this should not crash Mozilla
+ </span>
+</div>
+
+
+</body></html>
diff --git a/layout/reftests/first-line/stress-5.html b/layout/reftests/first-line/stress-5.html
new file mode 100644
index 0000000000..486d378fa3
--- /dev/null
+++ b/layout/reftests/first-line/stress-5.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#b::first-letter { }
+#c::first-line { }
+</style>
+</head>
+<body>
+This page should not crash Mozilla
+<div id="c">
+ <table>
+ <div id="b" style="display:table-header-group;">
+ <q>
+ text
+ <div style="position:fixed;">
+ <q>y</q>
+ </div>
+ </q>
+ </div>
+ <span style="display: table;"></span>
+</div>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-6.html b/layout/reftests/first-line/stress-6.html
new file mode 100644
index 0000000000..8883ea54f3
--- /dev/null
+++ b/layout/reftests/first-line/stress-6.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html class="reftest-wait"><head>
+<style>
+#b td::first-line { font-size:110%;}
+nobr::first-line { font-size:110%;}
+
+#b td::after { content:"anonymous text"; }
+nobr::after{ content:"anonymous text"; }
+
+#b::before { content:"before text";}
+#b td::before { content:"before text";}
+</style>
+</head>
+<body>
+<table style="display: table-row;"></table><nobr style="display: list-item; column-count: 2;">
+<table id="b" style="display: inline;"></table>
+</nobr>
+<br>
+This page should not crash Mozilla
+<script>
+function doe(){
+ var td = document.createElement('td');;
+ td.setAttribute('height', '50%');
+ var tr = document.createElement('tr');;
+ tr.setAttribute('height', '50%');
+ tr.appendChild(td);
+ document.getElementsByTagName('table')[1].appendChild(tr);
+ document.body.offsetHeight;
+
+ var td = document.createElement('td');;
+ td.setAttribute('height', '50%');
+ document.getElementsByTagName('tr')[0].appendChild(td);
+ document.body.offsetHeight;
+
+ var td = document.createElement('td');;
+ td.setAttribute('height', '50%');
+ document.getElementsByTagName('tr')[0].appendChild(td);
+
+ document.body.offsetWidth;
+ document.documentElement.className = "";
+}
+setTimeout(doe, 60);
+</script>
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-7.html b/layout/reftests/first-line/stress-7.html
new file mode 100644
index 0000000000..fb8fdfd594
--- /dev/null
+++ b/layout/reftests/first-line/stress-7.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html><head>
+<style>
+body > span::first-line { }
+span::before { content:"before text"; border:3px solid black;}
+</style>
+</head>
+<body>
+
+<span style=" float: left; column-count: 2;">
+ <span style="float: right;">
+ <span style=" float: right;column-count: 2;"></span>
+ </span>
+</span>
+
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-8-ref.html b/layout/reftests/first-line/stress-8-ref.html
new file mode 100644
index 0000000000..30e9caa909
--- /dev/null
+++ b/layout/reftests/first-line/stress-8-ref.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div>
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-8.html b/layout/reftests/first-line/stress-8.html
new file mode 100644
index 0000000000..120f2d0afa
--- /dev/null
+++ b/layout/reftests/first-line/stress-8.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<head><style>
+ div:first-line {}
+</style></head>
+<body>
+<div>
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a
+b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b a b
+a b a b a b a b a b
+
+</div>
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-9-ref.html b/layout/reftests/first-line/stress-9-ref.html
new file mode 100644
index 0000000000..773cefbe77
--- /dev/null
+++ b/layout/reftests/first-line/stress-9-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html><head>
+<style>
+*::after { content:"anonymous text"; }
+*::before { content:"before text"; }
+</style>
+</head>
+<body>
+
+<ol style="overflow: hidden; float: right; column-count: 3;">
+<span style="overflow: auto; float: left;"></span>
+</ol>
+</body>
+</html>
diff --git a/layout/reftests/first-line/stress-9.html b/layout/reftests/first-line/stress-9.html
new file mode 100644
index 0000000000..90e0b63beb
--- /dev/null
+++ b/layout/reftests/first-line/stress-9.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html><head>
+<style>
+*::first-line { }
+*::after { content:"anonymous text"; }
+*::before { content:"before text"; }
+</style>
+</head>
+<body>
+
+<ol style="overflow: hidden; float: right; column-count: 3;">
+<span style="overflow: auto; float: left;"></span>
+</ol>
+</body>
+</html>