mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 07:29:53 +00:00
LibWeb+LibXML: Preserve element attribute order in XML documents
We now use OrderedHashMap instead of HashMap to ensure that attributes on XML elements retain their original order.
This commit is contained in:
parent
da88db04cf
commit
b7595013c1
Notes:
github-actions[bot]
2025-08-22 09:37:04 +00:00
Author: https://github.com/awesomekling
Commit: b7595013c1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5944
7 changed files with 22 additions and 6 deletions
|
@ -700,7 +700,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_empty_element_tag()
|
|||
TRY(expect("<"sv));
|
||||
|
||||
auto name = TRY(parse_name());
|
||||
HashMap<Name, ByteString> attributes;
|
||||
OrderedHashMap<Name, ByteString> attributes;
|
||||
|
||||
while (true) {
|
||||
if (auto result = skip_whitespace(Required::Yes); result.is_error())
|
||||
|
@ -854,7 +854,7 @@ ErrorOr<NonnullOwnPtr<Node>, ParseError> Parser::parse_start_tag()
|
|||
auto accept = accept_rule();
|
||||
|
||||
auto name = TRY(parse_name());
|
||||
HashMap<Name, ByteString> attributes;
|
||||
OrderedHashMap<Name, ByteString> attributes;
|
||||
|
||||
while (true) {
|
||||
if (auto result = skip_whitespace(Required::Yes); result.is_error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue