diff options
author | Max Wipfli <mail@maxwipfli.ch> | 2021-07-14 23:53:11 +0200 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-17 16:24:57 +0430 |
commit | 918bde98b17ad890ba0a83c1de137da86519f9b1 (patch) | |
tree | 543147c03a460c425063dae02babe23df46425b1 /Userland/Libraries/LibWeb/HTML/SyntaxHighlighter | |
parent | 15d8635afc7c1e3c01524cc670d90c3709670b2c (diff) | |
download | serenity-918bde98b17ad890ba0a83c1de137da86519f9b1.zip |
LibWeb: Hide implementation details of HTMLToken attribute list
Previously, HTMLToken would expose the Vector<Attribute> directly to
its users. In preparation for a future change, all users now use
implementation-agnostic APIs which do not expose the Vector directly.
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML/SyntaxHighlighter')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp index d08ea0c11f..cae5183436 100644 --- a/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp +++ b/Userland/Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.cpp @@ -132,7 +132,7 @@ void SyntaxHighlighter::rehighlight(Palette const& palette) { palette.syntax_keyword(), {}, false, true }, token->is_start_tag() ? AugmentedTokenKind::OpenTag : AugmentedTokenKind::CloseTag); - for (auto& attribute : token->attributes()) { + token->for_each_attribute([&](auto& attribute) { highlight( attribute.name_start_position.line, attribute.name_start_position.column + token_start_offset, @@ -147,7 +147,8 @@ void SyntaxHighlighter::rehighlight(Palette const& palette) attribute.value_end_position.column + token_start_offset, { palette.syntax_string(), {} }, AugmentedTokenKind::AttributeValue); - } + return IterationDecision::Continue; + }); } else if (token->is_doctype()) { highlight( token->start_position().line, |