فهرست منبع

LibWeb: Port HTMLTextAreaElement from DeprecatedString

Shannon Booth 1 سال پیش
والد
کامیت
cc43dbf56e

+ 2 - 3
Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp

@@ -20,7 +20,6 @@ namespace Web::HTML {
 
 HTMLTextAreaElement::HTMLTextAreaElement(DOM::Document& document, DOM::QualifiedName qualified_name)
     : HTMLElement(document, move(qualified_name))
-    , m_raw_value(DeprecatedString::empty())
 {
 }
 
@@ -111,7 +110,7 @@ void HTMLTextAreaElement::create_shadow_tree_if_needed()
     m_text_node->set_editable_text_node_owner(Badge<HTMLTextAreaElement> {}, *this);
     // NOTE: If `children_changed()` was called before now, `m_raw_value` will hold the text content.
     //       Otherwise, it will get filled in whenever that does get called.
-    m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
+    m_text_node->set_text_content(m_raw_value);
 
     MUST(m_inner_text_element->append_child(*m_text_node));
     MUST(element->append_child(*m_inner_text_element));
@@ -127,7 +126,7 @@ void HTMLTextAreaElement::children_changed()
     if (!m_dirty) {
         m_raw_value = child_text_content();
         if (m_text_node)
-            m_text_node->set_text_content(MUST(String::from_deprecated_string(m_raw_value)));
+            m_text_node->set_text_content(m_raw_value);
     }
 }
 

+ 3 - 3
Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.h

@@ -27,9 +27,9 @@ public:
 
     virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
 
-    DeprecatedString const& type() const
+    String const& type() const
     {
-        static DeprecatedString textarea = "textarea";
+        static String const textarea = "textarea"_string;
         return textarea;
     }
 
@@ -84,7 +84,7 @@ private:
     JS::GCPtr<DOM::Text> m_text_node;
 
     bool m_dirty { false };
-    DeprecatedString m_raw_value;
+    String m_raw_value;
 };
 
 }