mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
The hover invalidation code only tried matching ::before/::after selectors when has_pseudo_element() returned true, which requires an existing layout node. A pseudo-element that doesn't exist yet (because its content is only set by a hover rule) has no layout node, so the match was skipped and hovering never triggered a style recompute. Always try ::before/::after selectors during hover invalidation.
37 lines
959 B
HTML
37 lines
959 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
.outer {
|
|
height: 100px;
|
|
}
|
|
.update {
|
|
display: inline-block;
|
|
}
|
|
.update::before {
|
|
content: "Hi";
|
|
}
|
|
.outer:hover .update::before {
|
|
content: "Long text";
|
|
}
|
|
.create {
|
|
display: inline-block;
|
|
}
|
|
.outer:hover .create::before {
|
|
content: "Flag";
|
|
}
|
|
</style>
|
|
<script src="../include.js"></script>
|
|
<div class="outer"><div class="update"></div><div class="create"></div></div>
|
|
<script>
|
|
test(() => {
|
|
const update = document.querySelector('.update');
|
|
const create = document.querySelector('.create');
|
|
println(`update: ${update.clientWidth} create: ${create.clientWidth}`);
|
|
|
|
internals.mouseMove(50, 50);
|
|
println(`update: ${update.clientWidth} create: ${create.clientWidth}`);
|
|
|
|
internals.mouseMove(200, 200);
|
|
println(`update: ${update.clientWidth} create: ${create.clientWidth}`);
|
|
});
|
|
</script>
|