mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibWeb: Allow SVG root elements to have visible overflow
We were overly aggressive in clipping SVG roots, which effectively made them behave as if they always had `overflow: hidden`. This fixes incorrect clipping of the logo on https://basecamp.com/
This commit is contained in:
parent
f2134dc1e9
commit
2fdf2b9215
Notes:
github-actions[bot]
2024-10-07 07:32:16 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/2fdf2b9215d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1659
5 changed files with 28 additions and 2 deletions
6
Tests/LibWeb/Ref/reference/svg-overflow-hidden-ref.html
Normal file
6
Tests/LibWeb/Ref/reference/svg-overflow-hidden-ref.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<style>
|
||||
svg {
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
<svg class="visible" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="50" height="100" fill="green"></rect></svg>
|
6
Tests/LibWeb/Ref/reference/svg-overflow-visible-ref.html
Normal file
6
Tests/LibWeb/Ref/reference/svg-overflow-visible-ref.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<style>
|
||||
svg {
|
||||
height: 200px;
|
||||
}
|
||||
</style>
|
||||
<svg class="visible" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="50" height="200" fill="green"></rect></svg>
|
8
Tests/LibWeb/Ref/svg-overflow-hidden.html
Normal file
8
Tests/LibWeb/Ref/svg-overflow-hidden.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<link rel="match" href="reference/svg-overflow-hidden-ref.html" />
|
||||
<style>
|
||||
svg {
|
||||
width: 100px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<svg class="visible" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="50" height="200" fill="green"></rect></svg>
|
8
Tests/LibWeb/Ref/svg-overflow-visible.html
Normal file
8
Tests/LibWeb/Ref/svg-overflow-visible.html
Normal file
|
@ -0,0 +1,8 @@
|
|||
<link rel="match" href="reference/svg-overflow-visible-ref.html" />
|
||||
<style>
|
||||
svg {
|
||||
width: 100px;
|
||||
overflow: visible;
|
||||
}
|
||||
</style>
|
||||
<svg class="visible" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect x="0" y="0" width="50" height="200" fill="green"></rect></svg>
|
|
@ -32,9 +32,7 @@ void SVGSVGPaintable::before_children_paint(PaintContext& context, PaintPhase ph
|
|||
if (phase != PaintPhase::Foreground)
|
||||
return;
|
||||
context.display_list_recorder().save();
|
||||
auto clip_rect = absolute_rect();
|
||||
context.display_list_recorder().set_scroll_frame_id(scroll_frame_id());
|
||||
context.display_list_recorder().add_clip_rect(context.enclosing_device_rect(clip_rect).to_type<int>());
|
||||
}
|
||||
|
||||
void SVGSVGPaintable::after_children_paint(PaintContext& context, PaintPhase phase) const
|
||||
|
|
Loading…
Reference in a new issue