mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +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:
|
public:
|
||||||
using PercentageOr<Length>::PercentageOr;
|
using PercentageOr<Length>::PercentageOr;
|
||||||
|
|
||||||
|
bool is_auto() const { return is_length() && length().is_auto(); }
|
||||||
|
|
||||||
bool is_length() const { return is_t(); }
|
bool is_length() const { return is_t(); }
|
||||||
Length const& length() const { return get_t(); }
|
Length const& length() const { return get_t(); }
|
||||||
virtual Length resolve_calculated(NonnullRefPtr<CalculatedStyleValue> const&, Layout::Node const&, Length const& reference_value) const override;
|
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