Bug 1483776 [wpt PR 12513] - HTML: fieldset's "rendered legend" used value of display is block, a=testonly
authorSimon Pieters <zcorpan@gmail.com>
Fri, 24 Aug 2018 13:02:44 +0000
changeset 491622 387eb3dad4da4bf88aa4f5f266f565fe316ce34f
parent 491621 d521b5022652f2a599f0ced135621a33daa6c46e
child 491623 6060c2ad104f07484ca52028d344df43810beee4
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1483776, 12513
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1483776 [wpt PR 12513] - HTML: fieldset's "rendered legend" used value of display is block, a=testonly Automatic update from web-platform-testsHTML: fieldset's "rendered legend" used value of display is block See https://github.com/whatwg/html/issues/3927 -- wpt-commits: 0e10a5e47320a06c6f049fabcdfc6bd36922dc83 wpt-pr: 12513
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-display.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -356403,16 +356403,22 @@
     ]
    ],
    "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-block-formatting-context.html": [
     [
      "/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-block-formatting-context.html",
      {}
     ]
    ],
+   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-display.html": [
+    [
+     "/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-display.html",
+     {}
+    ]
+   ],
    "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-float-abspos.html": [
     [
      "/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-float-abspos.html",
      {}
     ]
    ],
    "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-grid-flex-multicol.html": [
     [
@@ -597736,16 +597742,20 @@
   "html/rendering/non-replaced-elements/the-fieldset-element-0/fieldset-transform-translatez.html": [
    "df30468b0041323667946739369ec7d42bf47742",
    "reftest"
   ],
   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-block-formatting-context.html": [
    "4e9539179739a3690aab276f2ba98c25bd4dfe9b",
    "testharness"
   ],
+  "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-display.html": [
+   "914547fc6cdde3e464b28eb7cc9737d17305f9af",
+   "testharness"
+  ],
   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-float-abspos.html": [
    "7979e1d03ece2575ef9ec7a2a8cba96df3705d78",
    "testharness"
   ],
   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-float-ref.html": [
    "c51bca231e158db109774b6ca70cdedb9d099b3a",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-display.html
@@ -0,0 +1,31 @@
+<!doctype html>
+<title>rendered legend and CSS display</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<fieldset><legend id="ref">x</legend></fieldset>
+<fieldset><legend id="test">x</legend></fieldset>
+<script>
+  const refElm = document.querySelector('#ref');
+  const refStyle = getComputedStyle(refElm);
+  const testElm = document.querySelector('#test');
+  const values = ['block', 'table', 'table-row-group', 'table-header-group', 'table-footer-group', 'table-row', 'table-cell',
+                  'table-column-group', 'table-column', 'table-caption', 'list-item', 'flow', 'flow-root','run-in','inline',
+                  'inline-block', 'inline-table', 'ruby', 'ruby-base', 'ruby-text', 'ruby-base-container', 'ruby-text-container',
+                  'grid', 'inline-grid', 'flex', 'inline-flex'];
+
+  for (const val of values) {
+    test(() => {
+      testElm.style.removeProperty('display');
+      testElm.style.display = val;
+      const computed = getComputedStyle(testElm);
+      // Note that computed value is different from the used value.
+      // E.g., if ruby is not supported, the following assertion will
+      // fail as the computed value of display will be block.
+      // If ruby is supported, computed.display will return "ruby",
+      // but the used value is supposed to be "block".
+      assert_equals(computed.display, val, `display: ${val} is not supported`);
+      assert_equals(computed.width, refStyle.width, 'width');
+      assert_equals(testElm.offsetLeft, refElm.offsetLeft, 'offsetLeft');
+    }, `rendered legend with display: ${val}`);
+  }
+</script>