mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:17:36 +00:00
LibWeb: Add missing visit_edges() for ImageStyleValue
ImageStyleValue has a visit_edges() method, although it is not a GC-allocated object. This is necessary because it owns a GC-allocated ImageRequest that we want to visit, instead of using JS::Handle, to avoid leaks. In the future, we might want to make StyleValue be GC-allocated. For now, this change adds missing visit_edges() calls for objects that own ImageStyleValue.
This commit is contained in:
parent
b43b3d2f8d
commit
32be413f4e
4 changed files with 23 additions and 0 deletions
|
@ -307,6 +307,17 @@ NodeWithStyle::NodeWithStyle(DOM::Document& document, DOM::Node* node, CSS::Comp
|
|||
m_font = Platform::FontPlugin::the().default_font();
|
||||
}
|
||||
|
||||
void NodeWithStyle::visit_edges(Visitor& visitor)
|
||||
{
|
||||
Base::visit_edges(visitor);
|
||||
for (auto& layer : m_computed_values.background_layers()) {
|
||||
if (layer.background_image && layer.background_image->is_image())
|
||||
layer.background_image->as_image().visit_edges(visitor);
|
||||
}
|
||||
if (m_list_style_image && m_list_style_image->is_image())
|
||||
m_list_style_image->as_image().visit_edges(visitor);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/css-values-4/#snap-a-length-as-a-border-width
|
||||
static CSSPixels snap_a_length_as_a_border_width(double device_pixels_per_css_pixel, CSSPixels length)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue