mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:28:11 +00:00
LibWeb: Copy some properties from specified style into layout node
Another step towards not having to carry the full specified style with us everywhere. This isn't the ideal final layout, since we're mixing computed and used values a bit randomly here, but one step at a time.
This commit is contained in:
parent
e5490ae1d1
commit
2cc39cfb0e
4 changed files with 30 additions and 18 deletions
|
@ -343,15 +343,10 @@ RefPtr<Gfx::Bitmap> Document::background_image() const
|
|||
if (!body_layout_node)
|
||||
return {};
|
||||
|
||||
auto background_image = body_layout_node->specified_style().property(CSS::PropertyID::BackgroundImage);
|
||||
if (!background_image.has_value() || !background_image.value()->is_image())
|
||||
auto background_image = body_layout_node->background_image();
|
||||
if (!background_image)
|
||||
return {};
|
||||
|
||||
auto& image_value = static_cast<const CSS::ImageStyleValue&>(*background_image.value());
|
||||
if (!image_value.bitmap())
|
||||
return {};
|
||||
|
||||
return *image_value.bitmap();
|
||||
return background_image->bitmap();
|
||||
}
|
||||
|
||||
URL Document::complete_url(const String& string) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue