mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
Libweb: Map marquee
attributes to dimension properties
This commit is contained in:
parent
4c3101e021
commit
baca0e5e55
Notes:
github-actions[bot]
2024-10-02 09:28:30 +00:00
Author: https://github.com/tcl3
Commit: baca0e5e55
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1591
3 changed files with 43 additions and 0 deletions
|
@ -39,6 +39,25 @@ void HTMLMarqueeElement::apply_presentational_hints(CSS::StyleProperties& style)
|
|||
auto color = parse_legacy_color_value(value);
|
||||
if (color.has_value())
|
||||
style.set_property(CSS::PropertyID::BackgroundColor, CSS::CSSColorValue::create_from_color(color.value()));
|
||||
} else if (name == HTML::AttributeNames::height) {
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#the-marquee-element-2:maps-to-the-dimension-property
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::Height, *parsed_value);
|
||||
}
|
||||
} else if (name == HTML::AttributeNames::hspace) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::MarginLeft, *parsed_value);
|
||||
style.set_property(CSS::PropertyID::MarginRight, *parsed_value);
|
||||
}
|
||||
} else if (name == HTML::AttributeNames::vspace) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::MarginTop, *parsed_value);
|
||||
style.set_property(CSS::PropertyID::MarginBottom, *parsed_value);
|
||||
}
|
||||
} else if (name == HTML::AttributeNames::width) {
|
||||
if (auto parsed_value = parse_dimension_value(value)) {
|
||||
style.set_property(CSS::PropertyID::Width, *parsed_value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue