Skip to content

Commit 8c760a0

Browse files
committed
Re-import html/rendering/the-details-element WPT
https://bugs.webkit.org/show_bug.cgi?id=294892 rdar://154165662 Reviewed by Anne van Kesteren. Upstream commit: web-platform-tests/wpt@bdbb910 * LayoutTests/TestExpectations: * LayoutTests/imported/w3c/resources/resource-files.json: * LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/auto-expand-details-text-fragment-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/auto-expand-details-text-fragment.html: * LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/resources/auto-expand-details-text-fragment.html: * LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/w3c-import.log: Canonical link: https://commits.webkit.org/296570@main
1 parent 22d6d63 commit 8c760a0

File tree

6 files changed

+29
-16
lines changed

6 files changed

+29
-16
lines changed

LayoutTests/TestExpectations

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,9 @@ imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-e
973973
imported/w3c/web-platform-tests/html/rendering/the-details-element/details-pseudo-elements-004.html [ ImageOnlyFailure ]
974974
imported/w3c/web-platform-tests/html/rendering/the-details-element/details-pseudo-elements-005.html [ ImageOnlyFailure ]
975975

976+
# https://bugs.webkit.org/show_bug.cgi?id=228843
977+
imported/w3c/web-platform-tests/html/rendering/the-details-element/auto-expand-details-text-fragment.html [ Skip ]
978+
976979
# Cross-Origin-Embedder-Policy: credentialless is not supported.
977980
imported/w3c/web-platform-tests/html/cross-origin-embedder-policy/credentialless
978981

LayoutTests/imported/w3c/resources/resource-files.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11206,6 +11206,8 @@
1120611206
"web-platform-tests/html/rendering/the-details-element/details-pseudo-elements-004-ref.html",
1120711207
"web-platform-tests/html/rendering/the-details-element/details-pseudo-elements-005-ref.html",
1120811208
"web-platform-tests/html/rendering/the-details-element/details-revert-ref.html",
11209+
"web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-001-ref.html",
11210+
"web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-002-ref.html",
1120911211
"web-platform-tests/html/rendering/the-details-element/details-two-pages-print-ref.html",
1121011212
"web-platform-tests/html/rendering/the-details-element/single-summary.html",
1121111213
"web-platform-tests/html/rendering/the-details-element/summary-display-flex-ref.html",
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11

2-
FAIL Verifies that the beforematch event is fired on the matching element of a ScrollToTextFragment navigation. assert_true: The matching closed details element should be open. expected true got false
2+
Harness Error (TIMEOUT), message = null
3+
4+
TIMEOUT Verifies that the target page has scrolled as a result of a ScrollToTextFragment navigation. Test timed out
35

LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/auto-expand-details-text-fragment.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<meta charset="utf-8">
33
<title>beforematch fired on ScrollToTextFragment</title>
44
<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
5-
<link rel="help" href="https://github.com/WICG/display-locking">
5+
<link rel="help" href="https://html.spec.whatwg.org/multipage/interactive-elements.html#the-details-element">
66
<script src="/resources/testharness.js"></script>
77
<script src="/resources/testharnessreport.js"></script>
88
<script src="/resources/testdriver.js"></script>
@@ -26,5 +26,5 @@
2626
'The matching closed details element should be open.');
2727
assert_true(results.pageYOffsetAfterRaf > 0,
2828
'The page should be scrolled down to the match.');
29-
}), 'Verifies that the beforematch event is fired on the matching element of a ScrollToTextFragment navigation.');
29+
}), 'Verifies that the target page has scrolled as a result of a ScrollToTextFragment navigation.');
3030
</script>

LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/resources/auto-expand-details-text-fragment.html

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,18 @@
99
<div>foo</div>
1010
</details>
1111
<script>
12-
requestAnimationFrame(() => {
13-
requestAnimationFrame(() => {
14-
const results = {};
15-
// This should be true. The details element should be opened by
16-
// ScrollToTextFragment because it has matching text.
17-
results.detailsHasOpenAttribute = document.querySelector('details').hasAttribute('open');
18-
// This should be greater than zero. The page should be scrolled down
19-
// to the matching target.
20-
results.pageYOffsetAfterRaf = window.pageYOffset;
12+
const details = document.querySelector("details");
13+
details.ontoggle = () => {
14+
const results = {};
15+
// This should be true. The details element should be opened by
16+
// ScrollToTextFragment because it has matching text.
17+
results.detailsHasOpenAttribute = document.querySelector('details').hasAttribute('open');
18+
// This should be greater than zero. The page should be scrolled down
19+
// to the matching target.
20+
results.pageYOffsetAfterRaf = window.pageYOffset;
2121

22-
params = new URLSearchParams(window.location.search);
23-
stashResultsThenClose(params.get('key'), results);
24-
});
25-
});
22+
params = new URLSearchParams(window.location.search);
23+
stashResultsThenClose(params.get('key'), results);
24+
};
2625
</script>
2726
</body>

LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/w3c-import.log

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ List of files:
2323
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-before-expected-mismatch.html
2424
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-before.html
2525
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-blockification.html
26+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-crash.html
2627
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-display-type-001-expected.html
2728
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-display-type-001-ref-expected.html
2829
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-display-type-001-ref.html
@@ -55,6 +56,12 @@ List of files:
5556
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-revert-expected.html
5657
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-revert-ref.html
5758
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-revert.html
59+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-001-expected.html
60+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-001-ref.html
61+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-001.html
62+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-002-expected.html
63+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-002-ref.html
64+
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-summary-display-inline-002.html
5865
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/details-two-pages-print-ref.html
5966
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/empty-crash.html
6067
/LayoutTests/imported/w3c/web-platform-tests/html/rendering/the-details-element/single-summary.html

0 commit comments

Comments
 (0)