mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-24 02:09:28 +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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user