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:
Andrew Kaster 2024-09-30 17:52:30 -06:00 committed by Andreas Kling
commit 7aa0165fe7
Notes: github-actions[bot] 2024-10-01 09:05:13 +00:00
5 changed files with 63 additions and 0 deletions

View file

@ -0,0 +1,8 @@
divs[0].id: fred
divs[0].className: math
divs[1].id: spaghetti
divs[1].className:
divs[2].getAttribute("grape"): foo
divs[0].numAttributes: 2
divs[1].numAttributes: 2
divs[2].numAttributes: 1