mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
LibWeb/CSS: Implement UnicodeRangeStyleValue
This is preparation for storing at-rule descriptors as style values.
This commit is contained in:
parent
e0a03147c6
commit
09b8f73e11
Notes:
github-actions[bot]
2025-03-28 09:15:53 +00:00
Author: https://github.com/AtkinsSJ
Commit: 09b8f73e11
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4125
8 changed files with 86 additions and 0 deletions
|
@ -268,6 +268,7 @@ private:
|
|||
Optional<Gfx::UnicodeRange> parse_unicode_range(TokenStream<ComponentValue>&);
|
||||
Optional<Gfx::UnicodeRange> parse_unicode_range(StringView);
|
||||
Vector<Gfx::UnicodeRange> parse_unicode_ranges(TokenStream<ComponentValue>&);
|
||||
RefPtr<UnicodeRangeStyleValue> parse_unicode_range_value(TokenStream<ComponentValue>&);
|
||||
Optional<GridSize> parse_grid_size(ComponentValue const&);
|
||||
Optional<GridFitContent> parse_grid_fit_content(Vector<ComponentValue> const&);
|
||||
Optional<GridMinMax> parse_min_max(Vector<ComponentValue> const&);
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include <LibWeb/CSS/StyleValues/StringStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/TimeStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/URLStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/UnicodeRangeStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
|
@ -621,6 +622,13 @@ Vector<Gfx::UnicodeRange> Parser::parse_unicode_ranges(TokenStream<ComponentValu
|
|||
return unicode_ranges;
|
||||
}
|
||||
|
||||
RefPtr<UnicodeRangeStyleValue> Parser::parse_unicode_range_value(TokenStream<ComponentValue>& tokens)
|
||||
{
|
||||
if (auto range = parse_unicode_range(tokens); range.has_value())
|
||||
return UnicodeRangeStyleValue::create(range.release_value());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
RefPtr<CSSStyleValue> Parser::parse_integer_value(TokenStream<ComponentValue>& tokens)
|
||||
{
|
||||
auto const& peek_token = tokens.next_token();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue