mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
LibWeb: Deduplicate attributes when emitting start and end tags
The HTML tokenizer specification says that we're supposed to do this when leaving the Attribute name or when emitting the token, as appropriate. Hopefully 'as appropriate' can mean only when emitting the token, as that's the easiest place to insert this logic without complicating the tokenizer any more.
This commit is contained in:
committed by
Andreas Kling
parent
b3f8d63372
commit
7aa0165fe7
Notes:
github-actions[bot]
2024-10-01 09:05:13 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/7aa0165fe75 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1582
@@ -2863,6 +2863,9 @@ void HTMLTokenizer::will_emit(HTMLToken& token)
|
||||
|
||||
auto is_start_or_end_tag = token.type() == HTMLToken::Type::StartTag || token.type() == HTMLToken::Type::EndTag;
|
||||
token.set_end_position({}, nth_last_position(is_start_or_end_tag ? 1 : 0));
|
||||
|
||||
if (is_start_or_end_tag)
|
||||
token.normalize_attributes();
|
||||
}
|
||||
|
||||
bool HTMLTokenizer::current_end_tag_token_is_appropriate() const
|
||||
|
||||
Reference in New Issue
Block a user