mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-06 11:12:54 +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:
parent
b3f8d63372
commit
7aa0165fe7
Notes:
github-actions[bot]
2024-10-01 09:05:13 +00:00
Author: https://github.com/ADKaster
Commit: 7aa0165fe7
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1582
5 changed files with 63 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue