Skip to content

Commit 003cf8f

Browse files
vmpstrmoz-wptsync-bot
authored andcommitted
Bug 1812122 [wpt PR 38144] - Revert "VT: Remove containment requirement.", a=testonly
Automatic update from web-platform-tests Revert "VT: Remove containment requirement." This reverts commit e554cf340761c4b11e0da4d0c98b1b58f9189cbd. Reason for revert: Decided against this feature for now. Original change's description: > VT: Remove containment requirement. > > This patch removes the containment requirement from view-transitions. > > This is to align with proposed resolution > w3c/csswg-drafts#7882 > > R=​[email protected], [email protected] > > Fixed: 1409491 > Change-Id: Iad0eb54c8d2de503f209a58a9f438e586fcd6a36 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4188811 > Reviewed-by: David Bokan <[email protected]> > Reviewed-by: Khushal Sagar <[email protected]> > Commit-Queue: Vladimir Levin <[email protected]> > Cr-Commit-Position: refs/heads/main@{#1096187} Change-Id: Id0b58230eb372a96aa1f1dff2e7d84e2f297219f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4192788 Commit-Queue: Vladimir Levin <[email protected]> Bot-Commit: Rubber Stamper <[email protected]> Cr-Commit-Position: refs/heads/main@{#1096273} -- wpt-commits: 404735f5905970d19b54fc1c4e9f84ef19edaac3 wpt-pr: 38144
1 parent b431b32 commit 003cf8f

32 files changed

+211
-0
lines changed

testing/web-platform/tests/css/css-view-transitions/3d-transform-incoming-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
background: blue;
1616
}
1717
.shared {
18+
contain: layout;
1819
width: 100px;
1920
height: 100px;
2021
}

testing/web-platform/tests/css/css-view-transitions/3d-transform-incoming.html

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
}
2626
.shared {
2727
view-transition-name: shared;
28+
contain: layout;
2829
width: 100px;
2930
height: 100px;
3031
}
@@ -33,6 +34,7 @@
3334
width: 10px;
3435
height: 10px;
3536
background: red;
37+
contain: layout;
3638
}
3739

3840
::view-transition-group(hidden) { animation-duration: 300s; }

testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
background: green;
1010
}
1111
.shared {
12+
contain: layout;
1213
width: 100px;
1314
height: 100px;
1415
}

testing/web-platform/tests/css/css-view-transitions/3d-transform-outgoing.html

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
}
2727
.shared {
2828
view-transition-name: shared;
29+
contain: layout;
2930
width: 100px;
3031
height: 100px;
3132
}
@@ -34,6 +35,7 @@
3435
width: 10px;
3536
height: 10px;
3637
background: red;
38+
contain: layout;
3739
}
3840

3941
::view-transition-group(hidden) { animation-duration: 300s; }

testing/web-platform/tests/css/css-view-transitions/css-tags-paint-order-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
<style>
77
div {
8+
contain: layout;
89
position: absolute;
910
top: 50px;
1011
width: 100px;

testing/web-platform/tests/css/css-view-transitions/css-tags-paint-order.html

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
<script src="/common/reftest-wait.js"></script>
99
<style>
10+
div { contain: layout; }
1011
#one {
1112
background: green;
1213
width: 100px;

testing/web-platform/tests/css/css-view-transitions/dialog-in-top-layer-during-transition-new.html

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
padding: 0;
1818

1919
view-transition-name: dialog;
20+
contain: layout;
2021
}
2122

2223
#target::backdrop {
@@ -25,6 +26,7 @@
2526
background: grey;
2627

2728
view-transition-name: backdrop;
29+
contain: layout;
2830
}
2931

3032
.hidden {

testing/web-platform/tests/css/css-view-transitions/dialog-in-top-layer-during-transition-old.html

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
padding: 0;
1818

1919
view-transition-name: dialog;
20+
contain: layout;
2021
}
2122

2223
#target::backdrop {
@@ -25,6 +26,7 @@
2526
background: grey;
2627

2728
view-transition-name: backdrop;
29+
contain: layout;
2830
}
2931

3032
.hidden {

testing/web-platform/tests/css/css-view-transitions/element-with-overflow.html

+2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@
1212
height: 10px;
1313
view-transition-name: hidden;
1414
background: green;
15+
contain: layout;
1516
}
1617

1718
.target {
1819
width: 100px;
1920
height: 100px;
2021
background: lightblue;
22+
contain: layout;
2123
view-transition-name: target;
2224
}
2325
.inner {

testing/web-platform/tests/css/css-view-transitions/new-content-element-writing-modes.html

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
contain: paint;
2828
border: 1px solid black;
2929
}
30+
.source {
31+
contain: layout;
32+
}
3033
#target {
3134
background: red;
3235
position: absolute;

testing/web-platform/tests/css/css-view-transitions/new-content-object-fit-fill.html

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
width: 10px;
3030
height: 10px;
3131
view-transition-name: hidden;
32+
contain: layout;
3233
}
3334

3435
html::view-transition-group(target) {

testing/web-platform/tests/css/css-view-transitions/new-content-object-fit-none.html

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
width: 10px;
2222
height: 10px;
2323
view-transition-name: hidden;
24+
contain: layout;
2425
}
2526

2627
html::view-transition-group(target) {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<title>View transitions: transition skipped if no containment on new element after animation started</title>
4+
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
5+
<link rel="author" href="mailto:[email protected]">
6+
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
10+
<style>
11+
div {
12+
width: 100px;
13+
height: 100px;
14+
background: blue;
15+
view-transition-name: target;
16+
contain: paint;
17+
}
18+
19+
html::view-transition-group(target) {
20+
animation-duration: 300s;
21+
}
22+
</style>
23+
24+
<div id=first></div>
25+
26+
<script>
27+
promise_test(async t => {
28+
assert_implements(document.startViewTransition, "Missing document.startViewTransition");
29+
return new Promise(async (resolve, reject) => {
30+
let transition = document.startViewTransition();
31+
await transition.updateCallbackDone;
32+
await transition.ready;
33+
34+
transition.finished.then(resolve, reject);
35+
first.style.contain = "none";
36+
});
37+
}, "new element becoming uncontained should skip the transition");
38+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<title>View transitions: transition skipped if no containment on new element</title>
4+
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
5+
<link rel="author" href="mailto:[email protected]">
6+
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
10+
<style>
11+
div {
12+
width: 100px;
13+
height: 100px;
14+
background: blue;
15+
view-transition-name: target;
16+
contain: paint;
17+
}
18+
</style>
19+
20+
<div id=first></div>
21+
22+
<script>
23+
promise_test(async t => {
24+
assert_implements(document.startViewTransition, "Missing document.startViewTransition");
25+
return new Promise(async (resolve, reject) => {
26+
let transition = document.startViewTransition(() => {
27+
first.style.contain = "none";
28+
});
29+
30+
let readyRejected = false;
31+
transition.ready.then(reject, () => { readyRejected = true; });
32+
33+
let updateCallbackDone = false;
34+
transition.updateCallbackDone.then(() => { updateCallbackDone = true; }, reject);
35+
transition.finished.then(() => {
36+
assert_true(readyRejected, "ready not rejected");
37+
assert_true(updateCallbackDone, "dom not updated");
38+
39+
if (window.getComputedStyle(first).contain == "none")
40+
resolve();
41+
else
42+
reject("dom update callback did not run");
43+
44+
}, reject);
45+
});
46+
}, "uncontained new element should skip the transition");
47+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<title>View transitions: transition skipped if no containment on old element</title>
4+
<link rel="help" href="https://www.w3.org/TR/css-view-transitions-1/">
5+
<link rel="author" href="mailto:[email protected]">
6+
7+
<script src="/resources/testharness.js"></script>
8+
<script src="/resources/testharnessreport.js"></script>
9+
10+
<style>
11+
div {
12+
width: 100px;
13+
height: 100px;
14+
background: blue;
15+
view-transition-name: target;
16+
}
17+
</style>
18+
19+
<div id=first></div>
20+
21+
<script>
22+
promise_test(async t => {
23+
assert_implements(document.startViewTransition, "Missing document.startViewTransition");
24+
return new Promise(async (resolve, reject) => {
25+
let transition = document.startViewTransition(() => {
26+
first.style.contain = "paint";
27+
});
28+
29+
let readyRejected = false;
30+
transition.ready.then(reject, () => { readyRejected = true; });
31+
32+
let updateCallbackDone = false;
33+
transition.updateCallbackDone.then(() => { updateCallbackDone = true; }, reject);
34+
transition.finished.then(() => {
35+
assert_true(readyRejected, "ready not rejected");
36+
assert_true(updateCallbackDone, "dom not updated");
37+
38+
if (window.getComputedStyle(first).contain == "paint")
39+
resolve();
40+
else
41+
reject("dom update callback did not run");
42+
43+
}, reject);
44+
});
45+
}, "uncontained old element should skip the transition");
46+
</script>

testing/web-platform/tests/css/css-view-transitions/old-content-object-fit-fill.html

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
width: 10px;
3030
height: 10px;
3131
view-transition-name: hidden;
32+
contain: layout;
3233
}
3334

3435
html::view-transition-group(target) {

testing/web-platform/tests/css/css-view-transitions/old-content-object-fit-none.html

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
width: 10px;
2222
height: 10px;
2323
view-transition-name: hidden;
24+
contain: layout;
2425
}
2526

2627
html::view-transition-group(target) {

testing/web-platform/tests/css/css-view-transitions/only-child-group.html

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828
color: red;
2929
}
3030

31+
div {
32+
contain: layout;
33+
}
3134
</style>
3235
<div id="target"></div>
3336
<div id="target2"></div>

testing/web-platform/tests/css/css-view-transitions/only-child-new.html

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
color: red;
2929
}
3030

31+
#target {
32+
contain: layout;
33+
}
34+
3135
</style>
3236
<div id="target"></div>
3337

testing/web-platform/tests/css/css-view-transitions/only-child-old.html

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
color: red;
2929
}
3030

31+
#target {
32+
contain: layout;
33+
}
34+
3135
</style>
3236
<div id="target"></div>
3337

testing/web-platform/tests/css/css-view-transitions/paused-animation-at-end.html

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#target {
1212
width: 100px;
1313
height: 100px;
14+
contain: layout;
1415
view-transition-name: target;
1516
}
1617
.one {

testing/web-platform/tests/css/css-view-transitions/scroller-child-abspos-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
<style>
77
#target {
8+
contain: layout;
89
width: 200px;
910
height: 200px;
1011
background: yellow;

testing/web-platform/tests/css/css-view-transitions/scroller-child-abspos.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<style>
1111
#target {
12+
contain: layout;
1213
view-transition-name: target;
1314
width: 200px;
1415
height: 200px;

testing/web-platform/tests/css/css-view-transitions/scroller-child-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
<style>
77
#target {
8+
contain: layout;
89
width: 500px;
910
height: 500px;
1011
background: yellow;

testing/web-platform/tests/css/css-view-transitions/scroller-child.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
<style>
1111
#target {
12+
contain: layout;
1213
view-transition-name: target;
1314
width: 500px;
1415
height: 500px;

testing/web-platform/tests/css/css-view-transitions/scroller-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
width: 100px;
1010
height: 100px;
1111
background: blue;
12+
contain: layout;
1213
}
1314

1415
#child {

testing/web-platform/tests/css/css-view-transitions/scroller.html

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
width: 100px;
1414
height: 100px;
1515
background: blue;
16+
contain: layout;
1617
view-transition-name: target;
1718
}
1819

testing/web-platform/tests/css/css-view-transitions/set-current-time-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.target {
77
width: 100px;
88
height: 100px;
9+
contain: layout;
910
background: blue;
1011
opacity: 0.5;
1112
}

testing/web-platform/tests/css/css-view-transitions/set-current-time-transform-ref.html

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#target {
1414
width: 100px;
1515
height: 100px;
16+
contain: layout;
1617
background: blue;
1718
view-transition-name: target;
1819
position: relative;

testing/web-platform/tests/css/css-view-transitions/set-current-time-transform.html

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#target {
1111
width: 100px;
1212
height: 100px;
13+
contain: layout;
1314
background: blue;
1415
view-transition-name: target;
1516
position: relative;

0 commit comments

Comments
 (0)