mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-29 08:11:13 +00:00
a8f4ea5226
Instead of carrying the display list for a mask in each command that might potentially be affected by "background-clip: text", this change introduces a new AddMask command that is applied once for all background layers within one box. The new AddMask command includes a rectangle for the mask destination that is translated by the corresponding scroll offset. Fixes https://github.com/LadybirdBrowser/ladybird/issues/857
31 lines
715 B
HTML
31 lines
715 B
HTML
<!DOCTYPE html>
|
|
<link rel="match" href="reference/background-clip-text-inside-scrollable-ref.html" />
|
|
<style>
|
|
* {
|
|
scrollbar-width: none;
|
|
}
|
|
|
|
#text {
|
|
background: linear-gradient(#6d98cc, #8a64e5);
|
|
background-clip: text;
|
|
color: transparent;
|
|
font-size: 50px;
|
|
}
|
|
|
|
#scrollable {
|
|
width: 300px;
|
|
height: 300px;
|
|
border: 1px solid black;
|
|
overflow: scroll;
|
|
}
|
|
</style>
|
|
<div id="scrollable">
|
|
<div style="height: 200px"></div>
|
|
Clip<span id="text">Text</span>
|
|
<div style="height: 600px"></div>
|
|
</div>
|
|
<script>
|
|
const scrollContainer = document.getElementById("scrollable");
|
|
scrollContainer.scrollTop = 200;
|
|
</script>
|