1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:37:35 +00:00

LibWeb: Port Text interface from DeprecatedString to String

This commit is contained in:
Shannon Booth 2023-09-06 15:17:20 +12:00 committed by Tim Flynn
parent 6789a2dd8e
commit bcb6851c07
15 changed files with 25 additions and 25 deletions

View file

@ -502,7 +502,7 @@ void HTMLInputElement::create_shadow_tree_if_needed()
m_placeholder_element = heap().allocate<PlaceholderElement>(realm(), document());
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Height, "1lh"sv));
m_placeholder_text_node = heap().allocate<DOM::Text>(realm(), document(), initial_value);
m_placeholder_text_node = heap().allocate<DOM::Text>(realm(), document(), MUST(String::from_deprecated_string(initial_value)));
m_placeholder_text_node->set_data(deprecated_attribute(HTML::AttributeNames::placeholder));
m_placeholder_text_node->set_owner_input_element({}, *this);
MUST(m_placeholder_element->append_child(*m_placeholder_text_node));
@ -511,7 +511,7 @@ void HTMLInputElement::create_shadow_tree_if_needed()
m_inner_text_element = DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML).release_value_but_fixme_should_propagate_errors();
MUST(m_inner_text_element->style_for_bindings()->set_property(CSS::PropertyID::Height, "1lh"sv));
m_text_node = heap().allocate<DOM::Text>(realm(), document(), initial_value);
m_text_node = heap().allocate<DOM::Text>(realm(), document(), MUST(String::from_deprecated_string(initial_value)));
if (m_type == TypeAttributeState::FileUpload) {
// NOTE: file upload state is mutable, but we don't allow the text node to be modifed
m_text_node->set_always_editable(false);

View file

@ -1009,7 +1009,7 @@ DOM::Text* HTMLParser::find_character_insertion_node()
if (adjusted_insertion_location.insert_before_sibling) {
if (is_empty_text_node(adjusted_insertion_location.insert_before_sibling->previous_sibling()))
return static_cast<DOM::Text*>(adjusted_insertion_location.insert_before_sibling->previous_sibling());
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), "");
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), String {});
adjusted_insertion_location.parent->insert_before(*new_text_node, *adjusted_insertion_location.insert_before_sibling);
return new_text_node;
}
@ -1017,7 +1017,7 @@ DOM::Text* HTMLParser::find_character_insertion_node()
return nullptr;
if (is_empty_text_node(adjusted_insertion_location.parent->last_child()))
return static_cast<DOM::Text*>(adjusted_insertion_location.parent->last_child());
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), "");
auto new_text_node = realm().heap().allocate<DOM::Text>(realm(), document(), String {});
MUST(adjusted_insertion_location.parent->append_child(*new_text_node));
return new_text_node;
}