-
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.
WebKit export: [view-transitions] Misplaced arrows after scrolling th…
…en transitioning on https://codepen.io/bramus/full/xxmozvN (#46780) https://bugs.webkit.org/show_bug.cgi?id=275506
- Loading branch information
Showing
2 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
css/css-view-transitions/transformed-element-scroll-transform-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,36 @@ | ||
<!DOCTYPE html> | ||
<html style="reftest-wait"> | ||
<head> | ||
<style> | ||
#target { | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
margin: 300px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="target"></div> | ||
<div style="height: 1000px"></div> | ||
<script> | ||
function scrollBy(y) { | ||
return new Promise(resolve => { | ||
addEventListener("scroll", () => { | ||
requestAnimationFrame(() => { | ||
requestAnimationFrame(resolve); | ||
}); | ||
}, { once: true, capture: true }); | ||
document.documentElement.scrollBy({ | ||
top: y, | ||
behavior: "instant" | ||
}); | ||
}); | ||
} | ||
addEventListener("load", async () => { | ||
await scrollBy(200); | ||
document.documentElement.classList.remove("reftest-wait"); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
56 changes: 56 additions & 0 deletions
56
css/css-view-transitions/transformed-element-scroll-transform.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,56 @@ | ||
<!DOCTYPE html> | ||
<html style="reftest-wait"> | ||
<head> | ||
<title>Scroll position transform should be the last one to be applied</title> | ||
<link rel="author" title="Tim Nguyen" href="https://github.com/nt1m"> | ||
<link rel="help" href="https://drafts.csswg.org/css-view-transitions-1/"> | ||
<link rel="match" href="transformed-element-scroll-transform-ref.html"> | ||
<style> | ||
:root { | ||
view-transition-name: none; | ||
} | ||
|
||
::view-transition-group(*) { | ||
animation-duration: 10s; | ||
} | ||
|
||
#target { | ||
width: 100px; | ||
height: 100px; | ||
background: green; | ||
margin: 300px; | ||
view-transition-name: target; | ||
rotate: 90deg; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div id="target"></div> | ||
<div style="height: 1000px"></div> | ||
<script> | ||
function scrollBy(y) { | ||
return new Promise(resolve => { | ||
addEventListener("scroll", () => { | ||
requestAnimationFrame(() => { | ||
requestAnimationFrame(resolve); | ||
}); | ||
}, { once: true, capture: true }); | ||
document.documentElement.scrollBy({ | ||
top: y, | ||
behavior: "instant" | ||
}); | ||
}); | ||
} | ||
addEventListener("load", async () => { | ||
await scrollBy(200); | ||
const transition = document.startViewTransition(); | ||
await transition.ready; | ||
requestAnimationFrame(() => { | ||
requestAnimationFrame(() => { | ||
document.documentElement.classList.remove("reftest-wait"); | ||
}); | ||
}); | ||
}); | ||
</script> | ||
</body> | ||
</html> |