-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
view-transitions: Add WPT for exit transitions with LayoutObjects.
Before [1], ViewTransition had a bug which would incorrectly assume that a PaintLayer generating anonymous LayoutObject corresponds to a node which is participating in a ViewTransition. While the previous patch fixed this bug, it was intended to be a no-op. This change adds a test to ensure the error case is covered in VT WPTs. [1]: https://chromium-review.googlesource.com/c/chromium/src/+/4367418 [email protected] Fixed: 1443134 Change-Id: I259fdda6d4e49464cedb28c9b6c120d35ec998d0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4528215 Commit-Queue: Chris Harrelson <[email protected]> Reviewed-by: Chris Harrelson <[email protected]> Auto-Submit: Khushal Sagar <[email protected]> Cr-Commit-Position: refs/heads/main@{#1143496}
- Loading branch information
1 parent
1ad2e61
commit 1475379
Showing
2 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
css/css-view-transitions/exit-transition-with-anonymous-layout-object-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<title>View transitions: exit transition with layout objects that don't have a node (ref)</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
|
||
<style> | ||
body { | ||
width: 100vw; | ||
height: 100vh; | ||
background: pink; | ||
} | ||
|
||
#target { | ||
width: 100px; | ||
height: 100px; | ||
background: blue; | ||
} | ||
</style> | ||
<div id="target"></div> |
64 changes: 64 additions & 0 deletions
64
css/css-view-transitions/exit-transition-with-anonymous-layout-object.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>View transitions: exit transition with layout objects that don't have a node</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="author" href="mailto:[email protected]"> | ||
<link rel="match" href="exit-transition-with-anonymous-layout-object-ref.html"> | ||
|
||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
body { | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
|
||
#target { | ||
width: 100px; | ||
height: 100px; | ||
background: blue; | ||
view-transition-name: target; | ||
} | ||
|
||
#hidden { | ||
width: 10px; | ||
height: 10px; | ||
background: grey; | ||
view-transition-name: hidden; | ||
} | ||
|
||
fieldset { | ||
width: 100px; | ||
height: 100px; | ||
background: lightgreen; | ||
overflow: clip; | ||
} | ||
|
||
html::view-transition { background: pink; } | ||
html::view-transition-group(root) { visibility: hidden; } | ||
html::view-transition-group(hidden) { animation-duration: 300s; } | ||
html::view-transition-image-pair(hidden) { animation: unset; opacity: 0; } | ||
html::view-transition-old(target) { | ||
animation: unset; | ||
opacity: 1; | ||
} | ||
</style> | ||
<div id="target"></div> | ||
<fieldset id="anonymous">hi</fieldset> | ||
<div id=hidden class=hidden></div> | ||
|
||
<script> | ||
failIfNot(document.startViewTransition, "Missing document.startViewTransition"); | ||
|
||
async function runTest() { | ||
let t = document.startViewTransition(() => { | ||
target.style.viewTransitionName = "none"; | ||
}); | ||
await t.ready; | ||
anonymous.style.position = "relative"; | ||
requestAnimationFrame(() => requestAnimationFrame(() => | ||
requestAnimationFrame(() => requestAnimationFrame(takeScreenshot)) | ||
)); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|