diff options
author | Sam Atkins <atkinssj@gmail.com> | 2021-07-12 14:13:29 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-07-14 13:31:00 +0200 |
commit | dadcb4634430d6e963e53dc8465261fad87470ee (patch) | |
tree | 22c0da2af39386edc8d44d7b5b754ee0dce1ceed /Userland/Libraries/LibWeb/CSS/Selector.cpp | |
parent | cd55b817cfa776f002d21c2acdd26f2412e94fa0 (diff) | |
download | serenity-dadcb4634430d6e963e53dc8465261fad87470ee.zip |
LibWeb: Convert CSS Dump, Selector, & SelectorEngine to east const
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/Selector.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/Selector.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Selector.cpp b/Userland/Libraries/LibWeb/CSS/Selector.cpp index 1ddd9de306..896534daf4 100644 --- a/Userland/Libraries/LibWeb/CSS/Selector.cpp +++ b/Userland/Libraries/LibWeb/CSS/Selector.cpp @@ -47,7 +47,7 @@ u32 Selector::specificity() const return ids * 0x10000 + classes * 0x100 + tag_names; } -Selector::SimpleSelector::NthChildPattern Selector::SimpleSelector::NthChildPattern::parse(const StringView& args) +Selector::SimpleSelector::NthChildPattern Selector::SimpleSelector::NthChildPattern::parse(StringView const& args) { CSS::Selector::SimpleSelector::NthChildPattern pattern; if (args.equals_ignoring_case("odd")) { @@ -56,7 +56,7 @@ Selector::SimpleSelector::NthChildPattern Selector::SimpleSelector::NthChildPatt } else if (args.equals_ignoring_case("even")) { pattern.step_size = 2; } else { - const auto consume_int = [](GenericLexer& lexer) -> Optional<int> { + auto const consume_int = [](GenericLexer& lexer) -> Optional<int> { return AK::StringUtils::convert_to_int(lexer.consume_while([](char c) -> bool { return isdigit(c) || c == '+' || c == '-'; })); @@ -81,7 +81,7 @@ Selector::SimpleSelector::NthChildPattern Selector::SimpleSelector::NthChildPatt step_size_or_offset = -1; lexer.retreat(); } else { - const auto value = consume_int(lexer); + auto const value = consume_int(lexer); if (!value.has_value()) return {}; step_size_or_offset = value.value(); @@ -90,12 +90,12 @@ Selector::SimpleSelector::NthChildPattern Selector::SimpleSelector::NthChildPatt if (lexer.consume_specific("n")) { lexer.ignore_while(isspace); if (lexer.next_is('+') || lexer.next_is('-')) { - const auto sign = lexer.next_is('+') ? 1 : -1; + auto const sign = lexer.next_is('+') ? 1 : -1; lexer.ignore(); lexer.ignore_while(isspace); // "An+B" pattern - const auto offset = consume_int(lexer); + auto const offset = consume_int(lexer); if (!offset.has_value()) return {}; pattern.step_size = step_size_or_offset; |