mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
LibWeb/CSS: Remove illegal <number-percentage> type
Various places in the spec allow for `<number> | <percentage>`, but this is either/or, and they are not allowed to be combined like dimensions and percentages are. (For example, `calc(12 + 50%)` is never valid.) User code generally doesn't need to care about this distinction, but it does now need to check if a calculation resolves to a number, or to a percentage, instead of a single call. The existing parse_number_percentage[_value]() methods have been kept for simplicity, but updated to check for number/percentage separately.
This commit is contained in:
@@ -99,7 +99,6 @@ public:
|
||||
Optional<Time> resolve_time_percentage(Time const& percentage_basis) const;
|
||||
|
||||
bool resolves_to_number() const { return m_resolved_type.matches_number(); }
|
||||
bool resolves_to_number_percentage() const { return m_resolved_type.matches_number_percentage(); }
|
||||
Optional<double> resolve_number() const;
|
||||
Optional<double> resolve_number(Length::ResolutionContext const&) const;
|
||||
Optional<double> resolve_number(Layout::Node const& layout_node) const;
|
||||
|
||||
Reference in New Issue
Block a user