html: Ignore a parse error on 'srcset' attribute parsing (#39260)

Parsing the 'srcset' attribute of an image element may result in a parse
error
indicating a non-fatal mismatch between the input and the requirements.
https://html.spec.whatwg.org/multipage/#concept-microsyntax-parse-error
https://html.spec.whatwg.org/multipage/#parse-a-srcset-attribute

This error should not be a reason to stop parsing and may be used by the
user agent to signal a syntax error.

Other browsers generally ignore this error, and we do the same.

Testing: Improvements in the following tests
-
html/semantics/embedded-content/the-img-element/srcset/parse-a-srcset-attribute.html

Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
This commit is contained in:
Andrei Volykhin 2025-09-12 09:45:01 +03:00 committed by GitHub
parent 097a69169a
commit 965e87d006
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 16 deletions

View file

@ -1,13 +1,4 @@
[parse-a-srcset-attribute.html]
["data:,a,, , "]
expected: FAIL
[",,,data:,a"]
expected: FAIL
[" , ,,data:,a"]
expected: FAIL
["data:,a 1.0w"]
expected: FAIL