mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
LibWeb: Check for valid names in Document.createElement() & friends
We now validate that the provided tag names are valid XML tag names, and otherwise throw an "invalid character" DOM exception. 2% progression on ACID3. :^)
This commit is contained in:
parent
8daf603f46
commit
fe67fe3791
Notes:
sideshowbarker
2024-07-17 18:15:12 +09:00
Author: https://github.com/awesomekling
Commit: fe67fe3791
7 changed files with 82 additions and 24 deletions
|
@ -171,7 +171,7 @@ void HTMLInputElement::create_shadow_tree_if_needed()
|
|||
auto initial_value = attribute(HTML::AttributeNames::value);
|
||||
if (initial_value.is_null())
|
||||
initial_value = String::empty();
|
||||
auto element = document().create_element(HTML::TagNames::div);
|
||||
auto element = document().create_element(HTML::TagNames::div).release_value();
|
||||
element->set_attribute(HTML::AttributeNames::style, "white-space: pre; padding-top: 1px; padding-bottom: 1px; padding-left: 2px; padding-right: 2px");
|
||||
m_text_node = adopt_ref(*new DOM::Text(document(), initial_value));
|
||||
m_text_node->set_always_editable(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue