mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 03:57:15 +02:00
LibWeb: Use an infallible method to add attributes to nodes
In the HTML parser spec, there are 2 instances of the following text:
add the attribute and its corresponding value to that element
The "add the attribute" text does not have a corresponding spec link to
actually specify what to do. We currently use `set_attribute`, which can
throw an exception if the attribute name contains an invalid character
(such as '<'). Instead, switch to `append_attribute`, which allows such
attribute names. This behavior matches Firefox.
Note we cannot yet make the unclosed-html-element.html test match the
expectations of the unclosed-body-element.html due to another bug that
would prevent checking if the expected element has the right attribute.
That will be fixed in an upcoming commit.
This commit is contained in:
committed by
Andreas Kling
parent
c1b0e180ba
commit
9fe35ddddf
Notes:
github-actions[bot]
2024-07-30 07:42:37 +00:00
Author: https://github.com/trflynn89 Commit: https://github.com/LadybirdBrowser/ladybird/commit/9fe35ddddf8 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/894
10
Tests/LibWeb/Text/input/unclosed-html-element.html
Normal file
10
Tests/LibWeb/Text/input/unclosed-html-element.html
Normal file
@@ -0,0 +1,10 @@
|
||||
<link>
|
||||
<html
|
||||
<head>
|
||||
|
||||
<script src="include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
println("PASS (didn't crash)");
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user