1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:17:35 +00:00

LibWeb: Store background layers in ComputedValues

Instead of storing these as individual `background-foo` properties, we
combine them together into layers, since that is how they will be
painted. It also makes it more convenient to pass them around.
This commit is contained in:
Sam Atkins 2021-11-12 12:11:01 +00:00 committed by Andreas Kling
parent 64d805a027
commit cdeac132dc
6 changed files with 86 additions and 1 deletions

View file

@ -353,6 +353,19 @@ Color Document::background_color(const Palette& palette) const
return color;
}
Vector<CSS::BackgroundLayerData> const* Document::background_layers() const
{
auto* body_element = body();
if (!body_element)
return {};
auto* body_layout_node = body_element->layout_node();
if (!body_layout_node)
return {};
return &body_layout_node->background_layers();
}
RefPtr<Gfx::Bitmap> Document::background_image() const
{
auto* body_element = body();