diff options
author | MacDue <macdue@dueutil.tech> | 2022-07-12 00:28:19 +0100 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2022-07-17 20:11:38 +0100 |
commit | ee7e9e7c86b34ebc7c9439e84dd185f383d7a998 (patch) | |
tree | 33d3991602223aa9ae9d1d65076d9a821ec1228e /Userland/Libraries/LibWeb/Layout | |
parent | d924e9ff609a555247f19aa0db87797efeb655a7 (diff) | |
download | serenity-ee7e9e7c86b34ebc7c9439e84dd185f383d7a998.zip |
LibWeb: Allow having a linear-gradient() as a background-image
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index fc0b01b266..e255ba45ff 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -280,9 +280,13 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& computed_style) for (size_t layer_index = 0; layer_index < layer_count; layer_index++) { CSS::BackgroundLayerData layer; - if (auto image_value = value_for_layer(images, layer_index); image_value && image_value->is_image()) { - layer.image = image_value->as_image(); - layer.image->load_bitmap(document()); + if (auto image_value = value_for_layer(images, layer_index); image_value) { + if (image_value->is_image()) { + image_value->as_image().load_bitmap(document()); + layer.background_image = image_value; + } else if (image_value->is_linear_gradient()) { + layer.background_image = image_value; + } } if (auto attachment_value = value_for_layer(attachments, layer_index); attachment_value && attachment_value->has_identifier()) { |