LibWeb: Don't paint text fragments with CSS visibility:hidden

We *could* even skip creating a paintable for hidden nodes, but that
means that dynamic updates to the CSS visibility property would require
mutating the paint tree, so let's keep it simple for now.

(cherry picked from commit 349b17cc7aaba8c6cce3aaef26d14a0127f43ff1)
This commit is contained in:
Andreas Kling authored and Nico Weber committed 2024-11-08 22:32:11 -05:00
1 parent ee0f711d16
commit 31237da230
3 files changed
+6

No files matched your search

@@ -0,0 +1,2 @@
<link rel="match" href="reference/inline-visibility-hidden-ref.html" />
<span>hello friends<span style="visibility: hidden"> and enemies</span></span>
@@ -0,0 +1 @@
<span>hello friends</span>
@@ -678,6 +678,9 @@ void paint_text_decoration(PaintContext& context, TextPaintable const& paintable
void paint_text_fragment(PaintContext& context, TextPaintable const& paintable, PaintableFragment const& fragment, PaintPhase phase)
{
if (!paintable.is_visible())
return;
auto& painter = context.display_list_recorder();
if (phase == PaintPhase::Foreground) {