mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-04 23:30:20 +00:00
LibWeb/CSS: Stop returning Optional for enum properties
While keyword_to_foo() does return Optional<Foo>, in practice the invalid keywords get rejected at parse-time, so we don't have to worry about them here. This simplifies the user code quite a bit.
This commit is contained in:
parent
d3057a9c79
commit
4cb2063577
Notes:
github-actions[bot]
2025-02-05 17:13:42 +00:00
Author: https://github.com/AtkinsSJ
Commit: 4cb2063577
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3467
Reviewed-by: https://github.com/gmta ✅
6 changed files with 244 additions and 360 deletions
|
@ -501,7 +501,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style()
|
|||
// FIXME: Find the spec for this.
|
||||
if (is<HTML::HTMLTableElement>(*this)) {
|
||||
auto text_align = new_computed_properties->text_align();
|
||||
if (text_align.has_value() && (text_align.value() == CSS::TextAlign::LibwebLeft || text_align.value() == CSS::TextAlign::LibwebCenter || text_align.value() == CSS::TextAlign::LibwebRight))
|
||||
if (text_align == CSS::TextAlign::LibwebLeft || text_align == CSS::TextAlign::LibwebCenter || text_align == CSS::TextAlign::LibwebRight)
|
||||
new_computed_properties->set_property(CSS::PropertyID::TextAlign, CSS::CSSKeywordValue::create(CSS::Keyword::Start));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue