diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index b13fcd82dcb..58e40cb637c 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -3013,7 +3013,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@) if (!cpp_value) impl->remove_attribute(HTML::AttributeNames::@attribute.reflect_name@); else - MUST(impl->set_attribute(HTML::AttributeNames::@attribute.reflect_name@, DeprecatedString::empty())); + MUST(impl->set_attribute(HTML::AttributeNames::@attribute.reflect_name@, String {})); )~~~"); } diff --git a/Tests/LibWeb/TestHTMLTokenizer.cpp b/Tests/LibWeb/TestHTMLTokenizer.cpp index 39f4fe4dec4..15a01a85b6c 100644 --- a/Tests/LibWeb/TestHTMLTokenizer.cpp +++ b/Tests/LibWeb/TestHTMLTokenizer.cpp @@ -61,7 +61,7 @@ using Token = Web::HTML::HTMLToken; #define EXPECT_TAG_TOKEN_ATTRIBUTE(name, attribute_value, name_start_column, name_end_column, value_start_column, value_end_column) \ VERIFY(last_token); \ - auto name##_attr = last_token->raw_attribute(#name); \ + auto name##_attr = last_token->raw_attribute(#name##_fly_string); \ VERIFY(name##_attr.has_value()); \ EXPECT_EQ(name##_attr->value, attribute_value); \ EXPECT_EQ(name##_attr->name_start_position.column, name_start_column); \ diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index dbc96297202..bdf4c1d0471 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -46,14 +46,14 @@ JS::ThrowCompletionOr> AudioConstructor::construct( auto audio = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() { return DOM::create_element(document, HTML::TagNames::audio, Namespace::HTML); })); // 3. Set an attribute value for audio using "preload" and "auto". - MUST(audio->set_attribute(HTML::AttributeNames::preload, "auto"sv)); + MUST(audio->set_attribute(HTML::AttributeNames::preload, "auto"_string)); auto src_value = vm.argument(0); // 4. If src is given, then set an attribute value for audio using "src" and src. // (This will cause the user agent to invoke the object's resource selection algorithm before returning.) if (!src_value.is_undefined()) { - auto src = TRY(src_value.to_deprecated_string(vm)); + auto src = TRY(src_value.to_string(vm)); MUST(audio->set_attribute(HTML::AttributeNames::src, move(src))); } diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index 54702eb923d..06ebc87ddb2 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -48,13 +48,13 @@ JS::ThrowCompletionOr> ImageConstructor::construct( // 3. If width is given, then set an attribute value for img using "width" and width. if (vm.argument_count() > 0) { u32 width = TRY(vm.argument(0).to_u32(vm)); - MUST(image_element->set_attribute(HTML::AttributeNames::width, DeprecatedString::formatted("{}", width))); + MUST(image_element->set_attribute(HTML::AttributeNames::width, MUST(String::formatted("{}", width)))); } // 4. If height is given, then set an attribute value for img using "height" and height. if (vm.argument_count() > 1) { u32 height = TRY(vm.argument(1).to_u32(vm)); - MUST(image_element->set_attribute(HTML::AttributeNames::height, DeprecatedString::formatted("{}", height))); + MUST(image_element->set_attribute(HTML::AttributeNames::height, MUST(String::formatted("{}", height)))); } // 5. Return img. diff --git a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp index cd1755d54e6..be599b3d672 100644 --- a/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/OptionConstructor.cpp @@ -61,7 +61,7 @@ JS::ThrowCompletionOr> OptionConstructor::construct // 4. If value is given, then set an attribute value for option using "value" and value. if (vm.argument_count() > 1) { - auto value = TRY(vm.argument(1).to_deprecated_string(vm)); + auto value = TRY(vm.argument(1).to_string(vm)); MUST(option_element->set_attribute(HTML::AttributeNames::value, value)); } @@ -69,7 +69,7 @@ JS::ThrowCompletionOr> OptionConstructor::construct if (vm.argument_count() > 2) { auto default_selected = vm.argument(2).to_boolean(); if (default_selected) { - MUST(option_element->set_attribute(HTML::AttributeNames::selected, "")); + MUST(option_element->set_attribute(HTML::AttributeNames::selected, String {})); } } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp index 4410b685a5e..b45064a3394 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleDeclaration.cpp @@ -183,7 +183,7 @@ void ElementInlineCSSStyleDeclaration::update_style_attribute() m_updating = true; // 5. Set an attribute value for owner node using "style" and the result of serializing declaration block. - MUST(m_element->set_attribute(HTML::AttributeNames::style, serialized())); + MUST(m_element->set_attribute(HTML::AttributeNames::style, MUST(String::from_deprecated_string(serialized())))); // 6. Unset declaration block’s updating flag. m_updating = false; diff --git a/Userland/Libraries/LibWeb/DOM/Attr.cpp b/Userland/Libraries/LibWeb/DOM/Attr.cpp index f1444b58ac6..d7625dda036 100644 --- a/Userland/Libraries/LibWeb/DOM/Attr.cpp +++ b/Userland/Libraries/LibWeb/DOM/Attr.cpp @@ -115,7 +115,7 @@ void Attr::handle_attribute_changes(Element& element, DeprecatedString const& ol } // 3. Run the attribute change steps with element, attribute’s local name, oldValue, newValue, and attribute’s namespace. - element.run_attribute_change_steps(local_name().to_deprecated_fly_string(), old_value, new_value, deprecated_namespace_uri); + element.run_attribute_change_steps(local_name(), old_value, new_value, deprecated_namespace_uri); } } diff --git a/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp b/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp index 2a70a2dc835..07b66a67547 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentLoading.cpp @@ -126,7 +126,7 @@ static bool build_image_document(DOM::Document& document, ByteBuffer const& data MUST(html_element->append_child(body_element)); auto image_element = DOM::create_element(document, HTML::TagNames::img, Namespace::HTML).release_value_but_fixme_should_propagate_errors(); - MUST(image_element->set_attribute(HTML::AttributeNames::src, document.url().to_deprecated_string())); + MUST(image_element->set_attribute(HTML::AttributeNames::src, MUST(document.url().to_string()))); MUST(body_element->append_child(image_element)); return true; @@ -170,9 +170,9 @@ static bool build_video_document(DOM::Document& document) MUST(html_element->append_child(body_element)); auto video_element = DOM::create_element(document, HTML::TagNames::video, Namespace::HTML).release_value_but_fixme_should_propagate_errors(); - MUST(video_element->set_attribute(HTML::AttributeNames::src, document.url().to_deprecated_string())); - MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, DeprecatedString::empty())); - MUST(video_element->set_attribute(HTML::AttributeNames::controls, DeprecatedString::empty())); + MUST(video_element->set_attribute(HTML::AttributeNames::src, MUST(document.url().to_string()))); + MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, String {})); + MUST(video_element->set_attribute(HTML::AttributeNames::controls, String {})); MUST(body_element->append_child(video_element)); return true; @@ -190,9 +190,9 @@ static bool build_audio_document(DOM::Document& document) MUST(html_element->append_child(body_element)); auto video_element = DOM::create_element(document, HTML::TagNames::audio, Namespace::HTML).release_value_but_fixme_should_propagate_errors(); - MUST(video_element->set_attribute(HTML::AttributeNames::src, document.url().to_deprecated_string())); - MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, DeprecatedString::empty())); - MUST(video_element->set_attribute(HTML::AttributeNames::controls, DeprecatedString::empty())); + MUST(video_element->set_attribute(HTML::AttributeNames::src, MUST(document.url().to_string()))); + MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, String {})); + MUST(video_element->set_attribute(HTML::AttributeNames::controls, String {})); MUST(body_element->append_child(video_element)); return true; diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 4eeb5f3127a..c145996c10a 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -468,7 +468,7 @@ void Element::add_attribute_change_steps(AttributeChangeSteps steps) m_attribute_change_steps.append(move(steps)); } -void Element::run_attribute_change_steps(DeprecatedFlyString const& local_name, DeprecatedString const& old_value, DeprecatedString const& value, DeprecatedFlyString const& namespace_) +void Element::run_attribute_change_steps(FlyString const& local_name, DeprecatedString const& old_value, DeprecatedString const& value, DeprecatedFlyString const& namespace_) { for (auto const& attribute_change_steps : m_attribute_change_steps) attribute_change_steps(local_name, old_value, value, namespace_); @@ -478,7 +478,7 @@ void Element::run_attribute_change_steps(DeprecatedFlyString const& local_name, invalidate_style_after_attribute_change(local_name); } -void Element::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void Element::attribute_changed(FlyString const& name, DeprecatedString const& value) { if (name == HTML::AttributeNames::class_) { auto new_classes = value.split_view(Infra::is_ascii_whitespace); @@ -614,7 +614,7 @@ NonnullRefPtr Element::resolved_css_values() DOMTokenList* Element::class_list() { if (!m_class_list) - m_class_list = DOMTokenList::create(*this, FlyString::from_deprecated_fly_string(HTML::AttributeNames::class_).release_value()); + m_class_list = DOMTokenList::create(*this, HTML::AttributeNames::class_); return m_class_list; } @@ -1026,7 +1026,7 @@ i32 Element::tab_index() const // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex void Element::set_tab_index(i32 tab_index) { - MUST(set_attribute(HTML::AttributeNames::tabindex, DeprecatedString::number(tab_index))); + MUST(set_attribute(HTML::AttributeNames::tabindex, MUST(String::number(tab_index)))); } // https://drafts.csswg.org/cssom-view/#potentially-scrollable @@ -1583,7 +1583,7 @@ ErrorOr Element::scroll_into_view(Optional value) m_qualified_name.set_prefix(move(value)); } -void Element::for_each_attribute(Function callback) const +void Element::for_each_attribute(Function callback) const { for (size_t i = 0; i < m_attributes->length(); ++i) { auto const* attribute = m_attributes->item(i); - callback(attribute->name().to_deprecated_fly_string(), attribute->value().to_deprecated_string()); + callback(attribute->name(), attribute->value().to_deprecated_string()); } } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index fe7fad308ae..ba0e84cdbf5 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -145,7 +145,7 @@ public: int client_width() const; int client_height() const; - void for_each_attribute(Function) const; + void for_each_attribute(Function) const; bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const; Vector const& class_names() const { return m_classes; } @@ -153,11 +153,11 @@ public: virtual void apply_presentational_hints(CSS::StyleProperties&) const { } // https://dom.spec.whatwg.org/#concept-element-attributes-change-ext - using AttributeChangeSteps = Function; + using AttributeChangeSteps = Function; void add_attribute_change_steps(AttributeChangeSteps steps); - void run_attribute_change_steps(DeprecatedFlyString const& local_name, DeprecatedString const& old_value, DeprecatedString const& value, DeprecatedFlyString const& namespace_); - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value); + void run_attribute_change_steps(FlyString const& local_name, DeprecatedString const& old_value, DeprecatedString const& value, DeprecatedFlyString const& namespace_); + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value); struct [[nodiscard]] RequiredInvalidationAfterStyleChange { bool repaint { false }; @@ -386,7 +386,7 @@ protected: private: void make_html_uppercased_qualified_name(); - void invalidate_style_after_attribute_change(DeprecatedFlyString const& attribute_name); + void invalidate_style_after_attribute_change(FlyString const& attribute_name); WebIDL::ExceptionOr> insert_adjacent(DeprecatedString const& where, JS::NonnullGCPtr node); diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index 5692d729d2c..875eb60ac80 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -131,7 +131,7 @@ const HTML::HTMLElement* Node::enclosing_html_element() const return first_ancestor_of_type(); } -const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(DeprecatedFlyString const& attribute) const +const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const { for (auto* node = this; node; node = node->parent()) { if (is(*node) && verify_cast(*node).has_attribute(attribute)) @@ -815,7 +815,7 @@ JS::NonnullGCPtr Node::clone_node(Document* document, bool clone_children) element.for_each_attribute([&](auto& name, auto& value) { // 1. Let copyAttribute be a clone of attribute. // 2. Append copyAttribute to copy. - MUST(element_copy->set_attribute(name, value)); + MUST(element_copy->set_attribute(name, MUST(String::from_deprecated_string(value)))); }); copy = move(element_copy); diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index f1be3851288..b2bd6bcea9e 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -158,7 +158,7 @@ public: const HTML::HTMLAnchorElement* enclosing_link_element() const; const HTML::HTMLElement* enclosing_html_element() const; - const HTML::HTMLElement* enclosing_html_element_with_attribute(DeprecatedFlyString const&) const; + const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const; DeprecatedString child_text_content() const; diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp index 568e1334f60..935b6d3dbb8 100644 --- a/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp +++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.cpp @@ -9,7 +9,7 @@ namespace Web::HTML { namespace AttributeNames { -#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name; +#define __ENUMERATE_HTML_ATTRIBUTE(name) FlyString name; ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE @@ -19,19 +19,19 @@ void initialize_strings() VERIFY(!s_initialized); #define __ENUMERATE_HTML_ATTRIBUTE(name) \ - name = #name; + name = #name##_fly_string; ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE // NOTE: Special cases for C++ keywords. - class_ = "class"; - for_ = "for"; - default_ = "default"; - char_ = "char"; + class_ = "class"_fly_string; + for_ = "for"_fly_string; + default_ = "default"_fly_string; + char_ = "char"_fly_string; // NOTE: Special cases for attributes with dashes in them. - accept_charset = "accept-charset"; - http_equiv = "http-equiv"; + accept_charset = "accept-charset"_fly_string; + http_equiv = "http-equiv"_fly_string; s_initialized = true; } @@ -39,7 +39,7 @@ void initialize_strings() } // https://html.spec.whatwg.org/#boolean-attribute -bool is_boolean_attribute(DeprecatedFlyString const& attribute) +bool is_boolean_attribute(FlyString const& attribute) { // NOTE: This is the list of attributes from https://html.spec.whatwg.org/#attributes-3 // with a Value column value of "Boolean attribute". diff --git a/Userland/Libraries/LibWeb/HTML/AttributeNames.h b/Userland/Libraries/LibWeb/HTML/AttributeNames.h index b037428f257..a8ec466eda7 100644 --- a/Userland/Libraries/LibWeb/HTML/AttributeNames.h +++ b/Userland/Libraries/LibWeb/HTML/AttributeNames.h @@ -6,8 +6,8 @@ #pragma once -#include #include +#include namespace Web::HTML { namespace AttributeNames { @@ -240,7 +240,7 @@ namespace AttributeNames { __ENUMERATE_HTML_ATTRIBUTE(width) \ __ENUMERATE_HTML_ATTRIBUTE(wrap) -#define __ENUMERATE_HTML_ATTRIBUTE(name) extern DeprecatedFlyString name; +#define __ENUMERATE_HTML_ATTRIBUTE(name) extern FlyString name; ENUMERATE_HTML_ATTRIBUTES #undef __ENUMERATE_HTML_ATTRIBUTE @@ -248,6 +248,6 @@ void initialize_strings(); } -bool is_boolean_attribute(DeprecatedFlyString const& attribute); +bool is_boolean_attribute(FlyString const& attribute); } diff --git a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp index 9e1270c1d42..e452c31a192 100644 --- a/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp +++ b/Userland/Libraries/LibWeb/HTML/DOMStringMap.cpp @@ -48,10 +48,10 @@ Vector DOMStringMap::get_name_value_pairs() const // in the order that those attributes are listed in the element's attribute list, add a name-value pair to list whose name is the attribute's name with the first five characters removed and whose value // is the attribute's value. m_associated_element->for_each_attribute([&](auto& name, auto& value) { - if (!name.starts_with("data-"sv)) + if (!name.bytes_as_string_view().starts_with("data-"sv)) return; - auto name_after_starting_data = name.view().substring_view(5); + auto name_after_starting_data = name.bytes_as_string_view().substring_view(5); for (auto character : name_after_starting_data) { if (is_ascii_upper_alpha(character)) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp index f4bb1479b38..ba04654c1e0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.cpp @@ -27,7 +27,7 @@ void HTMLAnchorElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAnchorElement")); } -void HTMLAnchorElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLAnchorElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); if (name == HTML::AttributeNames::href) { @@ -40,7 +40,7 @@ DeprecatedString HTMLAnchorElement::hyperlink_element_utils_href() const return deprecated_attribute(HTML::AttributeNames::href); } -WebIDL::ExceptionOr HTMLAnchorElement::set_hyperlink_element_utils_href(DeprecatedString href) +WebIDL::ExceptionOr HTMLAnchorElement::set_hyperlink_element_utils_href(String href) { return set_attribute(HTML::AttributeNames::href, move(href)); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h index bd27729a454..2573d9d5ca8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAnchorElement.h @@ -43,13 +43,13 @@ private: void run_activation_behavior(Web::DOM::Event const&); // ^DOM::Element - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils virtual DOM::Document& hyperlink_element_utils_document() override { return document(); } virtual DeprecatedString hyperlink_element_utils_href() const override; - virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(DeprecatedString) override; + virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(String) override; virtual bool hyperlink_element_utils_is_html_anchor_element() const final { return true; } virtual bool hyperlink_element_utils_is_connected() const final { return is_connected(); } virtual void hyperlink_element_utils_queue_an_element_task(HTML::Task::Source source, Function steps) override diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp index 6da8b55e559..e871d979854 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.cpp @@ -23,7 +23,7 @@ void HTMLAreaElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLAreaElement")); } -void HTMLAreaElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLAreaElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); if (name == HTML::AttributeNames::href) { @@ -36,7 +36,7 @@ DeprecatedString HTMLAreaElement::hyperlink_element_utils_href() const return deprecated_attribute(HTML::AttributeNames::href); } -WebIDL::ExceptionOr HTMLAreaElement::set_hyperlink_element_utils_href(DeprecatedString href) +WebIDL::ExceptionOr HTMLAreaElement::set_hyperlink_element_utils_href(String href) { return set_attribute(HTML::AttributeNames::href, move(href)); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h index a70cd58991d..3c407c2d21b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLAreaElement.h @@ -26,13 +26,13 @@ private: virtual void initialize(JS::Realm&) override; // ^DOM::Element - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // ^HTML::HTMLHyperlinkElementUtils virtual DOM::Document& hyperlink_element_utils_document() override { return document(); } virtual DeprecatedString hyperlink_element_utils_href() const override; - virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(DeprecatedString) override; + virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(String) override; virtual bool hyperlink_element_utils_is_html_anchor_element() const override { return false; } virtual bool hyperlink_element_utils_is_connected() const override { return is_connected(); } virtual void hyperlink_element_utils_queue_an_element_task(HTML::Task::Source source, Function steps) override diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp index 0ad8e328761..9730235c4fd 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.cpp @@ -43,7 +43,7 @@ void HTMLBaseElement::removed_from(Node* parent) document().update_base_element({}); } -void HTMLBaseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLBaseElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h index b1157847292..975bea911ef 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -23,7 +23,7 @@ public: virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; private: HTMLBaseElement(DOM::Document&, DOM::QualifiedName); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index d38af321d10..6460ca89b48 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -55,7 +55,7 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co }); } -void HTMLBodyElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLBodyElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); if (name.equals_ignoring_ascii_case("link"sv)) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h index ba96a216e3e..921aeff1bec 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.h @@ -20,7 +20,7 @@ class HTMLBodyElement final public: virtual ~HTMLBodyElement() override; - virtual void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; + virtual void attribute_changed(FlyString const&, DeprecatedString const&) override; virtual void apply_presentational_hints(CSS::StyleProperties&) const override; // https://www.w3.org/TR/html-aria/#el-body diff --git a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp index 9ab610e96a4..de35643938f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLCanvasElement.cpp @@ -111,7 +111,7 @@ void HTMLCanvasElement::reset_context_to_default_state() WebIDL::ExceptionOr HTMLCanvasElement::set_width(unsigned value) { - TRY(set_attribute(HTML::AttributeNames::width, DeprecatedString::number(value))); + TRY(set_attribute(HTML::AttributeNames::width, MUST(String::number(value)))); m_bitmap = nullptr; reset_context_to_default_state(); return {}; @@ -119,7 +119,7 @@ WebIDL::ExceptionOr HTMLCanvasElement::set_width(unsigned value) WebIDL::ExceptionOr HTMLCanvasElement::set_height(unsigned value) { - TRY(set_attribute(HTML::AttributeNames::height, DeprecatedString::number(value))); + TRY(set_attribute(HTML::AttributeNames::height, MUST(String::number(value)))); m_bitmap = nullptr; reset_context_to_default_state(); return {}; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index d17f3e2d51d..08fabf8f6ce 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -41,7 +41,7 @@ void HTMLDetailsElement::initialize(JS::Realm& realm) create_shadow_tree(realm).release_value_but_fixme_should_propagate_errors(); } -void HTMLDetailsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLDetailsElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); @@ -160,13 +160,13 @@ void HTMLDetailsElement::update_shadow_tree_style() if (has_attribute(HTML::AttributeNames::open)) { MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~( display: block; - )~~~")); + )~~~"_string)); } else { // FIXME: Should be `display: block` but we do not support `content-visibility: hidden`. MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~( display: none; content-visibility: hidden; - )~~~")); + )~~~"_string)); } } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h index 47da32973f5..12c051c30cb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.h @@ -31,7 +31,7 @@ private: virtual void visit_edges(Cell::Visitor&) override; virtual void children_changed() override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; void queue_a_details_toggle_event_task(String old_state, String new_state); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index 72390694a60..e3da52de824 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -112,11 +112,11 @@ WebIDL::ExceptionOr HTMLElement::set_content_editable(StringView content_e return {}; } if (content_editable.equals_ignoring_ascii_case("true"sv)) { - MUST(set_attribute(HTML::AttributeNames::contenteditable, "true")); + MUST(set_attribute(HTML::AttributeNames::contenteditable, "true"_string)); return {}; } if (content_editable.equals_ignoring_ascii_case("false"sv)) { - MUST(set_attribute(HTML::AttributeNames::contenteditable, "false")); + MUST(set_attribute(HTML::AttributeNames::contenteditable, "false"_string)); return {}; } return WebIDL::SyntaxError::create(realm(), "Invalid contentEditable value, must be 'true', 'false', or 'inherit'"_fly_string); @@ -224,7 +224,7 @@ bool HTMLElement::cannot_navigate() const return !is(this) && !is_connected(); } -void HTMLElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Element::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h index 037eb0caeee..77dfddc4a37 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h @@ -70,7 +70,7 @@ protected: virtual void initialize(JS::Realm&) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual void visit_edges(Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp index fb8bd4bf39a..a1c85dee786 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.cpp @@ -23,7 +23,7 @@ void HTMLFrameSetElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLFrameSetElement")); } -void HTMLFrameSetElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLFrameSetElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h index 6489a1a681d..d19dade9576 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameSetElement.h @@ -24,7 +24,7 @@ private: HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; - virtual void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; + virtual void attribute_changed(FlyString const&, DeprecatedString const&) override; // ^HTML::GlobalEventHandlers virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp index ffb16cc75e3..0e45f7c43a7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.cpp @@ -441,10 +441,10 @@ DeprecatedString HTMLHyperlinkElementUtils::href() const } // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href -WebIDL::ExceptionOr HTMLHyperlinkElementUtils::set_href(StringView href) +WebIDL::ExceptionOr HTMLHyperlinkElementUtils::set_href(String href) { // The href attribute's setter must set this element's href content attribute's value to the given value. - return set_hyperlink_element_utils_href(href); + return set_hyperlink_element_utils_href(move(href)); } // https://html.spec.whatwg.org/multipage/links.html#update-href diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h index ec15a02d558..10c602e6bfc 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLHyperlinkElementUtils.h @@ -20,7 +20,7 @@ public: DeprecatedString origin() const; DeprecatedString href() const; - WebIDL::ExceptionOr set_href(StringView); + WebIDL::ExceptionOr set_href(String); DeprecatedString protocol() const; void set_protocol(StringView); @@ -52,7 +52,7 @@ public: protected: virtual DOM::Document& hyperlink_element_utils_document() = 0; virtual DeprecatedString hyperlink_element_utils_href() const = 0; - virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(DeprecatedString) = 0; + virtual WebIDL::ExceptionOr set_hyperlink_element_utils_href(String) = 0; virtual bool hyperlink_element_utils_is_html_anchor_element() const = 0; virtual bool hyperlink_element_utils_is_connected() const = 0; virtual DeprecatedString hyperlink_element_utils_get_an_elements_target() const = 0; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp index 26305d5385a..516b350ca97 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp @@ -33,7 +33,7 @@ JS::GCPtr HTMLIFrameElement::create_layout_node(NonnullRefPtr(document(), *this, move(style)); } -void HTMLIFrameElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLIFrameElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); if (m_content_navigable) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h index 994b7d9e41c..6039dd70112 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.h @@ -36,7 +36,7 @@ private: // ^DOM::Element virtual void inserted() override; virtual void removed_from(Node*) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual i32 default_tab_index_value() const override; // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp index ddb0ac8d90b..a3beb65306f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.cpp @@ -95,7 +95,7 @@ void HTMLImageElement::apply_presentational_hints(CSS::StyleProperties& style) c }); } -void HTMLImageElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLImageElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); @@ -190,7 +190,7 @@ unsigned HTMLImageElement::width() const WebIDL::ExceptionOr HTMLImageElement::set_width(unsigned width) { - return set_attribute(HTML::AttributeNames::width, DeprecatedString::number(width)); + return set_attribute(HTML::AttributeNames::width, MUST(String::number(width))); } // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-height @@ -218,7 +218,7 @@ unsigned HTMLImageElement::height() const WebIDL::ExceptionOr HTMLImageElement::set_height(unsigned height) { - return set_attribute(HTML::AttributeNames::height, DeprecatedString::number(height)); + return set_attribute(HTML::AttributeNames::height, MUST(String::number(height))); } // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-naturalwidth diff --git a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h index 5e6710f0b85..5bab4f6a978 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLImageElement.h @@ -32,7 +32,7 @@ class HTMLImageElement final public: virtual ~HTMLImageElement() override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; DeprecatedString alt() const { return deprecated_attribute(HTML::AttributeNames::alt); } DeprecatedString src() const { return deprecated_attribute(HTML::AttributeNames::src); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 27c226b79ad..7c5ae269ed6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -532,7 +532,7 @@ void HTMLInputElement::create_shadow_tree_if_needed() white-space: pre; border: none; padding: 1px 2px; -)~~~")); +)~~~"_string)); m_placeholder_element = heap().allocate(realm(), document()); MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Height, "1lh"sv)); @@ -586,7 +586,7 @@ void HTMLInputElement::did_lose_focus() }); } -void HTMLInputElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLInputElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); if (name == HTML::AttributeNames::checked) { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h index e9fbe5182a4..7afb67506e8 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -111,7 +111,7 @@ public: virtual bool is_focusable() const override { return m_type != TypeAttributeState::Hidden; } // ^HTMLElement - virtual void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; + virtual void attribute_changed(FlyString const&, DeprecatedString const&) override; // ^FormAssociatedElement // https://html.spec.whatwg.org/multipage/forms.html#category-listed diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp index 697f9507c3a..9ea9ee425b1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp @@ -77,7 +77,7 @@ bool HTMLLinkElement::has_loaded_icon() const return m_relationship & Relationship::Icon && resource() && resource()->is_loaded() && resource()->has_encoded_data(); } -void HTMLLinkElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLLinkElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h index 6e7f1602e35..4d0bfa32bc4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLLinkElement.h @@ -39,7 +39,7 @@ private: HTMLLinkElement(DOM::Document&, DOM::QualifiedName); virtual void initialize(JS::Realm&) override; - void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; + void attribute_changed(FlyString const&, DeprecatedString const&) override; // ^ResourceClient virtual void resource_did_fail() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index 90d14e372f1..99311e276c3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -83,7 +83,7 @@ void HTMLMediaElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_fetch_controller); } -void HTMLMediaElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLMediaElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h index 9f064624fa7..b3fd2797124 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.h @@ -134,7 +134,7 @@ protected: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual void removed_from(DOM::Node*) override; virtual void children_changed() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp index 3af2faa76b6..ad3e73c6027 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.cpp @@ -45,7 +45,7 @@ void HTMLObjectElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_image_request); } -void HTMLObjectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLObjectElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { NavigableContainer::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h index be1ced8c390..8d7c0e27682 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLObjectElement.h @@ -34,7 +34,7 @@ class HTMLObjectElement final public: virtual ~HTMLObjectElement() override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; String data() const; void set_data(String const& data) { MUST(set_attribute(HTML::AttributeNames::data, data)); } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index aee6c046eb9..b928d9604f2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -31,7 +31,7 @@ void HTMLOptionElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "HTMLOptionElement")); } -void HTMLOptionElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLOptionElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { HTMLElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h index f8bc35d0881..4cda4810b2e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.h @@ -40,7 +40,7 @@ private: virtual void initialize(JS::Realm&) override; - void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + void attribute_changed(FlyString const& name, DeprecatedString const& value) override; void ask_for_a_reset(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp index 7e200789578..e1164f5e0aa 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLProgressElement.cpp @@ -71,7 +71,7 @@ WebIDL::ExceptionOr HTMLProgressElement::set_value(double value) if (value < 0) return {}; - TRY(set_attribute(HTML::AttributeNames::value, DeprecatedString::number(value))); + TRY(set_attribute(HTML::AttributeNames::value, MUST(String::number(value)))); progress_position_updated(); return {}; } @@ -98,7 +98,7 @@ WebIDL::ExceptionOr HTMLProgressElement::set_max(double value) if (value <= 0) return {}; - TRY(set_attribute(HTML::AttributeNames::max, DeprecatedString::number(value))); + TRY(set_attribute(HTML::AttributeNames::max, MUST(String::number(value)))); progress_position_updated(); return {}; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 0c7d99bd9d5..f2a7dd0d7f2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -45,7 +45,7 @@ void HTMLScriptElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_preparation_time_document.ptr()); } -void HTMLScriptElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLScriptElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h index f693c03cb97..506c00d467f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.h @@ -62,7 +62,7 @@ private: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; // https://html.spec.whatwg.org/multipage/scripting.html#prepare-the-script-element void prepare_script(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp index 2b8d0c69203..f0d0b710e9e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSummaryElement.cpp @@ -27,7 +27,7 @@ HTMLSummaryElement::HTMLSummaryElement(DOM::Document& document, DOM::QualifiedNa if (parent->has_attribute(HTML::AttributeNames::open)) parent->remove_attribute(HTML::AttributeNames::open); else - parent->set_attribute(HTML::AttributeNames::open, "").release_value_but_fixme_should_propagate_errors(); + parent->set_attribute(HTML::AttributeNames::open, String {}).release_value_but_fixme_should_propagate_errors(); }; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index 0fb700cb5fe..9c7f8d6e412 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -116,7 +116,7 @@ unsigned int HTMLTableCellElement::col_span() const WebIDL::ExceptionOr HTMLTableCellElement::set_col_span(unsigned int value) { - return set_attribute(HTML::AttributeNames::colspan, DeprecatedString::number(value)); + return set_attribute(HTML::AttributeNames::colspan, MUST(String::number(value))); } // This implements step 9 in the spec here: @@ -136,7 +136,7 @@ unsigned int HTMLTableCellElement::row_span() const WebIDL::ExceptionOr HTMLTableCellElement::set_row_span(unsigned int value) { - return set_attribute(HTML::AttributeNames::rowspan, DeprecatedString::number(value)); + return set_attribute(HTML::AttributeNames::rowspan, MUST(String::number(value))); } Optional HTMLTableCellElement::default_role() const diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 6d30e1ac2b1..e74db69cf1d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -40,7 +40,7 @@ void HTMLVideoElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_fetch_controller); } -void HTMLVideoElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void HTMLVideoElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h index 3fdf5e76dd8..de2dae0233d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.h @@ -47,7 +47,7 @@ private: virtual void initialize(JS::Realm&) override; virtual void visit_edges(Cell::Visitor&) override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h index 2a90b8fbd0f..d3110132696 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLToken.h @@ -247,28 +247,29 @@ public: } } - StringView attribute(DeprecatedFlyString const& attribute_name) const + StringView attribute(FlyString const& attribute_name) const { if (auto result = raw_attribute(attribute_name); result.has_value()) return result->value; return {}; } - Optional raw_attribute(DeprecatedFlyString const& attribute_name) const + Optional raw_attribute(FlyString const& attribute_name) const { VERIFY(is_start_tag() || is_end_tag()); + auto deprecated_attribute_name = attribute_name.to_deprecated_fly_string(); auto* ptr = tag_attributes(); if (!ptr) return {}; for (auto& attribute : *ptr) { - if (attribute_name == attribute.local_name) + if (deprecated_attribute_name == attribute.local_name) return attribute; } return {}; } - bool has_attribute(DeprecatedFlyString const& attribute_name) + bool has_attribute(FlyString const& attribute_name) const { return !attribute(attribute_name).is_null(); } diff --git a/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp b/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp index 38689da2e12..d98c6a96e69 100644 --- a/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp +++ b/Userland/Libraries/LibWeb/SVG/AttributeNames.cpp @@ -8,7 +8,7 @@ namespace Web::SVG::AttributeNames { -#define __ENUMERATE_SVG_ATTRIBUTE(name) DeprecatedFlyString name; +#define __ENUMERATE_SVG_ATTRIBUTE(name) FlyString name; ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) #undef __ENUMERATE_SVG_ATTRIBUTE @@ -18,7 +18,7 @@ void initialize_strings() VERIFY(!s_initialized); #define __ENUMERATE_SVG_ATTRIBUTE(name) \ - name = #name; + name = #name##_fly_string; ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) #undef __ENUMERATE_SVG_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/SVG/AttributeNames.h b/Userland/Libraries/LibWeb/SVG/AttributeNames.h index 8dedb4ecc92..71f4f011a7f 100644 --- a/Userland/Libraries/LibWeb/SVG/AttributeNames.h +++ b/Userland/Libraries/LibWeb/SVG/AttributeNames.h @@ -6,8 +6,8 @@ #pragma once -#include #include +#include namespace Web::SVG::AttributeNames { @@ -96,7 +96,7 @@ namespace Web::SVG::AttributeNames { E(yChannelSelector) \ E(zoomAndPan) -#define __ENUMERATE_SVG_ATTRIBUTE(name) extern DeprecatedFlyString name; +#define __ENUMERATE_SVG_ATTRIBUTE(name) extern FlyString name; ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) #undef __ENUMERATE_SVG_ATTRIBUTE diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp index b5786256962..f481b262b1a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.cpp @@ -22,7 +22,7 @@ void SVGCircleElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGCircleElement")); } -void SVGCircleElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGCircleElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h index c24512c9f27..9471d5cb2a6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGCircleElement.h @@ -17,7 +17,7 @@ class SVGCircleElement final : public SVGGeometryElement { public: virtual ~SVGCircleElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index e04301bd4c1..e8c63790749 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -34,7 +34,7 @@ void SVGElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_dataset); } -void SVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGElement.h index a31e7732a64..91df1fa65a1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.h @@ -17,7 +17,7 @@ class SVGElement : public DOM::Element { public: virtual bool requires_svg_container() const override { return true; } - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual void children_changed() override; virtual void inserted() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp index fb8c1b3b55b..01498a14ab9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.cpp @@ -22,7 +22,7 @@ void SVGEllipseElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGEllipseElement")); } -void SVGEllipseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGEllipseElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h index ca538609852..bd88df19de0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGEllipseElement.h @@ -17,7 +17,7 @@ class SVGEllipseElement final : public SVGGeometryElement { public: virtual ~SVGEllipseElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp index 265216f77b4..63a2d867863 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.cpp @@ -17,7 +17,7 @@ SVGGradientElement::SVGGradientElement(DOM::Document& document, DOM::QualifiedNa { } -void SVGGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGElement::attribute_changed(name, value); if (name == AttributeNames::gradientUnits) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h index b4feb74b8bc..be6521083e0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGradientElement.h @@ -40,7 +40,7 @@ class SVGGradientElement : public SVGElement { public: virtual ~SVGGradientElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const = 0; diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index bc34f26b045..91e619ef95e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -32,7 +32,7 @@ void SVGGraphicsElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGGraphicsElement")); } -void SVGGraphicsElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGGraphicsElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGElement::attribute_changed(name, value); if (name == "transform"sv) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h index 806452a79d8..0b9c7cc7f41 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.h @@ -25,7 +25,7 @@ class SVGGraphicsElement : public SVGElement { public: virtual void apply_presentational_hints(CSS::StyleProperties&) const override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; Optional fill_color() const; Optional fill_rule() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 02514028294..7d341309eca 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -22,7 +22,7 @@ void SVGLineElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLineElement")); } -void SVGLineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGLineElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h index 993395307f5..88a110622a6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.h @@ -17,7 +17,7 @@ class SVGLineElement final : public SVGGeometryElement { public: virtual ~SVGLineElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp index de2bee93ca9..b094c6adf14 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.cpp @@ -24,7 +24,7 @@ void SVGLinearGradientElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGLinearGradientElement")); } -void SVGLinearGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGLinearGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGradientElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h index a445fdc0e65..3153e9e138e 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGLinearGradientElement.h @@ -18,7 +18,7 @@ class SVGLinearGradientElement : public SVGGradientElement { public: virtual ~SVGLinearGradientElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp index b113e1a0113..d27d5b5b362 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.cpp @@ -31,7 +31,7 @@ JS::GCPtr SVGMaskElement::create_layout_node(NonnullRefPtr(document(), *this, move(style)); } -void SVGMaskElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGMaskElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGraphicsElement::attribute_changed(name, value); if (name == AttributeNames::maskUnits) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h index 031284bf2e7..6f343edbe84 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGMaskElement.h @@ -17,7 +17,7 @@ class SVGMaskElement final : public SVGGraphicsElement { public: virtual ~SVGMaskElement() override; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual JS::GCPtr create_layout_node(NonnullRefPtr) override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp index e5a3ab17adf..3bbf0a531b7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp @@ -95,7 +95,7 @@ void SVGPathElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPathElement")); } -void SVGPathElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGPathElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h index bec1ef94a21..fa37e627bf7 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPathElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPathElement.h @@ -19,7 +19,7 @@ class SVGPathElement final : public SVGGeometryElement { public: virtual ~SVGPathElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp index 4fa87df75f3..42fd9955088 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.cpp @@ -22,7 +22,7 @@ void SVGPolygonElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolygonElement")); } -void SVGPolygonElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGPolygonElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h index 61ddb522b78..55457a6feb3 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolygonElement.h @@ -16,7 +16,7 @@ class SVGPolygonElement final : public SVGGeometryElement { public: virtual ~SVGPolygonElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp index c884c2623f4..17502219336 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.cpp @@ -22,7 +22,7 @@ void SVGPolylineElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGPolylineElement")); } -void SVGPolylineElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGPolylineElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h index 6e7d934a633..2580bc24377 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGPolylineElement.h @@ -16,7 +16,7 @@ class SVGPolylineElement final : public SVGGeometryElement { public: virtual ~SVGPolylineElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp index 9a7fa7181cd..aef6a0fd616 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.cpp @@ -21,7 +21,7 @@ void SVGRadialGradientElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRadialGradientElement")); } -void SVGRadialGradientElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGRadialGradientElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGradientElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h index 55e50ff2ecb..50f40f28690 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRadialGradientElement.h @@ -18,7 +18,7 @@ class SVGRadialGradientElement : public SVGGradientElement { public: virtual ~SVGRadialGradientElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Optional to_gfx_paint_style(SVGPaintContext const&) const override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp index baf32a20892..d5124aaf137 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.cpp @@ -24,7 +24,7 @@ void SVGRectElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGRectElement")); } -void SVGRectElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGRectElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGeometryElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h index 9af6a7f50de..f5ad08615e1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGRectElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGRectElement.h @@ -17,7 +17,7 @@ class SVGRectElement final : public SVGGeometryElement { public: virtual ~SVGRectElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual Gfx::Path& get_path() override; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp index 722bf51e72a..ea956d6292c 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.cpp @@ -61,7 +61,7 @@ void SVGSVGElement::apply_presentational_hints(CSS::StyleProperties& style) cons } } -void SVGSVGElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGSVGElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGraphicsElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h index df584b6e76f..a9c893a80b4 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSVGElement.h @@ -36,7 +36,7 @@ private: virtual bool is_svg_svg_element() const override { return true; } - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; void update_fallback_view_box_for_svg_as_image(); diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp index 452d4e600f1..50b273d80c4 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.cpp @@ -19,7 +19,7 @@ SVGStopElement::SVGStopElement(DOM::Document& document, DOM::QualifiedName quali { } -void SVGStopElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGStopElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGElement::attribute_changed(name, value); if (name == SVG::AttributeNames::offset) { diff --git a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h index 6b46791490f..8d822286668 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGStopElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGStopElement.h @@ -19,7 +19,7 @@ class SVGStopElement final : public SVGElement { public: virtual ~SVGStopElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; JS::NonnullGCPtr offset() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index 616b376caf2..c4cc5309bdf 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -39,7 +39,7 @@ void SVGSymbolElement::apply_presentational_hints(CSS::StyleProperties& style) c } } -void SVGSymbolElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGSymbolElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox)) m_view_box = try_parse_view_box(value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h index 7ce10c98475..313581e8847 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGSymbolElement.h @@ -29,7 +29,7 @@ private: bool is_direct_child_of_use_shadow_tree() const; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; Optional m_view_box; }; diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp index 879b0b9375a..b019526e338 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.cpp @@ -28,7 +28,7 @@ void SVGTextPositioningElement::initialize(JS::Realm& realm) set_prototype(&Bindings::ensure_web_prototype(realm, "SVGTextPositioningElement")); } -void SVGTextPositioningElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGTextPositioningElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { SVGGraphicsElement::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h index 2742867988e..25d9ca631e6 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGTextPositioningElement.h @@ -16,7 +16,7 @@ class SVGTextPositioningElement : public SVGTextContentElement { WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement); public: - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; Gfx::FloatPoint get_offset() const; diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index f64f049a9da..16e471f1ba0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -45,7 +45,7 @@ void SVGUseElement::visit_edges(Cell::Visitor& visitor) visitor.visit(m_document_observer); } -void SVGUseElement::attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) +void SVGUseElement::attribute_changed(FlyString const& name, DeprecatedString const& value) { Base::attribute_changed(name, value); diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h index 591221bc57a..6e4c21ce5d5 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.h +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.h @@ -19,7 +19,7 @@ class SVGUseElement final : public SVGGraphicsElement { public: virtual ~SVGUseElement() override = default; - virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value) override; + virtual void attribute_changed(FlyString const& name, DeprecatedString const& value) override; virtual void inserted() override; diff --git a/Userland/Services/WebContent/WebDriverConnection.cpp b/Userland/Services/WebContent/WebDriverConnection.cpp index 4cbfc3828fd..0a370466ba0 100644 --- a/Userland/Services/WebContent/WebDriverConnection.cpp +++ b/Userland/Services/WebContent/WebDriverConnection.cpp @@ -1064,18 +1064,16 @@ Messages::WebDriverClient::GetElementAttributeResponse WebDriverConnection::get_ // 4. Let result be the result of the first matching condition: Optional result; - auto deprecated_name = name.to_deprecated_string(); - // -> If name is a boolean attribute - if (Web::HTML::is_boolean_attribute(deprecated_name)) { + if (Web::HTML::is_boolean_attribute(name)) { // "true" (string) if the element has the attribute, otherwise null. - if (element->has_attribute(deprecated_name)) + if (element->has_attribute(name)) result = "true"sv; } // -> Otherwise else { // The result of getting an attribute by name name. - result = element->deprecated_get_attribute(deprecated_name); + result = element->deprecated_get_attribute(name); } // 5. Return success with data result.