LibWeb: Advance position at attribute end quote in encoding detection

This did not cause any immediate issues except generating instances of
`Attr` with useless values which caused some unnecessary work during
encoding detection.
This commit is contained in:
Jelle Raaijmakers 2025-11-21 10:42:30 +01:00 committed by Jelle Raaijmakers
parent 40d1f42418
commit 4ebbbdfef1
Notes: github-actions[bot] 2025-11-21 16:44:27 +00:00

View file

@ -180,8 +180,10 @@ value:
// 3. If the value of the byte at position is the value of b, then advance position to the next byte
// and abort the "get an attribute" algorithm.
// The attribute's name is the value of attribute name, and its value is the value of attribute value.
if (input[position] == quote_character)
if (input[position] == quote_character) {
++position;
return DOM::Attr::create(document, MUST(attribute_name.to_string()), MUST(attribute_value.to_string()));
}
// 4. Otherwise, if the value of the byte at position is in the range 0x41 (A) to 0x5A (Z),
// then append a code point to attribute value whose value is 0x20 more than the value of the byte at position.