diff --git a/layout/reftests/bugs/405517-1-ref.xhtml b/layout/reftests/bugs/405517-1-ref.xhtml
new file mode 100644
index 00000000000..903d531a2ee
--- /dev/null
+++ b/layout/reftests/bugs/405517-1-ref.xhtml
@@ -0,0 +1,7 @@
+
+
+
+
+a
bc
+
+
diff --git a/layout/reftests/bugs/405517-1.xhtml b/layout/reftests/bugs/405517-1.xhtml
new file mode 100644
index 00000000000..acf1f547c1c
--- /dev/null
+++ b/layout/reftests/bugs/405517-1.xhtml
@@ -0,0 +1,15 @@
+
+
+
+
+
+a
c
+
+
diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list
index 5904c8ebc41..e9ddcfeace7 100644
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -599,6 +599,7 @@ random == 403134-1.html 403134-1-ref.html # bug 405377
== 405186-1.xhtml about:blank
== 405305-1.html 405305-1-ref.html
== 405380-1.html 405380-1-ref.html
+== 405517-1.xhtml 405517-1-ref.xhtml
== 405577-1.html 405577-1-ref.html
== 405584-1.html 405584-1-ref.html
== 406073-1.html 406073-1-ref.html