NEW303746
Improve readability of StyleLogicalHeight by adopting a switch on statement.
https://bugs.webkit.org/show_bug.cgi?id=303746
Summary Improve readability of StyleLogicalHeight by adopting a switch on statement.
Karl Dubost
Reported 2025-12-08 04:13:56 PST
See Sam Weining comment on https://github.com/WebKit/WebKit/pull/54635#discussion_r2583134648 Please consider using the switchOn() form here. While a bit more verbose, I think it ends up making things more clear. WTF::switchOn(styleLogicalHeight, [&](const Style::PreferredSize::Fixed& fixed) { ... }, [&](Style::IsPercentageOrCalc auto const& percentageOrCalc) { ... }, [&](const CSS::Keyword::FitContent&) { ... }, [&](const CSS::Keyword::WebkitFillAvailable&) { ... }, [&](const CSS::Keyword::MinContent&) { ... }, [&](const CSS::Keyword::MaxContent&) { ... }, [&](const CSS::Keyword::Intrinsic&) { ... }, [&](const CSS::Keyword::MinIntrinsic&) { ... }, [&](const CSS::Keyword::Auto&) { ... } );
Attachments
Radar WebKit Bug Importer
Comment 1 2025-12-15 04:14:11 PST
Note You need to log in before you can comment on or make changes to this bug.