-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SET: Add support for clip-path object-view-box calculations.
This patch adds clip-path support for object-view-box calculations. This includes tests with both subset and intersecting clip-paths. R=khushalsagar@chromium.org Fixed: 1311706 Change-Id: Id62232f92d6628daa44b8fc2fd79742d071d1f82 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3645236 Reviewed-by: Khushal Sagar <khushalsagar@chromium.org> Commit-Queue: Khushal Sagar <khushalsagar@chromium.org> Commit-Queue: Vladimir Levin <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/main@{#1003964} NOKEYCHECK=True GitOrigin-RevId: b074e802240c39226401a8f2f8c1f720099d5273
- Loading branch information
Showing
5 changed files
with
273 additions
and
4 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
46 changes: 46 additions & 0 deletions
46
...web_tests/wpt_internal/document-transition/new-content-object-view-box-clip-path-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,46 @@ | ||
<!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; | ||
} | ||
#one { clip-path: inset(10px 12px 20px 28px); } | ||
#two { clip-path: inset(10px -12px 20px -28px); } | ||
body { background: lightpink; } | ||
</style> | ||
|
||
<div id=one class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> | ||
<div style="height: 20px;"></div> | ||
<div id=two class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> |
79 changes: 79 additions & 0 deletions
79
blink/web_tests/wpt_internal/document-transition/new-content-object-view-box-clip-path.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,79 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>Shared transitions: object-view-box with larger clip-path</title> | ||
<link rel="help" href="https://github.com/WICG/shared-element-transitions"> | ||
<link rel="author" href="mailto:vmpstr@chromium.org"> | ||
<link rel="match" href="new-content-object-view-box-clip-path-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; | ||
} | ||
.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; | ||
} | ||
#one { | ||
page-transition-tag: target-one; | ||
clip-path: inset(10px 12px 20px 28px); | ||
} | ||
#two { | ||
page-transition-tag: target-two; | ||
clip-path: inset(10px -12px 20px -28px); | ||
} | ||
|
||
html::page-transition-container(target-one), | ||
html::page-transition-container(target-two) { animation-duration: 300s; } | ||
html::page-transition-outgoing-image(target-one), | ||
html::page-transition-outgoing-image(target-two) { animation: unset; opacity: 0; } | ||
html::page-transition-incoming-image(target-one), | ||
html::page-transition-incoming-image(target-two) { | ||
animation: unset; | ||
opacity: 1; | ||
/* clip overflow, and verify inner contents only */ | ||
overflow: hidden; | ||
} | ||
|
||
html::page-transition-container(root) { animation: unset; opacity: 0; } | ||
html::page-transition { background: lightpink; } | ||
</style> | ||
|
||
<div id=one class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> | ||
<div style="height: 20px;"></div> | ||
<div id=two 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> | ||
|
46 changes: 46 additions & 0 deletions
46
...web_tests/wpt_internal/document-transition/old-content-object-view-box-clip-path-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,46 @@ | ||
<!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; | ||
} | ||
#one { clip-path: inset(10px 12px 20px 28px); } | ||
#two { clip-path: inset(10px -12px 20px -28px); } | ||
body { background: lightpink; } | ||
</style> | ||
|
||
<div id=one class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> | ||
<div style="height: 20px;"></div> | ||
<div id=two class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> |
79 changes: 79 additions & 0 deletions
79
blink/web_tests/wpt_internal/document-transition/old-content-object-view-box-clip-path.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,79 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>Shared transitions: object-view-box with larger clip-path</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-clip-path-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; | ||
} | ||
.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; | ||
} | ||
#one { | ||
page-transition-tag: target-one; | ||
clip-path: inset(10px 12px 20px 28px); | ||
} | ||
#two { | ||
page-transition-tag: target-two; | ||
clip-path: inset(10px -12px 20px -28px); | ||
} | ||
|
||
html::page-transition-container(target-one), | ||
html::page-transition-container(target-two) { animation-duration: 300s; } | ||
html::page-transition-incoming-image(target-one), | ||
html::page-transition-incoming-image(target-two) { animation: unset; opacity: 0; } | ||
html::page-transition-outgoing-image(target-one), | ||
html::page-transition-outgoing-image(target-two) { | ||
animation: unset; | ||
opacity: 1; | ||
/* clip overflow, and verify inner contents only */ | ||
overflow: hidden; | ||
} | ||
|
||
html::page-transition-container(root) { animation: unset; opacity: 0; } | ||
html::page-transition { background: lightpink; } | ||
</style> | ||
|
||
<div id=one class=target> | ||
<div class=child> | ||
<div class=grandchild></div> | ||
</div> | ||
</div> | ||
<div style="height: 20px;"></div> | ||
<div id=two 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> | ||
|