diff --git a/content/html/content/test/Makefile.in b/content/html/content/test/Makefile.in
index e59749cf4705..81d3e2aa58f4 100644
--- a/content/html/content/test/Makefile.in
+++ b/content/html/content/test/Makefile.in
@@ -270,6 +270,31 @@ MOCHITEST_FILES = \
file_iframe_sandbox_b_if1.html \
file_iframe_sandbox_b_if2.html \
file_iframe_sandbox_b_if3.html \
+ test_iframe_sandbox_navigation.html \
+ file_iframe_sandbox_d_if1.html \
+ file_iframe_sandbox_d_if2.html \
+ file_iframe_sandbox_d_if3.html \
+ file_iframe_sandbox_d_if4.html \
+ file_iframe_sandbox_d_if5.html \
+ file_iframe_sandbox_d_if6.html \
+ file_iframe_sandbox_d_if7.html \
+ file_iframe_sandbox_d_if8.html \
+ file_iframe_sandbox_d_if9.html \
+ file_iframe_sandbox_d_if10.html \
+ file_iframe_sandbox_d_if11.html \
+ file_iframe_sandbox_d_if12.html \
+ file_iframe_sandbox_d_if13.html \
+ file_iframe_sandbox_navigation_start.html \
+ file_iframe_sandbox_navigation_pass.html \
+ file_iframe_sandbox_navigation_fail.html \
+ file_iframe_sandbox_e_if1.html \
+ file_iframe_sandbox_e_if2.html \
+ file_iframe_sandbox_e_if3.html \
+ file_iframe_sandbox_e_if4.html \
+ file_iframe_sandbox_e_if5.html \
+ file_iframe_sandbox_e_if6.html \
+ file_iframe_sandbox_top_navigation_pass.html \
+ file_iframe_sandbox_top_navigation_fail.html \
test_iframe_sandbox_plugins.html \
file_iframe_sandbox_f_if1.html \
file_iframe_sandbox_f_if2.html \
diff --git a/content/html/content/test/file_iframe_sandbox_d_if1.html b/content/html/content/test/file_iframe_sandbox_d_if1.html
new file mode 100644
index 000000000000..8af6c6b11244
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if1.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if10.html b/content/html/content/test/file_iframe_sandbox_d_if10.html
new file mode 100644
index 000000000000..69977aebc8cd
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if10.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if11.html b/content/html/content/test/file_iframe_sandbox_d_if11.html
new file mode 100644
index 000000000000..b6d431c893a0
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if11.html
@@ -0,0 +1,26 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+ CLICK ME
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if12.html b/content/html/content/test/file_iframe_sandbox_d_if12.html
new file mode 100644
index 000000000000..0d7936512e2a
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if12.html
@@ -0,0 +1,16 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if13.html b/content/html/content/test/file_iframe_sandbox_d_if13.html
new file mode 100644
index 000000000000..759388f27a2d
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if13.html
@@ -0,0 +1,34 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if2.html b/content/html/content/test/file_iframe_sandbox_d_if2.html
new file mode 100644
index 000000000000..5e51075a073f
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if2.html
@@ -0,0 +1,28 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if3.html b/content/html/content/test/file_iframe_sandbox_d_if3.html
new file mode 100644
index 000000000000..cd2d53bce962
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if3.html
@@ -0,0 +1,13 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if4.html b/content/html/content/test/file_iframe_sandbox_d_if4.html
new file mode 100644
index 000000000000..8138d14f00d7
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if4.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if5.html b/content/html/content/test/file_iframe_sandbox_d_if5.html
new file mode 100644
index 000000000000..5191bd46fb85
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if5.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts allow-same-origin'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if6.html b/content/html/content/test/file_iframe_sandbox_d_if6.html
new file mode 100644
index 000000000000..e7e19fc2e6ed
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if6.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if7.html b/content/html/content/test/file_iframe_sandbox_d_if7.html
new file mode 100644
index 000000000000..4b8062eb7152
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if7.html
@@ -0,0 +1,16 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if8.html b/content/html/content/test/file_iframe_sandbox_d_if8.html
new file mode 100644
index 000000000000..ded19cff55b3
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if8.html
@@ -0,0 +1,16 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+ I am sandboxed with 'allow-scripts' and 'allow-same-origin' the first time I am loaded, and with 'allow-scripts' the second time
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_d_if9.html b/content/html/content/test/file_iframe_sandbox_d_if9.html
new file mode 100644
index 000000000000..ee641904fcd3
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_d_if9.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+ I am sandboxed with 'allow-scripts' and 'allow-same-origin' the first time I am loaded, and with 'allow-same-origin' the second time
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if1.html b/content/html/content/test/file_iframe_sandbox_e_if1.html
new file mode 100644
index 000000000000..08ba5b70fc1e
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if1.html
@@ -0,0 +1,24 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if2.html b/content/html/content/test/file_iframe_sandbox_e_if2.html
new file mode 100644
index 000000000000..17b51dfd82b0
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if2.html
@@ -0,0 +1,22 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if3.html b/content/html/content/test/file_iframe_sandbox_e_if3.html
new file mode 100644
index 000000000000..ce010e6893f0
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if3.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if4.html b/content/html/content/test/file_iframe_sandbox_e_if4.html
new file mode 100644
index 000000000000..740a33a94d0a
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if4.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if5.html b/content/html/content/test/file_iframe_sandbox_e_if5.html
new file mode 100644
index 000000000000..46bfff357bf1
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if5.html
@@ -0,0 +1,19 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+ I am sandboxed with 'allow-scripts and allow-top-navigation'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_e_if6.html b/content/html/content/test/file_iframe_sandbox_e_if6.html
new file mode 100644
index 000000000000..4b74c34dd79e
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_e_if6.html
@@ -0,0 +1,24 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+
+
+ I am sandboxed with 'allow-scripts'
+
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_navigation_fail.html b/content/html/content/test/file_iframe_sandbox_navigation_fail.html
new file mode 100644
index 000000000000..151cf50765a2
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_navigation_fail.html
@@ -0,0 +1,16 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+FAIL
+
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_navigation_pass.html b/content/html/content/test/file_iframe_sandbox_navigation_pass.html
new file mode 100644
index 000000000000..9f8ec967208e
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_navigation_pass.html
@@ -0,0 +1,16 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+PASS
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_navigation_start.html b/content/html/content/test/file_iframe_sandbox_navigation_start.html
new file mode 100644
index 000000000000..fa5642517767
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_navigation_start.html
@@ -0,0 +1,11 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+I am just a normal HTML document, probably contained in a sandboxed iframe
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_top_navigation_fail.html b/content/html/content/test/file_iframe_sandbox_top_navigation_fail.html
new file mode 100644
index 000000000000..9158dce65ce0
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_top_navigation_fail.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+FAIL\
+
+
diff --git a/content/html/content/test/file_iframe_sandbox_top_navigation_pass.html b/content/html/content/test/file_iframe_sandbox_top_navigation_pass.html
new file mode 100644
index 000000000000..13b3acc596d8
--- /dev/null
+++ b/content/html/content/test/file_iframe_sandbox_top_navigation_pass.html
@@ -0,0 +1,17 @@
+
+
+
+
+ Test for Bug 341604
+
+
+
+
+PASS
+
+
diff --git a/content/html/content/test/test_iframe_sandbox_navigation.html b/content/html/content/test/test_iframe_sandbox_navigation.html
new file mode 100644
index 000000000000..0cfcaf24e685
--- /dev/null
+++ b/content/html/content/test/test_iframe_sandbox_navigation.html
@@ -0,0 +1,229 @@
+
+
+
+
+
+ Test for Bug 341604 - navigation
+
+
+
+
+
+
+Mozilla Bug 341604 - Implement HTML5 sandbox attribute for IFRAMEs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+