mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +00:00
LibWeb: Make CSS :hover selector match shadow-inclusive ancestors
Before this change, :hover wouldn't match anything outside the shadow boundary when hovering elements inside a shadow tree. This was most noticeable when hovering the text inside an input element and hover styles disappearing from the hosting input element itself.
This commit is contained in:
parent
f3405b6eb2
commit
84ab8bf797
Notes:
github-actions[bot]
2024-08-25 10:53:57 +00:00
Author: https://github.com/awesomekling
Commit: 84ab8bf797
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1187
3 changed files with 25 additions and 1 deletions
23
Tests/LibWeb/Text/input/ShadowDOM/css-hover-shadow-dom.html
Normal file
23
Tests/LibWeb/Text/input/ShadowDOM/css-hover-shadow-dom.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<style>
|
||||
#myShadowHost:hover {
|
||||
background: green;
|
||||
}
|
||||
#myShadowHost {
|
||||
position: absolute;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
<body><div id="myShadowHost"><template shadowrootmode="open"><div>hover me</div></template></div></body>
|
||||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
if (window.internals && window.internals.movePointerTo)
|
||||
internals.movePointerTo(50, 50);
|
||||
|
||||
let s = getComputedStyle(myShadowHost);
|
||||
println("hovered bg: " + s.backgroundColor);
|
||||
|
||||
myShadowHost.remove();
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue