Bug 1483171 [wpt PR 12473] - HTML: fieldset should have min-inline-size: min-content, a=testonly
authorSimon Pieters <zcorpan@gmail.com>
Wed, 22 Aug 2018 13:26:17 +0000
changeset 831123 9b9811e57fe82fc9ba7ba2be27e029ce75085f2b
parent 831122 3591b99a02f4270f46da6a9807ba067618a05e36
child 831124 a5f525a8bd6309059495b4d43eeec92c4572910c
push id118868
push userbmo:zjz@zjz.name
push dateFri, 24 Aug 2018 07:04:39 +0000
reviewerstestonly
bugs1483171, 12473
milestone63.0a1
Bug 1483171 [wpt PR 12473] - HTML: fieldset should have min-inline-size: min-content, a=testonly Automatic update from web-platform-testsHTML: fieldset should have min-inline-size: min-content See https://github.com/whatwg/html/issues/2078. -- wpt-commits: a150d010d5771afd9d11fcaf08e457d29b1bf48a wpt-pr: 12473
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-inline-size.html
testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html
testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -183494,28 +183494,16 @@
       [
        "/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-position-relative-ref.html",
        "=="
       ]
      ],
      {}
     ]
    ],
-   "html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html": [
-    [
-     "/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html",
-     [
-      [
-       "/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html",
-       "=="
-      ]
-     ],
-     {}
-    ]
-   ],
    "html/rendering/non-replaced-elements/the-hr-element-0/align.html": [
     [
      "/html/rendering/non-replaced-elements/the-hr-element-0/align.html",
      [
       [
        "/html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html",
        "=="
       ]
@@ -285625,21 +285613,16 @@
      {}
     ]
    ],
    "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-position-relative-ref.html": [
     [
      {}
     ]
    ],
-   "html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html": [
-    [
-     {}
-    ]
-   ],
    "html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html": [
     [
      {}
     ]
    ],
    "html/rendering/non-replaced-elements/the-hr-element-0/color-ref.html": [
     [
      {}
@@ -355944,16 +355927,22 @@
     ]
    ],
    "html/rendering/non-replaced-elements/the-fieldset-element-0/legend.html": [
     [
      "/html/rendering/non-replaced-elements/the-fieldset-element-0/legend.html",
      {}
     ]
    ],
+   "html/rendering/non-replaced-elements/the-fieldset-element-0/min-inline-size.html": [
+    [
+     "/html/rendering/non-replaced-elements/the-fieldset-element-0/min-inline-size.html",
+     {}
+    ]
+   ],
    "html/rendering/non-replaced-elements/the-hr-element-0/hr.html": [
     [
      "/html/rendering/non-replaced-elements/the-hr-element-0/hr.html",
      {}
     ]
    ],
    "html/rendering/non-replaced-elements/the-hr-element-0/setting-overflow-visible.html": [
     [
@@ -596863,23 +596852,19 @@
   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend-position-relative.html": [
    "efd55ab22db75f8195a8d15161995311abf5b735",
    "reftest"
   ],
   "html/rendering/non-replaced-elements/the-fieldset-element-0/legend.html": [
    "1cda91f32baf119b8dd827275a3ba8b10c484084",
    "testharness"
   ],
-  "html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html": [
-   "cabbaf20e6563decd428c6fddae09e93b4dcc172",
-   "reftest"
-  ],
-  "html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html": [
-   "d17268a786bc99a32ef9a1420ca9fcd93a84a724",
-   "support"
+  "html/rendering/non-replaced-elements/the-fieldset-element-0/min-inline-size.html": [
+   "92c33029701b41678f4f514d28c6260338bd8e77",
+   "testharness"
   ],
   "html/rendering/non-replaced-elements/the-hr-element-0/align-ref.html": [
    "9e4283e208e17e4f2cfed05882bb1aff276028ad",
    "support"
   ],
   "html/rendering/non-replaced-elements/the-hr-element-0/align.html": [
    "1657f2458d0f606fb787b6d809309dd5192b1a2a",
    "reftest"
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-inline-size.html
@@ -0,0 +1,39 @@
+<!doctype html>
+<title>fieldset min-inline-size</title>
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<style>
+ fieldset { width: 0; height: 0 }
+ fieldset > div { width: 100px; height: 100px }
+ #vertical-lr { writing-mode: vertical-lr }
+ #vertical-rl { writing-mode: vertical-rl }
+ .override { min-inline-size: 5px }
+</style>
+<fieldset id=horizontal-tb><div></div></fieldset>
+<fieldset id=vertical-lr><div></div></fieldset>
+<fieldset id=vertical-rl><div></div></fieldset>
+<script>
+  for (const className of ['', 'override']) {
+    const expected = className === '' ? '100px' : '5px';
+    test(() => {
+      const fieldset = document.getElementById('horizontal-tb');
+      fieldset.className = className;
+      assert_equals(getComputedStyle(fieldset).width, expected, 'width');
+      assert_equals(getComputedStyle(fieldset).height, '0px', 'height');
+    }, `horizontal-tb ${className}`);
+
+    test(() => {
+      const fieldset = document.getElementById('vertical-lr');
+      fieldset.className = className;
+      assert_equals(getComputedStyle(fieldset).width, '0px', 'width');
+      assert_equals(getComputedStyle(fieldset).height, expected, 'height');
+    }, `vertical-lr ${className}`);
+
+    test(() => {
+      const fieldset = document.getElementById('vertical-rl');
+      fieldset.className = className;
+      assert_equals(getComputedStyle(fieldset).width, '0px', 'width');
+      assert_equals(getComputedStyle(fieldset).height, expected, 'height');
+    }, `vertical-rl ${className}`);
+  }
+</script>
deleted file mode 100644
--- a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>Rendering requirements test (suggested default rendering): fieldset min-width is overridable</title>
-    <link rel="author" title="Chris Rebert" href="http://chrisrebert.com">
-    <link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-fieldset-and-legend-elements">
-    <link rel="help" href="http://drafts.csswg.org/css2/visudet.html#min-max-widths">
-    <link rel="help" href="http://drafts.csswg.org/css-sizing/#width-height-keywords">
-    <link rel="match" href="ref.html">
-    <meta name="flags" content="">
-    <meta name="assert" content="fieldset's default min-width should be overridable since it's not !important and not spec'd to be non-overridable">
-    <style>
-body {
-    margin: 10px;
-}
-#cover {
-    background-color: green;
-    position: absolute;
-    left: 10px;
-    top: 10px;
-    height: 100px;
-    width: 100px;
-    z-index: 2;
-}
-fieldset {
-    min-width: 0;/* property under test */
-    /* zero these out so it renders more like a div element */
-    border: none;
-    margin: 0;
-    padding: 0;
-}
-.outer {
-    width: 100px;
-}
-.inner {
-    background-color: red;
-    color: red;
-    height: 100px;
-    overflow: scroll;
-    white-space: nowrap;
-}
-    </style>
-</head>
-<body>
-    <div class="outer">
-        <fieldset>
-            <div class="inner">a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a</div>
-        </fieldset>
-    </div>
-    <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
-    <div id="cover"></div>
-</body>
-</html>
deleted file mode 100644
--- a/testing/web-platform/tests/html/rendering/non-replaced-elements/the-fieldset-element-0/ref.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <meta charset="utf-8">
-    <title>Rendering requirements Reftest Reference</title>
-    <style>
-body {
-    margin: 10px;
-}
-div {
-    background-color: green;
-    height: 100px;
-    width: 100px;
-}
-    </style>
-</head>
-<body>
-    <div></div>
-    <p>Test passes if there is a <strong>filled green square</strong> and <strong>no red</strong>.</p>
-</body>
-</html>