mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibWeb/Painting: Don't paint invisible paintables
This check technically isn't necessary in `SVGForeignObjectPaintable::paint()` because `PaintableWithLines::paint(context, phase);` does the check already, but I've added it there anyway to save some debugging time if someone does add more code there. :^)
This commit is contained in:
parent
6ee91c4189
commit
994bbcaa75
Notes:
github-actions[bot]
2025-07-03 10:40:15 +00:00
Author: https://github.com/AtkinsSJ
Commit: 994bbcaa75
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5281
Reviewed-by: https://github.com/kalenikaliaksandr ✅
4 changed files with 33 additions and 0 deletions
|
@ -32,6 +32,9 @@ constexpr float sin_60_deg = 0.866025403f;
|
|||
|
||||
void MarkerPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||
{
|
||||
if (!is_visible())
|
||||
return;
|
||||
|
||||
if (phase == PaintPhase::Overlay)
|
||||
PaintableBox::paint(context, phase);
|
||||
if (phase != PaintPhase::Foreground)
|
||||
|
|
|
@ -33,6 +33,9 @@ TraversalDecision SVGForeignObjectPaintable::hit_test(CSSPixelPoint position, Hi
|
|||
|
||||
void SVGForeignObjectPaintable::paint(PaintContext& context, PaintPhase phase) const
|
||||
{
|
||||
if (!is_visible())
|
||||
return;
|
||||
|
||||
PaintableWithLines::paint(context, phase);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
<!DOCTYPE html>
|
||||
There should be nothing visible below.
|
25
Tests/LibWeb/Ref/input/css/hidden-list-item-markers.html
Normal file
25
Tests/LibWeb/Ref/input/css/hidden-list-item-markers.html
Normal file
|
@ -0,0 +1,25 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="../../expected/css/hidden-list-item-markers-ref.html" />
|
||||
<style>
|
||||
.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
.display-none {
|
||||
display: none;
|
||||
}
|
||||
#a { color: red; }
|
||||
#b { color: green; }
|
||||
#c { color: blue; }
|
||||
#d { color: orange; }
|
||||
</style>
|
||||
There should be nothing visible below.
|
||||
<ul class="hidden">
|
||||
<li id="a"></li>
|
||||
</ul>
|
||||
<ul class="display-none">
|
||||
<li id="b"></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li class="hidden" id="c"></li>
|
||||
<li class="display-none" id="d"></li>
|
||||
</ul>
|
Loading…
Add table
Add a link
Reference in a new issue