mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:47:34 +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:
parent
64d805a027
commit
cdeac132dc
6 changed files with 86 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue