summaryrefslogtreecommitdiffstats
path: root/layout/reftests/forms/legend
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/reftests/forms/legend
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/forms/legend')
-rw-r--r--layout/reftests/forms/legend/1273433-ref.html51
-rw-r--r--layout/reftests/forms/legend/1273433.html51
-rw-r--r--layout/reftests/forms/legend/1339287-ref.html46
-rw-r--r--layout/reftests/forms/legend/1339287.html58
-rw-r--r--layout/reftests/forms/legend/legend-padding-1-ref.html43
-rw-r--r--layout/reftests/forms/legend/legend-padding-1.html42
-rw-r--r--layout/reftests/forms/legend/legend-padding-2-ref.html44
-rw-r--r--layout/reftests/forms/legend/legend-padding-2.html43
-rw-r--r--layout/reftests/forms/legend/legend-ref.html95
-rw-r--r--layout/reftests/forms/legend/legend.html87
-rw-r--r--layout/reftests/forms/legend/reftest.list5
-rw-r--r--layout/reftests/forms/legend/shadow-dom-ref.html29
12 files changed, 594 insertions, 0 deletions
diff --git a/layout/reftests/forms/legend/1273433-ref.html b/layout/reftests/forms/legend/1273433-ref.html
new file mode 100644
index 0000000000..6c28a9f0c8
--- /dev/null
+++ b/layout/reftests/forms/legend/1273433-ref.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 1273433</title>
+ <style type="text/css">
+
+html,body {
+ color:black; background-color:white; font-size:12px; padding:0; margin:0;
+}
+
+fieldset { border: 1px solid black; }
+.v { writing-mode: vertical-lr; height:300px; float:left; }
+legend { width: 100px; border:1px solid blue; }
+.v legend, .rl legend { width: auto; height: 100px; }
+.rtl { direction:rtl; }
+.ltr { direction:ltr; }
+
+ </style>
+</head>
+<body>
+
+<fieldset align="left"><legend>(unset)</legend></fieldset>
+<fieldset><legend align="left">left</legend></fieldset>
+<fieldset class="rtl"><legend style="text-align:left">right</legend></fieldset>
+
+<fieldset><legend align="right" style="text-align:right">(unset)</legend><div class=rtl>RTL</div></fieldset>
+<fieldset><legend align="left" style="text-align:right">left</legend><div class=rtl>RTL</div></fieldset>
+<fieldset><legend align="right" style="text-align:right">right</legend><div class=rtl>RTL</div></fieldset>
+
+<fieldset><legend>left</legend><div class=rtl>RTL</div></fieldset>
+<fieldset><legend align="right" style="text-align:left">right</legend><div class=rtl>RTL</div></fieldset>
+
+<fieldset><legend align="left">bottom</legend></fieldset>
+<fieldset><legend align="left">top</legend></fieldset>
+
+<fieldset class="v"><legend align="left">(unset)</legend></fieldset>
+<fieldset class="v"><legend align="left">left</legend></fieldset>
+<fieldset class="v rtl"><legend style="text-align:left">right</legend></fieldset>
+
+<fieldset class="v"><legend align="right" style="text-align:right">(unset)</legend><div class=rtl>RTL</div></fieldset>
+<fieldset class="v"><legend align="left" style="text-align:right">left</legend><div class=rtl>RTL</div></fieldset>
+<fieldset class="v"><legend align="right" style="text-align:right">right</legend><div class=rtl>RTL</div></fieldset>
+
+<fieldset class="v"><legend>left</legend><div class=rtl>RTL</div></fieldset>
+<fieldset class="v"><legend align="right" style="text-align:left">right</legend><div class=rtl>RTL</div></fieldset>
+
+<fieldset class="v"><legend align="left">bottom</legend></fieldset>
+<fieldset class="v"><legend align="left">top</legend></fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/1273433.html b/layout/reftests/forms/legend/1273433.html
new file mode 100644
index 0000000000..beb1b09070
--- /dev/null
+++ b/layout/reftests/forms/legend/1273433.html
@@ -0,0 +1,51 @@
+<!DOCTYPE HTML>
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 1273433</title>
+ <style type="text/css">
+
+html,body {
+ color:black; background-color:white; font-size:12px; padding:0; margin:0;
+}
+
+fieldset { border: 1px solid black; }
+.v { writing-mode: vertical-lr; height:300px; float:left; }
+legend { width: 100px; border:1px solid blue; }
+.v legend, .rl legend { width: auto; height: 100px; }
+.rtl { direction:rtl; }
+.ltr { direction:ltr; }
+
+ </style>
+</head>
+<body>
+
+<fieldset><legend>(unset)</legend></fieldset>
+<fieldset><legend align="left">left</legend></fieldset>
+<fieldset><legend align="right">right</legend></fieldset>
+
+<fieldset class="rtl"><legend>(unset)</legend>RTL</fieldset>
+<fieldset class="rtl"><legend align="left">left</legend>RTL</fieldset>
+<fieldset class="rtl"><legend align="right">right</legend>RTL</fieldset>
+
+<fieldset class="rtl"><legend class="ltr" align="left">left</legend>RTL</fieldset>
+<fieldset class="rtl"><legend class="ltr" align="right">right</legend>RTL</fieldset>
+
+<fieldset><legend align="bottom">bottom</legend></fieldset>
+<fieldset><legend align="top">top</legend></fieldset>
+
+<fieldset class="v"><legend>(unset)</legend></fieldset>
+<fieldset class="v"><legend align="left">left</legend></fieldset>
+<fieldset class="v"><legend align="right">right</legend></fieldset>
+
+<fieldset class="v rtl"><legend>(unset)</legend>RTL</fieldset>
+<fieldset class="v rtl"><legend align="left">left</legend>RTL</fieldset>
+<fieldset class="v rtl"><legend align="right">right</legend>RTL</fieldset>
+
+<fieldset class="v rtl"><legend class="ltr" align="left">left</legend>RTL</fieldset>
+<fieldset class="v rtl"><legend class="ltr" align="right">right</legend>RTL</fieldset>
+
+<fieldset class="v"><legend align="bottom">bottom</legend></fieldset>
+<fieldset class="v"><legend align="top">top</legend></fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/1339287-ref.html b/layout/reftests/forms/legend/1339287-ref.html
new file mode 100644
index 0000000000..8dea047bbd
--- /dev/null
+++ b/layout/reftests/forms/legend/1339287-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 1339287</title>
+ <style type="text/css">
+
+html,body {
+ color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+fieldset { border:1px solid black; } /* solid border is less likely to cause AA issues */
+
+ </style>
+</head>
+<body>
+
+ <fieldset>
+ <legend style="display:inline-flex">
+ Headline Instructions
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:inline-grid">
+ Headline Instructions
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:flex">
+ Headline Instructions
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:grid">
+ Headline Instructions
+ </legend>
+ </fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/1339287.html b/layout/reftests/forms/legend/1339287.html
new file mode 100644
index 0000000000..482663f79f
--- /dev/null
+++ b/layout/reftests/forms/legend/1339287.html
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html><head>
+ <meta charset="utf-8">
+ <title>Testcase for bug 1339287</title>
+ <style type="text/css">
+
+html,body {
+ color:black; background-color:white; font:16px/1 monospace; padding:0; margin:0;
+}
+
+fieldset { border:1px solid black; } /* solid border is less likely to cause AA issues */
+
+ </style>
+</head>
+<body>
+
+ <fieldset>
+ <legend style="display:inline-flex">
+ Headline
+ <span>
+ Instructions
+ </span>
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:inline-grid">
+ Headline
+ <span>
+ Instructions
+ </span>
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:flex">
+ Headline
+ <span>
+ Instructions
+ </span>
+ </legend>
+ </fieldset>
+
+ <fieldset>
+ <legend style="display:grid">
+ Headline
+ <span>
+ Instructions
+ </span>
+ </legend>
+ </fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend-padding-1-ref.html b/layout/reftests/forms/legend/legend-padding-1-ref.html
new file mode 100644
index 0000000000..950d8d1833
--- /dev/null
+++ b/layout/reftests/forms/legend/legend-padding-1-ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Reference for bug 1483499</title>
+ <style>
+ legend, .legendRef {
+ /* Here in the reference case, we explicitly specify padding, and we also
+ use a custom-styled div as the reference case for any legend element
+ that is not directly snapped into a fieldset border. */
+ background: yellow;
+ border: 1px solid brown;
+ padding: 0px 2px;
+ }
+ </style>
+</head>
+<body>
+<!-- Test: legend default styling shouldn't be affected
+ by presence of a display:contents wrapper: -->
+<fieldset>
+ <legend>DisplayContentsWrapper</legend>
+</fieldset>
+<br>
+
+<!-- Test: legend should get the same 2px of inline-axis padding, even
+ if it's not inside of a fieldset at all. -->
+<div class="legendRef">JustALegend</div>
+<br>
+
+<div class="legendRef">
+ <div class="legendRef">NestedLegend</div>
+</div>
+<br>
+
+<fieldset>
+ <legend>
+ <div class="legendRef">
+ <div class="legendRef">NestedLegendInFieldset</div>
+ </div>
+ </legend>
+</fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend-padding-1.html b/layout/reftests/forms/legend/legend-padding-1.html
new file mode 100644
index 0000000000..9535d3dd93
--- /dev/null
+++ b/layout/reftests/forms/legend/legend-padding-1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Testcase for bug 1483499</title>
+ <style>
+ legend {
+ background: yellow;
+ border: 1px solid brown;
+ }
+ </style>
+</head>
+<body>
+<!-- Test: legend default styling shouldn't be affected
+ by presence of a display:contents wrapper: -->
+<fieldset>
+ <div style="display: contents">
+ <legend>DisplayContentsWrapper</legend>
+ </div>
+</fieldset>
+<br>
+
+<!-- Test: legend should get the same 2px of inline-axis padding, even
+ if it's not inside of a fieldset at all. -->
+<legend>JustALegend</legend>
+<br>
+
+<!-- ...and if it's nested, each nesting level will add 2px of padding. -->
+<legend>
+ <legend>NestedLegend</legend>
+</legend>
+<br>
+
+<fieldset>
+ <legend>
+ <legend>
+ <legend>NestedLegendInFieldset</legend>
+ </legend>
+ </legend>
+</fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend-padding-2-ref.html b/layout/reftests/forms/legend/legend-padding-2-ref.html
new file mode 100644
index 0000000000..4050ab7c26
--- /dev/null
+++ b/layout/reftests/forms/legend/legend-padding-2-ref.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Reference for bug 1483499</title>
+ <style>
+ html { writing-mode: vertical-rl }
+ legend, .legendRef {
+ /* Here in the reference case, we explicitly specify padding, and we also
+ use a custom-styled div as the reference case for any legend element
+ that is not directly snapped into a fieldset border. */
+ background: yellow;
+ border: 1px solid brown;
+ padding: 2px 0px;
+ }
+ </style>
+</head>
+<body>
+<!-- Test: legend default styling shouldn't be affected
+ by presence of a display:contents wrapper: -->
+<fieldset>
+ <legend>DisplayContentsWrapper</legend>
+</fieldset>
+<br>
+
+<!-- Test: legend should get the same 2px of inline-axis padding, even
+ if it's not inside of a fieldset at all. -->
+<div class="legendRef">JustALegend</div>
+<br>
+
+<div class="legendRef">
+ <div class="legendRef">NestedLegend</div>
+</div>
+<br>
+
+<fieldset>
+ <legend>
+ <div class="legendRef">
+ <div class="legendRef">NestedLegendInFieldset</div>
+ </div>
+ </legend>
+</fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend-padding-2.html b/layout/reftests/forms/legend/legend-padding-2.html
new file mode 100644
index 0000000000..52f7bcafcf
--- /dev/null
+++ b/layout/reftests/forms/legend/legend-padding-2.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Testcase for bug 1483499</title>
+ <style>
+ html { writing-mode: vertical-rl }
+ legend {
+ background: yellow;
+ border: 1px solid brown;
+ }
+ </style>
+</head>
+<body>
+<!-- Test: legend default styling shouldn't be affected
+ by presence of a display:contents wrapper: -->
+<fieldset>
+ <div style="display: contents">
+ <legend>DisplayContentsWrapper</legend>
+ </div>
+</fieldset>
+<br>
+
+<!-- Test: legend should get the same 2px of inline-axis padding, even
+ if it's not inside of a fieldset at all. -->
+<legend>JustALegend</legend>
+<br>
+
+<!-- ...and if it's nested, each nesting level will add 2px of padding. -->
+<legend>
+ <legend>NestedLegend</legend>
+</legend>
+<br>
+
+<fieldset>
+ <legend>
+ <legend>
+ <legend>NestedLegendInFieldset</legend>
+ </legend>
+ </legend>
+</fieldset>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend-ref.html b/layout/reftests/forms/legend/legend-ref.html
new file mode 100644
index 0000000000..3684841714
--- /dev/null
+++ b/layout/reftests/forms/legend/legend-ref.html
@@ -0,0 +1,95 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>Reference case for bug 740743</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+fieldset { padding: 2px; }
+legend { padding: 0; }
+span {
+ background: lime;
+ display: block;
+ padding-left: 2px;
+ padding-right: 2px;
+}
+
+.s10 { width:10px; height:10px; }
+.h10 { height:10px; }
+.w50 { width:50px; }
+.hidden { overflow:hidden; }
+.scroll { overflow:scroll; }
+.auto { overflow:auto; }
+
+.o { text-overflow: ellipsis; }
+
+#inline span { display:inline; }
+#inline-block span { display:inline-block; }
+
+ </style>
+</head>
+<body>
+
+<fieldset><legend><span class="hidden s10"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="scroll s10">Legend Test</span></legend></fieldset>
+<fieldset><legend><span class="auto s10">Legend Test</span></legend></fieldset>
+<fieldset><legend><span class="hidden w50"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="scroll w50">Legend Test</span></legend></fieldset>
+<fieldset><legend><span class="auto w50"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="hidden">Legend Test</span></legend></fieldset>
+<fieldset><legend><span class="auto"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="auto"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="auto"><b>Legend Test</b></span></legend></fieldset>
+
+<fieldset><legend><span class="hidden w50 o"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend><span class="hidden w50 o">Test Legend</span></legend></fieldset>
+<fieldset><legend><span class="hidden o">Test Legend</span></legend></fieldset>
+<fieldset><legend><span class="auto w50 o"><b>Legend Test</b></span></legend></fieldset>
+<fieldset><legend align="right"><span class="hidden w50 o">Test Legend</span></legend></fieldset>
+<fieldset><legend align="center"><span class="hidden w50 o">Test Legend</span></legend></fieldset>
+
+<div id="inline">
+<span class="hidden s10"><b>Legend Test</b></span>
+<span class="scroll s10">Legend Test</span>
+<span class="auto s10">Legend Test</span>
+<span class="hidden w50"><b>Legend Test</b></span>
+<span class="scroll w50">Legend Test</span>
+<span class="auto w50"><b>Legend Test</b></span>
+<span class="hidden">Legend Test</span>
+<span class="auto"><b>Legend Test</b></span>
+
+<span class="hidden w50 o"><b>Legend Test</b></span>
+<span class="hidden w50 o">Test Legend</span>
+<span class="hidden o">Test Legend</span>
+<span class="auto w50 o"><b>Legend Test</b></span>
+<span class="hidden w50 o">Test Legend</span>
+<span class="hidden w50 o">Test Legend</span>
+</div>
+
+<div id="inline-block">
+<span class="hidden s10"><b>Legend Test</b></span>
+<span class="scroll s10">Legend Test</span>
+<span class="auto s10">Legend Test</span>
+<span class="hidden w50"><b>Legend Test</b></span>
+<span class="scroll w50">Legend Test</span>
+<span class="auto w50"><b>Legend Test</b></span>
+<span class="hidden">Legend Test</span>
+<span class="auto"><b>Legend Test</b></span>
+<span class="auto"><b>Legend Test</b></span>
+
+<span class="hidden w50 o"><b>Legend Test</b></span>
+<span class="hidden w50 o">Test Legend</span>
+<span class="hidden o">Test Legend</span>
+<span class="auto w50 o"><b>Legend Test</b></span>
+<span class="hidden w50 o">Test Legend</span>
+<span class="hidden w50 o">Test Legend</span>
+</div>
+
+<span class="auto w50"><b>Legend Test</b></span>
+<span><b>Legend Test</b></span>
+<span><b>Legend Test</b></span>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/legend.html b/layout/reftests/forms/legend/legend.html
new file mode 100644
index 0000000000..9d05fbe6af
--- /dev/null
+++ b/layout/reftests/forms/legend/legend.html
@@ -0,0 +1,87 @@
+<!DOCTYPE HTML>
+<html><head>
+ <title>Testcase for bug 740743</title>
+ <style type="text/css">
+
+ html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+ }
+
+fieldset { padding: 2px; }
+legend { background: lime; }
+.s10 { width:10px; height:10px; }
+.h10 { height:10px; }
+.w50 { width:50px; }
+.hidden { overflow:hidden; }
+.scroll { overflow:scroll; }
+.auto { overflow:auto; }
+
+.o { text-overflow: ellipsis; }
+
+#inline legend { display:inline; }
+#inline-block legend { display:inline-block; }
+ </style>
+</head>
+<body>
+
+<fieldset><legend class="hidden s10"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="scroll s10">Legend Test</legend></fieldset>
+<fieldset><legend class="auto s10">Legend Test</legend></fieldset>
+<fieldset><legend class="hidden w50"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="scroll w50">Legend Test</legend></fieldset>
+<fieldset><legend class="auto w50"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="hidden">Legend Test</legend></fieldset>
+<fieldset><legend class="auto"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="auto" style="width:auto"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend style="width:auto"><b>Legend Test</b></legend></fieldset>
+
+<fieldset><legend class="hidden w50 o"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="hidden w50 o">Test Legend</legend></fieldset>
+<fieldset><legend class="hidden o">Test Legend</legend></fieldset>
+<fieldset><legend class="auto w50 o"><b>Legend Test</b></legend></fieldset>
+<fieldset><legend class="hidden w50 o" align="right">Test Legend</legend></fieldset>
+<fieldset><legend class="hidden w50 o" align="center">Test Legend</legend></fieldset>
+
+<div id="inline">
+<legend class="hidden s10"><b>Legend Test</b></legend>
+<legend class="scroll s10">Legend Test</legend>
+<legend class="auto s10">Legend Test</legend>
+<legend class="hidden w50"><b>Legend Test</b></legend>
+<legend class="scroll w50">Legend Test</legend>
+<legend class="auto w50"><b>Legend Test</b></legend>
+<legend class="hidden">Legend Test</legend>
+<legend class="auto"><b>Legend Test</b></legend>
+
+<legend class="hidden w50 o"><b>Legend Test</b></legend>
+<legend class="hidden w50 o">Test Legend</legend>
+<legend class="hidden o">Test Legend</legend>
+<legend class="auto w50 o"><b>Legend Test</b></legend>
+<legend class="hidden w50 o" align="right">Test Legend</legend>
+<legend class="hidden w50 o" align="center">Test Legend</legend>
+</div>
+
+<div id="inline-block">
+<legend class="hidden s10"><b>Legend Test</b></legend>
+<legend class="scroll s10">Legend Test</legend>
+<legend class="auto s10">Legend Test</legend>
+<legend class="hidden w50"><b>Legend Test</b></legend>
+<legend class="scroll w50">Legend Test</legend>
+<legend class="auto w50"><b>Legend Test</b></legend>
+<legend class="hidden">Legend Test</legend>
+<legend class="auto"><b>Legend Test</b></legend>
+<legend class="auto" style="width:auto"><b>Legend Test</b></legend>
+
+<legend class="hidden w50 o"><b>Legend Test</b></legend>
+<legend class="hidden w50 o">Test Legend</legend>
+<legend class="hidden o">Test Legend</legend>
+<legend class="auto w50 o"><b>Legend Test</b></legend>
+<legend class="hidden w50 o" align="right">Test Legend</legend>
+<legend class="hidden w50 o" align="center">Test Legend</legend>
+</div>
+
+<legend class="auto w50"><b>Legend Test</b></legend>
+<legend class="auto" zstyle="width:auto"><b>Legend Test</b></legend>
+<legend style="width:auto"><b>Legend Test</b></legend>
+
+</body>
+</html>
diff --git a/layout/reftests/forms/legend/reftest.list b/layout/reftests/forms/legend/reftest.list
new file mode 100644
index 0000000000..4b96bf0576
--- /dev/null
+++ b/layout/reftests/forms/legend/reftest.list
@@ -0,0 +1,5 @@
+== legend.html legend-ref.html # Bug 1392106
+== legend-padding-1.html legend-padding-1-ref.html
+== legend-padding-2.html legend-padding-2-ref.html
+fuzzy-if(Android,0-255,0-41) == 1273433.html 1273433-ref.html
+fails == 1339287.html 1339287-ref.html # bug 1383868
diff --git a/layout/reftests/forms/legend/shadow-dom-ref.html b/layout/reftests/forms/legend/shadow-dom-ref.html
new file mode 100644
index 0000000000..472d33acfd
--- /dev/null
+++ b/layout/reftests/forms/legend/shadow-dom-ref.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<!--
+ Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/
+-->
+<html lang="en-US">
+ <head>
+ <title>Test LEGEND placed into FIELDSET shadow DOM</title>
+ <link rel="author" title="Mats Palmgren" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1140579">
+<style>
+html,body {
+ color:black; background-color:white; font-size:16px; padding:0; margin:0;
+}
+.inline { display:inline; }
+z,.b { color:blue; }
+</style>
+ </head>
+ <body>
+ <fieldset id="host1"><legend>1</legend>a c</fieldset>
+ <fieldset id="host2"><legend>2</legend>a c</fieldset>
+ <fieldset id="host3"><legend>3</legend>a c</fieldset>
+ <fieldset id="host4"><legend>4</legend>a c</fieldset>
+ <fieldset id="host5"><legend>5</legend>a c</fieldset>
+ <fieldset id="host6"><legend class="b">6</legend>a c</fieldset>
+ <fieldset id="host7"><legend>7</legend>a <legend class="inline">L</legend> B</fieldset>
+ <fieldset id="host8"><legend>a 8</legend>A <legend class="inline">L c</legend> B</fieldset>
+ <fieldset id="host9"><legend>a 9</legend>A <legend class="inline p0">a L2 c</legend><z>a<legend>L3</legend>c</z> B</fieldset>
+ </body>
+</html>