mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:27:46 +00:00
LibWeb: Add LengthPercentage::is_auto() convenience helper
This lets you ask if a LengthPercentage is `auto` with one call instead of two, which will make some conditions nicer to express.
This commit is contained in:
parent
44025e837f
commit
734ff422ad
1 changed files with 2 additions and 0 deletions
|
@ -182,6 +182,8 @@ class LengthPercentage : public PercentageOr<Length> {
|
|||
public:
|
||||
using PercentageOr<Length>::PercentageOr;
|
||||
|
||||
bool is_auto() const { return is_length() && length().is_auto(); }
|
||||
|
||||
bool is_length() const { return is_t(); }
|
||||
Length const& length() const { return get_t(); }
|
||||
virtual Length resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&, Length const& reference_value) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue