Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested view transitions: adjust for border offset #48771

Merged
merged 1 commit into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<title>Box model is copied to group style</title>
<meta name=fuzzy content="maxDifference=0-10; totalPixels=0-200000">
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<style>
* {
box-sizing: border-box;
}

body {
background: rebeccapurple;
margin: 0;
}

div {
width: 200px;
height: 200px;
background: green;
border: 10px solid blue;
padding: 48px;
}

.child {
border: 32px solid yellow;
}

.parent {
border-width: 15px;
padding-top: 27px;
padding-left: 100px;
overflow: clip;
}
</style>
<body>
<div class="parent">
<div class="child"></div>
</div>
</body>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html class=reftest-wait>
<title>Box model is copied to group style</title>
<meta name=fuzzy content="maxDifference=0-10; totalPixels=0-200000">
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-2/">
<link rel="match" href="box-model-capture-nested-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
* {
/* Will add tests for different sizing once the spec is resolved. */
box-sizing: border-box;
}

::view-transition {
background: rebeccapurple;
}

body {
margin: 0;
}

div {
width: 200px;
height: 200px;
background: green;
border: 10px solid blue;
}


.parent {
view-transition-name: parent;
padding: 48px 48px 48px 100px;
overflow: clip;
}

.child {
view-transition-name: child;
view-transition-group: parent;
border: 32px solid yellow;
padding: 48px;
}

.vt-new .parent {
border-width: 20px;
padding: 6px 48px 48px 100px;
}

::view-transition-group(*) {
animation-play-state: paused;
animation-timing-function: steps(2, start);
}

::view-transition-new(*), ::view-transition-old(*) {
animation: none;
}
</style>
<body>
<div class="parent">
<div class="child"></div>
</div>
<script>
document.startViewTransition(() => {
document.documentElement.classList.add("vt-new");
}).ready.then(() => takeScreenshot());
</script>
</body>