mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-20 02:40:27 +00:00
LibWeb: Set background-image presentational hint as StyleValueList
This fixes a crash introduced in a11666e
This commit is contained in:
parent
62a3a99a50
commit
09b20f172f
Notes:
github-actions[bot]
2025-12-09 12:09:54 +00:00
Author: https://github.com/Calme1709
Commit: 09b20f172f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/7062
Reviewed-by: https://github.com/tcl3 ✅
7 changed files with 108 additions and 5 deletions
|
|
@ -11,6 +11,7 @@
|
|||
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/KeywordStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/DOM/ElementFactory.h>
|
||||
#include <LibWeb/DOM/HTMLCollection.h>
|
||||
|
|
@ -62,7 +63,7 @@ void HTMLTableRowElement::apply_presentational_hints(GC::Ref<CSS::CascadedProper
|
|||
} else if (name == HTML::AttributeNames::background) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#tables-2:encoding-parsing-and-serializing-a-url
|
||||
if (auto parsed_value = document().encoding_parse_url(value); parsed_value.has_value())
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(*parsed_value));
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::BackgroundImage, CSS::StyleValueList::create({ CSS::ImageStyleValue::create(*parsed_value) }, CSS::StyleValueList::Separator::Comma));
|
||||
} else if (name == HTML::AttributeNames::height) {
|
||||
if (auto parsed_value = parse_dimension_value(value))
|
||||
cascaded_properties->set_property_from_presentational_hint(CSS::PropertyID::Height, *parsed_value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue