diff --git a/layout/reftests/forms/legend/1339287-ref.html b/layout/reftests/forms/legend/1339287-ref.html
new file mode 100644
index 000000000000..8dea047bbd14
--- /dev/null
+++ b/layout/reftests/forms/legend/1339287-ref.html
@@ -0,0 +1,46 @@
+
+
+
+
+ Testcase for bug 1339287
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/forms/legend/1339287.html b/layout/reftests/forms/legend/1339287.html
new file mode 100644
index 000000000000..482663f79fb8
--- /dev/null
+++ b/layout/reftests/forms/legend/1339287.html
@@ -0,0 +1,58 @@
+
+
+
+
+ Testcase for bug 1339287
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/layout/reftests/forms/legend/reftest.list b/layout/reftests/forms/legend/reftest.list
index 879835a59bea..279cc9aea8a7 100644
--- a/layout/reftests/forms/legend/reftest.list
+++ b/layout/reftests/forms/legend/reftest.list
@@ -1,3 +1,4 @@
== legend.html legend-ref.html
fuzzy-if(skiaContent,1,7) pref(dom.webcomponents.enabled,true) == shadow-dom.html shadow-dom-ref.html
== 1273433.html 1273433-ref.html
+== 1339287.html 1339287-ref.html