mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +00:00
b821f7b283
Introduces the rendering of scroll thumbs in vertical and horizontal directions. Currently, the thumbs are purely graphical elements that do not respond to mouse events. Nevertheless, this is beneficial as it makes it easier to identify elements that should respond to scrolling events. Painting of scrollbars uncovers numerous bugs in the calculation of scrollable overflow rectangles highlighting all the places where elements are made scrollable whey they shouldn't be. Positively, this issue might motivate us to pay more attention to this problem to eliminate unnecessary scrollbars. Currently, the scrollbar style is uniform across all platforms: a semi-transparent gray rectangle with rounded corners. Also here we add `scrollbar-width: none` to all existing scrolling ref-tests, so they keep working with this change.
50 lines
1.1 KiB
HTML
50 lines
1.1 KiB
HTML
<link rel="match" href="reference/scrollable-box-with-nested-stacking-context-ref.html" />
|
|
<style>
|
|
* {
|
|
scrollbar-width: none;
|
|
}
|
|
|
|
#scrollable-box {
|
|
width: 300px;
|
|
height: 500px;
|
|
overflow: auto;
|
|
position: relative;
|
|
border: 2px solid black;
|
|
}
|
|
|
|
.content {
|
|
height: 1000px;
|
|
background-color: lightblue;
|
|
}
|
|
|
|
.abspos {
|
|
position: absolute;
|
|
bottom: 0px;
|
|
right: 0px;
|
|
width: 150px;
|
|
height: 50px;
|
|
background-color: coral;
|
|
z-index: 1000;
|
|
display: flex;
|
|
}
|
|
|
|
.box {
|
|
background-color: magenta;
|
|
width: 100px;
|
|
height: 100px;
|
|
position: relative;
|
|
top: 0px;
|
|
left: 0px;
|
|
}
|
|
</style>
|
|
<div id="scrollable-box">
|
|
<div class="content">
|
|
Lots of scrollable content here!
|
|
<div class="box">box</div>
|
|
</div>
|
|
<div class="abspos"><div class="box">box</div></div>
|
|
</div>
|
|
<script>
|
|
const scrollContainer = document.getElementById("scrollable-box");
|
|
scrollContainer.scrollTop = 500;
|
|
</script>
|