LibWeb: Support valign attribute on tr elements

This commit is contained in:
implicitfield 2023-11-19 16:20:29 +04:00 committed by Andreas Kling
parent 468b2a5ace
commit 3d1fbcb26b
Notes: sideshowbarker 2024-07-17 03:03:37 +09:00
3 changed files with 42 additions and 0 deletions

View file

@ -5,8 +5,11 @@
*/
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/CSS/Parser/Parser.h>
#include <LibWeb/CSS/Parser/ParsingContext.h>
#include <LibWeb/CSS/StyleProperties.h>
#include <LibWeb/CSS/StyleValues/ColorStyleValue.h>
#include <LibWeb/CSS/StyleValues/IdentifierStyleValue.h>
#include <LibWeb/CSS/StyleValues/ImageStyleValue.h>
#include <LibWeb/DOM/Document.h>
#include <LibWeb/DOM/ElementFactory.h>
@ -49,6 +52,10 @@ void HTMLTableRowElement::apply_presentational_hints(CSS::StyleProperties& style
if (auto parsed_value = document().parse_url(value); parsed_value.is_valid())
style.set_property(CSS::PropertyID::BackgroundImage, CSS::ImageStyleValue::create(parsed_value));
return;
} else if (name == HTML::AttributeNames::valign) {
if (auto parsed_value = parse_css_value(CSS::Parser::ParsingContext { document() }, value.view(), CSS::PropertyID::VerticalAlign))
style.set_property(CSS::PropertyID::VerticalAlign, parsed_value.release_nonnull());
return;
}
});
}