mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00: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
@@ -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