summaryrefslogtreecommitdiffstats
path: root/dom/html/reftests
diff options
context:
space:
mode:
Diffstat (limited to 'dom/html/reftests')
-rw-r--r--dom/html/reftests/41464-1-ref.html5
-rw-r--r--dom/html/reftests/41464-1a.html8
-rw-r--r--dom/html/reftests/41464-1b.html8
-rw-r--r--dom/html/reftests/468263-1a.html6
-rw-r--r--dom/html/reftests/468263-1b.html6
-rw-r--r--dom/html/reftests/468263-1c.html6
-rw-r--r--dom/html/reftests/468263-1d.html6
-rw-r--r--dom/html/reftests/468263-2-alternate-ref.html8
-rw-r--r--dom/html/reftests/468263-2-ref.html10
-rw-r--r--dom/html/reftests/468263-2.html10
-rw-r--r--dom/html/reftests/484200-1-ref.html11
-rw-r--r--dom/html/reftests/484200-1.html11
-rw-r--r--dom/html/reftests/485377-ref.html3
-rw-r--r--dom/html/reftests/485377.html3
-rw-r--r--dom/html/reftests/52019-1-ref.html11
-rw-r--r--dom/html/reftests/52019-1.html11
-rw-r--r--dom/html/reftests/557840-ref.html3
-rw-r--r--dom/html/reftests/557840.html3
-rw-r--r--dom/html/reftests/560059-video-dimensions-ref.html3
-rw-r--r--dom/html/reftests/560059-video-dimensions.html3
-rw-r--r--dom/html/reftests/573322-no-quirks-ref.html28
-rw-r--r--dom/html/reftests/573322-no-quirks.html28
-rw-r--r--dom/html/reftests/573322-quirks-ref.html27
-rw-r--r--dom/html/reftests/573322-quirks.html27
-rw-r--r--dom/html/reftests/596455-1a.html14
-rw-r--r--dom/html/reftests/596455-1b.html14
-rw-r--r--dom/html/reftests/596455-2a.html14
-rw-r--r--dom/html/reftests/596455-2b.html14
-rw-r--r--dom/html/reftests/596455-ref-1.html6
-rw-r--r--dom/html/reftests/596455-ref-2.html6
-rw-r--r--dom/html/reftests/610935-ref.html12
-rw-r--r--dom/html/reftests/610935.html11
-rw-r--r--dom/html/reftests/649134-1.html31
-rw-r--r--dom/html/reftests/649134-2-ref.html25
-rw-r--r--dom/html/reftests/649134-2.html31
-rw-r--r--dom/html/reftests/649134-ref.html13
-rw-r--r--dom/html/reftests/741776-1-ref.html1
-rw-r--r--dom/html/reftests/741776-1.vtt1
-rw-r--r--dom/html/reftests/82711-1-ref.html15
-rw-r--r--dom/html/reftests/82711-1.html15
-rw-r--r--dom/html/reftests/82711-2-ref.html15
-rw-r--r--dom/html/reftests/82711-2.html8
-rw-r--r--dom/html/reftests/autofocus/autofocus-after-body-focus-ref.html7
-rw-r--r--dom/html/reftests/autofocus/autofocus-after-body-focus.html10
-rw-r--r--dom/html/reftests/autofocus/autofocus-after-load-ref.html7
-rw-r--r--dom/html/reftests/autofocus/autofocus-after-load.html21
-rw-r--r--dom/html/reftests/autofocus/autofocus-leaves-iframe-ref.html17
-rw-r--r--dom/html/reftests/autofocus/autofocus-leaves-iframe.html16
-rw-r--r--dom/html/reftests/autofocus/button-create.html23
-rw-r--r--dom/html/reftests/autofocus/button-load.html13
-rw-r--r--dom/html/reftests/autofocus/button-ref.html7
-rw-r--r--dom/html/reftests/autofocus/input-create.html23
-rw-r--r--dom/html/reftests/autofocus/input-load.html13
-rw-r--r--dom/html/reftests/autofocus/input-number-ref.html17
-rw-r--r--dom/html/reftests/autofocus/input-number.html26
-rw-r--r--dom/html/reftests/autofocus/input-ref.html7
-rw-r--r--dom/html/reftests/autofocus/input-time-ref.html22
-rw-r--r--dom/html/reftests/autofocus/input-time.html22
-rw-r--r--dom/html/reftests/autofocus/reftest.list13
-rw-r--r--dom/html/reftests/autofocus/select-create.html23
-rw-r--r--dom/html/reftests/autofocus/select-load.html13
-rw-r--r--dom/html/reftests/autofocus/select-ref.html7
-rw-r--r--dom/html/reftests/autofocus/style.css10
-rw-r--r--dom/html/reftests/autofocus/textarea-create.html23
-rw-r--r--dom/html/reftests/autofocus/textarea-load.html13
-rw-r--r--dom/html/reftests/autofocus/textarea-ref.html7
-rw-r--r--dom/html/reftests/body-frame-margin-remove-other-pres-hint-ref.html14
-rw-r--r--dom/html/reftests/body-frame-margin-remove-other-pres-hint.html16
-rw-r--r--dom/html/reftests/body-topmargin-dynamic.html12
-rw-r--r--dom/html/reftests/body-topmargin-ref.html7
-rw-r--r--dom/html/reftests/bug1106522-1.html11
-rw-r--r--dom/html/reftests/bug1106522-2.html11
-rw-r--r--dom/html/reftests/bug1106522-ref.html8
-rw-r--r--dom/html/reftests/bug1196784-no-srcset.html6
-rw-r--r--dom/html/reftests/bug1196784-with-srcset.html6
-rw-r--r--dom/html/reftests/bug1196784.pngbin0 -> 294 bytes
-rw-r--r--dom/html/reftests/bug1228601-video-rotated-ref.html13
-rw-r--r--dom/html/reftests/bug1228601-video-rotation-90.html13
-rw-r--r--dom/html/reftests/bug1423850-canvas-video-rotated-ref.html16
-rw-r--r--dom/html/reftests/bug1423850-canvas-video-rotation-90.html16
-rw-r--r--dom/html/reftests/bug1512297-ref.html7
-rw-r--r--dom/html/reftests/bug1512297.html14
-rw-r--r--dom/html/reftests/bug448564-1_ideal.html13
-rw-r--r--dom/html/reftests/bug448564-1_malformed.html19
-rw-r--r--dom/html/reftests/bug448564-1_well-formed.html11
-rw-r--r--dom/html/reftests/bug448564-4a.html10
-rw-r--r--dom/html/reftests/bug448564-4b.html6
-rw-r--r--dom/html/reftests/bug448564_forms.css2
-rw-r--r--dom/html/reftests/bug502168-1_malformed.html10
-rw-r--r--dom/html/reftests/bug502168-1_well-formed.html9
-rw-r--r--dom/html/reftests/bug917595-1-ref.html17
-rw-r--r--dom/html/reftests/bug917595-exif-rotated.jpgbin0 -> 90700 bytes
-rw-r--r--dom/html/reftests/bug917595-iframe-1.html17
-rw-r--r--dom/html/reftests/bug917595-pixel-rotated.jpgbin0 -> 91596 bytes
-rw-r--r--dom/html/reftests/bug917595-unrotated.jpgbin0 -> 90864 bytes
-rw-r--r--dom/html/reftests/figure-ref.html11
-rw-r--r--dom/html/reftests/figure.html8
-rw-r--r--dom/html/reftests/href-attr-change-restyles-ref.html33
-rw-r--r--dom/html/reftests/href-attr-change-restyles.html48
-rw-r--r--dom/html/reftests/image-load-shortcircuit-1.html8
-rw-r--r--dom/html/reftests/image-load-shortcircuit-2.html10
-rw-r--r--dom/html/reftests/image-load-shortcircuit-ref.html1
-rw-r--r--dom/html/reftests/lime100x100.svg4
-rw-r--r--dom/html/reftests/pass.pngbin0 -> 1036 bytes
-rw-r--r--dom/html/reftests/pre-1-ref.html22
-rw-r--r--dom/html/reftests/pre-1.html22
-rw-r--r--dom/html/reftests/red.pngbin0 -> 82 bytes
-rw-r--r--dom/html/reftests/reftest.list75
-rw-r--r--dom/html/reftests/responsive-image-load-shortcircuit-ref.html1
-rw-r--r--dom/html/reftests/responsive-image-load-shortcircuit.html15
-rw-r--r--dom/html/reftests/table-border-1-ref.html46
-rw-r--r--dom/html/reftests/table-border-1.html36
-rw-r--r--dom/html/reftests/table-border-2-notref.html40
-rw-r--r--dom/html/reftests/table-border-2-ref.html30
-rw-r--r--dom/html/reftests/table-border-2.html30
-rw-r--r--dom/html/reftests/toblob-todataurl/blob.js68
-rw-r--r--dom/html/reftests/toblob-todataurl/dataurl.js56
-rw-r--r--dom/html/reftests/toblob-todataurl/images/original.pngbin0 -> 50613 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q0.jpgbin0 -> 2165 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q100.jpgbin0 -> 54323 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q25.jpgbin0 -> 3898 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q50.jpgbin0 -> 4924 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q75.jpgbin0 -> 6405 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/images/q92.jpgbin0 -> 13931 bytes
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-0-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-100-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-25-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-50-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-75-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/quality-92-ref.html2
-rw-r--r--dom/html/reftests/toblob-todataurl/reftest.list16
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-0.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-100.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-25.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-50.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-75.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-92.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-default.html7
-rw-r--r--dom/html/reftests/toblob-todataurl/toblob-quality-undefined.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-0.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-100.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-25.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-50.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-75.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-92.html10
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-default.html7
-rw-r--r--dom/html/reftests/toblob-todataurl/todataurl-quality-undefined.html10
-rw-r--r--dom/html/reftests/video_rotated.mp4bin0 -> 1543 bytes
-rw-r--r--dom/html/reftests/video_rotation_90.mp4bin0 -> 1541 bytes
149 files changed, 1881 insertions, 0 deletions
diff --git a/dom/html/reftests/41464-1-ref.html b/dom/html/reftests/41464-1-ref.html
new file mode 100644
index 0000000000..3b68fca6d7
--- /dev/null
+++ b/dom/html/reftests/41464-1-ref.html
@@ -0,0 +1,5 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=help href=http://www.whatwg.org/html5/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=soft cols=20>01234567890 01234567890 01234567890</textarea>
diff --git a/dom/html/reftests/41464-1a.html b/dom/html/reftests/41464-1a.html
new file mode 100644
index 0000000000..f0569347fe
--- /dev/null
+++ b/dom/html/reftests/41464-1a.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=help href=http://www.whatwg.org/html5/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>
+<script>
+document.getElementsByTagName("textarea")[0].wrap = "soft";
+</script>
diff --git a/dom/html/reftests/41464-1b.html b/dom/html/reftests/41464-1b.html
new file mode 100644
index 0000000000..13c42518cc
--- /dev/null
+++ b/dom/html/reftests/41464-1b.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<title>Dynamic manipulation of textarea.wrap</title>
+<link rel=help href=http://www.whatwg.org/html5/#dom-textarea-wrap>
+<link rel=author title=Ms2ger href=mailto:ms2ger@gmail.com>
+<textarea wrap=off cols=20>01234567890 01234567890 01234567890</textarea>
+<script>
+document.getElementsByTagName("textarea")[0].setAttribute("wrap", "soft");
+</script>
diff --git a/dom/html/reftests/468263-1a.html b/dom/html/reftests/468263-1a.html
new file mode 100644
index 0000000000..93ad7df34e
--- /dev/null
+++ b/dom/html/reftests/468263-1a.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <img id="image2" src="pass.png">
+</body>
+</html>
diff --git a/dom/html/reftests/468263-1b.html b/dom/html/reftests/468263-1b.html
new file mode 100644
index 0000000000..e637e30945
--- /dev/null
+++ b/dom/html/reftests/468263-1b.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <input id="image3" type="image" src="pass.png">
+</body>
+</html>
diff --git a/dom/html/reftests/468263-1c.html b/dom/html/reftests/468263-1c.html
new file mode 100644
index 0000000000..14c2b2b378
--- /dev/null
+++ b/dom/html/reftests/468263-1c.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <object id="image4" type="image/png" data="pass.png"></object>
+</body>
+</html>
diff --git a/dom/html/reftests/468263-1d.html b/dom/html/reftests/468263-1d.html
new file mode 100644
index 0000000000..53740e596f
--- /dev/null
+++ b/dom/html/reftests/468263-1d.html
@@ -0,0 +1,6 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <object id="image5" type="text/html" data="data:text/html,<b>Testing</b>"></object>
+</body>
+</html>
diff --git a/dom/html/reftests/468263-2-alternate-ref.html b/dom/html/reftests/468263-2-alternate-ref.html
new file mode 100644
index 0000000000..c3bdb9da93
--- /dev/null
+++ b/dom/html/reftests/468263-2-alternate-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <img id="image1" src="">
+ <img id="image2">
+ <input id="image3" type="image">
+</body>
+</html>
diff --git a/dom/html/reftests/468263-2-ref.html b/dom/html/reftests/468263-2-ref.html
new file mode 100644
index 0000000000..6e7f6cb360
--- /dev/null
+++ b/dom/html/reftests/468263-2-ref.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body>
+ <img id="image1" src="">
+ <img id="image2">
+ <input id="image3" type="image">
+ <object id="image4" type="image/png">
+ <object id="image5" type="text/html"></object>
+</body>
+</html>
diff --git a/dom/html/reftests/468263-2.html b/dom/html/reftests/468263-2.html
new file mode 100644
index 0000000000..d3d447d07e
--- /dev/null
+++ b/dom/html/reftests/468263-2.html
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML>
+<html>
+<body onload="document.getElementById('image1').setAttribute('src', ''); document.getElementById('image2').removeAttribute('src'); document.getElementById('image3').removeAttribute('src'); document.getElementById('image4').removeAttribute('data'); document.getElementById('image5').removeAttribute('data');">
+ <img id="image1" src="pass.png">
+ <img id="image2" src="pass.png">
+ <input id="image3" type="image" src="pass.png">
+ <object id="image4" type="image/png" data="pass.png"></object>
+ <object id="image5" type="text/html" data="data:text/html,<b>Testing</b>"></object>
+</body>
+</html>
diff --git a/dom/html/reftests/484200-1-ref.html b/dom/html/reftests/484200-1-ref.html
new file mode 100644
index 0000000000..39ef12261d
--- /dev/null
+++ b/dom/html/reftests/484200-1-ref.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<title>Test for Bug 484200</title>
+<style>
+p { background:lime }
+</style>
+</head>
+<body>
+<p>xxxxx</p>
+</body>
+</html>
diff --git a/dom/html/reftests/484200-1.html b/dom/html/reftests/484200-1.html
new file mode 100644
index 0000000000..c2663d1aea
--- /dev/null
+++ b/dom/html/reftests/484200-1.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<title>Test for Bug 484200</title>
+<style src=style>
+p { background:lime }
+</style>
+</head>
+<body>
+<p>xxxxx</p>
+</body>
+</html>
diff --git a/dom/html/reftests/485377-ref.html b/dom/html/reftests/485377-ref.html
new file mode 100644
index 0000000000..e98cbbb71f
--- /dev/null
+++ b/dom/html/reftests/485377-ref.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<title>The mark element</title>
+<p>Foo <span style="background: yellow; color: black;">bar</span> baz.
diff --git a/dom/html/reftests/485377.html b/dom/html/reftests/485377.html
new file mode 100644
index 0000000000..9f91f99805
--- /dev/null
+++ b/dom/html/reftests/485377.html
@@ -0,0 +1,3 @@
+<!DOCTYPE html>
+<title>The mark element</title>
+<p>Foo <mark>bar</mark> baz.
diff --git a/dom/html/reftests/52019-1-ref.html b/dom/html/reftests/52019-1-ref.html
new file mode 100644
index 0000000000..73bf05f681
--- /dev/null
+++ b/dom/html/reftests/52019-1-ref.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<title>Test for Bug 52019</title>
+</head>
+<body>
+<font>font</font>
+<font>font</font>
+<font size="+2">font</font>
+<font size="-2">font</font>
+</body>
+</html>
diff --git a/dom/html/reftests/52019-1.html b/dom/html/reftests/52019-1.html
new file mode 100644
index 0000000000..09cff148fa
--- /dev/null
+++ b/dom/html/reftests/52019-1.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+<title>Test for Bug 52019</title>
+</head>
+<body>
+<font size="+.5">font</font>
+<font size="-.5">font</font>
+<font size="+2.5">font</font>
+<font size="-2.5">font</font>
+</body>
+</html>
diff --git a/dom/html/reftests/557840-ref.html b/dom/html/reftests/557840-ref.html
new file mode 100644
index 0000000000..ea72d50f5f
--- /dev/null
+++ b/dom/html/reftests/557840-ref.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Canvas and hspace, vspace</title>
+<canvas style="background: black;"></canvas>
diff --git a/dom/html/reftests/557840.html b/dom/html/reftests/557840.html
new file mode 100644
index 0000000000..4aed5092a8
--- /dev/null
+++ b/dom/html/reftests/557840.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Canvas and hspace, vspace</title>
+<canvas hspace="42" vspace="42" style="background: black;"></canvas>
diff --git a/dom/html/reftests/560059-video-dimensions-ref.html b/dom/html/reftests/560059-video-dimensions-ref.html
new file mode 100644
index 0000000000..f3424de689
--- /dev/null
+++ b/dom/html/reftests/560059-video-dimensions-ref.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Video dimensions</title>
+<video style="border: thin solid black;" width="300" height="150"></video>
diff --git a/dom/html/reftests/560059-video-dimensions.html b/dom/html/reftests/560059-video-dimensions.html
new file mode 100644
index 0000000000..99373c999a
--- /dev/null
+++ b/dom/html/reftests/560059-video-dimensions.html
@@ -0,0 +1,3 @@
+<!doctype html>
+<title>Video dimensions</title>
+<video style="border: thin solid black;"></video>
diff --git a/dom/html/reftests/573322-no-quirks-ref.html b/dom/html/reftests/573322-no-quirks-ref.html
new file mode 100644
index 0000000000..e3f993f2f7
--- /dev/null
+++ b/dom/html/reftests/573322-no-quirks-ref.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<style>
+div { background: green; border: solid blue; width: 100px; height: 100px; }
+</style>
+<table border=1 width=50%>
+<tr>
+<td><div></div>left
+</table>
+<table border=1 width=50%>
+<tr>
+<td><div></div>justify
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-right;"><div></div>right
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-center;"><div></div>center
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-center;"><div></div>middle
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: center;"><div></div>absmiddle
+</table>
diff --git a/dom/html/reftests/573322-no-quirks.html b/dom/html/reftests/573322-no-quirks.html
new file mode 100644
index 0000000000..ac27609e36
--- /dev/null
+++ b/dom/html/reftests/573322-no-quirks.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<style>
+div { background: green; border: solid blue; width: 100px; height: 100px; }
+</style>
+<table border=1 width=50%>
+<tr>
+<td align=left><div></div>left
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=justify><div></div>justify
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=right><div></div>right
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=center><div></div>center
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=middle><div></div>middle
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=absmiddle><div></div>absmiddle
+</table>
diff --git a/dom/html/reftests/573322-quirks-ref.html b/dom/html/reftests/573322-quirks-ref.html
new file mode 100644
index 0000000000..6cc22a58e5
--- /dev/null
+++ b/dom/html/reftests/573322-quirks-ref.html
@@ -0,0 +1,27 @@
+<style>
+div { background: green; border: solid blue; width: 100px; height: 100px; }
+</style>
+<table border=1 width=50%>
+<tr>
+<td><div></div>left
+</table>
+<table border=1 width=50%>
+<tr>
+<td><div></div>justify
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-right;"><div></div>right
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-center;"><div></div>center
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: -moz-center;"><div></div>middle
+</table>
+<table border=1 width=50%>
+<tr>
+<td style="text-align: center;"><div></div>absmiddle
+</table>
diff --git a/dom/html/reftests/573322-quirks.html b/dom/html/reftests/573322-quirks.html
new file mode 100644
index 0000000000..35757b1859
--- /dev/null
+++ b/dom/html/reftests/573322-quirks.html
@@ -0,0 +1,27 @@
+<style>
+div { background: green; border: solid blue; width: 100px; height: 100px; }
+</style>
+<table border=1 width=50%>
+<tr>
+<td align=left><div></div>left
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=justify><div></div>justify
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=right><div></div>right
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=center><div></div>center
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=middle><div></div>middle
+</table>
+<table border=1 width=50%>
+<tr>
+<td align=absmiddle><div></div>absmiddle
+</table>
diff --git a/dom/html/reftests/596455-1a.html b/dom/html/reftests/596455-1a.html
new file mode 100644
index 0000000000..60d494072e
--- /dev/null
+++ b/dom/html/reftests/596455-1a.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <script>
+ function onLoadHandler()
+ {
+ document.getElementById('l').value = document.getElementById('i').value;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input type='hidden' value='foo&#13;bar' id='i'>
+ <textarea id='l'></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/596455-1b.html b/dom/html/reftests/596455-1b.html
new file mode 100644
index 0000000000..8478786c12
--- /dev/null
+++ b/dom/html/reftests/596455-1b.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <script>
+ function onLoadHandler()
+ {
+ document.getElementById('l').value = document.getElementById('i').value;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input value='foo&#13;bar' type='hidden' id='i'>
+ <textarea id='l'></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/596455-2a.html b/dom/html/reftests/596455-2a.html
new file mode 100644
index 0000000000..f78a36c613
--- /dev/null
+++ b/dom/html/reftests/596455-2a.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <script>
+ function onLoadHandler()
+ {
+ document.getElementById('l').value = document.getElementById('i').value;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input style="display:none;" type='text' value='foo&#13;bar' id='i'>
+ <textarea id='l'></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/596455-2b.html b/dom/html/reftests/596455-2b.html
new file mode 100644
index 0000000000..1867327903
--- /dev/null
+++ b/dom/html/reftests/596455-2b.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class='reftest-wait'>
+ <script>
+ function onLoadHandler()
+ {
+ document.getElementById('l').value = document.getElementById('i').value;
+ document.documentElement.className='';
+ }
+ </script>
+ <body onload="onLoadHandler();">
+ <input style="display:none;" value='foo&#13;bar' type='text' id='i'>
+ <textarea id='l'></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/596455-ref-1.html b/dom/html/reftests/596455-ref-1.html
new file mode 100644
index 0000000000..10371df270
--- /dev/null
+++ b/dom/html/reftests/596455-ref-1.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea>foo&#13;bar</textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/596455-ref-2.html b/dom/html/reftests/596455-ref-2.html
new file mode 100644
index 0000000000..0dbc4dbb31
--- /dev/null
+++ b/dom/html/reftests/596455-ref-2.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+ <body>
+ <textarea>foobar</textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/610935-ref.html b/dom/html/reftests/610935-ref.html
new file mode 100644
index 0000000000..7a2a41a52a
--- /dev/null
+++ b/dom/html/reftests/610935-ref.html
@@ -0,0 +1,12 @@
+<!doctype html>
+<title>Test for bug 610935</title>
+<style>
+div { width:300px; background:yellow; height:50px; }
+table { width:150%; }
+td { background:blue; }
+</style>
+<div>
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr><td>parent div float=left</td></tr>
+ </table>
+</div>
diff --git a/dom/html/reftests/610935.html b/dom/html/reftests/610935.html
new file mode 100644
index 0000000000..5495ae3d5a
--- /dev/null
+++ b/dom/html/reftests/610935.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>Test for bug 610935</title>
+<style>
+div { width:300px; background:yellow; height:50px; }
+td { background:blue; }
+</style>
+<div>
+ <table width="150%" cellspacing="0" cellpadding="0" border="0">
+ <tr><td>parent div float=left</td></tr>
+ </table>
+</div>
diff --git a/dom/html/reftests/649134-1.html b/dom/html/reftests/649134-1.html
new file mode 100644
index 0000000000..b38e988304
--- /dev/null
+++ b/dom/html/reftests/649134-1.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug </title>
+<link rel="stylesheet" type="text/css" href="" />
+<!--
+ #foo {
+ /* This doesn't get evaluated */
+ color: red;
+ }
+ #ie {
+ border: 5px solid red;
+ }
+ #ie {
+ display: block;
+ }
+ #moz {
+ color: blue;
+ /* display: none; */
+ }
+-->
+
+</head>
+<body>
+
+<p id="foo">foo</p>
+<p id="ie">ie</p>
+<p id="moz">moz</p>
+
+</body>
+</html>
diff --git a/dom/html/reftests/649134-2-ref.html b/dom/html/reftests/649134-2-ref.html
new file mode 100644
index 0000000000..d15fae5282
--- /dev/null
+++ b/dom/html/reftests/649134-2-ref.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug </title>
+<style>
+ #ie {
+ border: 5px solid red;
+ }
+ #ie {
+ display: block;
+ }
+ #moz {
+ color: blue;
+ /* display: none; */
+ }
+</style>
+</head>
+<body>
+
+<p id="foo">foo</p>
+<p id="ie">ie</p>
+<p id="moz">moz</p>
+
+</body>
+</html>
diff --git a/dom/html/reftests/649134-2.html b/dom/html/reftests/649134-2.html
new file mode 100644
index 0000000000..4d2a5ae50d
--- /dev/null
+++ b/dom/html/reftests/649134-2.html
@@ -0,0 +1,31 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug </title>
+<link rel="stylesheet" type="text/css" href=" " />
+<!--
+ #foo {
+ /* This doesn't get evaluated */
+ color: red;
+ }
+ #ie {
+ border: 5px solid red;
+ }
+ #ie {
+ display: block;
+ }
+ #moz {
+ color: blue;
+ /* display: none; */
+ }
+-->
+
+</head>
+<body>
+
+<p id="foo">foo</p>
+<p id="ie">ie</p>
+<p id="moz">moz</p>
+
+</body>
+</html>
diff --git a/dom/html/reftests/649134-ref.html b/dom/html/reftests/649134-ref.html
new file mode 100644
index 0000000000..2968464bed
--- /dev/null
+++ b/dom/html/reftests/649134-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <title>Testcase for bug </title>
+</head>
+<body>
+
+<p id="foo">foo</p>
+<p id="ie">ie</p>
+<p id="moz">moz</p>
+
+</body>
+</html>
diff --git a/dom/html/reftests/741776-1-ref.html b/dom/html/reftests/741776-1-ref.html
new file mode 100644
index 0000000000..bc05ae4487
--- /dev/null
+++ b/dom/html/reftests/741776-1-ref.html
@@ -0,0 +1 @@
+<!DOCTYPE html><meta charset=utf-8><pre>ää
diff --git a/dom/html/reftests/741776-1.vtt b/dom/html/reftests/741776-1.vtt
new file mode 100644
index 0000000000..b66b11694c
--- /dev/null
+++ b/dom/html/reftests/741776-1.vtt
@@ -0,0 +1 @@
+ää
diff --git a/dom/html/reftests/82711-1-ref.html b/dom/html/reftests/82711-1-ref.html
new file mode 100644
index 0000000000..e0b25fc9b3
--- /dev/null
+++ b/dom/html/reftests/82711-1-ref.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+<body>
+<textarea rows="10" cols="25" wrap="off">
+ 0 1 2 3
+ 4 5
+
+ 6 7 8
+ 9
+
+
+ This is a long line that could wrap.
+</textarea>
+</body>
+</html>
diff --git a/dom/html/reftests/82711-1.html b/dom/html/reftests/82711-1.html
new file mode 100644
index 0000000000..70a8c1b23f
--- /dev/null
+++ b/dom/html/reftests/82711-1.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+<body>
+<textarea rows="10" cols="25" style="white-space: pre">
+ 0 1 2 3
+ 4 5
+
+ 6 7 8
+ 9
+
+
+ This is a long line that could wrap.
+</textarea>
+</body>
+</html>
diff --git a/dom/html/reftests/82711-2-ref.html b/dom/html/reftests/82711-2-ref.html
new file mode 100644
index 0000000000..963b9c7141
--- /dev/null
+++ b/dom/html/reftests/82711-2-ref.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html>
+<body>
+<textarea rows="10" cols="25" wrap="off" style="white-space: normal">
+ 0 1 2 3
+ 4 5
+
+ 6 7 8
+ 9
+
+
+ This is a long line that could wrap.
+</textarea>
+</body>
+</html>
diff --git a/dom/html/reftests/82711-2.html b/dom/html/reftests/82711-2.html
new file mode 100644
index 0000000000..aacd6d481e
--- /dev/null
+++ b/dom/html/reftests/82711-2.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html>
+<body>
+<textarea rows="10" cols="25" style="white-space: normal">
+0 1 2 3 4 5 6 7 8 9 This is a long line that could wrap.
+</textarea>
+</body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-after-body-focus-ref.html b/dom/html/reftests/autofocus/autofocus-after-body-focus-ref.html
new file mode 100644
index 0000000000..3801ed7543
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-after-body-focus-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementsByTagName('input')[0].focus();">
+ <input onfocus="document.documentElement.removeAttribute('class');">
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-after-body-focus.html b/dom/html/reftests/autofocus/autofocus-after-body-focus.html
new file mode 100644
index 0000000000..6d43b865a8
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-after-body-focus.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <script>
+ document.body.focus();
+ </script>
+ <input autofocus onfocus="document.documentElement.removeAttribute('class');">
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-after-load-ref.html b/dom/html/reftests/autofocus/autofocus-after-load-ref.html
new file mode 100644
index 0000000000..f28f06f0f3
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-after-load-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <input autofocus><textarea></textarea><select></select><button></button>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-after-load.html b/dom/html/reftests/autofocus/autofocus-after-load.html
new file mode 100644
index 0000000000..753ef183d1
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-after-load.html
@@ -0,0 +1,21 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function loadHandler()
+ {
+ var body = document.body;
+
+ var elements = ["input", "textarea", "select", "button"];
+ for (var e of elements) {
+ var el = document.createElement(e);
+ el.autofocus = true;
+ body.appendChild(el);
+ }
+
+ setTimeout(document.documentElement.removeAttribute('class'), 0);
+ }
+ </script>
+ <body onload="loadHandler();">
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-leaves-iframe-ref.html b/dom/html/reftests/autofocus/autofocus-leaves-iframe-ref.html
new file mode 100644
index 0000000000..e74e2753dc
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-leaves-iframe-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function loadHandler()
+ {
+ frames[0].document.getElementsByTagName('input')[0].onfocus = function() {
+ document.documentElement.removeAttribute('class');
+ }
+ frames[0].document.getElementsByTagName('input')[0].focus();
+ }
+ </script>
+ <body onload="loadHandler();">
+ <iframe srcdoc="<input>"></iframe>
+ <input></input>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/autofocus-leaves-iframe.html b/dom/html/reftests/autofocus/autofocus-leaves-iframe.html
new file mode 100644
index 0000000000..9069156878
--- /dev/null
+++ b/dom/html/reftests/autofocus/autofocus-leaves-iframe.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function frameLoadHandler()
+ {
+ var i = document.createElement('input');
+ i.autofocus = true;
+ document.body.appendChild(i);
+ setTimeout(document.documentElement.removeAttribute('class'), 0);
+ }
+ </script>
+ <body>
+ <iframe onload="frameLoadHandler();" srcdoc="<input autofocus>"></iframe>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/button-create.html b/dom/html/reftests/autofocus/button-create.html
new file mode 100644
index 0000000000..ae49d162ad
--- /dev/null
+++ b/dom/html/reftests/autofocus/button-create.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <script>
+ var body = document.body;
+
+ var i = document.createElement('button');
+ i.autofocus = false;
+ body.appendChild(i);
+
+ i = document.createElement('button');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+
+ i = document.createElement('button');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+ </script>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/button-load.html b/dom/html/reftests/autofocus/button-load.html
new file mode 100644
index 0000000000..a9e28e2bb6
--- /dev/null
+++ b/dom/html/reftests/autofocus/button-load.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function focusHandler()
+ {
+ setTimeout(document.documentElement.removeAttribute('class'), 0);
+ }
+ </script>
+ <body>
+ <button></button><button autofocus onfocus="focusHandler();"></button><button autofocus onfocus="focusHandler();"></button>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/button-ref.html b/dom/html/reftests/autofocus/button-ref.html
new file mode 100644
index 0000000000..878c8e2681
--- /dev/null
+++ b/dom/html/reftests/autofocus/button-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementsByTagName('button')[1].focus();">
+ <button></button><button onfocus="document.documentElement.removeAttribute('class');"></button><button></button>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/input-create.html b/dom/html/reftests/autofocus/input-create.html
new file mode 100644
index 0000000000..c6d0c28089
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-create.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <script>
+ var body = document.body;
+
+ var i = document.createElement('input');
+ i.autofocus = false;
+ body.appendChild(i);
+
+ i = document.createElement('input');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+
+ i = document.createElement('input');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+ </script>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/input-load.html b/dom/html/reftests/autofocus/input-load.html
new file mode 100644
index 0000000000..d40b49177a
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-load.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function focusHandler()
+ {
+ document.documentElement.removeAttribute('class');
+ }
+ </script>
+ <body>
+ <input><input autofocus onfocus="focusHandler();"><input autofocus onfocus="focusHandler();">
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/input-number-ref.html b/dom/html/reftests/autofocus/input-number-ref.html
new file mode 100644
index 0000000000..384915edb8
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-number-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- In this case we're using reftest-wait to make sure the test doesn't
+ get snapshotted before it's been focused. We're not testing
+ invalidation so we don't need to listen for MozReftestInvalidate.
+ -->
+ <head>
+ <meta charset="utf-8">
+ </head>
+ <body onload="document.getElementsByTagName('input')[0].focus();">
+ <input onfocus="document.documentElement.removeAttribute('class');"
+ style="-moz-appearance: none;">
+ <!-- div to cover spin box area for type=number to type=text comparison -->
+ <div style="display:block; position:absolute; background-color:black; width:200px; height:100px; top:0px; left:100px;">
+ </body>
+</html>
+
diff --git a/dom/html/reftests/autofocus/input-number.html b/dom/html/reftests/autofocus/input-number.html
new file mode 100644
index 0000000000..7816ee9bd9
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-number.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- In this case we're using reftest-wait to make sure the test doesn't
+ get snapshotted before it's been focused. We're not testing
+ invalidation so we don't need to listen for MozReftestInvalidate.
+ -->
+ <head>
+ <meta charset="utf-8">
+ <script>
+
+function focusHandler() {
+ setTimeout(function() {
+ document.documentElement.removeAttribute('class');
+ }, 0);
+}
+
+ </script>
+ </head>
+ <body>
+ <input type="number" autofocus onfocus="focusHandler();"
+ style="-moz-appearance: none;">
+ <!-- div to cover spin box area for type=number to type=text comparison -->
+ <div style="display:block; position:absolute; background-color:black; width:200px; height:100px; top:0px; left:100px;">
+ </body>
+</html>
+
diff --git a/dom/html/reftests/autofocus/input-ref.html b/dom/html/reftests/autofocus/input-ref.html
new file mode 100644
index 0000000000..6e2e546d24
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementsByTagName('input')[1].focus();">
+ <input><input onfocus="document.documentElement.removeAttribute('class');"><input>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/input-time-ref.html b/dom/html/reftests/autofocus/input-time-ref.html
new file mode 100644
index 0000000000..abaa6feeac
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-time-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- In this case we're using reftest-wait to make sure the test doesn't
+ get snapshotted before it's been focused. We're not testing
+ invalidation so we don't need to listen for MozReftestInvalidate.
+ -->
+ <head>
+ <script>
+ function focusHandler() {
+ setTimeout(function() {
+ document.documentElement.removeAttribute("class");
+ }, 0);
+ }
+ </script>
+ </head>
+ <body onload="document.getElementById('t').focus();">
+ <input type="time" id="t" onfocus="focusHandler();"
+ style="-moz-appearance: none;">
+ </body>
+</html>
+
+
diff --git a/dom/html/reftests/autofocus/input-time.html b/dom/html/reftests/autofocus/input-time.html
new file mode 100644
index 0000000000..a86a91bbfc
--- /dev/null
+++ b/dom/html/reftests/autofocus/input-time.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <!-- In this case we're using reftest-wait to make sure the test doesn't
+ get snapshotted before it's been focused. We're not testing
+ invalidation so we don't need to listen for MozReftestInvalidate.
+ -->
+ <head>
+ <script>
+ function focusHandler() {
+ setTimeout(function() {
+ document.documentElement.removeAttribute("class");
+ }, 0);
+ }
+ </script>
+ </head>
+ <body>
+ <input type="time" autofocus onfocus="focusHandler();"
+ style="-moz-appearance: none;">
+ </body>
+</html>
+
+
diff --git a/dom/html/reftests/autofocus/reftest.list b/dom/html/reftests/autofocus/reftest.list
new file mode 100644
index 0000000000..03ddce4149
--- /dev/null
+++ b/dom/html/reftests/autofocus/reftest.list
@@ -0,0 +1,13 @@
+needs-focus == input-load.html input-ref.html
+needs-focus == input-create.html input-ref.html
+needs-focus == input-number.html input-number-ref.html
+fuzzy(0-5,0-1) needs-focus == input-time.html input-time-ref.html # One anti-aliased outline corner.
+needs-focus == button-load.html button-ref.html
+needs-focus == button-create.html button-ref.html
+fuzzy-if(gtkWidget,0-18,0-1) needs-focus == textarea-load.html textarea-ref.html # One anti-aliased corner.
+needs-focus == textarea-create.html textarea-ref.html
+fuzzy-if(Android,0-10,0-5) needs-focus == select-load.html select-ref.html
+fuzzy(0-10,0-5) needs-focus == select-create.html select-ref.html
+fuzzy(0-1,0-1) needs-focus == autofocus-after-load.html autofocus-after-load-ref.html
+needs-focus == autofocus-leaves-iframe.html autofocus-leaves-iframe-ref.html
+fuzzy(0-5,0-1) needs-focus == autofocus-after-body-focus.html autofocus-after-body-focus-ref.html
diff --git a/dom/html/reftests/autofocus/select-create.html b/dom/html/reftests/autofocus/select-create.html
new file mode 100644
index 0000000000..fd9c29c954
--- /dev/null
+++ b/dom/html/reftests/autofocus/select-create.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <script>
+ var body = document.body;
+
+ var i = document.createElement('select');
+ i.autofocus = false;
+ body.appendChild(i);
+
+ i = document.createElement('select');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+
+ i = document.createElement('select');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+ </script>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/select-load.html b/dom/html/reftests/autofocus/select-load.html
new file mode 100644
index 0000000000..976005bec2
--- /dev/null
+++ b/dom/html/reftests/autofocus/select-load.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function focusHandler()
+ {
+ setTimeout(document.documentElement.removeAttribute('class'), 0);
+ }
+ </script>
+ <body>
+ <select></select><select autofocus onfocus="focusHandler();"></select><select autofocus onfocus="focusHandler();"></select>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/select-ref.html b/dom/html/reftests/autofocus/select-ref.html
new file mode 100644
index 0000000000..7fa9cd6559
--- /dev/null
+++ b/dom/html/reftests/autofocus/select-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementsByTagName('select')[1].focus();">
+ <select></select><select onfocus="document.documentElement.removeAttribute('class');"></select><select></select>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/style.css b/dom/html/reftests/autofocus/style.css
new file mode 100644
index 0000000000..f0dd5d1498
--- /dev/null
+++ b/dom/html/reftests/autofocus/style.css
@@ -0,0 +1,10 @@
+:focus { background-color: green; }
+
+/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1645773 */
+textarea { -moz-appearance: none; }
+
+/**
+ * autofocus is considered like a keyboard focus and .focus() isn't.
+ * We might change that with bug 620056 but for these tests, we don't really care.
+ */
+::-moz-focus-inner { border: none; }
diff --git a/dom/html/reftests/autofocus/textarea-create.html b/dom/html/reftests/autofocus/textarea-create.html
new file mode 100644
index 0000000000..e506bb2b72
--- /dev/null
+++ b/dom/html/reftests/autofocus/textarea-create.html
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body>
+ <script>
+ var body = document.body;
+
+ var i = document.createElement('textarea');
+ i.autofocus = false;
+ body.appendChild(i);
+
+ i = document.createElement('textarea');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+
+ i = document.createElement('textarea');
+ i.autofocus = true;
+ i.onfocus = function() { setTimeout(document.documentElement.removeAttribute('class'), 0); };
+ body.appendChild(i);
+ </script>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/textarea-load.html b/dom/html/reftests/autofocus/textarea-load.html
new file mode 100644
index 0000000000..13ab2cb2cc
--- /dev/null
+++ b/dom/html/reftests/autofocus/textarea-load.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <script>
+ function focusHandler()
+ {
+ setTimeout(document.documentElement.removeAttribute('class'), 0);
+ }
+ </script>
+ <body>
+ <textarea></textarea><textarea autofocus onfocus="focusHandler();"></textarea><textarea autofocus onfocus="focusHandler();"></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/autofocus/textarea-ref.html b/dom/html/reftests/autofocus/textarea-ref.html
new file mode 100644
index 0000000000..b79bd7abe8
--- /dev/null
+++ b/dom/html/reftests/autofocus/textarea-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+ <link rel='stylesheet' type='text/css' href='style.css'>
+ <body onload="document.getElementsByTagName('textarea')[1].focus();">
+ <textarea></textarea><textarea onfocus="document.documentElement.removeAttribute('class');"></textarea><textarea></textarea>
+ </body>
+</html>
diff --git a/dom/html/reftests/body-frame-margin-remove-other-pres-hint-ref.html b/dom/html/reftests/body-frame-margin-remove-other-pres-hint-ref.html
new file mode 100644
index 0000000000..1e651db66d
--- /dev/null
+++ b/dom/html/reftests/body-frame-margin-remove-other-pres-hint-ref.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <title></title>
+</head>
+<body>
+<script type="text/javascript">
+ function loadFrame() {
+ document.documentElement.className = "";
+ }
+</script>
+<iframe id=frame onload="loadFrame()" srcdoc="<body><span lang='en'>text</span></body>" marginwidth="100px" marginheight="100px" width=300px height=300px></iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/dom/html/reftests/body-frame-margin-remove-other-pres-hint.html b/dom/html/reftests/body-frame-margin-remove-other-pres-hint.html
new file mode 100644
index 0000000000..16428813af
--- /dev/null
+++ b/dom/html/reftests/body-frame-margin-remove-other-pres-hint.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+ <title></title>
+</head>
+<body>
+<script type="text/javascript">
+ function loadFrame() {
+ let frame = document.getElementById('frame');
+ frame.contentDocument.body.removeAttribute('lang');
+ document.documentElement.className = "";
+ }
+</script>
+<iframe id=frame onload="loadFrame()" srcdoc="<body lang='en'>text</body>" marginwidth="100px" marginheight="100px" width=300px height=300px></iframe>
+</body>
+</html> \ No newline at end of file
diff --git a/dom/html/reftests/body-topmargin-dynamic.html b/dom/html/reftests/body-topmargin-dynamic.html
new file mode 100644
index 0000000000..e6c8c505e7
--- /dev/null
+++ b/dom/html/reftests/body-topmargin-dynamic.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html>
+<body>
+this text should have a margin of 100px on the top and left
+<p style="direction: rtl">this text should have a margin of 100px on the right</p>
+<script type="text/javascript">
+ document.body.setAttribute("topmargin", "100px");
+ document.body.setAttribute("leftmargin", "100px");
+ document.body.setAttribute("rightmargin", "100px");
+</script>
+</body>
+</html>
diff --git a/dom/html/reftests/body-topmargin-ref.html b/dom/html/reftests/body-topmargin-ref.html
new file mode 100644
index 0000000000..6530a0ae4b
--- /dev/null
+++ b/dom/html/reftests/body-topmargin-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<body topmargin="100px" leftmargin="100px" rightmargin="100px">
+this text should have a margin of 100px on the top and left
+<p style="direction: rtl">this text should have a margin of 100px on the right</p>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1106522-1.html b/dom/html/reftests/bug1106522-1.html
new file mode 100644
index 0000000000..db07c1010e
--- /dev/null
+++ b/dom/html/reftests/bug1106522-1.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<html>
+<body>
+ <picture>
+ <source srcset="lime100x100.svg" type="image/svg+xml">
+ <img src="red.png" width="100" height="100">
+ </picture>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1106522-2.html b/dom/html/reftests/bug1106522-2.html
new file mode 100644
index 0000000000..15520982fc
--- /dev/null
+++ b/dom/html/reftests/bug1106522-2.html
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<html>
+<body>
+ <picture>
+ <source srcset="lime100x100.svg">
+ <img src="red.png" width="100" height="100">
+ </picture>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1106522-ref.html b/dom/html/reftests/bug1106522-ref.html
new file mode 100644
index 0000000000..476c47c12d
--- /dev/null
+++ b/dom/html/reftests/bug1106522-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<!-- Any copyright is dedicated to the Public Domain.
+ - http://creativecommons.org/publicdomain/zero/1.0/ -->
+<html>
+<body>
+ <img src="lime100x100.svg">
+</body>
+</html>
diff --git a/dom/html/reftests/bug1196784-no-srcset.html b/dom/html/reftests/bug1196784-no-srcset.html
new file mode 100644
index 0000000000..df55d48631
--- /dev/null
+++ b/dom/html/reftests/bug1196784-no-srcset.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <img height="100" width="100" src="bug1196784.png">
+</body>
+</html>
diff --git a/dom/html/reftests/bug1196784-with-srcset.html b/dom/html/reftests/bug1196784-with-srcset.html
new file mode 100644
index 0000000000..1cd77bad9b
--- /dev/null
+++ b/dom/html/reftests/bug1196784-with-srcset.html
@@ -0,0 +1,6 @@
+<!DOCTYPE html>
+<html>
+<body>
+ <img height="100" width="100" src="bug1196784.png" srcset="bug1196784.png">
+</body>
+</html>
diff --git a/dom/html/reftests/bug1196784.png b/dom/html/reftests/bug1196784.png
new file mode 100644
index 0000000000..8d0ed56825
--- /dev/null
+++ b/dom/html/reftests/bug1196784.png
Binary files differ
diff --git a/dom/html/reftests/bug1228601-video-rotated-ref.html b/dom/html/reftests/bug1228601-video-rotated-ref.html
new file mode 100644
index 0000000000..e489c9a75b
--- /dev/null
+++ b/dom/html/reftests/bug1228601-video-rotated-ref.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script>
+function done() {
+ document.documentElement.removeAttribute("class");
+}
+</script>
+</head>
+<body onload="setTimeout(done, 3);">
+ <video src="video_rotated.mp4" onended="done()" autoplay="true">
+</body>
+</html>
diff --git a/dom/html/reftests/bug1228601-video-rotation-90.html b/dom/html/reftests/bug1228601-video-rotation-90.html
new file mode 100644
index 0000000000..94c57d7504
--- /dev/null
+++ b/dom/html/reftests/bug1228601-video-rotation-90.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head>
+<script>
+function done() {
+ document.documentElement.removeAttribute("class");
+}
+</script>
+</head>
+<body onload="setTimeout(done, 3);">
+ <video src="video_rotation_90.mp4" onended="done()" autoplay="true">
+</body>
+</html>
diff --git a/dom/html/reftests/bug1423850-canvas-video-rotated-ref.html b/dom/html/reftests/bug1423850-canvas-video-rotated-ref.html
new file mode 100644
index 0000000000..8927b6e9f7
--- /dev/null
+++ b/dom/html/reftests/bug1423850-canvas-video-rotated-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head><script>
+function done() {
+ let video = document.querySelector("video");
+ let canvas = document.querySelector("canvas");
+ let context = canvas.getContext("2d");
+ context.drawImage(video, 30, 50, video.videoWidth, video.videoHeight);
+ document.documentElement.removeAttribute("class");
+}
+</script></head>
+<body bgcolor="gray">
+ <video src="video_rotated.mp4" onended="done()" autoplay="true"></video>
+ <canvas width="60" height="100"></canvas>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1423850-canvas-video-rotation-90.html b/dom/html/reftests/bug1423850-canvas-video-rotation-90.html
new file mode 100644
index 0000000000..5039e64afa
--- /dev/null
+++ b/dom/html/reftests/bug1423850-canvas-video-rotation-90.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<head><script>
+function done() {
+ let video = document.querySelector("video");
+ let canvas = document.querySelector("canvas");
+ let context = canvas.getContext("2d");
+ context.drawImage(video, 30, 50, video.videoWidth, video.videoHeight);
+ document.documentElement.removeAttribute("class");
+}
+</script></head>
+<body bgcolor="gray">
+ <video src="video_rotation_90.mp4" onended="done()" autoplay="true"></video>
+ <canvas width="60" height="100"></canvas>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1512297-ref.html b/dom/html/reftests/bug1512297-ref.html
new file mode 100644
index 0000000000..45026e86cc
--- /dev/null
+++ b/dom/html/reftests/bug1512297-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<html>
+<head></head>
+<body>
+<div><img src="" alt="ALT"></div>
+</body>
+</html>
diff --git a/dom/html/reftests/bug1512297.html b/dom/html/reftests/bug1512297.html
new file mode 100644
index 0000000000..55d8d4564f
--- /dev/null
+++ b/dom/html/reftests/bug1512297.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html>
+<head class="reftest-wait"></head>
+<body>
+<div><img src="" alt="ALT"></div>
+<script>
+var img = document.querySelector('img');
+img.remove();
+
+var div = document.querySelector('div');
+div.appendChild(img);
+</script>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564-1_ideal.html b/dom/html/reftests/bug448564-1_ideal.html
new file mode 100644
index 0000000000..e93c1771f6
--- /dev/null
+++ b/dom/html/reftests/bug448564-1_ideal.html
@@ -0,0 +1,13 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css"
+ href="bug448564_forms.css">
+ </link>
+</head>
+<body>
+ <i><b>
+ <form>a</form>
+ <form>b</form>
+ </b></i>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564-1_malformed.html b/dom/html/reftests/bug448564-1_malformed.html
new file mode 100644
index 0000000000..404517c70e
--- /dev/null
+++ b/dom/html/reftests/bug448564-1_malformed.html
@@ -0,0 +1,19 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css"
+ href="bug448564_forms.css">
+ </link>
+</head>
+<body>
+ <i><b>
+ <form>a</form> <!-- These forms should not end up nested! -->
+ <form>b</form>
+ <!-- Why does it matter whether we explicitly close this tag? -->
+ <!-- It matters because nsHTMLTokenizer::ScanDocStructure checks
+ whether there are any malformed tags before parsing begins,
+ and, if there are any, residual style tags (<i>, <b>, &c.)
+ must be pushed inside block elements (e.g., <form>). -->
+ <div><!-- </div> -->
+ </b></i>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564-1_well-formed.html b/dom/html/reftests/bug448564-1_well-formed.html
new file mode 100644
index 0000000000..46dbb8bdd0
--- /dev/null
+++ b/dom/html/reftests/bug448564-1_well-formed.html
@@ -0,0 +1,11 @@
+<html>
+<head>
+ <link rel="stylesheet" type="text/css"
+ href="bug448564_forms.css">
+ </link>
+</head>
+<body>
+ <form><i><b>a</b></i></form>
+ <form><i><b>b</b></i></form>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564-4a.html b/dom/html/reftests/bug448564-4a.html
new file mode 100644
index 0000000000..6fbaf85c2f
--- /dev/null
+++ b/dom/html/reftests/bug448564-4a.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+ <b><i>
+ <!-- Closing a form causes any open residual style tags to be closed
+ as well. This test ensures that these tags get reopened. -->
+ <form>form contents</form>
+ bold text
+ </i></b>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564-4b.html b/dom/html/reftests/bug448564-4b.html
new file mode 100644
index 0000000000..f04d5fe48f
--- /dev/null
+++ b/dom/html/reftests/bug448564-4b.html
@@ -0,0 +1,6 @@
+<html>
+<body>
+ <form><b><i>form contents</i></b></form>
+ <b><i>bold text</i></b>
+</body>
+</html>
diff --git a/dom/html/reftests/bug448564_forms.css b/dom/html/reftests/bug448564_forms.css
new file mode 100644
index 0000000000..b98788862c
--- /dev/null
+++ b/dom/html/reftests/bug448564_forms.css
@@ -0,0 +1,2 @@
+/* make nesting obvious */
+form { border: 1px solid black; }
diff --git a/dom/html/reftests/bug502168-1_malformed.html b/dom/html/reftests/bug502168-1_malformed.html
new file mode 100644
index 0000000000..efe23ac47f
--- /dev/null
+++ b/dom/html/reftests/bug502168-1_malformed.html
@@ -0,0 +1,10 @@
+<html><head>
+<title> Bug 502168 - Particular images are displayed multiple times in a formated way - only FF 3.5</title>
+</head><body>
+
+<table><tbody><tr><td >You should see this text only once</td>
+<embed type="*" style="display: none;"/>
+</td></tr></tbody></table>
+
+</body>
+</html>
diff --git a/dom/html/reftests/bug502168-1_well-formed.html b/dom/html/reftests/bug502168-1_well-formed.html
new file mode 100644
index 0000000000..5eb25c6b35
--- /dev/null
+++ b/dom/html/reftests/bug502168-1_well-formed.html
@@ -0,0 +1,9 @@
+<html><head>
+<title> Bug 502168 - Particular images are displayed multiple times in a formated way - only FF 3.5</title>
+</head><body>
+
+<embed type="*" style="display: none;">
+<table><tbody><tr><td>You should see this text only once</td>
+</tr></tbody></table>
+
+</body></html>
diff --git a/dom/html/reftests/bug917595-1-ref.html b/dom/html/reftests/bug917595-1-ref.html
new file mode 100644
index 0000000000..b777751ff8
--- /dev/null
+++ b/dom/html/reftests/bug917595-1-ref.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<style>
+ iframe {
+ width: 100%;
+ height: 100%;
+ border: 0px;
+ }
+</style>
+<script>
+ document.addEventListener('MozReftestInvalidate',
+ () => document.documentElement.removeAttribute('class'));
+</script>
+<body>
+ <iframe src="bug917595-pixel-rotated.jpg" scrolling="no" marginwidth="0" marginheight="0"></iframe>
+</body>
+</html>
diff --git a/dom/html/reftests/bug917595-exif-rotated.jpg b/dom/html/reftests/bug917595-exif-rotated.jpg
new file mode 100644
index 0000000000..e7b0c22f35
--- /dev/null
+++ b/dom/html/reftests/bug917595-exif-rotated.jpg
Binary files differ
diff --git a/dom/html/reftests/bug917595-iframe-1.html b/dom/html/reftests/bug917595-iframe-1.html
new file mode 100644
index 0000000000..f7fca8232c
--- /dev/null
+++ b/dom/html/reftests/bug917595-iframe-1.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html class="reftest-wait">
+<style>
+ iframe {
+ width: 100%;
+ height: 100%;
+ border: 0px;
+ }
+</style>
+<script>
+ document.addEventListener('MozReftestInvalidate',
+ () => document.documentElement.removeAttribute('class'));
+</script>
+<body>
+ <iframe src="bug917595-exif-rotated.jpg" scrolling="no" marginwidth="0" marginheight="0"></iframe>
+</body>
+</html>
diff --git a/dom/html/reftests/bug917595-pixel-rotated.jpg b/dom/html/reftests/bug917595-pixel-rotated.jpg
new file mode 100644
index 0000000000..ac39faadad
--- /dev/null
+++ b/dom/html/reftests/bug917595-pixel-rotated.jpg
Binary files differ
diff --git a/dom/html/reftests/bug917595-unrotated.jpg b/dom/html/reftests/bug917595-unrotated.jpg
new file mode 100644
index 0000000000..a787797c5e
--- /dev/null
+++ b/dom/html/reftests/bug917595-unrotated.jpg
Binary files differ
diff --git a/dom/html/reftests/figure-ref.html b/dom/html/reftests/figure-ref.html
new file mode 100644
index 0000000000..23ca9f6037
--- /dev/null
+++ b/dom/html/reftests/figure-ref.html
@@ -0,0 +1,11 @@
+<!doctype html>
+<title>The figure element</title>
+<link rel=author title=Ms2ger href=ms2ger@gmail.com>
+<link rel=help href=http://www.whatwg.org/html5/#the-figure-element>
+<style>
+body > div { margin: 1em 40px; }
+</style>
+<div>
+<div>Caption</div>
+Figure
+</div>
diff --git a/dom/html/reftests/figure.html b/dom/html/reftests/figure.html
new file mode 100644
index 0000000000..ad83670b80
--- /dev/null
+++ b/dom/html/reftests/figure.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<title>The figure element</title>
+<link rel=author title=Ms2ger href=ms2ger@gmail.com>
+<link rel=help href=http://www.whatwg.org/html5/#the-figure-element>
+<figure>
+<figcaption>Caption</figcaption>
+Figure
+</figure>
diff --git a/dom/html/reftests/href-attr-change-restyles-ref.html b/dom/html/reftests/href-attr-change-restyles-ref.html
new file mode 100644
index 0000000000..4ebaec9249
--- /dev/null
+++ b/dom/html/reftests/href-attr-change-restyles-ref.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test for bug 549797 - Removing href attribute doesn't remove link styling</title>
+ <style type="text/css">
+ :link, :visited {
+ color:blue;
+ }
+ link {
+ display:block;
+ }
+ #link2::before {
+ content:"Test link 1";
+ }
+ #link4::before {
+ content:"Test link 2";
+ }
+ #link6::before {
+ content:"Test link 3";
+ }
+ </style>
+</head>
+<body>
+<p>
+ <a>Test anchor 1</a>
+ <link id="link2"/>
+ <a href="http://example.com/1">Test anchor 2</a>
+ <link id="link4" href="http://example.com/1"/>
+ <a href="">Test anchor 3</a>
+ <link id="link6" href=""/>
+</p>
+</body>
+</html>
diff --git a/dom/html/reftests/href-attr-change-restyles.html b/dom/html/reftests/href-attr-change-restyles.html
new file mode 100644
index 0000000000..1fa54bfd6f
--- /dev/null
+++ b/dom/html/reftests/href-attr-change-restyles.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Test for bug 549797 - Removing href attribute doesn't remove link styling</title>
+ <style type="text/css">
+ :link, :visited {
+ color:blue;
+ }
+ link {
+ display:block;
+ }
+ #link2::before {
+ content:"Test link 1";
+ }
+ #link4::before {
+ content:"Test link 2";
+ }
+ #link6::before {
+ content:"Test link 3";
+ }
+ </style>
+</head>
+<body onload="run_test();">
+<script type="text/javascript">
+function run_test()
+{
+ // Remove the href attributes of the links so they should be restyled as
+ // non-links.
+ document.getElementById("link1").removeAttribute("href");
+ document.getElementById("link2").removeAttribute("href");
+
+ // Add the href attribute to the links so they should be restyled as links.
+ document.getElementById("link3").href = "http://example.com/1";
+ document.getElementById("link4").href = "http://example.com/1";
+ document.getElementById("link5").setAttribute("href", "");
+ document.getElementById("link6").setAttribute("href", "");
+}
+</script>
+<p>
+ <a id="link1" href="http://example.com/1">Test anchor 1</a>
+ <link id="link2" href="http://example.com/1"/>
+ <a id="link3">Test anchor 2</a>
+ <link id="link4"/>
+ <a id="link5">Test anchor 3</a>
+ <link id="link6"/>
+</p>
+</body>
+</html>
diff --git a/dom/html/reftests/image-load-shortcircuit-1.html b/dom/html/reftests/image-load-shortcircuit-1.html
new file mode 100644
index 0000000000..28e16b7464
--- /dev/null
+++ b/dom/html/reftests/image-load-shortcircuit-1.html
@@ -0,0 +1,8 @@
+<html>
+<div></div>
+<script>
+ var d = (new DOMParser()).parseFromString("<img src=pass.png>", "text/html");
+ var n = d.adoptNode(d.querySelector('img'));
+ document.querySelector('div').appendChild(n);
+</script>
+</html>
diff --git a/dom/html/reftests/image-load-shortcircuit-2.html b/dom/html/reftests/image-load-shortcircuit-2.html
new file mode 100644
index 0000000000..3c4baa43be
--- /dev/null
+++ b/dom/html/reftests/image-load-shortcircuit-2.html
@@ -0,0 +1,10 @@
+<html>
+<body>
+<template id="template">
+<img src="pass.png" alt="Alt Text" />
+</template>
+<script>
+ document.body.appendChild(document.getElementById('template').content.children[0].cloneNode(1));
+</script>
+</body>
+</html>
diff --git a/dom/html/reftests/image-load-shortcircuit-ref.html b/dom/html/reftests/image-load-shortcircuit-ref.html
new file mode 100644
index 0000000000..7dd28922d4
--- /dev/null
+++ b/dom/html/reftests/image-load-shortcircuit-ref.html
@@ -0,0 +1 @@
+<div><img src=pass.png></div>
diff --git a/dom/html/reftests/lime100x100.svg b/dom/html/reftests/lime100x100.svg
new file mode 100644
index 0000000000..8bdec62c1f
--- /dev/null
+++ b/dom/html/reftests/lime100x100.svg
@@ -0,0 +1,4 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
+ width="100" height="100">
+ <rect width="100%" height="100%" fill="lime"/>
+</svg>
diff --git a/dom/html/reftests/pass.png b/dom/html/reftests/pass.png
new file mode 100644
index 0000000000..3b30b1de7c
--- /dev/null
+++ b/dom/html/reftests/pass.png
Binary files differ
diff --git a/dom/html/reftests/pre-1-ref.html b/dom/html/reftests/pre-1-ref.html
new file mode 100644
index 0000000000..a79b4f46a4
--- /dev/null
+++ b/dom/html/reftests/pre-1-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<div style="width: 15em">
+<pre>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+</div>
+12
diff --git a/dom/html/reftests/pre-1.html b/dom/html/reftests/pre-1.html
new file mode 100644
index 0000000000..1b21bcd746
--- /dev/null
+++ b/dom/html/reftests/pre-1.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<div style="width: 15em">
+<pre>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre width=12>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre cols=12>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap width=12>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+<pre wrap cols=12>
+MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM MMMMM
+</pre>
+</div>
+<script>document.write(document.querySelectorAll('pre')[1].width);</script>
diff --git a/dom/html/reftests/red.png b/dom/html/reftests/red.png
new file mode 100644
index 0000000000..aa9ce25263
--- /dev/null
+++ b/dom/html/reftests/red.png
Binary files differ
diff --git a/dom/html/reftests/reftest.list b/dom/html/reftests/reftest.list
new file mode 100644
index 0000000000..4dc3df7a4a
--- /dev/null
+++ b/dom/html/reftests/reftest.list
@@ -0,0 +1,75 @@
+# autofocus attribute (we can't test with mochitests)
+include autofocus/reftest.list
+include toblob-todataurl/reftest.list
+
+== 41464-1a.html 41464-1-ref.html
+== 41464-1b.html 41464-1-ref.html
+== 52019-1.html 52019-1-ref.html
+== 82711-1.html 82711-1-ref.html
+== 82711-2.html 82711-2-ref.html
+!= 82711-1-ref.html 82711-2-ref.html
+!= 468263-1a.html about:blank
+!= 468263-1b.html about:blank
+!= 468263-1c.html about:blank
+!= 468263-1d.html about:blank
+== 468263-2.html 468263-2-ref.html
+== 468263-2.html 468263-2-alternate-ref.html
+== 484200-1.html 484200-1-ref.html
+== 485377.html 485377-ref.html
+== 557840.html 557840-ref.html
+== 560059-video-dimensions.html 560059-video-dimensions-ref.html
+== 573322-quirks.html 573322-quirks-ref.html
+== 573322-no-quirks.html 573322-no-quirks-ref.html
+== 596455-1a.html 596455-ref-1.html
+== 596455-1b.html 596455-ref-1.html
+== 596455-2a.html 596455-ref-2.html
+== 596455-2b.html 596455-ref-2.html
+== 610935.html 610935-ref.html
+== 649134-1.html 649134-ref.html
+skip-if(Android) == 649134-2.html 649134-2-ref.html
+== 741776-1.vtt 741776-1-ref.html
+
+== bug448564-1_malformed.html bug448564-1_well-formed.html
+== bug448564-1_malformed.html bug448564-1_ideal.html
+
+== bug448564-4a.html bug448564-4b.html
+== bug502168-1_malformed.html bug502168-1_well-formed.html
+
+== responsive-image-load-shortcircuit.html responsive-image-load-shortcircuit-ref.html
+== image-load-shortcircuit-1.html image-load-shortcircuit-ref.html
+== image-load-shortcircuit-2.html image-load-shortcircuit-ref.html
+
+# Test that image documents taken into account CSS properties like
+# image-orientation when determining the size of the image.
+# (Fuzzy necessary due to pixel-wise comparison of different JPEGs.
+# The vast majority of the fuzziness comes from Linux and WinXP.)
+skip-if(isCoverageBuild) fuzzy(0-2,0-830) random-if(useDrawSnapshot) == bug917595-iframe-1.html bug917595-1-ref.html
+fuzzy(0-3,0-7544) fuzzy-if(!geckoview,2-3,50-7544) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg # bug 1060869
+
+# Test support for SVG-as-image in <picture> elements.
+== bug1106522-1.html bug1106522-ref.html
+== bug1106522-2.html bug1106522-ref.html
+
+== href-attr-change-restyles.html href-attr-change-restyles-ref.html
+== figure.html figure-ref.html
+== pre-1.html pre-1-ref.html
+== table-border-1.html table-border-1-ref.html
+== table-border-2.html table-border-2-ref.html
+!= table-border-2.html table-border-2-notref.html
+
+# Test imageset is using permissions.default.image
+pref(permissions.default.image,1) HTTP == bug1196784-with-srcset.html bug1196784-no-srcset.html
+pref(permissions.default.image,2) HTTP == bug1196784-with-srcset.html bug1196784-no-srcset.html
+
+# Test video with rotation information can be rotated.
+fails-if(geckoview&&!swgl) == bug1228601-video-rotation-90.html bug1228601-video-rotated-ref.html # bug 1558285 for geckoview
+fuzzy(0-1,0-30) fails-if(geckoview&&!swgl) random-if(geckoview&&swgl) == bug1423850-canvas-video-rotation-90.html bug1423850-canvas-video-rotated-ref.html # bug 1558285 for geckoview
+
+== bug1512297.html bug1512297-ref.html
+
+# Test that dynamically setting body margin attributes updates style appropriately
+== body-topmargin-dynamic.html body-topmargin-ref.html
+
+# Test that dynamically removing a nonmargin mapped attribute does not
+# destroy margins inherited from the frame.
+== body-frame-margin-remove-other-pres-hint.html body-frame-margin-remove-other-pres-hint-ref.html
diff --git a/dom/html/reftests/responsive-image-load-shortcircuit-ref.html b/dom/html/reftests/responsive-image-load-shortcircuit-ref.html
new file mode 100644
index 0000000000..59d8925ba5
--- /dev/null
+++ b/dom/html/reftests/responsive-image-load-shortcircuit-ref.html
@@ -0,0 +1 @@
+<iframe srcdoc="<img src=pass.png>" width="300px"></iframe>
diff --git a/dom/html/reftests/responsive-image-load-shortcircuit.html b/dom/html/reftests/responsive-image-load-shortcircuit.html
new file mode 100644
index 0000000000..1cfb92cb20
--- /dev/null
+++ b/dom/html/reftests/responsive-image-load-shortcircuit.html
@@ -0,0 +1,15 @@
+<html class="reftest-wait">
+<iframe srcdoc="<img srcset=red.png>" width="150px"></iframe>
+<script>
+ var iframe = document.querySelector('iframe');
+ iframe.onload = function() {
+ var doc = iframe.contentDocument;
+ var img = doc.querySelector('img');
+ img.srcset = "pass.png";
+ iframe.width = "300px";
+ img.onload = function() {
+ document.documentElement.classList.remove('reftest-wait');
+ };
+ }
+</script>
+</html>
diff --git a/dom/html/reftests/table-border-1-ref.html b/dom/html/reftests/table-border-1-ref.html
new file mode 100644
index 0000000000..ceac88e9a3
--- /dev/null
+++ b/dom/html/reftests/table-border-1-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<style>
+table {
+ border-width: 1px;
+ border-style: outset;
+}
+td {
+ border-width: 1px;
+ border-style: inset;
+}
+</style>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/dom/html/reftests/table-border-1.html b/dom/html/reftests/table-border-1.html
new file mode 100644
index 0000000000..12bfb2af46
--- /dev/null
+++ b/dom/html/reftests/table-border-1.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<table border>
+<tr><td>Test
+</table>
+<table border="">
+<tr><td>Test
+</table>
+<table border=null>
+<tr><td>Test
+</table>
+<table border=undefined>
+<tr><td>Test
+</table>
+<table border=foo>
+<tr><td>Test
+</table>
+<table border=1>
+<tr><td>Test
+</table>
+<table border=1foo>
+<tr><td>Test
+</table>
+<table border=1%>
+<tr><td>Test
+</table>
+<table border=-1>
+<tr><td>Test
+</table>
+<table border=-1foo>
+<tr><td>Test
+</table>
+<table border=-1%>
+<tr><td>Test
+</table>
diff --git a/dom/html/reftests/table-border-2-notref.html b/dom/html/reftests/table-border-2-notref.html
new file mode 100644
index 0000000000..7558e5271a
--- /dev/null
+++ b/dom/html/reftests/table-border-2-notref.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<style>
+table {
+ border-width: 1px;
+ border-style: outset;
+}
+td {
+ border-width: 1px;
+ border-style: inset;
+}
+</style>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/dom/html/reftests/table-border-2-ref.html b/dom/html/reftests/table-border-2-ref.html
new file mode 100644
index 0000000000..36d1e45106
--- /dev/null
+++ b/dom/html/reftests/table-border-2-ref.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
+<table>
+<tr><td>Test
+</table>
diff --git a/dom/html/reftests/table-border-2.html b/dom/html/reftests/table-border-2.html
new file mode 100644
index 0000000000..4f209545c2
--- /dev/null
+++ b/dom/html/reftests/table-border-2.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<meta charset=utf-8>
+<title>Table borders</title>
+<table border=0>
+<tr><td>Test
+</table>
+<table border=0foo>
+<tr><td>Test
+</table>
+<table border=0%>
+<tr><td>Test
+</table>
+<table border=+0>
+<tr><td>Test
+</table>
+<table border=+0foo>
+<tr><td>Test
+</table>
+<table border=+0%>
+<tr><td>Test
+</table>
+<table border=-0>
+<tr><td>Test
+</table>
+<table border=-0foo>
+<tr><td>Test
+</table>
+<table border=-0%>
+<tr><td>Test
+</table>
diff --git a/dom/html/reftests/toblob-todataurl/blob.js b/dom/html/reftests/toblob-todataurl/blob.js
new file mode 100644
index 0000000000..4ed9fdb372
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/blob.js
@@ -0,0 +1,68 @@
+function init() {
+ function end() {
+ document.documentElement.className = '';
+ }
+
+ function next() {
+ compressAndDisplay(original, end);
+ }
+
+ var original = getImageFromDataUrl(sample);
+ setImgLoadListener(original, next);
+}
+
+function compressAndDisplay(image, next) {
+ var canvas = document.createElement('canvas');
+ canvas.width = image.naturalWidth;
+ canvas.height = image.naturalHeight;
+ var ctx = canvas.getContext('2d');
+ ctx.drawImage(image, 0, 0);
+
+ function gotBlob(blob) {
+ var img = getImageFromBlob(blob);
+ setImgLoadListener(img, next);
+ document.body.appendChild(img);
+ }
+
+ // I want to test passing 'undefined' as quality as well
+ if ('quality' in window) {
+ canvas.toBlob(gotBlob, 'image/jpeg', quality);
+ } else {
+ canvas.toBlob(gotBlob, 'image/jpeg');
+ }
+}
+
+function setImgLoadListener(img, func) {
+ if (img.complete) {
+ func.call(img, { target: img});
+ } else {
+ img.addEventListener('load', func);
+ }
+}
+
+function naturalDimensionsHandler(e) {
+ var img = e.target;
+ img.width = img.naturalWidth;
+ img.height = img.naturalHeight;
+}
+
+function getImageFromBlob(blob) {
+ var img = document.createElement('img');
+ img.src = window.URL.createObjectURL(blob);
+ setImgLoadListener(img, naturalDimensionsHandler);
+ setImgLoadListener(img, function(e) {
+ window.URL.revokeObjectURL(e.target.src);
+ });
+
+ return img;
+}
+
+function getImageFromDataUrl(url) {
+ var img = document.createElement('img');
+ img.src = url;
+ setImgLoadListener(img, naturalDimensionsHandler);
+
+ return img;
+}
+
+init();
diff --git a/dom/html/reftests/toblob-todataurl/dataurl.js b/dom/html/reftests/toblob-todataurl/dataurl.js
new file mode 100644
index 0000000000..8ffba1fa8e
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/dataurl.js
@@ -0,0 +1,56 @@
+function init() {
+ function end() {
+ document.documentElement.className = '';
+ }
+
+ function next() {
+ compressAndDisplay(original, end);
+ }
+
+ var original = getImageFromDataUrl(sample);
+ setImgLoadListener(original, next);
+}
+
+function compressAndDisplay(image, next) {
+ var canvas = document.createElement('canvas');
+ canvas.width = image.naturalWidth;
+ canvas.height = image.naturalHeight;
+ var ctx = canvas.getContext('2d');
+ ctx.drawImage(image, 0, 0);
+
+ var dataUrl;
+ // I want to test passing undefined as well
+ if ('quality' in window) {
+ dataUrl = canvas.toDataURL('image/jpeg', quality);
+ } else {
+ dataUrl = canvas.toDataURL('image/jpeg');
+ }
+
+ var img = getImageFromDataUrl(dataUrl);
+ setImgLoadListener(img, next);
+ document.body.appendChild(img);
+}
+
+function setImgLoadListener(img, func) {
+ if (img.complete) {
+ func.call(img, { target: img});
+ } else {
+ img.addEventListener('load', func);
+ }
+}
+
+function naturalDimensionsHandler(e) {
+ var img = e.target;
+ img.width = img.naturalWidth;
+ img.height = img.naturalHeight;
+}
+
+function getImageFromDataUrl(url) {
+ var img = document.createElement('img');
+ img.src = url;
+ setImgLoadListener(img, naturalDimensionsHandler);
+
+ return img;
+}
+
+init();
diff --git a/dom/html/reftests/toblob-todataurl/images/original.png b/dom/html/reftests/toblob-todataurl/images/original.png
new file mode 100644
index 0000000000..c2da5b3597
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/original.png
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q0.jpg b/dom/html/reftests/toblob-todataurl/images/q0.jpg
new file mode 100644
index 0000000000..eb41ad3e93
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q0.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q100.jpg b/dom/html/reftests/toblob-todataurl/images/q100.jpg
new file mode 100644
index 0000000000..aaa79f2d31
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q100.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q25.jpg b/dom/html/reftests/toblob-todataurl/images/q25.jpg
new file mode 100644
index 0000000000..d8b1c9bfb2
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q25.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q50.jpg b/dom/html/reftests/toblob-todataurl/images/q50.jpg
new file mode 100644
index 0000000000..f93356ef22
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q50.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q75.jpg b/dom/html/reftests/toblob-todataurl/images/q75.jpg
new file mode 100644
index 0000000000..6c25c55a1a
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q75.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/images/q92.jpg b/dom/html/reftests/toblob-todataurl/images/q92.jpg
new file mode 100644
index 0000000000..1de242a171
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/images/q92.jpg
Binary files differ
diff --git a/dom/html/reftests/toblob-todataurl/quality-0-ref.html b/dom/html/reftests/toblob-todataurl/quality-0-ref.html
new file mode 100644
index 0000000000..3d6923fd39
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-0-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q0.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/quality-100-ref.html b/dom/html/reftests/toblob-todataurl/quality-100-ref.html
new file mode 100644
index 0000000000..8b157d0ab3
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-100-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q100.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/quality-25-ref.html b/dom/html/reftests/toblob-todataurl/quality-25-ref.html
new file mode 100644
index 0000000000..385f2ab356
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-25-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q25.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/quality-50-ref.html b/dom/html/reftests/toblob-todataurl/quality-50-ref.html
new file mode 100644
index 0000000000..68b91f43f6
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-50-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q50.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/quality-75-ref.html b/dom/html/reftests/toblob-todataurl/quality-75-ref.html
new file mode 100644
index 0000000000..7e610d231b
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-75-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q75.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/quality-92-ref.html b/dom/html/reftests/toblob-todataurl/quality-92-ref.html
new file mode 100644
index 0000000000..15a930c942
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/quality-92-ref.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<html><body><img src='images/q92.jpg'/></table></body></html>
diff --git a/dom/html/reftests/toblob-todataurl/reftest.list b/dom/html/reftests/toblob-todataurl/reftest.list
new file mode 100644
index 0000000000..efe5a3e7f6
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/reftest.list
@@ -0,0 +1,16 @@
+fuzzy-if(Android,0-105,0-482) == toblob-quality-0.html quality-0-ref.html
+fuzzy-if(Android,0-38,0-2024) == toblob-quality-25.html quality-25-ref.html
+fuzzy-if(Android,0-29,0-2336) == toblob-quality-50.html quality-50-ref.html
+fuzzy-if(Android,0-23,0-3533) == toblob-quality-75.html quality-75-ref.html
+fuzzy-if(Android,0-16,0-4199) == toblob-quality-92.html quality-92-ref.html
+fuzzy-if(Android,0-8,0-2461) == toblob-quality-100.html quality-100-ref.html
+fuzzy-if(Android,0-16,0-4199) == toblob-quality-undefined.html quality-92-ref.html
+fuzzy-if(Android,0-16,0-4199) == toblob-quality-default.html quality-92-ref.html
+fuzzy-if(Android,0-105,0-482) == todataurl-quality-0.html quality-0-ref.html
+fuzzy-if(Android,0-38,0-2024) == todataurl-quality-25.html quality-25-ref.html
+fuzzy-if(Android,0-29,0-2336) == todataurl-quality-50.html quality-50-ref.html
+fuzzy-if(Android,0-23,0-3533) == todataurl-quality-75.html quality-75-ref.html
+fuzzy-if(Android,0-16,0-4199) == todataurl-quality-92.html quality-92-ref.html
+fuzzy-if(Android,0-8,0-2461) == todataurl-quality-100.html quality-100-ref.html
+fuzzy-if(Android,0-16,0-4199) == todataurl-quality-undefined.html quality-92-ref.html
+fuzzy-if(Android,0-16,0-4199) == todataurl-quality-default.html quality-92-ref.html \ No newline at end of file
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-0.html b/dom/html/reftests/toblob-todataurl/toblob-quality-0.html
new file mode 100644
index 0000000000..7e7298cb6b
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-0.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-100.html b/dom/html/reftests/toblob-todataurl/toblob-quality-100.html
new file mode 100644
index 0000000000..34f318e11f
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-100.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 1;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-25.html b/dom/html/reftests/toblob-todataurl/toblob-quality-25.html
new file mode 100644
index 0000000000..ed4350e6eb
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-25.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.25;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-50.html b/dom/html/reftests/toblob-todataurl/toblob-quality-50.html
new file mode 100644
index 0000000000..47e3b684fa
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-50.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.50;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-75.html b/dom/html/reftests/toblob-todataurl/toblob-quality-75.html
new file mode 100644
index 0000000000..45ccfe1fe0
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-75.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.75;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-92.html b/dom/html/reftests/toblob-todataurl/toblob-quality-92.html
new file mode 100644
index 0000000000..6a7f8788fb
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-92.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.92;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-default.html b/dom/html/reftests/toblob-todataurl/toblob-quality-default.html
new file mode 100644
index 0000000000..c5b404744c
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-default.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/toblob-quality-undefined.html b/dom/html/reftests/toblob-todataurl/toblob-quality-undefined.html
new file mode 100644
index 0000000000..3252900200
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/toblob-quality-undefined.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = undefined;
+ </script>
+ <script src='sample.js'></script>
+ <script src='blob.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-0.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-0.html
new file mode 100644
index 0000000000..1d4eb9b7f1
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-0.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-100.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-100.html
new file mode 100644
index 0000000000..66b627c13e
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-100.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 1;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-25.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-25.html
new file mode 100644
index 0000000000..15237cea8b
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-25.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.25;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-50.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-50.html
new file mode 100644
index 0000000000..93e820e68b
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-50.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.50;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-75.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-75.html
new file mode 100644
index 0000000000..acdc7416f8
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-75.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.75;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-92.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-92.html
new file mode 100644
index 0000000000..ca3de4ee0b
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-92.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = 0.92;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-default.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-default.html
new file mode 100644
index 0000000000..cc7771dbf0
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-default.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/toblob-todataurl/todataurl-quality-undefined.html b/dom/html/reftests/toblob-todataurl/todataurl-quality-undefined.html
new file mode 100644
index 0000000000..16801e4829
--- /dev/null
+++ b/dom/html/reftests/toblob-todataurl/todataurl-quality-undefined.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<html class='reftest-wait'>
+ <body>
+ <script>
+ var quality = undefined;
+ </script>
+ <script src='sample.js'></script>
+ <script src='dataurl.js'></script>
+ </body>
+</html>
diff --git a/dom/html/reftests/video_rotated.mp4 b/dom/html/reftests/video_rotated.mp4
new file mode 100644
index 0000000000..38a1b77f93
--- /dev/null
+++ b/dom/html/reftests/video_rotated.mp4
Binary files differ
diff --git a/dom/html/reftests/video_rotation_90.mp4 b/dom/html/reftests/video_rotation_90.mp4
new file mode 100644
index 0000000000..85aa055fb9
--- /dev/null
+++ b/dom/html/reftests/video_rotation_90.mp4
Binary files differ