1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +00:00

LibWeb: Port AttributeNames to FlyString

This commit is contained in:
Shannon Booth 2023-10-08 11:42:00 +13:00 committed by Tim Flynn
parent 6a3f27509f
commit e4f8c59210
93 changed files with 148 additions and 149 deletions

View file

@ -3013,7 +3013,7 @@ JS_DEFINE_NATIVE_FUNCTION(@class_name@::@attribute.setter_callback@)
if (!cpp_value) if (!cpp_value)
impl->remove_attribute(HTML::AttributeNames::@attribute.reflect_name@); impl->remove_attribute(HTML::AttributeNames::@attribute.reflect_name@);
else else
MUST(impl->set_attribute(HTML::AttributeNames::@attribute.reflect_name@, DeprecatedString::empty())); MUST(impl->set_attribute(HTML::AttributeNames::@attribute.reflect_name@, String {}));
)~~~"); )~~~");
} }

View file

@ -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) \ #define EXPECT_TAG_TOKEN_ATTRIBUTE(name, attribute_value, name_start_column, name_end_column, value_start_column, value_end_column) \
VERIFY(last_token); \ 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()); \ VERIFY(name##_attr.has_value()); \
EXPECT_EQ(name##_attr->value, attribute_value); \ EXPECT_EQ(name##_attr->value, attribute_value); \
EXPECT_EQ(name##_attr->name_start_position.column, name_start_column); \ EXPECT_EQ(name##_attr->name_start_position.column, name_start_column); \

View file

@ -46,14 +46,14 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> AudioConstructor::construct(
auto audio = TRY(Bindings::throw_dom_exception_if_needed(vm, [&]() { return DOM::create_element(document, HTML::TagNames::audio, Namespace::HTML); })); 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". // 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); auto src_value = vm.argument(0);
// 4. If src is given, then set an attribute value for audio using "src" and src. // 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.) // (This will cause the user agent to invoke the object's resource selection algorithm before returning.)
if (!src_value.is_undefined()) { 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))); MUST(audio->set_attribute(HTML::AttributeNames::src, move(src)));
} }

View file

@ -48,13 +48,13 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> ImageConstructor::construct(
// 3. If width is given, then set an attribute value for img using "width" and width. // 3. If width is given, then set an attribute value for img using "width" and width.
if (vm.argument_count() > 0) { if (vm.argument_count() > 0) {
u32 width = TRY(vm.argument(0).to_u32(vm)); 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. // 4. If height is given, then set an attribute value for img using "height" and height.
if (vm.argument_count() > 1) { if (vm.argument_count() > 1) {
u32 height = TRY(vm.argument(1).to_u32(vm)); 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. // 5. Return img.

View file

@ -61,7 +61,7 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> OptionConstructor::construct
// 4. If value is given, then set an attribute value for option using "value" and value. // 4. If value is given, then set an attribute value for option using "value" and value.
if (vm.argument_count() > 1) { 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)); MUST(option_element->set_attribute(HTML::AttributeNames::value, value));
} }
@ -69,7 +69,7 @@ JS::ThrowCompletionOr<JS::NonnullGCPtr<JS::Object>> OptionConstructor::construct
if (vm.argument_count() > 2) { if (vm.argument_count() > 2) {
auto default_selected = vm.argument(2).to_boolean(); auto default_selected = vm.argument(2).to_boolean();
if (default_selected) { if (default_selected) {
MUST(option_element->set_attribute(HTML::AttributeNames::selected, "")); MUST(option_element->set_attribute(HTML::AttributeNames::selected, String {}));
} }
} }

View file

@ -183,7 +183,7 @@ void ElementInlineCSSStyleDeclaration::update_style_attribute()
m_updating = true; m_updating = true;
// 5. Set an attribute value for owner node using "style" and the result of serializing declaration block. // 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 blocks updating flag. // 6. Unset declaration blocks updating flag.
m_updating = false; m_updating = false;

View file

@ -115,7 +115,7 @@ void Attr::handle_attribute_changes(Element& element, DeprecatedString const& ol
} }
// 3. Run the attribute change steps with element, attributes local name, oldValue, newValue, and attributes namespace. // 3. Run the attribute change steps with element, attributes local name, oldValue, newValue, and attributes 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);
} }
} }

View file

@ -126,7 +126,7 @@ static bool build_image_document(DOM::Document& document, ByteBuffer const& data
MUST(html_element->append_child(body_element)); 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(); 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)); MUST(body_element->append_child(image_element));
return true; return true;
@ -170,9 +170,9 @@ static bool build_video_document(DOM::Document& document)
MUST(html_element->append_child(body_element)); 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(); 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::src, MUST(document.url().to_string())));
MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, DeprecatedString::empty())); MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, String {}));
MUST(video_element->set_attribute(HTML::AttributeNames::controls, DeprecatedString::empty())); MUST(video_element->set_attribute(HTML::AttributeNames::controls, String {}));
MUST(body_element->append_child(video_element)); MUST(body_element->append_child(video_element));
return true; return true;
@ -190,9 +190,9 @@ static bool build_audio_document(DOM::Document& document)
MUST(html_element->append_child(body_element)); 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(); 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::src, MUST(document.url().to_string())));
MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, DeprecatedString::empty())); MUST(video_element->set_attribute(HTML::AttributeNames::autoplay, String {}));
MUST(video_element->set_attribute(HTML::AttributeNames::controls, DeprecatedString::empty())); MUST(video_element->set_attribute(HTML::AttributeNames::controls, String {}));
MUST(body_element->append_child(video_element)); MUST(body_element->append_child(video_element));
return true; return true;

View file

@ -468,7 +468,7 @@ void Element::add_attribute_change_steps(AttributeChangeSteps steps)
m_attribute_change_steps.append(move(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) for (auto const& attribute_change_steps : m_attribute_change_steps)
attribute_change_steps(local_name, old_value, value, namespace_); 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); 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_) { if (name == HTML::AttributeNames::class_) {
auto new_classes = value.split_view(Infra::is_ascii_whitespace); auto new_classes = value.split_view(Infra::is_ascii_whitespace);
@ -614,7 +614,7 @@ NonnullRefPtr<CSS::StyleProperties> Element::resolved_css_values()
DOMTokenList* Element::class_list() DOMTokenList* Element::class_list()
{ {
if (!m_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; return m_class_list;
} }
@ -1026,7 +1026,7 @@ i32 Element::tab_index() const
// https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex // https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex
void Element::set_tab_index(i32 tab_index) 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 // https://drafts.csswg.org/cssom-view/#potentially-scrollable
@ -1583,7 +1583,7 @@ ErrorOr<void> Element::scroll_into_view(Optional<Variant<bool, ScrollIntoViewOpt
// FIXME: 8. Optionally perform some other action that brings the element to the users attention. // FIXME: 8. Optionally perform some other action that brings the element to the users attention.
} }
void Element::invalidate_style_after_attribute_change(DeprecatedFlyString const& attribute_name) void Element::invalidate_style_after_attribute_change(FlyString const& attribute_name)
{ {
// FIXME: Only invalidate if the attribute can actually affect style. // FIXME: Only invalidate if the attribute can actually affect style.
(void)attribute_name; (void)attribute_name;
@ -1873,11 +1873,11 @@ void Element::set_prefix(Optional<FlyString> value)
m_qualified_name.set_prefix(move(value)); m_qualified_name.set_prefix(move(value));
} }
void Element::for_each_attribute(Function<void(DeprecatedFlyString const&, DeprecatedString const&)> callback) const void Element::for_each_attribute(Function<void(FlyString const&, DeprecatedString const&)> callback) const
{ {
for (size_t i = 0; i < m_attributes->length(); ++i) { for (size_t i = 0; i < m_attributes->length(); ++i) {
auto const* attribute = m_attributes->item(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());
} }
} }

View file

@ -145,7 +145,7 @@ public:
int client_width() const; int client_width() const;
int client_height() const; int client_height() const;
void for_each_attribute(Function<void(DeprecatedFlyString const&, DeprecatedString const&)>) const; void for_each_attribute(Function<void(FlyString const&, DeprecatedString const&)>) const;
bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const; bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
Vector<FlyString> const& class_names() const { return m_classes; } Vector<FlyString> const& class_names() const { return m_classes; }
@ -153,11 +153,11 @@ public:
virtual void apply_presentational_hints(CSS::StyleProperties&) const { } virtual void apply_presentational_hints(CSS::StyleProperties&) const { }
// https://dom.spec.whatwg.org/#concept-element-attributes-change-ext // https://dom.spec.whatwg.org/#concept-element-attributes-change-ext
using AttributeChangeSteps = Function<void(DeprecatedFlyString const& /*local_name*/, DeprecatedString const& /*old_value*/, DeprecatedString const& /*value*/, DeprecatedFlyString const& /*namespace_*/)>; using AttributeChangeSteps = Function<void(FlyString const& /*local_name*/, DeprecatedString const& /*old_value*/, DeprecatedString const& /*value*/, DeprecatedFlyString const& /*namespace_*/)>;
void add_attribute_change_steps(AttributeChangeSteps steps); 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_); void run_attribute_change_steps(FlyString const& local_name, DeprecatedString const& old_value, DeprecatedString const& value, DeprecatedFlyString const& namespace_);
virtual void attribute_changed(DeprecatedFlyString const& name, DeprecatedString const& value); virtual void attribute_changed(FlyString const& name, DeprecatedString const& value);
struct [[nodiscard]] RequiredInvalidationAfterStyleChange { struct [[nodiscard]] RequiredInvalidationAfterStyleChange {
bool repaint { false }; bool repaint { false };
@ -386,7 +386,7 @@ protected:
private: private:
void make_html_uppercased_qualified_name(); 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<JS::GCPtr<Node>> insert_adjacent(DeprecatedString const& where, JS::NonnullGCPtr<Node> node); WebIDL::ExceptionOr<JS::GCPtr<Node>> insert_adjacent(DeprecatedString const& where, JS::NonnullGCPtr<Node> node);

View file

@ -131,7 +131,7 @@ const HTML::HTMLElement* Node::enclosing_html_element() const
return first_ancestor_of_type<HTML::HTMLElement>(); return first_ancestor_of_type<HTML::HTMLElement>();
} }
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()) { for (auto* node = this; node; node = node->parent()) {
if (is<HTML::HTMLElement>(*node) && verify_cast<HTML::HTMLElement>(*node).has_attribute(attribute)) if (is<HTML::HTMLElement>(*node) && verify_cast<HTML::HTMLElement>(*node).has_attribute(attribute))
@ -815,7 +815,7 @@ JS::NonnullGCPtr<Node> Node::clone_node(Document* document, bool clone_children)
element.for_each_attribute([&](auto& name, auto& value) { element.for_each_attribute([&](auto& name, auto& value) {
// 1. Let copyAttribute be a clone of attribute. // 1. Let copyAttribute be a clone of attribute.
// 2. Append copyAttribute to copy. // 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); copy = move(element_copy);

View file

@ -158,7 +158,7 @@ public:
const HTML::HTMLAnchorElement* enclosing_link_element() const; const HTML::HTMLAnchorElement* enclosing_link_element() const;
const HTML::HTMLElement* enclosing_html_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; DeprecatedString child_text_content() const;

View file

@ -9,7 +9,7 @@
namespace Web::HTML { namespace Web::HTML {
namespace AttributeNames { namespace AttributeNames {
#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name; #define __ENUMERATE_HTML_ATTRIBUTE(name) FlyString name;
ENUMERATE_HTML_ATTRIBUTES ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE #undef __ENUMERATE_HTML_ATTRIBUTE
@ -19,19 +19,19 @@ void initialize_strings()
VERIFY(!s_initialized); VERIFY(!s_initialized);
#define __ENUMERATE_HTML_ATTRIBUTE(name) \ #define __ENUMERATE_HTML_ATTRIBUTE(name) \
name = #name; name = #name##_fly_string;
ENUMERATE_HTML_ATTRIBUTES ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE #undef __ENUMERATE_HTML_ATTRIBUTE
// NOTE: Special cases for C++ keywords. // NOTE: Special cases for C++ keywords.
class_ = "class"; class_ = "class"_fly_string;
for_ = "for"; for_ = "for"_fly_string;
default_ = "default"; default_ = "default"_fly_string;
char_ = "char"; char_ = "char"_fly_string;
// NOTE: Special cases for attributes with dashes in them. // NOTE: Special cases for attributes with dashes in them.
accept_charset = "accept-charset"; accept_charset = "accept-charset"_fly_string;
http_equiv = "http-equiv"; http_equiv = "http-equiv"_fly_string;
s_initialized = true; s_initialized = true;
} }
@ -39,7 +39,7 @@ void initialize_strings()
} }
// https://html.spec.whatwg.org/#boolean-attribute // 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 // NOTE: This is the list of attributes from https://html.spec.whatwg.org/#attributes-3
// with a Value column value of "Boolean attribute". // with a Value column value of "Boolean attribute".

View file

@ -6,8 +6,8 @@
#pragma once #pragma once
#include <AK/DeprecatedFlyString.h>
#include <AK/Error.h> #include <AK/Error.h>
#include <AK/FlyString.h>
namespace Web::HTML { namespace Web::HTML {
namespace AttributeNames { namespace AttributeNames {
@ -240,7 +240,7 @@ namespace AttributeNames {
__ENUMERATE_HTML_ATTRIBUTE(width) \ __ENUMERATE_HTML_ATTRIBUTE(width) \
__ENUMERATE_HTML_ATTRIBUTE(wrap) __ENUMERATE_HTML_ATTRIBUTE(wrap)
#define __ENUMERATE_HTML_ATTRIBUTE(name) extern DeprecatedFlyString name; #define __ENUMERATE_HTML_ATTRIBUTE(name) extern FlyString name;
ENUMERATE_HTML_ATTRIBUTES ENUMERATE_HTML_ATTRIBUTES
#undef __ENUMERATE_HTML_ATTRIBUTE #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);
} }

View file

@ -48,10 +48,10 @@ Vector<DOMStringMap::NameValuePair> 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 // 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. // is the attribute's value.
m_associated_element->for_each_attribute([&](auto& name, auto& 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; 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) { for (auto character : name_after_starting_data) {
if (is_ascii_upper_alpha(character)) if (is_ascii_upper_alpha(character))

View file

@ -27,7 +27,7 @@ void HTMLAnchorElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAnchorElementPrototype>(realm, "HTMLAnchorElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAnchorElementPrototype>(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); HTMLElement::attribute_changed(name, value);
if (name == HTML::AttributeNames::href) { if (name == HTML::AttributeNames::href) {
@ -40,7 +40,7 @@ DeprecatedString HTMLAnchorElement::hyperlink_element_utils_href() const
return deprecated_attribute(HTML::AttributeNames::href); return deprecated_attribute(HTML::AttributeNames::href);
} }
WebIDL::ExceptionOr<void> HTMLAnchorElement::set_hyperlink_element_utils_href(DeprecatedString href) WebIDL::ExceptionOr<void> HTMLAnchorElement::set_hyperlink_element_utils_href(String href)
{ {
return set_attribute(HTML::AttributeNames::href, move(href)); return set_attribute(HTML::AttributeNames::href, move(href));
} }

View file

@ -43,13 +43,13 @@ private:
void run_activation_behavior(Web::DOM::Event const&); void run_activation_behavior(Web::DOM::Event const&);
// ^DOM::Element // ^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; virtual i32 default_tab_index_value() const override;
// ^HTML::HTMLHyperlinkElementUtils // ^HTML::HTMLHyperlinkElementUtils
virtual DOM::Document& hyperlink_element_utils_document() override { return document(); } virtual DOM::Document& hyperlink_element_utils_document() override { return document(); }
virtual DeprecatedString hyperlink_element_utils_href() const override; virtual DeprecatedString hyperlink_element_utils_href() const override;
virtual WebIDL::ExceptionOr<void> set_hyperlink_element_utils_href(DeprecatedString) override; virtual WebIDL::ExceptionOr<void> 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_html_anchor_element() const final { return true; }
virtual bool hyperlink_element_utils_is_connected() const final { return is_connected(); } 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<void()> steps) override virtual void hyperlink_element_utils_queue_an_element_task(HTML::Task::Source source, Function<void()> steps) override

View file

@ -23,7 +23,7 @@ void HTMLAreaElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAreaElementPrototype>(realm, "HTMLAreaElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLAreaElementPrototype>(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); HTMLElement::attribute_changed(name, value);
if (name == HTML::AttributeNames::href) { if (name == HTML::AttributeNames::href) {
@ -36,7 +36,7 @@ DeprecatedString HTMLAreaElement::hyperlink_element_utils_href() const
return deprecated_attribute(HTML::AttributeNames::href); return deprecated_attribute(HTML::AttributeNames::href);
} }
WebIDL::ExceptionOr<void> HTMLAreaElement::set_hyperlink_element_utils_href(DeprecatedString href) WebIDL::ExceptionOr<void> HTMLAreaElement::set_hyperlink_element_utils_href(String href)
{ {
return set_attribute(HTML::AttributeNames::href, move(href)); return set_attribute(HTML::AttributeNames::href, move(href));
} }

View file

@ -26,13 +26,13 @@ private:
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
// ^DOM::Element // ^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; virtual i32 default_tab_index_value() const override;
// ^HTML::HTMLHyperlinkElementUtils // ^HTML::HTMLHyperlinkElementUtils
virtual DOM::Document& hyperlink_element_utils_document() override { return document(); } virtual DOM::Document& hyperlink_element_utils_document() override { return document(); }
virtual DeprecatedString hyperlink_element_utils_href() const override; virtual DeprecatedString hyperlink_element_utils_href() const override;
virtual WebIDL::ExceptionOr<void> set_hyperlink_element_utils_href(DeprecatedString) override; virtual WebIDL::ExceptionOr<void> 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_html_anchor_element() const override { return false; }
virtual bool hyperlink_element_utils_is_connected() const override { return is_connected(); } 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<void()> steps) override virtual void hyperlink_element_utils_queue_an_element_task(HTML::Task::Source source, Function<void()> steps) override

View file

@ -43,7 +43,7 @@ void HTMLBaseElement::removed_from(Node* parent)
document().update_base_element({}); 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); HTMLElement::attribute_changed(name, value);

View file

@ -23,7 +23,7 @@ public:
virtual void inserted() override; virtual void inserted() override;
virtual void removed_from(Node*) 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: private:
HTMLBaseElement(DOM::Document&, DOM::QualifiedName); HTMLBaseElement(DOM::Document&, DOM::QualifiedName);

View file

@ -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); HTMLElement::attribute_changed(name, value);
if (name.equals_ignoring_ascii_case("link"sv)) { if (name.equals_ignoring_ascii_case("link"sv)) {

View file

@ -20,7 +20,7 @@ class HTMLBodyElement final
public: public:
virtual ~HTMLBodyElement() override; 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; virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
// https://www.w3.org/TR/html-aria/#el-body // https://www.w3.org/TR/html-aria/#el-body

View file

@ -111,7 +111,7 @@ void HTMLCanvasElement::reset_context_to_default_state()
WebIDL::ExceptionOr<void> HTMLCanvasElement::set_width(unsigned value) WebIDL::ExceptionOr<void> 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; m_bitmap = nullptr;
reset_context_to_default_state(); reset_context_to_default_state();
return {}; return {};
@ -119,7 +119,7 @@ WebIDL::ExceptionOr<void> HTMLCanvasElement::set_width(unsigned value)
WebIDL::ExceptionOr<void> HTMLCanvasElement::set_height(unsigned value) WebIDL::ExceptionOr<void> 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; m_bitmap = nullptr;
reset_context_to_default_state(); reset_context_to_default_state();
return {}; return {};

View file

@ -41,7 +41,7 @@ void HTMLDetailsElement::initialize(JS::Realm& realm)
create_shadow_tree(realm).release_value_but_fixme_should_propagate_errors(); 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); Base::attribute_changed(name, value);
@ -160,13 +160,13 @@ void HTMLDetailsElement::update_shadow_tree_style()
if (has_attribute(HTML::AttributeNames::open)) { if (has_attribute(HTML::AttributeNames::open)) {
MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~( MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~(
display: block; display: block;
)~~~")); )~~~"_string));
} else { } else {
// FIXME: Should be `display: block` but we do not support `content-visibility: hidden`. // FIXME: Should be `display: block` but we do not support `content-visibility: hidden`.
MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~( MUST(m_descendants_slot->set_attribute(HTML::AttributeNames::style, R"~~~(
display: none; display: none;
content-visibility: hidden; content-visibility: hidden;
)~~~")); )~~~"_string));
} }
} }

View file

@ -31,7 +31,7 @@ private:
virtual void visit_edges(Cell::Visitor&) override; virtual void visit_edges(Cell::Visitor&) override;
virtual void children_changed() 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); void queue_a_details_toggle_event_task(String old_state, String new_state);

View file

@ -112,11 +112,11 @@ WebIDL::ExceptionOr<void> HTMLElement::set_content_editable(StringView content_e
return {}; return {};
} }
if (content_editable.equals_ignoring_ascii_case("true"sv)) { 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 {}; return {};
} }
if (content_editable.equals_ignoring_ascii_case("false"sv)) { 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 {};
} }
return WebIDL::SyntaxError::create(realm(), "Invalid contentEditable value, must be 'true', 'false', or 'inherit'"_fly_string); 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<HTML::HTMLAnchorElement>(this) && !is_connected(); return !is<HTML::HTMLAnchorElement>(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); Element::attribute_changed(name, value);

View file

@ -70,7 +70,7 @@ protected:
virtual void initialize(JS::Realm&) override; 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; virtual void visit_edges(Cell::Visitor&) override;

View file

@ -23,7 +23,7 @@ void HTMLFrameSetElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFrameSetElementPrototype>(realm, "HTMLFrameSetElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLFrameSetElementPrototype>(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); HTMLElement::attribute_changed(name, value);

View file

@ -24,7 +24,7 @@ private:
HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName); HTMLFrameSetElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override; 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 // ^HTML::GlobalEventHandlers
virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override; virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override;

View file

@ -441,10 +441,10 @@ DeprecatedString HTMLHyperlinkElementUtils::href() const
} }
// https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href // https://html.spec.whatwg.org/multipage/links.html#dom-hyperlink-href
WebIDL::ExceptionOr<void> HTMLHyperlinkElementUtils::set_href(StringView href) WebIDL::ExceptionOr<void> HTMLHyperlinkElementUtils::set_href(String href)
{ {
// The href attribute's setter must set this element's href content attribute's value to the given value. // 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 // https://html.spec.whatwg.org/multipage/links.html#update-href

View file

@ -20,7 +20,7 @@ public:
DeprecatedString origin() const; DeprecatedString origin() const;
DeprecatedString href() const; DeprecatedString href() const;
WebIDL::ExceptionOr<void> set_href(StringView); WebIDL::ExceptionOr<void> set_href(String);
DeprecatedString protocol() const; DeprecatedString protocol() const;
void set_protocol(StringView); void set_protocol(StringView);
@ -52,7 +52,7 @@ public:
protected: protected:
virtual DOM::Document& hyperlink_element_utils_document() = 0; virtual DOM::Document& hyperlink_element_utils_document() = 0;
virtual DeprecatedString hyperlink_element_utils_href() const = 0; virtual DeprecatedString hyperlink_element_utils_href() const = 0;
virtual WebIDL::ExceptionOr<void> set_hyperlink_element_utils_href(DeprecatedString) = 0; virtual WebIDL::ExceptionOr<void> set_hyperlink_element_utils_href(String) = 0;
virtual bool hyperlink_element_utils_is_html_anchor_element() const = 0; virtual bool hyperlink_element_utils_is_html_anchor_element() const = 0;
virtual bool hyperlink_element_utils_is_connected() const = 0; virtual bool hyperlink_element_utils_is_connected() const = 0;
virtual DeprecatedString hyperlink_element_utils_get_an_elements_target() const = 0; virtual DeprecatedString hyperlink_element_utils_get_an_elements_target() const = 0;

View file

@ -33,7 +33,7 @@ JS::GCPtr<Layout::Node> HTMLIFrameElement::create_layout_node(NonnullRefPtr<CSS:
return heap().allocate_without_realm<Layout::FrameBox>(document(), *this, move(style)); return heap().allocate_without_realm<Layout::FrameBox>(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); HTMLElement::attribute_changed(name, value);
if (m_content_navigable) if (m_content_navigable)

View file

@ -36,7 +36,7 @@ private:
// ^DOM::Element // ^DOM::Element
virtual void inserted() override; virtual void inserted() override;
virtual void removed_from(Node*) 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; virtual i32 default_tab_index_value() const override;
// https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes // https://html.spec.whatwg.org/multipage/iframe-embed-object.html#process-the-iframe-attributes

View file

@ -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); HTMLElement::attribute_changed(name, value);
@ -190,7 +190,7 @@ unsigned HTMLImageElement::width() const
WebIDL::ExceptionOr<void> HTMLImageElement::set_width(unsigned width) WebIDL::ExceptionOr<void> 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 // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-height
@ -218,7 +218,7 @@ unsigned HTMLImageElement::height() const
WebIDL::ExceptionOr<void> HTMLImageElement::set_height(unsigned height) WebIDL::ExceptionOr<void> 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 // https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-naturalwidth

View file

@ -32,7 +32,7 @@ class HTMLImageElement final
public: public:
virtual ~HTMLImageElement() override; 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 alt() const { return deprecated_attribute(HTML::AttributeNames::alt); }
DeprecatedString src() const { return deprecated_attribute(HTML::AttributeNames::src); } DeprecatedString src() const { return deprecated_attribute(HTML::AttributeNames::src); }

View file

@ -532,7 +532,7 @@ void HTMLInputElement::create_shadow_tree_if_needed()
white-space: pre; white-space: pre;
border: none; border: none;
padding: 1px 2px; padding: 1px 2px;
)~~~")); )~~~"_string));
m_placeholder_element = heap().allocate<PlaceholderElement>(realm(), document()); m_placeholder_element = heap().allocate<PlaceholderElement>(realm(), document());
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Height, "1lh"sv)); 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); HTMLElement::attribute_changed(name, value);
if (name == HTML::AttributeNames::checked) { if (name == HTML::AttributeNames::checked) {

View file

@ -111,7 +111,7 @@ public:
virtual bool is_focusable() const override { return m_type != TypeAttributeState::Hidden; } virtual bool is_focusable() const override { return m_type != TypeAttributeState::Hidden; }
// ^HTMLElement // ^HTMLElement
virtual void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; virtual void attribute_changed(FlyString const&, DeprecatedString const&) override;
// ^FormAssociatedElement // ^FormAssociatedElement
// https://html.spec.whatwg.org/multipage/forms.html#category-listed // https://html.spec.whatwg.org/multipage/forms.html#category-listed

View file

@ -77,7 +77,7 @@ bool HTMLLinkElement::has_loaded_icon() const
return m_relationship & Relationship::Icon && resource() && resource()->is_loaded() && resource()->has_encoded_data(); 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); HTMLElement::attribute_changed(name, value);

View file

@ -39,7 +39,7 @@ private:
HTMLLinkElement(DOM::Document&, DOM::QualifiedName); HTMLLinkElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
void attribute_changed(DeprecatedFlyString const&, DeprecatedString const&) override; void attribute_changed(FlyString const&, DeprecatedString const&) override;
// ^ResourceClient // ^ResourceClient
virtual void resource_did_fail() override; virtual void resource_did_fail() override;

View file

@ -83,7 +83,7 @@ void HTMLMediaElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_fetch_controller); 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); Base::attribute_changed(name, value);

View file

@ -134,7 +134,7 @@ protected:
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) 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 removed_from(DOM::Node*) override;
virtual void children_changed() override; virtual void children_changed() override;

View file

@ -45,7 +45,7 @@ void HTMLObjectElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_image_request); 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); NavigableContainer::attribute_changed(name, value);

View file

@ -34,7 +34,7 @@ class HTMLObjectElement final
public: public:
virtual ~HTMLObjectElement() override; 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; String data() const;
void set_data(String const& data) { MUST(set_attribute(HTML::AttributeNames::data, data)); } void set_data(String const& data) { MUST(set_attribute(HTML::AttributeNames::data, data)); }

View file

@ -31,7 +31,7 @@ void HTMLOptionElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(realm, "HTMLOptionElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(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); HTMLElement::attribute_changed(name, value);

View file

@ -40,7 +40,7 @@ private:
virtual void initialize(JS::Realm&) override; 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(); void ask_for_a_reset();

View file

@ -71,7 +71,7 @@ WebIDL::ExceptionOr<void> HTMLProgressElement::set_value(double value)
if (value < 0) if (value < 0)
return {}; return {};
TRY(set_attribute(HTML::AttributeNames::value, DeprecatedString::number(value))); TRY(set_attribute(HTML::AttributeNames::value, MUST(String::number(value))));
progress_position_updated(); progress_position_updated();
return {}; return {};
} }
@ -98,7 +98,7 @@ WebIDL::ExceptionOr<void> HTMLProgressElement::set_max(double value)
if (value <= 0) if (value <= 0)
return {}; return {};
TRY(set_attribute(HTML::AttributeNames::max, DeprecatedString::number(value))); TRY(set_attribute(HTML::AttributeNames::max, MUST(String::number(value))));
progress_position_updated(); progress_position_updated();
return {}; return {};
} }

View file

@ -45,7 +45,7 @@ void HTMLScriptElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_preparation_time_document.ptr()); 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); Base::attribute_changed(name, value);

View file

@ -62,7 +62,7 @@ private:
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) 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 // https://html.spec.whatwg.org/multipage/scripting.html#prepare-the-script-element
void prepare_script(); void prepare_script();

View file

@ -27,7 +27,7 @@ HTMLSummaryElement::HTMLSummaryElement(DOM::Document& document, DOM::QualifiedNa
if (parent->has_attribute(HTML::AttributeNames::open)) if (parent->has_attribute(HTML::AttributeNames::open))
parent->remove_attribute(HTML::AttributeNames::open); parent->remove_attribute(HTML::AttributeNames::open);
else 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();
}; };
} }

View file

@ -116,7 +116,7 @@ unsigned int HTMLTableCellElement::col_span() const
WebIDL::ExceptionOr<void> HTMLTableCellElement::set_col_span(unsigned int value) WebIDL::ExceptionOr<void> 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: // This implements step 9 in the spec here:
@ -136,7 +136,7 @@ unsigned int HTMLTableCellElement::row_span() const
WebIDL::ExceptionOr<void> HTMLTableCellElement::set_row_span(unsigned int value) WebIDL::ExceptionOr<void> 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<ARIA::Role> HTMLTableCellElement::default_role() const Optional<ARIA::Role> HTMLTableCellElement::default_role() const

View file

@ -40,7 +40,7 @@ void HTMLVideoElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_fetch_controller); 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); Base::attribute_changed(name, value);

View file

@ -47,7 +47,7 @@ private:
virtual void initialize(JS::Realm&) override; virtual void initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) 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<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override; virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;

View file

@ -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()) if (auto result = raw_attribute(attribute_name); result.has_value())
return result->value; return result->value;
return {}; return {};
} }
Optional<Attribute const&> raw_attribute(DeprecatedFlyString const& attribute_name) const Optional<Attribute const&> raw_attribute(FlyString const& attribute_name) const
{ {
VERIFY(is_start_tag() || is_end_tag()); VERIFY(is_start_tag() || is_end_tag());
auto deprecated_attribute_name = attribute_name.to_deprecated_fly_string();
auto* ptr = tag_attributes(); auto* ptr = tag_attributes();
if (!ptr) if (!ptr)
return {}; return {};
for (auto& attribute : *ptr) { for (auto& attribute : *ptr) {
if (attribute_name == attribute.local_name) if (deprecated_attribute_name == attribute.local_name)
return attribute; return attribute;
} }
return {}; return {};
} }
bool has_attribute(DeprecatedFlyString const& attribute_name) bool has_attribute(FlyString const& attribute_name) const
{ {
return !attribute(attribute_name).is_null(); return !attribute(attribute_name).is_null();
} }

View file

@ -8,7 +8,7 @@
namespace Web::SVG::AttributeNames { namespace Web::SVG::AttributeNames {
#define __ENUMERATE_SVG_ATTRIBUTE(name) DeprecatedFlyString name; #define __ENUMERATE_SVG_ATTRIBUTE(name) FlyString name;
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
#undef __ENUMERATE_SVG_ATTRIBUTE #undef __ENUMERATE_SVG_ATTRIBUTE
@ -18,7 +18,7 @@ void initialize_strings()
VERIFY(!s_initialized); VERIFY(!s_initialized);
#define __ENUMERATE_SVG_ATTRIBUTE(name) \ #define __ENUMERATE_SVG_ATTRIBUTE(name) \
name = #name; name = #name##_fly_string;
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
#undef __ENUMERATE_SVG_ATTRIBUTE #undef __ENUMERATE_SVG_ATTRIBUTE

View file

@ -6,8 +6,8 @@
#pragma once #pragma once
#include <AK/DeprecatedFlyString.h>
#include <AK/Error.h> #include <AK/Error.h>
#include <AK/FlyString.h>
namespace Web::SVG::AttributeNames { namespace Web::SVG::AttributeNames {
@ -96,7 +96,7 @@ namespace Web::SVG::AttributeNames {
E(yChannelSelector) \ E(yChannelSelector) \
E(zoomAndPan) E(zoomAndPan)
#define __ENUMERATE_SVG_ATTRIBUTE(name) extern DeprecatedFlyString name; #define __ENUMERATE_SVG_ATTRIBUTE(name) extern FlyString name;
ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE) ENUMERATE_SVG_ATTRIBUTES(__ENUMERATE_SVG_ATTRIBUTE)
#undef __ENUMERATE_SVG_ATTRIBUTE #undef __ENUMERATE_SVG_ATTRIBUTE

View file

@ -22,7 +22,7 @@ void SVGCircleElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGCircleElementPrototype>(realm, "SVGCircleElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGCircleElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -17,7 +17,7 @@ class SVGCircleElement final : public SVGGeometryElement {
public: public:
virtual ~SVGCircleElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -34,7 +34,7 @@ void SVGElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_dataset); 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); Base::attribute_changed(name, value);

View file

@ -17,7 +17,7 @@ class SVGElement : public DOM::Element {
public: public:
virtual bool requires_svg_container() const override { return true; } 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 children_changed() override;
virtual void inserted() override; virtual void inserted() override;

View file

@ -22,7 +22,7 @@ void SVGEllipseElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGEllipseElementPrototype>(realm, "SVGEllipseElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGEllipseElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -17,7 +17,7 @@ class SVGEllipseElement final : public SVGGeometryElement {
public: public:
virtual ~SVGEllipseElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -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); SVGElement::attribute_changed(name, value);
if (name == AttributeNames::gradientUnits) { if (name == AttributeNames::gradientUnits) {

View file

@ -40,7 +40,7 @@ class SVGGradientElement : public SVGElement {
public: public:
virtual ~SVGGradientElement() override = default; 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<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const = 0; virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const = 0;

View file

@ -32,7 +32,7 @@ void SVGGraphicsElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGraphicsElementPrototype>(realm, "SVGGraphicsElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGGraphicsElementPrototype>(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); SVGElement::attribute_changed(name, value);
if (name == "transform"sv) { if (name == "transform"sv) {

View file

@ -25,7 +25,7 @@ class SVGGraphicsElement : public SVGElement {
public: public:
virtual void apply_presentational_hints(CSS::StyleProperties&) const override; 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<Gfx::Color> fill_color() const; Optional<Gfx::Color> fill_color() const;
Optional<FillRule> fill_rule() const; Optional<FillRule> fill_rule() const;

View file

@ -22,7 +22,7 @@ void SVGLineElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLineElementPrototype>(realm, "SVGLineElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLineElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -17,7 +17,7 @@ class SVGLineElement final : public SVGGeometryElement {
public: public:
virtual ~SVGLineElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -24,7 +24,7 @@ void SVGLinearGradientElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLinearGradientElementPrototype>(realm, "SVGLinearGradientElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGLinearGradientElementPrototype>(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); SVGGradientElement::attribute_changed(name, value);

View file

@ -18,7 +18,7 @@ class SVGLinearGradientElement : public SVGGradientElement {
public: public:
virtual ~SVGLinearGradientElement() override = default; 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<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override; virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;

View file

@ -31,7 +31,7 @@ JS::GCPtr<Layout::Node> SVGMaskElement::create_layout_node(NonnullRefPtr<CSS::St
return heap().allocate_without_realm<Layout::SVGGraphicsBox>(document(), *this, move(style)); return heap().allocate_without_realm<Layout::SVGGraphicsBox>(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); SVGGraphicsElement::attribute_changed(name, value);
if (name == AttributeNames::maskUnits) { if (name == AttributeNames::maskUnits) {

View file

@ -17,7 +17,7 @@ class SVGMaskElement final : public SVGGraphicsElement {
public: public:
virtual ~SVGMaskElement() override; 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<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override; virtual JS::GCPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;

View file

@ -95,7 +95,7 @@ void SVGPathElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPathElementPrototype>(realm, "SVGPathElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPathElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -19,7 +19,7 @@ class SVGPathElement final : public SVGGeometryElement {
public: public:
virtual ~SVGPathElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -22,7 +22,7 @@ void SVGPolygonElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolygonElementPrototype>(realm, "SVGPolygonElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolygonElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -16,7 +16,7 @@ class SVGPolygonElement final : public SVGGeometryElement {
public: public:
virtual ~SVGPolygonElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -22,7 +22,7 @@ void SVGPolylineElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolylineElementPrototype>(realm, "SVGPolylineElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGPolylineElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -16,7 +16,7 @@ class SVGPolylineElement final : public SVGGeometryElement {
public: public:
virtual ~SVGPolylineElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -21,7 +21,7 @@ void SVGRadialGradientElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRadialGradientElementPrototype>(realm, "SVGRadialGradientElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRadialGradientElementPrototype>(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); SVGGradientElement::attribute_changed(name, value);

View file

@ -18,7 +18,7 @@ class SVGRadialGradientElement : public SVGGradientElement {
public: public:
virtual ~SVGRadialGradientElement() override = default; 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<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override; virtual Optional<Gfx::PaintStyle const&> to_gfx_paint_style(SVGPaintContext const&) const override;

View file

@ -24,7 +24,7 @@ void SVGRectElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRectElementPrototype>(realm, "SVGRectElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGRectElementPrototype>(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); SVGGeometryElement::attribute_changed(name, value);

View file

@ -17,7 +17,7 @@ class SVGRectElement final : public SVGGeometryElement {
public: public:
virtual ~SVGRectElement() override = default; 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; virtual Gfx::Path& get_path() override;

View file

@ -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); SVGGraphicsElement::attribute_changed(name, value);

View file

@ -36,7 +36,7 @@ private:
virtual bool is_svg_svg_element() const override { return true; } 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(); void update_fallback_view_box_for_svg_as_image();

View file

@ -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); SVGElement::attribute_changed(name, value);
if (name == SVG::AttributeNames::offset) { if (name == SVG::AttributeNames::offset) {

View file

@ -19,7 +19,7 @@ class SVGStopElement final : public SVGElement {
public: public:
virtual ~SVGStopElement() override = default; 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<SVGAnimatedNumber> offset() const; JS::NonnullGCPtr<SVGAnimatedNumber> offset() const;

View file

@ -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)) if (name.equals_ignoring_ascii_case(SVG::AttributeNames::viewBox))
m_view_box = try_parse_view_box(value); m_view_box = try_parse_view_box(value);

View file

@ -29,7 +29,7 @@ private:
bool is_direct_child_of_use_shadow_tree() const; 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<ViewBox> m_view_box; Optional<ViewBox> m_view_box;
}; };

View file

@ -28,7 +28,7 @@ void SVGTextPositioningElement::initialize(JS::Realm& realm)
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextPositioningElementPrototype>(realm, "SVGTextPositioningElement")); set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGTextPositioningElementPrototype>(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); SVGGraphicsElement::attribute_changed(name, value);

View file

@ -16,7 +16,7 @@ class SVGTextPositioningElement : public SVGTextContentElement {
WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement); WEB_PLATFORM_OBJECT(SVGTextPositioningElement, SVGTextContentElement);
public: 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; Gfx::FloatPoint get_offset() const;

View file

@ -45,7 +45,7 @@ void SVGUseElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_document_observer); 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); Base::attribute_changed(name, value);

View file

@ -19,7 +19,7 @@ class SVGUseElement final : public SVGGraphicsElement {
public: public:
virtual ~SVGUseElement() override = default; 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; virtual void inserted() override;

View file

@ -1064,18 +1064,16 @@ Messages::WebDriverClient::GetElementAttributeResponse WebDriverConnection::get_
// 4. Let result be the result of the first matching condition: // 4. Let result be the result of the first matching condition:
Optional<DeprecatedString> result; Optional<DeprecatedString> result;
auto deprecated_name = name.to_deprecated_string();
// -> If name is a boolean attribute // -> 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. // "true" (string) if the element has the attribute, otherwise null.
if (element->has_attribute(deprecated_name)) if (element->has_attribute(name))
result = "true"sv; result = "true"sv;
} }
// -> Otherwise // -> Otherwise
else { else {
// The result of getting an attribute by name name. // 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. // 5. Return success with data result.