-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make CSS view-transition-class a tree-scoped name
Parse view-transition-class a s CSSScopedNameList, and match with the document tree-scoped when capturing the old+new element. CSSWG resolution: w3c/csswg-drafts#10529 (comment) Bug: 358159341 Change-Id: Ib40816b8358bb9390a427bc4ea456d86f6060eab Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5776943 Reviewed-by: Khushal Sagar <[email protected]> Commit-Queue: Noam Rosenthal <[email protected]> Cr-Commit-Position: refs/heads/main@{#1340430}
- Loading branch information
1 parent
9f92b8d
commit c88a90b
Showing
3 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
css/css-view-transitions/shadow-part-with-class-inside-shadow-important.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,55 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>View transitions: shadow parts </title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="match" href="names-are-tree-scoped-ref.html"> | ||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
|
||
::part(party) { | ||
view-transition-name: party; | ||
view-transition-class: red; | ||
} | ||
|
||
:root { view-transition-name: none; } | ||
html::view-transition-group(*) { animation-play-state: paused; } | ||
html::view-transition-old(*) { animation: unset; opacity: 0 } | ||
html::view-transition-new(*) { animation: unset; opacity: 0 } | ||
html::view-transition-group(party) { | ||
position: absolute; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
} | ||
html::view-transition-group(party.red) { | ||
background: red; | ||
} | ||
</style> | ||
|
||
<custom-component> | ||
<template shadowrootmode="open"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div part="party" style="view-transition-class: none !important"></div> | ||
</template> | ||
</custom-component> | ||
|
||
<script> | ||
failIfNot(document.startViewTransition, "Missing document.startViewTransition"); | ||
|
||
function runTest() { | ||
document.startViewTransition().ready.then(takeScreenshot); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|
||
</body> |
54 changes: 54 additions & 0 deletions
54
css/css-view-transitions/shadow-part-with-class-inside-shadow.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,54 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>View transitions: shadow parts </title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="match" href="names-are-tree-scoped-ref.html"> | ||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
|
||
::part(party) { | ||
view-transition-name: party; | ||
} | ||
|
||
:root { view-transition-name: none; } | ||
html::view-transition-group(*) { animation-play-state: paused; } | ||
html::view-transition-old(*) { animation: unset; opacity: 0 } | ||
html::view-transition-new(*) { animation: unset; opacity: 0 } | ||
html::view-transition-group(party) { | ||
position: absolute; | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
} | ||
html::view-transition-group(party.red) { | ||
background: red; | ||
} | ||
</style> | ||
|
||
<custom-component> | ||
<template shadowrootmode="open"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div part="party" style="view-transition-class: red"></div> | ||
</template> | ||
</custom-component> | ||
|
||
<script> | ||
failIfNot(document.startViewTransition, "Missing document.startViewTransition"); | ||
|
||
function runTest() { | ||
document.startViewTransition().ready.then(takeScreenshot); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|
||
</body> |
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,58 @@ | ||
<!DOCTYPE html> | ||
<html class=reftest-wait> | ||
<title>View transitions: shadow parts </title> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="match" href="names-are-tree-scoped-ref.html"> | ||
<script src="/common/reftest-wait.js"></script> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
background: red; | ||
} | ||
|
||
::part(party) { | ||
view-transition-name: party; | ||
view-transition-class: green; | ||
} | ||
|
||
:root { view-transition-name: none; } | ||
html::view-transition-group(*) { animation-play-state: paused; } | ||
html::view-transition-old(*) { animation: unset; opacity: 0 } | ||
html::view-transition-new(*) { animation: unset; opacity: 0 } | ||
html::view-transition-group(party) { | ||
position: absolute; | ||
width: 100px; | ||
height: 100px; | ||
background: yellow; | ||
} | ||
html::view-transition-group(party.red) { | ||
background: red; | ||
} | ||
html::view-transition-group(party.green) { | ||
background: green; | ||
} | ||
</style> | ||
|
||
<custom-component> | ||
<template shadowrootmode="open"> | ||
<style> | ||
div { | ||
width: 100px; | ||
height: 100px; | ||
} | ||
</style> | ||
<div part="party" style="view-transition-class: red"></div> | ||
</template> | ||
</custom-component> | ||
|
||
<script> | ||
failIfNot(document.startViewTransition, "Missing document.startViewTransition"); | ||
|
||
function runTest() { | ||
document.startViewTransition().ready.then(takeScreenshot); | ||
} | ||
onload = () => requestAnimationFrame(() => requestAnimationFrame(runTest)); | ||
</script> | ||
|
||
</body> |