Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit d78fca4

Browse files
vmpstrmoz-wptsync-bot
authored andcommitted
Bug 1956352 [wpt PR 51586] - VT: Change view-transition-name: auto to use random string on id match., a=testonly
Automatic update from web-platform-tests VT: Change view-transition-name: auto to use random string on id match. This patch updates the auto implementation to use a random string to match auto names, which ensures namespacing between view-transition-name ident matches and auto id matches. [email protected] Bug: 402754383 Change-Id: I870b0ca5da6a1a10c2a45be80d5694ba10579813 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6378343 Reviewed-by: Nasko Oskov <[email protected]> Reviewed-by: Jeremy Roman <[email protected]> Reviewed-by: Noam Rosenthal <[email protected]> Commit-Queue: Vladimir Levin <[email protected]> Cr-Commit-Position: refs/heads/main@{#1438221} -- wpt-commits: 82a86955317eb250e973fc91ba8683f3b14c1324 wpt-pr: 51586
1 parent cc3257a commit d78fca4

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

testing/web-platform/tests/css/css-view-transitions/auto-name-from-id.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
.item {
1919
view-transition-name: auto;
20+
view-transition-class: item;
2021
}
2122

2223
main.switch #item1 {
@@ -38,8 +39,7 @@
3839
}
3940

4041
:root { view-transition-name: none; }
41-
html::view-transition-group(item1),
42-
html::view-transition-group(item2) {
42+
html::view-transition-group(*.item) {
4343
animation-timing-function: steps(2, start);
4444
animation-play-state: paused;
4545
}
@@ -51,7 +51,7 @@
5151

5252
</style>
5353

54-
<main>
54+
<main id=main>
5555
<div class="item" id="item1"></div>
5656
<div class="item" id="item2"></div>
5757
</main>
@@ -61,10 +61,19 @@
6161

6262
function runTest() {
6363
document.startViewTransition(() => {
64-
document.querySelector("main").classList.toggle("switch");
64+
main.classList.toggle("switch");
65+
let div1 = document.createElement("div");
66+
div1.classList.add("item");
67+
div1.id = "item1";
68+
69+
let div2 = document.createElement("div");
70+
div2.classList.add("item");
71+
div2.id = "item2";
72+
73+
main.replaceChildren(div1, div2);
6574
}).ready.then(takeScreenshot);
6675
}
6776
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest));
6877
</script>
6978

70-
</body>
79+
</body>

testing/web-platform/tests/css/css-view-transitions/navigation/resources/auto-name-from-id.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
display: none;
2424
}
2525

26-
html::view-transition-group(green) {
26+
html::view-transition-group(*) {
2727
animation-play-state: paused;
2828
animation-duration: 3s;
2929
animation-timing-function: steps(2, start);

0 commit comments

Comments
 (0)