-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SET: Compute object-view-box for incoming/outgoing images.
This patch makes style tracker compute the object-view-box based on the border box size and the overflow rect. This is currently ignoring clip-path since it's using a function for overflow that ignores this as well. R=khushalsagar@chromium.org Change-Id: I2a4329adc3b19da309522666e843fd1058d1a3ac Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3615255 Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1002841}
- Loading branch information
Showing
8 changed files
with
328 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
38 changes: 38 additions & 0 deletions
38
.../web_tests/wpt_internal/document-transition/new-content-object-view-box-overflow-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,38 @@ | ||
<!DOCTYPE html> | ||
<title>Shared transitions: object-view-box with larger overflow (ref)</title> | ||
<link rel="help" href="https://github.com/WICG/shared-element-transitions"> | ||
<link rel="author" href="mailto:vmpstr@chromium.org"> | ||
<style> | ||
.target { | ||
color: red; | ||
width: 100px; | ||
height: 100px; | ||
contain: paint; | ||
position: relative; | ||
top: 50px; | ||
left: 50px; | ||
} | ||
.child { | ||
width: 123px; | ||
height: 150px; | ||
background: lightblue; | ||
position: relative; | ||
top: -10px; | ||
left: -20px; | ||
} | ||
.grandchild { | ||
width: 25px; | ||
height: 25px; | ||
position: relative; | ||
top: 20px; | ||
left: 40px; | ||
background: green; | ||
} | ||
body { background: lightpink; } | ||
</style> | ||
|
||
<div class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> |
64 changes: 64 additions & 0 deletions
64
...link/web_tests/wpt_internal/document-transition/new-content-object-view-box-overflow.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>Shared transitions: object-view-box with larger overflow</title> | ||
<link rel="help" href="https://github.com/WICG/shared-element-transitions"> | ||
<link rel="author" href="mailto:vmpstr@chromium.org"> | ||
<link rel="match" href="old-content-object-view-box-overflow-ref.html"> | ||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
.target { | ||
color: red; | ||
width: 100px; | ||
height: 100px; | ||
contain: paint; | ||
overflow-clip-margin: 1000px; | ||
position: relative; | ||
top: 50px; | ||
left: 50px; | ||
page-transition-tag: target; | ||
} | ||
.child { | ||
width: 123px; | ||
height: 150px; | ||
background: lightblue; | ||
position: relative; | ||
top: -10px; | ||
left: -20px; | ||
} | ||
.grandchild { | ||
width: 25px; | ||
height: 25px; | ||
position: relative; | ||
top: 20px; | ||
left: 40px; | ||
background: green; | ||
} | ||
|
||
html::page-transition-container(target) { animation-duration: 300s; } | ||
html::page-transition-incoming-image(target) { | ||
animation: unset; | ||
opacity: 1; | ||
|
||
/* clip overflow, and verify inner contents only */ | ||
overflow: hidden; | ||
} | ||
html::page-transition-outgoing-image(target) { animation: unset; opacity: 0; } | ||
|
||
html::page-transition-container(root) { animation: unset; opacity: 0; } | ||
html::page-transition { background: lightpink; } | ||
</style> | ||
|
||
<div class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> | ||
|
||
<script> | ||
async function runTest() { | ||
document.createDocumentTransition().start(() => | ||
requestAnimationFrame(() => requestAnimationFrame(takeScreenshot))); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|
Oops, something went wrong.