Bug 1465714 [wpt PR 11264] - HTML: Test hidden attribute on table elements, a=testonly
authorMs2ger <Ms2ger@gmail.com>
Wed, 06 Jun 2018 17:23:00 +0000
changeset 476466 eda8b8384d15b478bbb8c93e8cb4698c2d260e05
parent 476465 7c89b1ca3135f706ccd56b1620f2f0353c07d5c9
child 476467 0635f78c6bb2929187e53319a892e498257f7ecd
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1465714, 11264
milestone62.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 1465714 [wpt PR 11264] - HTML: Test hidden attribute on table elements, a=testonly Automatic update from web-platform-testsHTML: Test hidden attribute on table elements (#11264) -- wpt-commits: 89dc77674112c00ac5b513b7cdce68a341019f85 wpt-pr: 11264
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/rendering/non-replaced-elements/tables/hidden-attr.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -340419,16 +340419,22 @@
     ]
    ],
    "html/rendering/non-replaced-elements/tables/form-in-tables.xhtml": [
     [
      "/html/rendering/non-replaced-elements/tables/form-in-tables.xhtml",
      {}
     ]
    ],
+   "html/rendering/non-replaced-elements/tables/hidden-attr.html": [
+    [
+     "/html/rendering/non-replaced-elements/tables/hidden-attr.html",
+     {}
+    ]
+   ],
    "html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html": [
     [
      "/html/rendering/non-replaced-elements/tables/table-vspace-hspace-s.html",
      {}
     ]
    ],
    "html/rendering/non-replaced-elements/tables/table-vspace-hspace.html": [
     [
@@ -576758,16 +576764,20 @@
   "html/rendering/non-replaced-elements/tables/form-in-tables.html": [
    "8319c136723513a019d48f66c663ce3673777bcd",
    "testharness"
   ],
   "html/rendering/non-replaced-elements/tables/form-in-tables.xhtml": [
    "610932708cb18b8022ca64b8c9f3f59d8cf1ae56",
    "testharness"
   ],
+  "html/rendering/non-replaced-elements/tables/hidden-attr.html": [
+   "dd0173850f4593c883b24f28a750462bf0bae0e5",
+   "testharness"
+  ],
   "html/rendering/non-replaced-elements/tables/table-border-1-ref.html": [
    "1f3aa494ba434211a8cdcd1be289e702856fa05a",
    "support"
   ],
   "html/rendering/non-replaced-elements/tables/table-border-1.html": [
    "17a35d8b06ed08ba39c9fcc3abf7566941ee0c6a",
    "reftest"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/rendering/non-replaced-elements/tables/hidden-attr.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>UA style for hidden attribute on table elements</title>
+<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#tables-2">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<table hidden></table>
+<table><caption hidden></caption></table>
+<table><colgroup hidden></table>
+<table><col hidden></table>
+<table><thead hidden></table>
+<table><tbody hidden></table>
+<table><tfoot hidden></table>
+<table><tr hidden></table>
+<table><tr><td hidden></table>
+<table><tr><th hidden></table>
+<script>
+const expectedDisplay = {
+  'table': 'none',
+  'caption': 'none',
+  'colgroup': 'table-column-group',
+  'col': 'table-column',
+  'thead': 'table-header-group',
+  'tbody': 'table-row-group',
+  'tfoot': 'table-footer-group',
+  'tr': 'table-row',
+  'td': 'table-cell',
+  'th': 'table-cell',
+};
+for (const el of document.querySelectorAll("[hidden]")) {
+  test(function() {
+    const style = getComputedStyle(el);
+    assert_equals(style.display, expectedDisplay[el.localName]);
+    if (el instanceof HTMLTableElement ||
+        el instanceof HTMLTableCaptionElement) {
+      assert_equals(style.visibility, 'visible');
+    } else {
+      assert_equals(style.visibility, 'collapse');
+    }
+  }, `Computed display and visibility of ${el.localName}`);
+}
+</script>