Bug 1708348 [wpt PR 28732] - Auto-expand details elements for element fragments, a=testonly
authorJoey Arhar <jarhar@chromium.org>
Wed, 01 Sep 2021 13:58:45 +0000
changeset 590627 6e0220922771080d49dcf07c0c0bc1cafaaa92ae
parent 590626 1fca7922a2159c603e7f960c5ddcce4b50b0aaba
child 590628 58d5f4d3a17fa9a6224822986758944553ddf6ee
push id149061
push userwptsync@mozilla.com
push dateThu, 02 Sep 2021 10:43:59 +0000
treeherderautoland@c074b07ef03e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1708348, 28732, 1236774, 1185950, 2858768, 913060
milestone93.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 1708348 [wpt PR 28732] - Auto-expand details elements for element fragments, a=testonly Automatic update from web-platform-tests Auto-expand details elements for element fragments Since the AutoExpandDetailsElement feature is disabled right now due to crbug.com/1236774 the test fails, but with the feature enabled, the test passes. Bug: 1185950 Change-Id: Ib22dab04ebeff329c76a3ccf220945fd850deaaf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2858768 Auto-Submit: Joey Arhar <jarhar@chromium.org> Reviewed-by: Mason Freed <masonf@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/master@{#913060} -- wpt-commits: 7430f58d8a3e091f2b152f13b2828078efb5b128 wpt-pr: 28732
testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/auto-expand-details-element-fragment.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/interactive-elements/the-details-element/auto-expand-details-element-fragment.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<link rel="help" href="https://github.com/whatwg/html/pull/6466">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<div style="height:2000px">spacer</div>
+
+<details id=details>
+  <div id=target>target</div>
+</details>
+
+<script>
+async_test(t => {
+  assert_false(details.hasAttribute('open'),
+    `The <details> should be closed at the start of the test.`);
+  assert_equals(window.pageYOffset, 0,
+    `The page should be scrolled to the top at the start of the test.`);
+
+  window.location.hash = '#target';
+
+  requestAnimationFrame(t.step_func_done(() => {
+    assert_true(details.hasAttribute('open'),
+      `<details> should be opened by navigating to an element inside it.`);
+    assert_not_equals(window.pageYOffset, 0,
+      `The page should be scrolled down to the <details> element.`);
+  }));
+});
+</script>