mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Reset text-shadow if needed after paint-only properties update
Previously we would not propagate text-shadow changes when it's changed from some value to none. Fixes https://github.com/LadybirdBrowser/ladybird/issues/6580
This commit is contained in:
parent
c7e4a99219
commit
57c925cfa9
Notes:
github-actions[bot]
2025-11-14 11:51:03 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 57c925cfa9
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6820
Reviewed-by: https://github.com/gmta ✅
3 changed files with 23 additions and 2 deletions
|
|
@ -1644,8 +1644,8 @@ void PaintableWithLines::resolve_paint_properties()
|
|||
fragment.set_text_decoration_thickness(css_line_thickness);
|
||||
|
||||
auto const& text_shadow = text_node.computed_values().text_shadow();
|
||||
Vector<ShadowData> resolved_shadow_data;
|
||||
if (!text_shadow.is_empty()) {
|
||||
Vector<ShadowData> resolved_shadow_data;
|
||||
resolved_shadow_data.ensure_capacity(text_shadow.size());
|
||||
for (auto const& layer : text_shadow) {
|
||||
resolved_shadow_data.empend(
|
||||
|
|
@ -1656,8 +1656,8 @@ void PaintableWithLines::resolve_paint_properties()
|
|||
layer.spread_distance.to_px(layout_node),
|
||||
ShadowPlacement::Outer);
|
||||
}
|
||||
fragment.set_shadows(move(resolved_shadow_data));
|
||||
}
|
||||
fragment.set_shadows(move(resolved_shadow_data));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,2 @@
|
|||
hovered text-shadow: rgb(88, 161, 230) 0px 0px 3px
|
||||
unhovered text-shadow: none
|
||||
19
Tests/LibWeb/Text/input/reset-text-shadow-after-unhover.html
Normal file
19
Tests/LibWeb/Text/input/reset-text-shadow-after-unhover.html
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
span:hover {
|
||||
text-shadow: 0 0 3px #58a1e6;
|
||||
}
|
||||
</style>
|
||||
<script src="./include.js"></script>
|
||||
<span>Hover over this span</span>
|
||||
<script>
|
||||
test(() => {
|
||||
// hover
|
||||
internals.movePointerTo(10, 10);
|
||||
println("hovered text-shadow: " + getComputedStyle(document.querySelector("span")).textShadow);
|
||||
|
||||
// unhover
|
||||
internals.movePointerTo(0, 0);
|
||||
println("unhovered text-shadow: " + getComputedStyle(document.querySelector("span")).textShadow);
|
||||
});
|
||||
</script>
|
||||
Loading…
Add table
Add a link
Reference in a new issue