mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 07:47:34 +00:00
AK+Everywhere: Rename FlyString to DeprecatedFlyString
DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so let's rename it to A) match the name of DeprecatedString, B) write a new FlyString class that is tied to String.
This commit is contained in:
parent
2eacc7aec1
commit
f3db548a3d
316 changed files with 1177 additions and 1177 deletions
|
@ -302,7 +302,7 @@ JS::Value LegacyPlatformObject::item_value(size_t) const
|
|||
return JS::js_undefined();
|
||||
}
|
||||
|
||||
JS::Value LegacyPlatformObject::named_item_value(FlyString const&) const
|
||||
JS::Value LegacyPlatformObject::named_item_value(DeprecatedFlyString const&) const
|
||||
{
|
||||
return JS::js_undefined();
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
JS::ThrowCompletionOr<Optional<JS::PropertyDescriptor>> legacy_platform_object_get_own_property_for_set_slot(JS::PropertyKey const&) const;
|
||||
|
||||
virtual JS::Value item_value(size_t index) const;
|
||||
virtual JS::Value named_item_value(FlyString const& name) const;
|
||||
virtual JS::Value named_item_value(DeprecatedFlyString const& name) const;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const;
|
||||
virtual bool is_supported_property_index(u32) const;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
#include <LibJS/Heap/MarkedVector.h>
|
||||
#include <LibJS/Runtime/Completion.h>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
FontFace::FontFace(FlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges)
|
||||
FontFace::FontFace(DeprecatedFlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges)
|
||||
: m_font_family(move(font_family))
|
||||
, m_sources(move(sources))
|
||||
, m_unicode_ranges(move(unicode_ranges))
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/URL.h>
|
||||
#include <LibWeb/CSS/UnicodeRange.h>
|
||||
|
||||
|
@ -17,19 +17,19 @@ public:
|
|||
struct Source {
|
||||
AK::URL url;
|
||||
// FIXME: Do we need to keep this around, or is it only needed to discard unwanted formats during parsing?
|
||||
Optional<FlyString> format;
|
||||
Optional<DeprecatedFlyString> format;
|
||||
};
|
||||
|
||||
FontFace(FlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges);
|
||||
FontFace(DeprecatedFlyString font_family, Vector<Source> sources, Vector<UnicodeRange> unicode_ranges);
|
||||
~FontFace() = default;
|
||||
|
||||
FlyString font_family() const { return m_font_family; }
|
||||
DeprecatedFlyString font_family() const { return m_font_family; }
|
||||
Vector<Source> const& sources() const { return m_sources; }
|
||||
Vector<UnicodeRange> const& unicode_ranges() const { return m_unicode_ranges; }
|
||||
// FIXME: font-style, font-weight, font-stretch, font-feature-settings
|
||||
|
||||
private:
|
||||
FlyString m_font_family;
|
||||
DeprecatedFlyString m_font_family;
|
||||
Vector<Source> m_sources;
|
||||
Vector<UnicodeRange> m_unicode_ranges;
|
||||
};
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <AK/NonnullRefPtr.h>
|
||||
#include <AK/Optional.h>
|
||||
|
|
|
@ -10,12 +10,12 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
MediaQueryListEvent* MediaQueryListEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<MediaQueryListEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, FlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init)
|
||||
: DOM::Event(realm, event_name, event_init)
|
||||
, m_media(event_init.media)
|
||||
, m_matches(event_init.matches)
|
||||
|
|
|
@ -19,7 +19,7 @@ class MediaQueryListEvent final : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(MediaQueryListEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static MediaQueryListEvent* construct_impl(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init = {});
|
||||
static MediaQueryListEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init = {});
|
||||
|
||||
virtual ~MediaQueryListEvent() override;
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
|||
bool matches() const { return m_matches; }
|
||||
|
||||
private:
|
||||
MediaQueryListEvent(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init);
|
||||
MediaQueryListEvent(JS::Realm&, DeprecatedFlyString const& event_name, MediaQueryListEventInit const& event_init);
|
||||
|
||||
DeprecatedString m_media;
|
||||
bool m_matches;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Web::CSS::Parser {
|
||||
|
||||
Declaration::Declaration(FlyString name, Vector<ComponentValue> values, Important important)
|
||||
Declaration::Declaration(DeprecatedFlyString name, Vector<ComponentValue> values, Important important)
|
||||
: m_name(move(name))
|
||||
, m_values(move(values))
|
||||
, m_important(move(important))
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Web::CSS::Parser {
|
|||
|
||||
class Declaration {
|
||||
public:
|
||||
Declaration(FlyString name, Vector<ComponentValue> values, Important);
|
||||
Declaration(DeprecatedFlyString name, Vector<ComponentValue> values, Important);
|
||||
~Declaration();
|
||||
|
||||
StringView name() const { return m_name; }
|
||||
|
@ -25,7 +25,7 @@ public:
|
|||
DeprecatedString to_deprecated_string() const;
|
||||
|
||||
private:
|
||||
FlyString m_name;
|
||||
DeprecatedFlyString m_name;
|
||||
Vector<ComponentValue> m_values;
|
||||
Important m_important { Important::No };
|
||||
};
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Web::CSS::Parser {
|
||||
|
||||
Function::Function(FlyString name, Vector<ComponentValue>&& values)
|
||||
Function::Function(DeprecatedFlyString name, Vector<ComponentValue>&& values)
|
||||
: m_name(move(name))
|
||||
, m_values(move(values))
|
||||
{
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibWeb/CSS/Parser/ComponentValue.h>
|
||||
|
@ -18,7 +18,7 @@ namespace Web::CSS::Parser {
|
|||
|
||||
class Function : public RefCounted<Function> {
|
||||
public:
|
||||
static NonnullRefPtr<Function> create(FlyString name, Vector<ComponentValue>&& values)
|
||||
static NonnullRefPtr<Function> create(DeprecatedFlyString name, Vector<ComponentValue>&& values)
|
||||
{
|
||||
return adopt_ref(*new Function(move(name), move(values)));
|
||||
}
|
||||
|
@ -31,9 +31,9 @@ public:
|
|||
DeprecatedString to_deprecated_string() const;
|
||||
|
||||
private:
|
||||
Function(FlyString name, Vector<ComponentValue>&& values);
|
||||
Function(DeprecatedFlyString name, Vector<ComponentValue>&& values);
|
||||
|
||||
FlyString m_name;
|
||||
DeprecatedFlyString m_name;
|
||||
Vector<ComponentValue> m_values;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -561,7 +561,7 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec
|
|||
return ParseError::SyntaxError;
|
||||
}
|
||||
// FIXME: Support multiple, comma-separated, language ranges.
|
||||
Vector<FlyString> languages;
|
||||
Vector<DeprecatedFlyString> languages;
|
||||
languages.append(pseudo_function.values().first().token().to_deprecated_string());
|
||||
return Selector::SimpleSelector {
|
||||
.type = Selector::SimpleSelector::Type::PseudoClass,
|
||||
|
@ -1518,7 +1518,7 @@ NonnullRefPtr<Rule> Parser::consume_an_at_rule(TokenStream<T>& tokens)
|
|||
|
||||
// Create a new at-rule with its name set to the value of the current input token, its prelude initially set to an empty list, and its value initially set to nothing.
|
||||
// NOTE: We create the Rule fully initialized when we return it instead.
|
||||
FlyString at_rule_name = ((Token)name_ident).at_keyword();
|
||||
DeprecatedFlyString at_rule_name = ((Token)name_ident).at_keyword();
|
||||
Vector<ComponentValue> prelude;
|
||||
RefPtr<Block> block;
|
||||
|
||||
|
@ -1801,7 +1801,7 @@ NonnullRefPtr<Function> Parser::consume_a_function(TokenStream<T>& tokens)
|
|||
// Create a function with its name equal to the value of the current input token
|
||||
// and with its value initially set to an empty list.
|
||||
// NOTE: We create the Function fully initialized when we return it instead.
|
||||
FlyString function_name = ((Token)name_ident).function();
|
||||
DeprecatedFlyString function_name = ((Token)name_ident).function();
|
||||
Vector<ComponentValue> function_values;
|
||||
|
||||
// Repeatedly consume the next input token and process it as follows:
|
||||
|
@ -1856,7 +1856,7 @@ Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& tokens)
|
|||
// Create a new declaration with its name set to the value of the current input token
|
||||
// and its value initially set to the empty list.
|
||||
// NOTE: We create a fully-initialized Declaration just before returning it instead.
|
||||
FlyString declaration_name = ((Token)token).ident();
|
||||
DeprecatedFlyString declaration_name = ((Token)token).ident();
|
||||
Vector<ComponentValue> declaration_values;
|
||||
Important declaration_important = Important::No;
|
||||
|
||||
|
@ -5289,7 +5289,7 @@ CSSRule* Parser::parse_font_face_rule(TokenStream<ComponentValue>& tokens)
|
|||
{
|
||||
auto declarations_and_at_rules = parse_a_list_of_declarations(tokens);
|
||||
|
||||
Optional<FlyString> font_family;
|
||||
Optional<DeprecatedFlyString> font_family;
|
||||
Vector<FontFace::Source> src;
|
||||
Vector<UnicodeRange> unicode_range;
|
||||
|
||||
|
@ -5412,7 +5412,7 @@ Vector<FontFace::Source> Parser::parse_font_face_src(TokenStream<ComponentValue>
|
|||
// FIXME: Implement optional tech() function from CSS-Fonts-4.
|
||||
if (auto maybe_url = parse_url_function(first, AllowedDataUrlType::Font); maybe_url.has_value()) {
|
||||
auto url = maybe_url.release_value();
|
||||
Optional<FlyString> format;
|
||||
Optional<DeprecatedFlyString> format;
|
||||
|
||||
source_tokens.skip_whitespace();
|
||||
if (!source_tokens.has_next_token()) {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace Web::CSS::Parser {
|
||||
|
||||
Rule::Rule(Rule::Type type, FlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
|
||||
Rule::Rule(Rule::Type type, DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
|
||||
: m_type(type)
|
||||
, m_at_rule_name(move(name))
|
||||
, m_prelude(move(prelude))
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibWeb/CSS/Parser/Block.h>
|
||||
|
@ -22,7 +22,7 @@ public:
|
|||
Qualified,
|
||||
};
|
||||
|
||||
static NonnullRefPtr<Rule> make_at_rule(FlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
|
||||
static NonnullRefPtr<Rule> make_at_rule(DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
|
||||
{
|
||||
return adopt_ref(*new Rule(Type::At, move(name), move(prelude), move(block)));
|
||||
}
|
||||
|
@ -44,10 +44,10 @@ public:
|
|||
DeprecatedString to_deprecated_string() const;
|
||||
|
||||
private:
|
||||
Rule(Type, FlyString name, Vector<ComponentValue> prelude, RefPtr<Block>);
|
||||
Rule(Type, DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block>);
|
||||
|
||||
Type const m_type;
|
||||
FlyString m_at_rule_name;
|
||||
DeprecatedFlyString m_at_rule_name;
|
||||
Vector<ComponentValue> m_prelude;
|
||||
RefPtr<Block> m_block;
|
||||
};
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/Utf8View.h>
|
||||
#include <LibWeb/CSS/Number.h>
|
||||
|
||||
|
@ -151,7 +151,7 @@ public:
|
|||
Position const& start_position() const { return m_start_position; }
|
||||
Position const& end_position() const { return m_end_position; }
|
||||
|
||||
static Token of_string(FlyString str)
|
||||
static Token of_string(DeprecatedFlyString str)
|
||||
{
|
||||
Token token;
|
||||
token.m_type = Type::String;
|
||||
|
@ -178,7 +178,7 @@ public:
|
|||
private:
|
||||
Type m_type { Type::Invalid };
|
||||
|
||||
FlyString m_value;
|
||||
DeprecatedFlyString m_value;
|
||||
Number m_number_value;
|
||||
HashType m_hash_type { HashType::Unrestricted };
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
#include <AK/RefCounted.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
SelectorList argument_selector_list {};
|
||||
|
||||
// Used for :lang(en-gb,dk)
|
||||
Vector<FlyString> languages {};
|
||||
Vector<DeprecatedFlyString> languages {};
|
||||
};
|
||||
|
||||
struct Attribute {
|
||||
|
@ -140,20 +140,20 @@ public:
|
|||
CaseInsensitiveMatch,
|
||||
};
|
||||
MatchType match_type;
|
||||
FlyString name {};
|
||||
DeprecatedFlyString name {};
|
||||
DeprecatedString value {};
|
||||
CaseType case_type;
|
||||
};
|
||||
|
||||
struct Name {
|
||||
Name(FlyString n)
|
||||
Name(DeprecatedFlyString n)
|
||||
: name(move(n))
|
||||
, lowercase_name(name.to_lowercase())
|
||||
{
|
||||
}
|
||||
|
||||
FlyString name;
|
||||
FlyString lowercase_name;
|
||||
DeprecatedFlyString name;
|
||||
DeprecatedFlyString lowercase_name;
|
||||
};
|
||||
|
||||
Type type;
|
||||
|
@ -166,10 +166,10 @@ public:
|
|||
PseudoElement const& pseudo_element() const { return value.get<PseudoElement>(); }
|
||||
PseudoElement& pseudo_element() { return value.get<PseudoElement>(); }
|
||||
|
||||
FlyString const& name() const { return value.get<Name>().name; }
|
||||
FlyString& name() { return value.get<Name>().name; }
|
||||
FlyString const& lowercase_name() const { return value.get<Name>().lowercase_name; }
|
||||
FlyString& lowercase_name() { return value.get<Name>().lowercase_name; }
|
||||
DeprecatedFlyString const& name() const { return value.get<Name>().name; }
|
||||
DeprecatedFlyString& name() { return value.get<Name>().name; }
|
||||
DeprecatedFlyString const& lowercase_name() const { return value.get<Name>().lowercase_name; }
|
||||
DeprecatedFlyString& lowercase_name() { return value.get<Name>().lowercase_name; }
|
||||
|
||||
DeprecatedString serialize() const;
|
||||
};
|
||||
|
|
|
@ -25,9 +25,9 @@
|
|||
namespace Web::SelectorEngine {
|
||||
|
||||
// https://drafts.csswg.org/selectors-4/#the-lang-pseudo
|
||||
static inline bool matches_lang_pseudo_class(DOM::Element const& element, Vector<FlyString> const& languages)
|
||||
static inline bool matches_lang_pseudo_class(DOM::Element const& element, Vector<DeprecatedFlyString> const& languages)
|
||||
{
|
||||
FlyString element_language;
|
||||
DeprecatedFlyString element_language;
|
||||
for (auto const* e = &element; e; e = e->parent_element()) {
|
||||
auto lang = e->attribute(HTML::AttributeNames::lang);
|
||||
if (!lang.is_null()) {
|
||||
|
|
|
@ -43,7 +43,7 @@ StyleComputer::~StyleComputer() = default;
|
|||
|
||||
class StyleComputer::FontLoader : public ResourceClient {
|
||||
public:
|
||||
explicit FontLoader(StyleComputer& style_computer, FlyString family_name, AK::URL url)
|
||||
explicit FontLoader(StyleComputer& style_computer, DeprecatedFlyString family_name, AK::URL url)
|
||||
: m_style_computer(style_computer)
|
||||
, m_family_name(move(family_name))
|
||||
{
|
||||
|
@ -105,7 +105,7 @@ private:
|
|||
}
|
||||
|
||||
StyleComputer& m_style_computer;
|
||||
FlyString m_family_name;
|
||||
DeprecatedFlyString m_family_name;
|
||||
RefPtr<Gfx::VectorFont> m_vector_font;
|
||||
|
||||
HashMap<float, NonnullRefPtr<Gfx::ScaledFont>> mutable m_cached_fonts;
|
||||
|
@ -571,7 +571,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
|||
style.set_property(property_id, value);
|
||||
}
|
||||
|
||||
static RefPtr<StyleValue> get_custom_property(DOM::Element const& element, FlyString const& custom_property_name)
|
||||
static RefPtr<StyleValue> get_custom_property(DOM::Element const& element, DeprecatedFlyString const& custom_property_name)
|
||||
{
|
||||
for (auto const* current_element = &element; current_element; current_element = current_element->parent_element()) {
|
||||
if (auto it = current_element->custom_properties().find(custom_property_name); it != current_element->custom_properties().end())
|
||||
|
@ -580,7 +580,7 @@ static RefPtr<StyleValue> get_custom_property(DOM::Element const& element, FlySt
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
bool StyleComputer::expand_variables(DOM::Element& element, StringView property_name, HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& dest) const
|
||||
bool StyleComputer::expand_variables(DOM::Element& element, StringView property_name, HashMap<DeprecatedFlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& dest) const
|
||||
{
|
||||
// Arbitrary large value chosen to avoid the billion-laughs attack.
|
||||
// https://www.w3.org/TR/css-variables-1/#long-variables
|
||||
|
@ -761,7 +761,7 @@ RefPtr<StyleValue> StyleComputer::resolve_unresolved_style_value(DOM::Element& e
|
|||
Parser::TokenStream unresolved_values_without_variables_expanded { unresolved.values() };
|
||||
Vector<Parser::ComponentValue> values_with_variables_expanded;
|
||||
|
||||
HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>> dependencies;
|
||||
HashMap<DeprecatedFlyString, NonnullRefPtr<PropertyDependencyNode>> dependencies;
|
||||
if (!expand_variables(element, string_from_property_id(property_id), dependencies, unresolved_values_without_variables_expanded, values_with_variables_expanded))
|
||||
return {};
|
||||
|
||||
|
@ -817,7 +817,7 @@ static ErrorOr<void> cascade_custom_properties(DOM::Element& element, Vector<Mat
|
|||
if (auto const* inline_style = verify_cast<PropertyOwningCSSStyleDeclaration>(element.inline_style()))
|
||||
needed_capacity += inline_style->custom_properties().size();
|
||||
|
||||
HashMap<FlyString, StyleProperty> custom_properties;
|
||||
HashMap<DeprecatedFlyString, StyleProperty> custom_properties;
|
||||
TRY(custom_properties.try_ensure_capacity(needed_capacity));
|
||||
|
||||
for (auto const& matching_rule : matching_rules) {
|
||||
|
@ -1444,7 +1444,7 @@ CSSPixelRect StyleComputer::viewport_rect() const
|
|||
return {};
|
||||
}
|
||||
|
||||
void StyleComputer::did_load_font([[maybe_unused]] FlyString const& family_name)
|
||||
void StyleComputer::did_load_font([[maybe_unused]] DeprecatedFlyString const& family_name)
|
||||
{
|
||||
document().invalidate_layout();
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public:
|
|||
|
||||
Gfx::Font const& initial_font() const;
|
||||
|
||||
void did_load_font(FlyString const& family_name);
|
||||
void did_load_font(DeprecatedFlyString const& family_name);
|
||||
|
||||
void load_fonts_from_sheet(CSSStyleSheet const&);
|
||||
|
||||
|
@ -87,7 +87,7 @@ private:
|
|||
void compute_defaulted_property_value(StyleProperties&, DOM::Element const*, CSS::PropertyID, Optional<CSS::Selector::PseudoElement>) const;
|
||||
|
||||
RefPtr<StyleValue> resolve_unresolved_style_value(DOM::Element&, PropertyID, UnresolvedStyleValue const&) const;
|
||||
bool expand_variables(DOM::Element&, StringView property_name, HashMap<FlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& dest) const;
|
||||
bool expand_variables(DOM::Element&, StringView property_name, HashMap<DeprecatedFlyString, NonnullRefPtr<PropertyDependencyNode>>& dependencies, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& dest) const;
|
||||
bool expand_unresolved_values(DOM::Element&, StringView property_name, Parser::TokenStream<Parser::ComponentValue>& source, Vector<Parser::ComponentValue>& dest) const;
|
||||
|
||||
template<typename Callback>
|
||||
|
@ -109,9 +109,9 @@ private:
|
|||
DOM::Document& m_document;
|
||||
|
||||
struct RuleCache {
|
||||
HashMap<FlyString, Vector<MatchingRule>> rules_by_id;
|
||||
HashMap<FlyString, Vector<MatchingRule>> rules_by_class;
|
||||
HashMap<FlyString, Vector<MatchingRule>> rules_by_tag_name;
|
||||
HashMap<DeprecatedFlyString, Vector<MatchingRule>> rules_by_id;
|
||||
HashMap<DeprecatedFlyString, Vector<MatchingRule>> rules_by_class;
|
||||
HashMap<DeprecatedFlyString, Vector<MatchingRule>> rules_by_tag_name;
|
||||
HashMap<Selector::PseudoElement, Vector<MatchingRule>> rules_by_pseudo_element;
|
||||
Vector<MatchingRule> other_rules;
|
||||
};
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace Web::DOM {
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#introroles
|
||||
FlyString ARIAMixin::role_or_default() const
|
||||
DeprecatedFlyString ARIAMixin::role_or_default() const
|
||||
{
|
||||
// 1. Use the rules of the host language to detect that an element has a role attribute and to identify the attribute value string for it.
|
||||
auto role_string = role();
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/WebIDL/ExceptionOr.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -132,9 +132,9 @@ public:
|
|||
virtual WebIDL::ExceptionOr<void> set_aria_value_text(DeprecatedString const&) = 0;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#docconformance
|
||||
virtual FlyString default_role() const { return {}; };
|
||||
virtual DeprecatedFlyString default_role() const { return {}; };
|
||||
|
||||
FlyString role_or_default() const;
|
||||
DeprecatedFlyString role_or_default() const;
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
|
||||
virtual bool exclude_from_accessibility_tree() const = 0;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::DOM::ARIARoleNames {
|
||||
|
||||
#define __ENUMERATE_ARIA_ROLE(name) FlyString name;
|
||||
#define __ENUMERATE_ARIA_ROLE(name) DeprecatedFlyString name;
|
||||
ENUMERATE_ARIA_ROLES
|
||||
#undef __ENUMERATE_ARIA_ROLE
|
||||
|
||||
|
@ -28,7 +28,7 @@ ENUMERATE_ARIA_ROLES
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#abstract_roles
|
||||
bool is_abstract_aria_role(FlyString const& role)
|
||||
bool is_abstract_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.is_one_of(
|
||||
ARIARoleNames::command,
|
||||
|
@ -46,7 +46,7 @@ bool is_abstract_aria_role(FlyString const& role)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#widget_roles
|
||||
bool is_widget_aria_role(FlyString const& role)
|
||||
bool is_widget_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.to_lowercase().is_one_of(
|
||||
ARIARoleNames::button,
|
||||
|
@ -80,7 +80,7 @@ bool is_widget_aria_role(FlyString const& role)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#document_structure_roles
|
||||
bool is_document_structure_aria_role(FlyString const& role)
|
||||
bool is_document_structure_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.to_lowercase().is_one_of(
|
||||
ARIARoleNames::application,
|
||||
|
@ -123,7 +123,7 @@ bool is_document_structure_aria_role(FlyString const& role)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#landmark_roles
|
||||
bool is_landmark_aria_role(FlyString const& role)
|
||||
bool is_landmark_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.to_lowercase().is_one_of(
|
||||
ARIARoleNames::banner,
|
||||
|
@ -137,7 +137,7 @@ bool is_landmark_aria_role(FlyString const& role)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#live_region_roles
|
||||
bool is_live_region_aria_role(FlyString const& role)
|
||||
bool is_live_region_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.to_lowercase().is_one_of(
|
||||
ARIARoleNames::alert,
|
||||
|
@ -148,14 +148,14 @@ bool is_live_region_aria_role(FlyString const& role)
|
|||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#window_roles
|
||||
bool is_windows_aria_role(FlyString const& role)
|
||||
bool is_windows_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return role.to_lowercase().is_one_of(
|
||||
ARIARoleNames::alertdialog,
|
||||
ARIARoleNames::dialog);
|
||||
}
|
||||
|
||||
bool is_non_abstract_aria_role(FlyString const& role)
|
||||
bool is_non_abstract_aria_role(DeprecatedFlyString const& role)
|
||||
{
|
||||
return is_widget_aria_role(role)
|
||||
|| is_document_structure_aria_role(role)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web::DOM::ARIARoleNames {
|
||||
|
||||
|
@ -106,17 +106,17 @@ namespace Web::DOM::ARIARoleNames {
|
|||
__ENUMERATE_ARIA_ROLE(widget) \
|
||||
__ENUMERATE_ARIA_ROLE(window)
|
||||
|
||||
#define __ENUMERATE_ARIA_ROLE(name) extern FlyString name;
|
||||
#define __ENUMERATE_ARIA_ROLE(name) extern DeprecatedFlyString name;
|
||||
ENUMERATE_ARIA_ROLES
|
||||
#undef __ENUMERATE_ARIA_ROLE
|
||||
|
||||
bool is_abstract_aria_role(FlyString const&);
|
||||
bool is_widget_aria_role(FlyString const&);
|
||||
bool is_document_structure_aria_role(FlyString const&);
|
||||
bool is_landmark_aria_role(FlyString const&);
|
||||
bool is_live_region_aria_role(FlyString const&);
|
||||
bool is_windows_aria_role(FlyString const&);
|
||||
bool is_abstract_aria_role(DeprecatedFlyString const&);
|
||||
bool is_widget_aria_role(DeprecatedFlyString const&);
|
||||
bool is_document_structure_aria_role(DeprecatedFlyString const&);
|
||||
bool is_landmark_aria_role(DeprecatedFlyString const&);
|
||||
bool is_live_region_aria_role(DeprecatedFlyString const&);
|
||||
bool is_windows_aria_role(DeprecatedFlyString const&);
|
||||
|
||||
bool is_non_abstract_aria_role(FlyString const&);
|
||||
bool is_non_abstract_aria_role(DeprecatedFlyString const&);
|
||||
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS::NonnullGCPtr<Attr> Attr::create(Document& document, FlyString local_name, DeprecatedString value, Element const* owner_element)
|
||||
JS::NonnullGCPtr<Attr> Attr::create(Document& document, DeprecatedFlyString local_name, DeprecatedString value, Element const* owner_element)
|
||||
{
|
||||
return document.heap().allocate<Attr>(document.realm(), document, QualifiedName(move(local_name), {}, {}), move(value), owner_element);
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
#include <LibWeb/DOM/QualifiedName.h>
|
||||
|
@ -18,16 +18,16 @@ class Attr final : public Node {
|
|||
WEB_PLATFORM_OBJECT(Attr, Node);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Attr> create(Document&, FlyString local_name, DeprecatedString value, Element const* = nullptr);
|
||||
static JS::NonnullGCPtr<Attr> create(Document&, DeprecatedFlyString local_name, DeprecatedString value, Element const* = nullptr);
|
||||
JS::NonnullGCPtr<Attr> clone(Document&);
|
||||
|
||||
virtual ~Attr() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return name(); }
|
||||
virtual DeprecatedFlyString node_name() const override { return name(); }
|
||||
|
||||
FlyString const& namespace_uri() const { return m_qualified_name.namespace_(); }
|
||||
FlyString const& prefix() const { return m_qualified_name.prefix(); }
|
||||
FlyString const& local_name() const { return m_qualified_name.local_name(); }
|
||||
DeprecatedFlyString const& namespace_uri() const { return m_qualified_name.namespace_(); }
|
||||
DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); }
|
||||
DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); }
|
||||
DeprecatedString const& name() const { return m_qualified_name.as_string(); }
|
||||
|
||||
DeprecatedString const& value() const { return m_value; }
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual ~CDATASection() override;
|
||||
|
||||
// ^Node
|
||||
virtual FlyString node_name() const override { return "#cdata-section"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#cdata-section"; }
|
||||
|
||||
private:
|
||||
CDATASection(Document&, DeprecatedString const&);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/DOM/CharacterData.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -18,7 +18,7 @@ public:
|
|||
static JS::NonnullGCPtr<Comment> construct_impl(JS::Realm&, DeprecatedString const& data);
|
||||
virtual ~Comment() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#comment"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#comment"; }
|
||||
|
||||
private:
|
||||
Comment(Document&, DeprecatedString const&);
|
||||
|
|
|
@ -11,17 +11,17 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
CustomEvent* CustomEvent::create(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init)
|
||||
CustomEvent* CustomEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<CustomEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
CustomEvent* CustomEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init)
|
||||
CustomEvent* CustomEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
CustomEvent::CustomEvent(JS::Realm& realm, FlyString const& event_name, CustomEventInit const& event_init)
|
||||
CustomEvent::CustomEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, CustomEventInit const& event_init)
|
||||
: Event(realm, event_name, event_init)
|
||||
, m_detail(event_init.detail)
|
||||
{
|
||||
|
|
|
@ -20,8 +20,8 @@ class CustomEvent : public Event {
|
|||
WEB_PLATFORM_OBJECT(CustomEvent, Event);
|
||||
|
||||
public:
|
||||
static CustomEvent* create(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init = {});
|
||||
static CustomEvent* construct_impl(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init);
|
||||
static CustomEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init = {});
|
||||
static CustomEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init);
|
||||
|
||||
virtual ~CustomEvent() override;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public:
|
|||
void init_custom_event(DeprecatedString const& type, bool bubbles, bool cancelable, JS::Value detail);
|
||||
|
||||
private:
|
||||
CustomEvent(JS::Realm&, FlyString const& event_name, CustomEventInit const& event_init);
|
||||
CustomEvent(JS::Realm&, DeprecatedFlyString const& event_name, CustomEventInit const& event_init);
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-customevent-initcustomevent-type-bubbles-cancelable-detail-detail
|
||||
JS::Value m_detail { JS::js_null() };
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibJS/Runtime/Object.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
@ -21,7 +21,7 @@ public:
|
|||
~DOMEventListener();
|
||||
|
||||
// type (a string)
|
||||
FlyString type;
|
||||
DeprecatedFlyString type;
|
||||
|
||||
// callback (null or an EventListener object)
|
||||
JS::GCPtr<IDLEventListener> callback;
|
||||
|
|
|
@ -52,14 +52,14 @@ inline void replace_in_ordered_set(Vector<DeprecatedString>& set, StringView ite
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
DOMTokenList* DOMTokenList::create(Element const& associated_element, FlyString associated_attribute)
|
||||
DOMTokenList* DOMTokenList::create(Element const& associated_element, DeprecatedFlyString associated_attribute)
|
||||
{
|
||||
auto& realm = associated_element.realm();
|
||||
return realm.heap().allocate<DOMTokenList>(realm, associated_element, move(associated_attribute));
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#ref-for-domtokenlist%E2%91%A0%E2%91%A2
|
||||
DOMTokenList::DOMTokenList(Element const& associated_element, FlyString associated_attribute)
|
||||
DOMTokenList::DOMTokenList(Element const& associated_element, DeprecatedFlyString associated_attribute)
|
||||
: Bindings::LegacyPlatformObject(Bindings::cached_web_prototype(associated_element.realm(), "DOMTokenList"))
|
||||
, m_associated_element(associated_element)
|
||||
, m_associated_attribute(move(associated_attribute))
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Vector.h>
|
||||
|
@ -23,7 +23,7 @@ class DOMTokenList final : public Bindings::LegacyPlatformObject {
|
|||
WEB_PLATFORM_OBJECT(DOMTokenList, Bindings::LegacyPlatformObject);
|
||||
|
||||
public:
|
||||
static DOMTokenList* create(Element const& associated_element, FlyString associated_attribute);
|
||||
static DOMTokenList* create(Element const& associated_element, DeprecatedFlyString associated_attribute);
|
||||
~DOMTokenList() = default;
|
||||
|
||||
void associated_attribute_changed(StringView value);
|
||||
|
@ -43,7 +43,7 @@ public:
|
|||
void set_value(DeprecatedString value);
|
||||
|
||||
private:
|
||||
DOMTokenList(Element const& associated_element, FlyString associated_attribute);
|
||||
DOMTokenList(Element const& associated_element, DeprecatedFlyString associated_attribute);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
@ -51,7 +51,7 @@ private:
|
|||
void run_update_steps();
|
||||
|
||||
JS::NonnullGCPtr<Element> m_associated_element;
|
||||
FlyString m_associated_attribute;
|
||||
DeprecatedFlyString m_associated_attribute;
|
||||
Vector<DeprecatedString> m_token_set;
|
||||
};
|
||||
|
||||
|
|
|
@ -1018,9 +1018,9 @@ JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_name(DeprecatedString
|
|||
});
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_class_name(FlyString const& class_names)
|
||||
JS::NonnullGCPtr<HTMLCollection> Document::get_elements_by_class_name(DeprecatedFlyString const& class_names)
|
||||
{
|
||||
Vector<FlyString> list_of_class_names;
|
||||
Vector<DeprecatedFlyString> list_of_class_names;
|
||||
for (auto& name : class_names.view().split_view(' ')) {
|
||||
list_of_class_names.append(name);
|
||||
}
|
||||
|
@ -1180,7 +1180,7 @@ JS::Value Document::run_javascript(StringView source, StringView filename)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-document-createelement
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> Document::create_element(FlyString const& a_local_name)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> Document::create_element(DeprecatedFlyString const& a_local_name)
|
||||
{
|
||||
auto local_name = a_local_name;
|
||||
|
||||
|
@ -1196,7 +1196,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> Document::create_element(FlyStrin
|
|||
// FIXME: 4. If options is a dictionary and options["is"] exists, then set is to it.
|
||||
|
||||
// 5. Let namespace be the HTML namespace, if this is an HTML document or this’s content type is "application/xhtml+xml"; otherwise null.
|
||||
FlyString namespace_;
|
||||
DeprecatedFlyString namespace_;
|
||||
if (document_type() == Type::HTML || content_type() == "application/xhtml+xml"sv)
|
||||
namespace_ = Namespace::HTML;
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/NonnullRefPtrVector.h>
|
||||
|
@ -127,7 +127,7 @@ public:
|
|||
|
||||
CSS::StyleSheetList* style_sheets_for_bindings() { return &style_sheets(); }
|
||||
|
||||
virtual FlyString node_name() const override { return "#document"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#document"; }
|
||||
|
||||
void set_hovered_node(Node*);
|
||||
Node* hovered_node() { return m_hovered_node.ptr(); }
|
||||
|
@ -203,7 +203,7 @@ public:
|
|||
void schedule_layout_update();
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_name(DeprecatedString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_class_name(FlyString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_class_name(DeprecatedFlyString const&);
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> applets();
|
||||
JS::NonnullGCPtr<HTMLCollection> anchors();
|
||||
|
@ -222,7 +222,7 @@ public:
|
|||
|
||||
JS::Value run_javascript(StringView source, StringView filename = "(unknown)"sv);
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> create_element(FlyString const& local_name);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> create_element(DeprecatedFlyString const& local_name);
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<Element>> create_element_ns(DeprecatedString const& namespace_, DeprecatedString const& qualified_name);
|
||||
JS::NonnullGCPtr<DocumentFragment> create_document_fragment();
|
||||
JS::NonnullGCPtr<Text> create_text_node(DeprecatedString const& data);
|
||||
|
@ -371,8 +371,8 @@ public:
|
|||
static bool is_valid_name(DeprecatedString const&);
|
||||
|
||||
struct PrefixAndTagName {
|
||||
FlyString prefix;
|
||||
FlyString tag_name;
|
||||
DeprecatedFlyString prefix;
|
||||
DeprecatedFlyString tag_name;
|
||||
};
|
||||
static WebIDL::ExceptionOr<PrefixAndTagName> validate_qualified_name(JS::Realm&, DeprecatedString const& qualified_name);
|
||||
|
||||
|
@ -456,7 +456,7 @@ private:
|
|||
Document(JS::Realm&, AK::URL const&);
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual EventTarget& global_event_handlers_to_event_target(FlyString const&) final { return *this; }
|
||||
virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const&) final { return *this; }
|
||||
|
||||
void tear_down_layout_tree();
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/DOM/NonElementParentNode.h>
|
||||
#include <LibWeb/DOM/ParentNode.h>
|
||||
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
virtual ~DocumentFragment() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#document-fragment"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#document-fragment"; }
|
||||
|
||||
Element* host() { return m_host.ptr(); }
|
||||
Element const* host() const { return m_host.ptr(); }
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/DOM/ChildNode.h>
|
||||
#include <LibWeb/DOM/Node.h>
|
||||
|
||||
|
@ -22,7 +22,7 @@ public:
|
|||
|
||||
virtual ~DocumentType() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return "#doctype"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#doctype"; }
|
||||
|
||||
DeprecatedString const& name() const { return m_name; }
|
||||
void set_name(DeprecatedString const& name) { m_name = name; }
|
||||
|
|
|
@ -80,7 +80,7 @@ void Element::visit_edges(Cell::Visitor& visitor)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-getattribute
|
||||
DeprecatedString Element::get_attribute(FlyString const& name) const
|
||||
DeprecatedString Element::get_attribute(DeprecatedFlyString const& name) const
|
||||
{
|
||||
// 1. Let attr be the result of getting an attribute given qualifiedName and this.
|
||||
auto const* attribute = m_attributes->get_attribute(name);
|
||||
|
@ -94,14 +94,14 @@ DeprecatedString Element::get_attribute(FlyString const& name) const
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-getattributenode
|
||||
JS::GCPtr<Attr> Element::get_attribute_node(FlyString const& name) const
|
||||
JS::GCPtr<Attr> Element::get_attribute_node(DeprecatedFlyString const& name) const
|
||||
{
|
||||
// The getAttributeNode(qualifiedName) method steps are to return the result of getting an attribute given qualifiedName and this.
|
||||
return m_attributes->get_attribute(name);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-setattribute
|
||||
WebIDL::ExceptionOr<void> Element::set_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
WebIDL::ExceptionOr<void> Element::set_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
// 1. If qualifiedName does not match the Name production in XML, then throw an "InvalidCharacterError" DOMException.
|
||||
// FIXME: Proper name validation
|
||||
|
@ -136,7 +136,7 @@ WebIDL::ExceptionOr<void> Element::set_attribute(FlyString const& name, Deprecat
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#validate-and-extract
|
||||
WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm& realm, FlyString namespace_, FlyString qualified_name)
|
||||
WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm& realm, DeprecatedFlyString namespace_, DeprecatedFlyString qualified_name)
|
||||
{
|
||||
// 1. If namespace is the empty string, then set it to null.
|
||||
if (namespace_.is_empty())
|
||||
|
@ -146,7 +146,7 @@ WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm& realm, FlyStr
|
|||
TRY(Document::validate_qualified_name(realm, qualified_name));
|
||||
|
||||
// 3. Let prefix be null.
|
||||
FlyString prefix = {};
|
||||
DeprecatedFlyString prefix = {};
|
||||
|
||||
// 4. Let localName be qualifiedName.
|
||||
auto local_name = qualified_name;
|
||||
|
@ -179,7 +179,7 @@ WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm& realm, FlyStr
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-setattributens
|
||||
WebIDL::ExceptionOr<void> Element::set_attribute_ns(FlyString const& namespace_, FlyString const& qualified_name, DeprecatedString const& value)
|
||||
WebIDL::ExceptionOr<void> Element::set_attribute_ns(DeprecatedFlyString const& namespace_, DeprecatedFlyString const& qualified_name, DeprecatedString const& value)
|
||||
{
|
||||
// 1. Let namespace, prefix, and localName be the result of passing namespace and qualifiedName to validate and extract.
|
||||
auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_, qualified_name));
|
||||
|
@ -191,7 +191,7 @@ WebIDL::ExceptionOr<void> Element::set_attribute_ns(FlyString const& namespace_,
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-removeattribute
|
||||
void Element::remove_attribute(FlyString const& name)
|
||||
void Element::remove_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
m_attributes->remove_attribute(name);
|
||||
|
||||
|
@ -201,13 +201,13 @@ void Element::remove_attribute(FlyString const& name)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-hasattribute
|
||||
bool Element::has_attribute(FlyString const& name) const
|
||||
bool Element::has_attribute(DeprecatedFlyString const& name) const
|
||||
{
|
||||
return m_attributes->get_attribute(name) != nullptr;
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-element-toggleattribute
|
||||
WebIDL::ExceptionOr<bool> Element::toggle_attribute(FlyString const& name, Optional<bool> force)
|
||||
WebIDL::ExceptionOr<bool> Element::toggle_attribute(DeprecatedFlyString const& name, Optional<bool> force)
|
||||
{
|
||||
// 1. If qualifiedName does not match the Name production in XML, then throw an "InvalidCharacterError" DOMException.
|
||||
// FIXME: Proper name validation
|
||||
|
@ -264,7 +264,7 @@ Vector<DeprecatedString> Element::get_attribute_names() const
|
|||
return names;
|
||||
}
|
||||
|
||||
bool Element::has_class(FlyString const& class_name, CaseSensitivity case_sensitivity) const
|
||||
bool Element::has_class(DeprecatedFlyString const& class_name, CaseSensitivity case_sensitivity) const
|
||||
{
|
||||
if (case_sensitivity == CaseSensitivity::CaseSensitive) {
|
||||
return any_of(m_classes, [&](auto& it) {
|
||||
|
@ -330,7 +330,7 @@ CSS::CSSStyleDeclaration const* Element::inline_style() const
|
|||
return m_inline_style.ptr();
|
||||
}
|
||||
|
||||
void Element::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void Element::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
if (name == HTML::AttributeNames::class_) {
|
||||
auto new_classes = value.split_view(Infra::is_ascii_whitespace);
|
||||
|
@ -350,7 +350,7 @@ void Element::parse_attribute(FlyString const& name, DeprecatedString const& val
|
|||
}
|
||||
}
|
||||
|
||||
void Element::did_remove_attribute(FlyString const& name)
|
||||
void Element::did_remove_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
if (name == HTML::AttributeNames::style) {
|
||||
if (m_inline_style) {
|
||||
|
@ -516,9 +516,9 @@ bool Element::is_active() const
|
|||
return document().active_element() == this;
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> Element::get_elements_by_class_name(FlyString const& class_names)
|
||||
JS::NonnullGCPtr<HTMLCollection> Element::get_elements_by_class_name(DeprecatedFlyString const& class_names)
|
||||
{
|
||||
Vector<FlyString> list_of_class_names;
|
||||
Vector<DeprecatedFlyString> list_of_class_names;
|
||||
for (auto& name : class_names.view().split_view_if(Infra::is_ascii_whitespace)) {
|
||||
list_of_class_names.append(name);
|
||||
}
|
||||
|
@ -1258,7 +1258,7 @@ ErrorOr<void> Element::scroll_into_view(Optional<Variant<bool, ScrollIntoViewOpt
|
|||
// FIXME: 8. Optionally perform some other action that brings the element to the user’s attention.
|
||||
}
|
||||
|
||||
void Element::invalidate_style_after_attribute_change(FlyString const& attribute_name)
|
||||
void Element::invalidate_style_after_attribute_change(DeprecatedFlyString const& attribute_name)
|
||||
{
|
||||
// FIXME: Only invalidate if the attribute can actually affect style.
|
||||
(void)attribute_name;
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibWeb/Bindings/ElementPrototype.h>
|
||||
#include <LibWeb/CSS/CSSStyleDeclaration.h>
|
||||
#include <LibWeb/CSS/StyleComputer.h>
|
||||
|
@ -50,31 +50,31 @@ public:
|
|||
|
||||
DeprecatedString const& qualified_name() const { return m_qualified_name.as_string(); }
|
||||
DeprecatedString const& html_uppercased_qualified_name() const { return m_html_uppercased_qualified_name; }
|
||||
virtual FlyString node_name() const final { return html_uppercased_qualified_name(); }
|
||||
FlyString const& local_name() const { return m_qualified_name.local_name(); }
|
||||
virtual DeprecatedFlyString node_name() const final { return html_uppercased_qualified_name(); }
|
||||
DeprecatedFlyString const& local_name() const { return m_qualified_name.local_name(); }
|
||||
|
||||
// NOTE: This is for the JS bindings
|
||||
DeprecatedString const& tag_name() const { return html_uppercased_qualified_name(); }
|
||||
|
||||
FlyString const& prefix() const { return m_qualified_name.prefix(); }
|
||||
FlyString const& namespace_() const { return m_qualified_name.namespace_(); }
|
||||
DeprecatedFlyString const& prefix() const { return m_qualified_name.prefix(); }
|
||||
DeprecatedFlyString const& namespace_() const { return m_qualified_name.namespace_(); }
|
||||
|
||||
// NOTE: This is for the JS bindings
|
||||
FlyString const& namespace_uri() const { return namespace_(); }
|
||||
DeprecatedFlyString const& namespace_uri() const { return namespace_(); }
|
||||
|
||||
bool has_attribute(FlyString const& name) const;
|
||||
bool has_attribute(DeprecatedFlyString const& name) const;
|
||||
bool has_attributes() const { return !m_attributes->is_empty(); }
|
||||
DeprecatedString attribute(FlyString const& name) const { return get_attribute(name); }
|
||||
DeprecatedString get_attribute(FlyString const& name) const;
|
||||
WebIDL::ExceptionOr<void> set_attribute(FlyString const& name, DeprecatedString const& value);
|
||||
WebIDL::ExceptionOr<void> set_attribute_ns(FlyString const& namespace_, FlyString const& qualified_name, DeprecatedString const& value);
|
||||
void remove_attribute(FlyString const& name);
|
||||
WebIDL::ExceptionOr<bool> toggle_attribute(FlyString const& name, Optional<bool> force);
|
||||
DeprecatedString attribute(DeprecatedFlyString const& name) const { return get_attribute(name); }
|
||||
DeprecatedString get_attribute(DeprecatedFlyString const& name) const;
|
||||
WebIDL::ExceptionOr<void> set_attribute(DeprecatedFlyString const& name, DeprecatedString const& value);
|
||||
WebIDL::ExceptionOr<void> set_attribute_ns(DeprecatedFlyString const& namespace_, DeprecatedFlyString const& qualified_name, DeprecatedString const& value);
|
||||
void remove_attribute(DeprecatedFlyString const& name);
|
||||
WebIDL::ExceptionOr<bool> toggle_attribute(DeprecatedFlyString const& name, Optional<bool> force);
|
||||
size_t attribute_list_size() const { return m_attributes->length(); }
|
||||
NamedNodeMap const* attributes() const { return m_attributes.ptr(); }
|
||||
Vector<DeprecatedString> get_attribute_names() const;
|
||||
|
||||
JS::GCPtr<Attr> get_attribute_node(FlyString const& name) const;
|
||||
JS::GCPtr<Attr> get_attribute_node(DeprecatedFlyString const& name) const;
|
||||
|
||||
DOMTokenList* class_list();
|
||||
|
||||
|
@ -95,12 +95,12 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
bool has_class(FlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||
Vector<FlyString> const& class_names() const { return m_classes; }
|
||||
bool has_class(DeprecatedFlyString const&, CaseSensitivity = CaseSensitivity::CaseSensitive) const;
|
||||
Vector<DeprecatedFlyString> const& class_names() const { return m_classes; }
|
||||
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const { }
|
||||
virtual void parse_attribute(FlyString const& name, DeprecatedString const& value);
|
||||
virtual void did_remove_attribute(FlyString const&);
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value);
|
||||
virtual void did_remove_attribute(DeprecatedFlyString const&);
|
||||
|
||||
enum class NeedsRelayout {
|
||||
No = 0,
|
||||
|
@ -129,14 +129,14 @@ public:
|
|||
bool is_focused() const;
|
||||
bool is_active() const;
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_class_name(FlyString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_class_name(DeprecatedFlyString const&);
|
||||
|
||||
ShadowRoot* shadow_root() { return m_shadow_root.ptr(); }
|
||||
ShadowRoot const* shadow_root() const { return m_shadow_root.ptr(); }
|
||||
void set_shadow_root(JS::GCPtr<ShadowRoot>);
|
||||
|
||||
void set_custom_properties(HashMap<FlyString, CSS::StyleProperty> custom_properties) { m_custom_properties = move(custom_properties); }
|
||||
HashMap<FlyString, CSS::StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
||||
void set_custom_properties(HashMap<DeprecatedFlyString, CSS::StyleProperty> custom_properties) { m_custom_properties = move(custom_properties); }
|
||||
HashMap<DeprecatedFlyString, CSS::StyleProperty> const& custom_properties() const { return m_custom_properties; }
|
||||
|
||||
void queue_an_element_task(HTML::Task::Source, JS::SafeFunction<void()>);
|
||||
|
||||
|
@ -261,7 +261,7 @@ protected:
|
|||
private:
|
||||
void make_html_uppercased_qualified_name();
|
||||
|
||||
void invalidate_style_after_attribute_change(FlyString const& attribute_name);
|
||||
void invalidate_style_after_attribute_change(DeprecatedFlyString const& attribute_name);
|
||||
|
||||
WebIDL::ExceptionOr<JS::GCPtr<Node>> insert_adjacent(DeprecatedString const& where, JS::NonnullGCPtr<Node> node);
|
||||
|
||||
|
@ -274,9 +274,9 @@ private:
|
|||
JS::GCPtr<ShadowRoot> m_shadow_root;
|
||||
|
||||
RefPtr<CSS::StyleProperties> m_computed_css_values;
|
||||
HashMap<FlyString, CSS::StyleProperty> m_custom_properties;
|
||||
HashMap<DeprecatedFlyString, CSS::StyleProperty> m_custom_properties;
|
||||
|
||||
Vector<FlyString> m_classes;
|
||||
Vector<DeprecatedFlyString> m_classes;
|
||||
|
||||
Array<JS::GCPtr<Layout::Node>, to_underlying(CSS::Selector::PseudoElement::PseudoElementCount)> m_pseudo_element_nodes;
|
||||
};
|
||||
|
@ -284,6 +284,6 @@ private:
|
|||
template<>
|
||||
inline bool Node::fast_is<Element>() const { return is_element(); }
|
||||
|
||||
WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm&, FlyString namespace_, FlyString qualified_name);
|
||||
WebIDL::ExceptionOr<QualifiedName> validate_and_extract(JS::Realm&, DeprecatedFlyString namespace_, DeprecatedFlyString qualified_name);
|
||||
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
namespace Web::DOM {
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-create-element
|
||||
JS::NonnullGCPtr<Element> create_element(Document& document, FlyString local_name, FlyString namespace_, FlyString prefix)
|
||||
JS::NonnullGCPtr<Element> create_element(Document& document, DeprecatedFlyString local_name, DeprecatedFlyString namespace_, DeprecatedFlyString prefix)
|
||||
{
|
||||
// 1. If prefix was not given, let prefix be null.
|
||||
// NOTE: This is already taken care of by `prefix` having a default value.
|
||||
|
|
|
@ -10,6 +10,6 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS::NonnullGCPtr<Element> create_element(Document&, FlyString local_name, FlyString namespace_, FlyString prefix = {});
|
||||
JS::NonnullGCPtr<Element> create_element(Document&, DeprecatedFlyString local_name, DeprecatedFlyString namespace_, DeprecatedFlyString prefix = {});
|
||||
|
||||
}
|
||||
|
|
|
@ -14,24 +14,24 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS::NonnullGCPtr<Event> Event::create(JS::Realm& realm, FlyString const& event_name, EventInit const& event_init)
|
||||
JS::NonnullGCPtr<Event> Event::create(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<Event>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<Event> Event::construct_impl(JS::Realm& realm, FlyString const& event_name, EventInit const& event_init)
|
||||
JS::NonnullGCPtr<Event> Event::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, EventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
Event::Event(JS::Realm& realm, FlyString const& type)
|
||||
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type)
|
||||
: PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
|
||||
, m_type(type)
|
||||
, m_initialized(true)
|
||||
{
|
||||
}
|
||||
|
||||
Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_init)
|
||||
Event::Event(JS::Realm& realm, DeprecatedFlyString const& type, EventInit const& event_init)
|
||||
: PlatformObject(Bindings::cached_web_prototype(realm, "Event"))
|
||||
, m_type(type)
|
||||
, m_bubbles(event_init.bubbles)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/DOM/EventTarget.h>
|
||||
|
||||
|
@ -45,17 +45,17 @@ public:
|
|||
|
||||
using Path = Vector<PathEntry>;
|
||||
|
||||
static JS::NonnullGCPtr<Event> create(JS::Realm&, FlyString const& event_name, EventInit const& event_init = {});
|
||||
static JS::NonnullGCPtr<Event> construct_impl(JS::Realm&, FlyString const& event_name, EventInit const& event_init);
|
||||
static JS::NonnullGCPtr<Event> create(JS::Realm&, DeprecatedFlyString const& event_name, EventInit const& event_init = {});
|
||||
static JS::NonnullGCPtr<Event> construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, EventInit const& event_init);
|
||||
|
||||
Event(JS::Realm&, FlyString const& type);
|
||||
Event(JS::Realm&, FlyString const& type, EventInit const& event_init);
|
||||
Event(JS::Realm&, DeprecatedFlyString const& type);
|
||||
Event(JS::Realm&, DeprecatedFlyString const& type, EventInit const& event_init);
|
||||
|
||||
virtual ~Event() = default;
|
||||
|
||||
double time_stamp() const;
|
||||
|
||||
FlyString const& type() const { return m_type; }
|
||||
DeprecatedFlyString const& type() const { return m_type; }
|
||||
void set_type(StringView type) { m_type = type; }
|
||||
|
||||
JS::GCPtr<EventTarget> target() const { return m_target; }
|
||||
|
@ -148,7 +148,7 @@ protected:
|
|||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
private:
|
||||
FlyString m_type;
|
||||
DeprecatedFlyString m_type;
|
||||
JS::GCPtr<EventTarget> m_target;
|
||||
JS::GCPtr<EventTarget> m_related_target;
|
||||
JS::GCPtr<EventTarget> m_current_target;
|
||||
|
|
|
@ -120,7 +120,7 @@ static FlattenedAddEventListenerOptions flatten_add_event_listener_options(Varia
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-addeventlistener
|
||||
void EventTarget::add_event_listener(FlyString const& type, IDLEventListener* callback, Variant<AddEventListenerOptions, bool> const& options)
|
||||
void EventTarget::add_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant<AddEventListenerOptions, bool> const& options)
|
||||
{
|
||||
// 1. Let capture, passive, once, and signal be the result of flattening more options.
|
||||
auto flattened_options = flatten_add_event_listener_options(options);
|
||||
|
@ -138,7 +138,7 @@ void EventTarget::add_event_listener(FlyString const& type, IDLEventListener* ca
|
|||
add_an_event_listener(*event_listener);
|
||||
}
|
||||
|
||||
void EventTarget::add_event_listener_without_options(FlyString const& type, IDLEventListener& callback)
|
||||
void EventTarget::add_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback)
|
||||
{
|
||||
add_event_listener(type, &callback, AddEventListenerOptions {});
|
||||
}
|
||||
|
@ -179,7 +179,7 @@ void EventTarget::add_an_event_listener(DOMEventListener& listener)
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-eventtarget-removeeventlistener
|
||||
void EventTarget::remove_event_listener(FlyString const& type, IDLEventListener* callback, Variant<EventListenerOptions, bool> const& options)
|
||||
void EventTarget::remove_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant<EventListenerOptions, bool> const& options)
|
||||
{
|
||||
// 1. Let capture be the result of flattening options.
|
||||
bool capture = flatten_event_listener_options(options);
|
||||
|
@ -202,7 +202,7 @@ void EventTarget::remove_event_listener(FlyString const& type, IDLEventListener*
|
|||
remove_an_event_listener(**it);
|
||||
}
|
||||
|
||||
void EventTarget::remove_event_listener_without_options(FlyString const& type, IDLEventListener& callback)
|
||||
void EventTarget::remove_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback)
|
||||
{
|
||||
remove_event_listener(type, &callback, EventListenerOptions {});
|
||||
}
|
||||
|
@ -241,7 +241,7 @@ WebIDL::ExceptionOr<bool> EventTarget::dispatch_event_binding(Event& event)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#window-reflecting-body-element-event-handler-set
|
||||
bool is_window_reflecting_body_element_event_handler(FlyString const& name)
|
||||
bool is_window_reflecting_body_element_event_handler(DeprecatedFlyString const& name)
|
||||
{
|
||||
return name.is_one_of(
|
||||
HTML::EventNames::blur,
|
||||
|
@ -253,7 +253,7 @@ bool is_window_reflecting_body_element_event_handler(FlyString const& name)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#windoweventhandlers
|
||||
static bool is_window_event_handler(FlyString const& name)
|
||||
static bool is_window_event_handler(DeprecatedFlyString const& name)
|
||||
{
|
||||
return name.is_one_of(
|
||||
HTML::EventNames::afterprint,
|
||||
|
@ -275,7 +275,7 @@ static bool is_window_event_handler(FlyString const& name)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#determining-the-target-of-an-event-handler
|
||||
static EventTarget* determine_target_of_event_handler(EventTarget& event_target, FlyString const& name)
|
||||
static EventTarget* determine_target_of_event_handler(EventTarget& event_target, DeprecatedFlyString const& name)
|
||||
{
|
||||
// To determine the target of an event handler, given an EventTarget object eventTarget on which the event handler is exposed,
|
||||
// and an event handler name name, the following steps are taken:
|
||||
|
@ -300,7 +300,7 @@ static EventTarget* determine_target_of_event_handler(EventTarget& event_target,
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:event-handler-idl-attributes-2
|
||||
WebIDL::CallbackType* EventTarget::event_handler_attribute(FlyString const& name)
|
||||
WebIDL::CallbackType* EventTarget::event_handler_attribute(DeprecatedFlyString const& name)
|
||||
{
|
||||
// 1. Let eventTarget be the result of determining the target of an event handler given this object and name.
|
||||
auto target = determine_target_of_event_handler(*this, name);
|
||||
|
@ -314,7 +314,7 @@ WebIDL::CallbackType* EventTarget::event_handler_attribute(FlyString const& name
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#getting-the-current-value-of-the-event-handler
|
||||
WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString const& name)
|
||||
WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(DeprecatedFlyString const& name)
|
||||
{
|
||||
// 1. Let handlerMap be eventTarget's event handler map. (NOTE: Not necessary)
|
||||
|
||||
|
@ -473,7 +473,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:event-handler-idl-attributes-3
|
||||
void EventTarget::set_event_handler_attribute(FlyString const& name, WebIDL::CallbackType* value)
|
||||
void EventTarget::set_event_handler_attribute(DeprecatedFlyString const& name, WebIDL::CallbackType* value)
|
||||
{
|
||||
// 1. Let eventTarget be the result of determining the target of an event handler given this object and name.
|
||||
auto event_target = determine_target_of_event_handler(*this, name);
|
||||
|
@ -520,7 +520,7 @@ void EventTarget::set_event_handler_attribute(FlyString const& name, WebIDL::Cal
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#activate-an-event-handler
|
||||
void EventTarget::activate_event_handler(FlyString const& name, HTML::EventHandler& event_handler)
|
||||
void EventTarget::activate_event_handler(DeprecatedFlyString const& name, HTML::EventHandler& event_handler)
|
||||
{
|
||||
// 1. Let handlerMap be eventTarget's event handler map.
|
||||
// 2. Let eventHandler be handlerMap[name].
|
||||
|
@ -570,7 +570,7 @@ void EventTarget::activate_event_handler(FlyString const& name, HTML::EventHandl
|
|||
event_handler.listener = listener;
|
||||
}
|
||||
|
||||
void EventTarget::deactivate_event_handler(FlyString const& name)
|
||||
void EventTarget::deactivate_event_handler(DeprecatedFlyString const& name)
|
||||
{
|
||||
// 1. Let handlerMap be eventTarget's event handler map. (NOTE: Not necessary)
|
||||
|
||||
|
@ -600,7 +600,7 @@ void EventTarget::deactivate_event_handler(FlyString const& name)
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#the-event-handler-processing-algorithm
|
||||
JS::ThrowCompletionOr<void> EventTarget::process_event_handler_for_event(FlyString const& name, Event& event)
|
||||
JS::ThrowCompletionOr<void> EventTarget::process_event_handler_for_event(DeprecatedFlyString const& name, Event& event)
|
||||
{
|
||||
// 1. Let callback be the result of getting the current value of the event handler given eventTarget and name.
|
||||
auto* callback = get_current_value_of_event_handler(name);
|
||||
|
@ -679,7 +679,7 @@ JS::ThrowCompletionOr<void> EventTarget::process_event_handler_for_event(FlyStri
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-attributes:concept-element-attributes-change-ext
|
||||
void EventTarget::element_event_handler_attribute_changed(FlyString const& local_name, DeprecatedString const& value)
|
||||
void EventTarget::element_event_handler_attribute_changed(DeprecatedFlyString const& local_name, DeprecatedString const& value)
|
||||
{
|
||||
// NOTE: Step 1 of this algorithm was handled in HTMLElement::parse_attribute.
|
||||
|
||||
|
@ -735,7 +735,7 @@ bool EventTarget::dispatch_event(Event& event)
|
|||
return EventDispatcher::dispatch(*this, event);
|
||||
}
|
||||
|
||||
bool EventTarget::has_event_listener(FlyString const& type) const
|
||||
bool EventTarget::has_event_listener(DeprecatedFlyString const& type) const
|
||||
{
|
||||
for (auto& listener : m_event_listener_list) {
|
||||
if (listener->type == type)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/Noncopyable.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibJS/Forward.h>
|
||||
|
@ -26,12 +26,12 @@ public:
|
|||
|
||||
virtual bool is_focusable() const { return false; }
|
||||
|
||||
void add_event_listener(FlyString const& type, IDLEventListener* callback, Variant<AddEventListenerOptions, bool> const& options);
|
||||
void remove_event_listener(FlyString const& type, IDLEventListener* callback, Variant<EventListenerOptions, bool> const& options);
|
||||
void add_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant<AddEventListenerOptions, bool> const& options);
|
||||
void remove_event_listener(DeprecatedFlyString const& type, IDLEventListener* callback, Variant<EventListenerOptions, bool> const& options);
|
||||
|
||||
// NOTE: These are for internal use only. They operate as though addEventListener(type, callback) was called instead of addEventListener(type, callback, options).
|
||||
void add_event_listener_without_options(FlyString const& type, IDLEventListener& callback);
|
||||
void remove_event_listener_without_options(FlyString const& type, IDLEventListener& callback);
|
||||
void add_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback);
|
||||
void remove_event_listener_without_options(DeprecatedFlyString const& type, IDLEventListener& callback);
|
||||
|
||||
virtual bool dispatch_event(Event&);
|
||||
WebIDL::ExceptionOr<bool> dispatch_event_binding(Event&);
|
||||
|
@ -51,15 +51,15 @@ public:
|
|||
virtual void legacy_cancelled_activation_behavior() { }
|
||||
virtual void legacy_cancelled_activation_behavior_was_not_called() { }
|
||||
|
||||
WebIDL::CallbackType* event_handler_attribute(FlyString const& name);
|
||||
void set_event_handler_attribute(FlyString const& name, WebIDL::CallbackType*);
|
||||
WebIDL::CallbackType* event_handler_attribute(DeprecatedFlyString const& name);
|
||||
void set_event_handler_attribute(DeprecatedFlyString const& name, WebIDL::CallbackType*);
|
||||
|
||||
bool has_event_listener(FlyString const& type) const;
|
||||
bool has_event_listener(DeprecatedFlyString const& type) const;
|
||||
|
||||
protected:
|
||||
explicit EventTarget(JS::Realm&);
|
||||
|
||||
void element_event_handler_attribute_changed(FlyString const& local_name, DeprecatedString const& value);
|
||||
void element_event_handler_attribute_changed(DeprecatedFlyString const& local_name, DeprecatedString const& value);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
@ -68,14 +68,14 @@ private:
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#event-handler-map
|
||||
// Spec Note: The order of the entries of event handler map could be arbitrary. It is not observable through any algorithms that operate on the map.
|
||||
HashMap<FlyString, JS::GCPtr<HTML::EventHandler>> m_event_handler_map;
|
||||
HashMap<DeprecatedFlyString, JS::GCPtr<HTML::EventHandler>> m_event_handler_map;
|
||||
|
||||
WebIDL::CallbackType* get_current_value_of_event_handler(FlyString const& name);
|
||||
void activate_event_handler(FlyString const& name, HTML::EventHandler& event_handler);
|
||||
void deactivate_event_handler(FlyString const& name);
|
||||
JS::ThrowCompletionOr<void> process_event_handler_for_event(FlyString const& name, Event& event);
|
||||
WebIDL::CallbackType* get_current_value_of_event_handler(DeprecatedFlyString const& name);
|
||||
void activate_event_handler(DeprecatedFlyString const& name, HTML::EventHandler& event_handler);
|
||||
void deactivate_event_handler(DeprecatedFlyString const& name);
|
||||
JS::ThrowCompletionOr<void> process_event_handler_for_event(DeprecatedFlyString const& name, Event& event);
|
||||
};
|
||||
|
||||
bool is_window_reflecting_body_element_event_handler(FlyString const& name);
|
||||
bool is_window_reflecting_body_element_event_handler(DeprecatedFlyString const& name);
|
||||
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ Element* HTMLCollection::item(size_t index) const
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-htmlcollection-nameditem-key
|
||||
Element* HTMLCollection::named_item(FlyString const& name) const
|
||||
Element* HTMLCollection::named_item(DeprecatedFlyString const& name) const
|
||||
{
|
||||
// 1. If key is the empty string, return null.
|
||||
if (name.is_empty())
|
||||
|
@ -130,7 +130,7 @@ JS::Value HTMLCollection::item_value(size_t index) const
|
|||
return const_cast<Element*>(element);
|
||||
}
|
||||
|
||||
JS::Value HTMLCollection::named_item_value(FlyString const& index) const
|
||||
JS::Value HTMLCollection::named_item_value(DeprecatedFlyString const& index) const
|
||||
{
|
||||
auto* element = named_item(index);
|
||||
if (!element)
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/Function.h>
|
||||
#include <LibJS/Heap/GCPtr.h>
|
||||
#include <LibWeb/Bindings/LegacyPlatformObject.h>
|
||||
|
@ -35,12 +35,12 @@ public:
|
|||
|
||||
size_t length();
|
||||
Element* item(size_t index) const;
|
||||
Element* named_item(FlyString const& name) const;
|
||||
Element* named_item(DeprecatedFlyString const& name) const;
|
||||
|
||||
JS::MarkedVector<Element*> collect_matching_elements() const;
|
||||
|
||||
virtual JS::Value item_value(size_t index) const override;
|
||||
virtual JS::Value named_item_value(FlyString const& name) const override;
|
||||
virtual JS::Value named_item_value(DeprecatedFlyString const& name) const override;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const override;
|
||||
virtual bool is_supported_property_index(u32) const override;
|
||||
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
|
||||
namespace Web::DOM {
|
||||
|
||||
JS::NonnullGCPtr<MutationRecord> MutationRecord::create(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value)
|
||||
JS::NonnullGCPtr<MutationRecord> MutationRecord::create(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value)
|
||||
{
|
||||
return realm.heap().allocate<MutationRecord>(realm, realm, type, target, added_nodes, removed_nodes, previous_sibling, next_sibling, attribute_name, attribute_namespace, old_value);
|
||||
}
|
||||
|
||||
MutationRecord::MutationRecord(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value)
|
||||
MutationRecord::MutationRecord(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value)
|
||||
: PlatformObject(realm)
|
||||
, m_type(type)
|
||||
, m_target(JS::make_handle(target))
|
||||
|
|
|
@ -15,11 +15,11 @@ class MutationRecord : public Bindings::PlatformObject {
|
|||
WEB_PLATFORM_OBJECT(MutationRecord, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<MutationRecord> create(JS::Realm&, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value);
|
||||
static JS::NonnullGCPtr<MutationRecord> create(JS::Realm&, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value);
|
||||
|
||||
virtual ~MutationRecord() override;
|
||||
|
||||
FlyString const& type() const { return m_type; }
|
||||
DeprecatedFlyString const& type() const { return m_type; }
|
||||
Node const* target() const { return m_target; }
|
||||
NodeList const* added_nodes() const { return m_added_nodes; }
|
||||
NodeList const* removed_nodes() const { return m_removed_nodes; }
|
||||
|
@ -30,10 +30,10 @@ public:
|
|||
DeprecatedString const& old_value() const { return m_old_value; }
|
||||
|
||||
private:
|
||||
MutationRecord(JS::Realm& realm, FlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value);
|
||||
MutationRecord(JS::Realm& realm, DeprecatedFlyString const& type, Node& target, NodeList& added_nodes, NodeList& removed_nodes, Node* previous_sibling, Node* next_sibling, DeprecatedString const& attribute_name, DeprecatedString const& attribute_namespace, DeprecatedString const& old_value);
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
FlyString m_type;
|
||||
DeprecatedFlyString m_type;
|
||||
JS::GCPtr<Node> m_target;
|
||||
JS::GCPtr<NodeList> m_added_nodes;
|
||||
JS::GCPtr<NodeList> m_removed_nodes;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::DOM::MutationType {
|
||||
|
||||
#define __ENUMERATE_MUTATION_TYPE(name) FlyString name;
|
||||
#define __ENUMERATE_MUTATION_TYPE(name) DeprecatedFlyString name;
|
||||
ENUMERATE_MUTATION_TYPES
|
||||
#undef __ENUMERATE_MUTATION_TYPE
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web::DOM::MutationType {
|
||||
|
||||
|
@ -15,7 +15,7 @@ namespace Web::DOM::MutationType {
|
|||
__ENUMERATE_MUTATION_TYPE(characterData) \
|
||||
__ENUMERATE_MUTATION_TYPE(childList)
|
||||
|
||||
#define __ENUMERATE_MUTATION_TYPE(name) extern FlyString name;
|
||||
#define __ENUMERATE_MUTATION_TYPE(name) extern DeprecatedFlyString name;
|
||||
ENUMERATE_MUTATION_TYPES
|
||||
#undef __ENUMERATE_MUTATION_TYPE
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ JS::Value NamedNodeMap::item_value(size_t index) const
|
|||
return node;
|
||||
}
|
||||
|
||||
JS::Value NamedNodeMap::named_item_value(FlyString const& name) const
|
||||
JS::Value NamedNodeMap::named_item_value(DeprecatedFlyString const& name) const
|
||||
{
|
||||
auto const* node = get_named_item(name);
|
||||
if (!node)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
virtual bool is_supported_property_index(u32 index) const override;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const override;
|
||||
virtual JS::Value item_value(size_t index) const override;
|
||||
virtual JS::Value named_item_value(FlyString const& name) const override;
|
||||
virtual JS::Value named_item_value(DeprecatedFlyString const& name) const override;
|
||||
|
||||
size_t length() const { return m_attributes.size(); }
|
||||
bool is_empty() const { return m_attributes.is_empty(); }
|
||||
|
|
|
@ -126,7 +126,7 @@ const HTML::HTMLElement* Node::enclosing_html_element() const
|
|||
return first_ancestor_of_type<HTML::HTMLElement>();
|
||||
}
|
||||
|
||||
const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const
|
||||
const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(DeprecatedFlyString const& attribute) const
|
||||
{
|
||||
for (auto* node = this; node; node = node->parent()) {
|
||||
if (is<HTML::HTMLElement>(*node) && verify_cast<HTML::HTMLElement>(*node).has_attribute(attribute))
|
||||
|
@ -1375,7 +1375,7 @@ Painting::PaintableBox const* Node::paint_box() const
|
|||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#queue-a-mutation-record
|
||||
void Node::queue_mutation_record(FlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr<NodeList> added_nodes, JS::NonnullGCPtr<NodeList> removed_nodes, Node* previous_sibling, Node* next_sibling)
|
||||
void Node::queue_mutation_record(DeprecatedFlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr<NodeList> added_nodes, JS::NonnullGCPtr<NodeList> removed_nodes, Node* previous_sibling, Node* next_sibling)
|
||||
{
|
||||
// NOTE: We defer garbage collection until the end of the scope, since we can't safely use MutationObserver* as a hashmap key otherwise.
|
||||
// FIXME: This is a total hack.
|
||||
|
|
|
@ -108,7 +108,7 @@ public:
|
|||
JS::NonnullGCPtr<NodeList> child_nodes();
|
||||
Vector<JS::Handle<Node>> children_as_vector() const;
|
||||
|
||||
virtual FlyString node_name() const = 0;
|
||||
virtual DeprecatedFlyString node_name() const = 0;
|
||||
|
||||
DeprecatedString base_uri() const;
|
||||
|
||||
|
@ -126,7 +126,7 @@ public:
|
|||
|
||||
const HTML::HTMLAnchorElement* enclosing_link_element() const;
|
||||
const HTML::HTMLElement* enclosing_html_element() const;
|
||||
const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const;
|
||||
const HTML::HTMLElement* enclosing_html_element_with_attribute(DeprecatedFlyString const&) const;
|
||||
|
||||
DeprecatedString child_text_content() const;
|
||||
|
||||
|
@ -223,7 +223,7 @@ public:
|
|||
|
||||
void add_registered_observer(RegisteredObserver& registered_observer) { m_registered_observer_list.append(registered_observer); }
|
||||
|
||||
void queue_mutation_record(FlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr<NodeList> added_nodes, JS::NonnullGCPtr<NodeList> removed_nodes, Node* previous_sibling, Node* next_sibling);
|
||||
void queue_mutation_record(DeprecatedFlyString const& type, DeprecatedString attribute_name, DeprecatedString attribute_namespace, DeprecatedString old_value, JS::NonnullGCPtr<NodeList> added_nodes, JS::NonnullGCPtr<NodeList> removed_nodes, Node* previous_sibling, Node* next_sibling);
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-shadow-including-descendant
|
||||
template<typename Callback>
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Web::DOM {
|
|||
template<typename NodeType>
|
||||
class NonElementParentNode {
|
||||
public:
|
||||
JS::GCPtr<Element> get_element_by_id(FlyString const& id) const
|
||||
JS::GCPtr<Element> get_element_by_id(DeprecatedFlyString const& id) const
|
||||
{
|
||||
JS::GCPtr<Element> found_element;
|
||||
static_cast<NodeType const*>(this)->template for_each_in_inclusive_subtree_of_type<Element>([&](auto& element) {
|
||||
|
@ -29,7 +29,7 @@ public:
|
|||
});
|
||||
return found_element;
|
||||
}
|
||||
JS::GCPtr<Element> get_element_by_id(FlyString const& id)
|
||||
JS::GCPtr<Element> get_element_by_id(DeprecatedFlyString const& id)
|
||||
{
|
||||
return const_cast<NonElementParentNode const*>(this)->get_element_by_id(id);
|
||||
}
|
||||
|
|
|
@ -103,7 +103,7 @@ JS::NonnullGCPtr<HTMLCollection> ParentNode::children()
|
|||
|
||||
// https://dom.spec.whatwg.org/#concept-getelementsbytagname
|
||||
// NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication.
|
||||
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(FlyString const& qualified_name)
|
||||
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(DeprecatedFlyString const& qualified_name)
|
||||
{
|
||||
// 1. If qualifiedName is "*" (U+002A), return a HTMLCollection rooted at root, whose filter matches only descendant elements.
|
||||
if (qualified_name == "*") {
|
||||
|
@ -132,7 +132,7 @@ JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name(FlyString
|
|||
|
||||
// https://dom.spec.whatwg.org/#concept-getelementsbytagnamens
|
||||
// NOTE: This method is only exposed on Document and Element, but is in ParentNode to prevent code duplication.
|
||||
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name_ns(FlyString const& nullable_namespace, FlyString const& local_name)
|
||||
JS::NonnullGCPtr<HTMLCollection> ParentNode::get_elements_by_tag_name_ns(DeprecatedFlyString const& nullable_namespace, DeprecatedFlyString const& local_name)
|
||||
{
|
||||
// 1. If namespace is the empty string, set it to null.
|
||||
DeprecatedString namespace_ = nullable_namespace;
|
||||
|
|
|
@ -28,8 +28,8 @@ public:
|
|||
|
||||
JS::NonnullGCPtr<HTMLCollection> children();
|
||||
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name(FlyString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name_ns(FlyString const&, FlyString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name(DeprecatedFlyString const&);
|
||||
JS::NonnullGCPtr<HTMLCollection> get_elements_by_tag_name_ns(DeprecatedFlyString const&, DeprecatedFlyString const&);
|
||||
|
||||
WebIDL::ExceptionOr<void> prepend(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes);
|
||||
WebIDL::ExceptionOr<void> append(Vector<Variant<JS::Handle<Node>, DeprecatedString>> const& nodes);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibWeb/DOM/CharacterData.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -17,7 +17,7 @@ class ProcessingInstruction final : public CharacterData {
|
|||
public:
|
||||
virtual ~ProcessingInstruction() override = default;
|
||||
|
||||
virtual FlyString node_name() const override { return m_target; }
|
||||
virtual DeprecatedFlyString node_name() const override { return m_target; }
|
||||
|
||||
DeprecatedString const& target() const { return m_target; }
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ struct ImplTraits : public Traits<QualifiedName::Impl*> {
|
|||
|
||||
static HashTable<QualifiedName::Impl*, ImplTraits> impls;
|
||||
|
||||
static NonnullRefPtr<QualifiedName::Impl> ensure_impl(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_)
|
||||
static NonnullRefPtr<QualifiedName::Impl> ensure_impl(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_)
|
||||
{
|
||||
auto hash = pair_int_hash(local_name.hash(), pair_int_hash(prefix.hash(), namespace_.hash()));
|
||||
auto it = impls.find(hash, [&](QualifiedName::Impl* entry) {
|
||||
|
@ -38,12 +38,12 @@ static NonnullRefPtr<QualifiedName::Impl> ensure_impl(FlyString const& local_nam
|
|||
return adopt_ref(*new QualifiedName::Impl(local_name, prefix, namespace_));
|
||||
}
|
||||
|
||||
QualifiedName::QualifiedName(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_)
|
||||
QualifiedName::QualifiedName(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_)
|
||||
: m_impl(ensure_impl(local_name, prefix, namespace_))
|
||||
{
|
||||
}
|
||||
|
||||
QualifiedName::Impl::Impl(FlyString const& a_local_name, FlyString const& a_prefix, FlyString const& a_namespace)
|
||||
QualifiedName::Impl::Impl(DeprecatedFlyString const& a_local_name, DeprecatedFlyString const& a_prefix, DeprecatedFlyString const& a_namespace)
|
||||
: local_name(a_local_name)
|
||||
, prefix(a_prefix)
|
||||
, namespace_(a_namespace)
|
||||
|
|
|
@ -7,28 +7,28 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
||||
class QualifiedName {
|
||||
public:
|
||||
QualifiedName(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_);
|
||||
QualifiedName(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_);
|
||||
|
||||
FlyString const& local_name() const { return m_impl->local_name; }
|
||||
FlyString const& prefix() const { return m_impl->prefix; }
|
||||
FlyString const& namespace_() const { return m_impl->namespace_; }
|
||||
DeprecatedFlyString const& local_name() const { return m_impl->local_name; }
|
||||
DeprecatedFlyString const& prefix() const { return m_impl->prefix; }
|
||||
DeprecatedFlyString const& namespace_() const { return m_impl->namespace_; }
|
||||
|
||||
DeprecatedString const& as_string() const { return m_impl->as_string; }
|
||||
|
||||
struct Impl : public RefCounted<Impl> {
|
||||
Impl(FlyString const& local_name, FlyString const& prefix, FlyString const& namespace_);
|
||||
Impl(DeprecatedFlyString const& local_name, DeprecatedFlyString const& prefix, DeprecatedFlyString const& namespace_);
|
||||
~Impl();
|
||||
|
||||
void make_internal_string();
|
||||
FlyString local_name;
|
||||
FlyString prefix;
|
||||
FlyString namespace_;
|
||||
DeprecatedFlyString local_name;
|
||||
DeprecatedFlyString prefix;
|
||||
DeprecatedFlyString namespace_;
|
||||
DeprecatedString as_string;
|
||||
};
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
ShadowRoot(Document&, Element&);
|
||||
|
||||
// ^Node
|
||||
virtual FlyString node_name() const override { return "#shadow-root"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; }
|
||||
virtual bool is_shadow_root() const final { return true; }
|
||||
|
||||
// NOTE: The specification doesn't seem to specify a default value for closed. Assuming false for now.
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <LibWeb/DOM/CharacterData.h>
|
||||
|
||||
namespace Web::DOM {
|
||||
|
@ -21,7 +21,7 @@ public:
|
|||
static JS::NonnullGCPtr<Text> construct_impl(JS::Realm& realm, DeprecatedString const& data);
|
||||
|
||||
// ^Node
|
||||
virtual FlyString node_name() const override { return "#text"; }
|
||||
virtual DeprecatedFlyString node_name() const override { return "#text"; }
|
||||
virtual bool is_editable() const override { return m_always_editable || CharacterData::is_editable(); }
|
||||
|
||||
void set_always_editable(bool b) { m_always_editable = b; }
|
||||
|
|
|
@ -41,7 +41,7 @@ WebIDL::ExceptionOr<DeprecatedString> XMLSerializer::serialize_to_string(JS::Non
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-add
|
||||
static void add_prefix_to_namespace_prefix_map(HashMap<FlyString, Vector<DeprecatedString>>& prefix_map, DeprecatedString const& prefix, FlyString const& namespace_)
|
||||
static void add_prefix_to_namespace_prefix_map(HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& prefix_map, DeprecatedString const& prefix, DeprecatedFlyString const& namespace_)
|
||||
{
|
||||
// 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns or if there is no such key, then let candidates list be null.
|
||||
auto candidates_list_iterator = prefix_map.find(namespace_);
|
||||
|
@ -59,7 +59,7 @@ static void add_prefix_to_namespace_prefix_map(HashMap<FlyString, Vector<Depreca
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-retrieving-a-preferred-prefix-string
|
||||
static Optional<DeprecatedString> retrieve_a_preferred_prefix_string(DeprecatedString const& preferred_prefix, HashMap<FlyString, Vector<DeprecatedString>> const& namespace_prefix_map, FlyString const& namespace_)
|
||||
static Optional<DeprecatedString> retrieve_a_preferred_prefix_string(DeprecatedString const& preferred_prefix, HashMap<DeprecatedFlyString, Vector<DeprecatedString>> const& namespace_prefix_map, DeprecatedFlyString const& namespace_)
|
||||
{
|
||||
// 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns or if there is no such key,
|
||||
// then stop running these steps, and return the null value.
|
||||
|
@ -85,7 +85,7 @@ static Optional<DeprecatedString> retrieve_a_preferred_prefix_string(DeprecatedS
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-generating-a-prefix
|
||||
static DeprecatedString generate_a_prefix(HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, FlyString const& new_namespace, u64& prefix_index)
|
||||
static DeprecatedString generate_a_prefix(HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, DeprecatedFlyString const& new_namespace, u64& prefix_index)
|
||||
{
|
||||
// 1. Let generated prefix be the concatenation of the string "ns" and the current numerical value of prefix index.
|
||||
auto generated_prefix = DeprecatedString::formatted("ns{}", prefix_index);
|
||||
|
@ -101,7 +101,7 @@ static DeprecatedString generate_a_prefix(HashMap<FlyString, Vector<DeprecatedSt
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-found
|
||||
static bool prefix_is_in_prefix_map(DeprecatedString const& prefix, HashMap<FlyString, Vector<DeprecatedString>> const& namespace_prefix_map, FlyString const& namespace_)
|
||||
static bool prefix_is_in_prefix_map(DeprecatedString const& prefix, HashMap<DeprecatedFlyString, Vector<DeprecatedString>> const& namespace_prefix_map, DeprecatedFlyString const& namespace_)
|
||||
{
|
||||
// 1. Let candidates list be the result of retrieving a list from map where there exists a key in map that matches the value of ns
|
||||
// or if there is no such key, then stop running these steps, and return false.
|
||||
|
@ -113,7 +113,7 @@ static bool prefix_is_in_prefix_map(DeprecatedString const& prefix, HashMap<FlyS
|
|||
return candidates_list_iterator->value.contains_slow(prefix);
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string_impl(JS::NonnullGCPtr<DOM::Node> root, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string_impl(JS::NonnullGCPtr<DOM::Node> root, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization
|
||||
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string(JS::NonnullGCPtr<DOM::Node> root, RequireWellFormed require_well_formed)
|
||||
|
@ -121,10 +121,10 @@ WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string(JS::NonnullGC
|
|||
// 1. Let namespace be a context namespace with value null. The context namespace tracks the XML serialization algorithm's current default namespace.
|
||||
// The context namespace is changed when either an Element Node has a default namespace declaration, or the algorithm generates a default namespace declaration
|
||||
// for the Element Node to match its own namespace. The algorithm assumes no namespace (null) to start.
|
||||
Optional<FlyString> namespace_;
|
||||
Optional<DeprecatedFlyString> namespace_;
|
||||
|
||||
// 2. Let prefix map be a new namespace prefix map.
|
||||
HashMap<FlyString, Vector<DeprecatedString>> prefix_map;
|
||||
HashMap<DeprecatedFlyString, Vector<DeprecatedString>> prefix_map;
|
||||
|
||||
// 3. Add the XML namespace with prefix value "xml" to prefix map.
|
||||
add_prefix_to_namespace_prefix_map(prefix_map, "xml"sv, Namespace::XML);
|
||||
|
@ -140,16 +140,16 @@ WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string(JS::NonnullGC
|
|||
return serialize_node_to_xml_string_impl(root, namespace_, prefix_map, prefix_index, require_well_formed);
|
||||
}
|
||||
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element const& element, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document(DOM::Document const& document, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element const& element, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document(DOM::Document const& document, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_comment(DOM::Comment const& comment, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_text(DOM::Text const& text, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document_type(DOM::DocumentType const& document_type, RequireWellFormed require_well_formed);
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_processing_instruction(DOM::ProcessingInstruction const& processing_instruction, RequireWellFormed require_well_formed);
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization-algorithm
|
||||
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string_impl(JS::NonnullGCPtr<DOM::Node> root, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string_impl(JS::NonnullGCPtr<DOM::Node> root, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
{
|
||||
// Each of the following algorithms for producing an XML serialization of a DOM node take as input a node to serialize and the following arguments:
|
||||
// - A context namespace namespace
|
||||
|
@ -216,7 +216,7 @@ WebIDL::ExceptionOr<DeprecatedString> serialize_node_to_xml_string_impl(JS::Nonn
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-recording-the-namespace-information
|
||||
static Optional<DeprecatedString> record_namespace_information(DOM::Element const& element, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, HashMap<DeprecatedString, DeprecatedString>& local_prefix_map)
|
||||
static Optional<DeprecatedString> record_namespace_information(DOM::Element const& element, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, HashMap<DeprecatedString, DeprecatedString>& local_prefix_map)
|
||||
{
|
||||
// 1. Let default namespace attr value be null.
|
||||
Optional<DeprecatedString> default_namespace_attribute_value;
|
||||
|
@ -306,7 +306,7 @@ struct LocalNameSetEntry {
|
|||
};
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization-of-the-attributes
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element_attributes(DOM::Element const& element, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, HashMap<DeprecatedString, DeprecatedString> const& local_prefixes_map, bool ignore_namespace_definition_attribute, RequireWellFormed require_well_formed)
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element_attributes(DOM::Element const& element, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, HashMap<DeprecatedString, DeprecatedString> const& local_prefixes_map, bool ignore_namespace_definition_attribute, RequireWellFormed require_well_formed)
|
||||
{
|
||||
auto& realm = element.realm();
|
||||
|
||||
|
@ -459,7 +459,7 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_element_attributes(DOM::E
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element const& element, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element const& element, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
{
|
||||
auto& realm = element.realm();
|
||||
|
||||
|
@ -486,7 +486,7 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element cons
|
|||
bool ignore_namespace_definition_attribute = false;
|
||||
|
||||
// 6. Given prefix map, copy a namespace prefix map and let map be the result.
|
||||
HashMap<FlyString, Vector<DeprecatedString>> map;
|
||||
HashMap<DeprecatedFlyString, Vector<DeprecatedString>> map;
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#dfn-copy-a-namespace-prefix-map
|
||||
// NOTE: This is only used here.
|
||||
|
@ -701,7 +701,7 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_element(DOM::Element cons
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#xml-serializing-a-document-node
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document(DOM::Document const& document, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document(DOM::Document const& document, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
{
|
||||
// If the require well-formed flag is set (its value is true), and this node has no documentElement (the documentElement attribute's value is null),
|
||||
// then throw an exception; the serialization of this node would not be a well-formed document.
|
||||
|
@ -763,7 +763,7 @@ static WebIDL::ExceptionOr<DeprecatedString> serialize_text(DOM::Text const& tex
|
|||
}
|
||||
|
||||
// https://w3c.github.io/DOM-Parsing/#xml-serializing-a-documentfragment-node
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional<FlyString>& namespace_, HashMap<FlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
static WebIDL::ExceptionOr<DeprecatedString> serialize_document_fragment(DOM::DocumentFragment const& document_fragment, Optional<DeprecatedFlyString>& namespace_, HashMap<DeprecatedFlyString, Vector<DeprecatedString>>& namespace_prefix_map, u64& prefix_index, RequireWellFormed require_well_formed)
|
||||
{
|
||||
// 1. Let markup the empty string.
|
||||
StringBuilder markup;
|
||||
|
|
|
@ -92,7 +92,7 @@ void dump_tree(StringBuilder& builder, Layout::Node const& layout_node, bool sho
|
|||
for (size_t i = 0; i < indent; ++i)
|
||||
builder.append(" "sv);
|
||||
|
||||
FlyString tag_name;
|
||||
DeprecatedFlyString tag_name;
|
||||
if (layout_node.is_anonymous())
|
||||
tag_name = "(anonymous)";
|
||||
else if (is<DOM::Element>(layout_node.dom_node()))
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Encoding/TextDecoder.h>
|
||||
|
@ -12,7 +12,7 @@
|
|||
|
||||
namespace Web::Encoding {
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(JS::Realm& realm, FlyString encoding)
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(JS::Realm& realm, DeprecatedFlyString encoding)
|
||||
{
|
||||
auto decoder = TextCodec::decoder_for(encoding);
|
||||
if (!decoder)
|
||||
|
@ -22,7 +22,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> TextDecoder::construct_impl(J
|
|||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textdecoder
|
||||
TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, FlyString encoding, bool fatal, bool ignore_bom)
|
||||
TextDecoder::TextDecoder(JS::Realm& realm, TextCodec::Decoder& decoder, DeprecatedFlyString encoding, bool fatal, bool ignore_bom)
|
||||
: PlatformObject(realm)
|
||||
, m_decoder(decoder)
|
||||
, m_encoding(move(encoding))
|
||||
|
|
|
@ -21,22 +21,22 @@ class TextDecoder : public Bindings::PlatformObject {
|
|||
WEB_PLATFORM_OBJECT(TextDecoder, Bindings::PlatformObject);
|
||||
|
||||
public:
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, FlyString encoding);
|
||||
static WebIDL::ExceptionOr<JS::NonnullGCPtr<TextDecoder>> construct_impl(JS::Realm&, DeprecatedFlyString encoding);
|
||||
|
||||
virtual ~TextDecoder() override;
|
||||
|
||||
WebIDL::ExceptionOr<DeprecatedString> decode(JS::Handle<JS::Object> const&) const;
|
||||
|
||||
FlyString const& encoding() const { return m_encoding; }
|
||||
DeprecatedFlyString const& encoding() const { return m_encoding; }
|
||||
bool fatal() const { return m_fatal; }
|
||||
bool ignore_bom() const { return m_ignore_bom; };
|
||||
|
||||
private:
|
||||
// https://encoding.spec.whatwg.org/#dom-textdecoder
|
||||
TextDecoder(JS::Realm&, TextCodec::Decoder&, FlyString encoding, bool fatal, bool ignore_bom);
|
||||
TextDecoder(JS::Realm&, TextCodec::Decoder&, DeprecatedFlyString encoding, bool fatal, bool ignore_bom);
|
||||
|
||||
TextCodec::Decoder& m_decoder;
|
||||
FlyString m_encoding;
|
||||
DeprecatedFlyString m_encoding;
|
||||
bool m_fatal { false };
|
||||
bool m_ignore_bom { false };
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <LibJS/Runtime/TypedArray.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Encoding/TextEncoder.h>
|
||||
|
@ -44,9 +44,9 @@ JS::Uint8Array* TextEncoder::encode(DeprecatedString const& input) const
|
|||
}
|
||||
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder-encoding
|
||||
FlyString const& TextEncoder::encoding()
|
||||
DeprecatedFlyString const& TextEncoder::encoding()
|
||||
{
|
||||
static FlyString encoding = "utf-8"sv;
|
||||
static DeprecatedFlyString encoding = "utf-8"sv;
|
||||
return encoding;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
|
||||
JS::Uint8Array* encode(DeprecatedString const& input) const;
|
||||
|
||||
static FlyString const& encoding();
|
||||
static DeprecatedFlyString const& encoding();
|
||||
|
||||
protected:
|
||||
// https://encoding.spec.whatwg.org/#dom-textencoder
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
|
||||
struct FontSelector {
|
||||
FlyString family;
|
||||
DeprecatedFlyString family;
|
||||
float point_size { 0 };
|
||||
int weight { 0 };
|
||||
int slope { 0 };
|
||||
|
|
|
@ -10,7 +10,7 @@ namespace Web {
|
|||
namespace HTML {
|
||||
namespace AttributeNames {
|
||||
|
||||
#define __ENUMERATE_HTML_ATTRIBUTE(name) FlyString name;
|
||||
#define __ENUMERATE_HTML_ATTRIBUTE(name) DeprecatedFlyString name;
|
||||
ENUMERATE_HTML_ATTRIBUTES
|
||||
#undef __ENUMERATE_HTML_ATTRIBUTE
|
||||
|
||||
|
@ -41,7 +41,7 @@ ENUMERATE_HTML_ATTRIBUTES
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/#boolean-attribute
|
||||
bool is_boolean_attribute(FlyString const& attribute)
|
||||
bool is_boolean_attribute(DeprecatedFlyString 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".
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web {
|
||||
namespace HTML {
|
||||
|
@ -229,13 +229,13 @@ namespace AttributeNames {
|
|||
__ENUMERATE_HTML_ATTRIBUTE(width) \
|
||||
__ENUMERATE_HTML_ATTRIBUTE(wrap)
|
||||
|
||||
#define __ENUMERATE_HTML_ATTRIBUTE(name) extern FlyString name;
|
||||
#define __ENUMERATE_HTML_ATTRIBUTE(name) extern DeprecatedFlyString name;
|
||||
ENUMERATE_HTML_ATTRIBUTES
|
||||
#undef __ENUMERATE_HTML_ATTRIBUTE
|
||||
|
||||
}
|
||||
|
||||
bool is_boolean_attribute(FlyString const& attribute);
|
||||
bool is_boolean_attribute(DeprecatedFlyString const& attribute);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,17 +9,17 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
CloseEvent* CloseEvent::create(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init)
|
||||
CloseEvent* CloseEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<CloseEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init)
|
||||
CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
CloseEvent::CloseEvent(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init)
|
||||
CloseEvent::CloseEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, CloseEventInit const& event_init)
|
||||
: DOM::Event(realm, event_name, event_init)
|
||||
, m_was_clean(event_init.was_clean)
|
||||
, m_code(event_init.code)
|
||||
|
|
|
@ -21,8 +21,8 @@ class CloseEvent : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(CloseEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static CloseEvent* create(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init = {});
|
||||
static CloseEvent* construct_impl(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init);
|
||||
static CloseEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init = {});
|
||||
static CloseEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init);
|
||||
|
||||
virtual ~CloseEvent() override;
|
||||
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
DeprecatedString reason() const { return m_reason; }
|
||||
|
||||
private:
|
||||
CloseEvent(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init);
|
||||
CloseEvent(JS::Realm&, DeprecatedFlyString const& event_name, CloseEventInit const& event_init);
|
||||
|
||||
bool m_was_clean { false };
|
||||
u16 m_code { 0 };
|
||||
|
|
|
@ -59,7 +59,7 @@ Vector<CrossOriginProperty> cross_origin_properties(Variant<Bindings::LocationOb
|
|||
bool is_cross_origin_accessible_window_property_name(JS::PropertyKey const& property_key)
|
||||
{
|
||||
// A JavaScript property name P is a cross-origin accessible window property name if it is "window", "self", "location", "close", "closed", "focus", "blur", "frames", "length", "top", "opener", "parent", "postMessage", or an array index property name.
|
||||
static Array<FlyString, 13> property_names {
|
||||
static Array<DeprecatedFlyString, 13> property_names {
|
||||
"window"sv, "self"sv, "location"sv, "close"sv, "closed"sv, "focus"sv, "blur"sv, "frames"sv, "length"sv, "top"sv, "opener"sv, "parent"sv, "postMessage"sv
|
||||
};
|
||||
return (property_key.is_string() && any_of(property_names, [&](auto const& name) { return property_key.as_string() == name; })) || property_key.is_number();
|
||||
|
|
|
@ -183,7 +183,7 @@ bool DOMStringMap::delete_existing_named_property(DeprecatedString const& name)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS::Value DOMStringMap::named_item_value(FlyString const& name) const
|
||||
JS::Value DOMStringMap::named_item_value(DeprecatedFlyString const& name) const
|
||||
{
|
||||
return JS::PrimitiveString::create(vm(), determine_value_of_named_property(name));
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ private:
|
|||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^LegacyPlatformObject
|
||||
virtual JS::Value named_item_value(FlyString const&) const override;
|
||||
virtual JS::Value named_item_value(DeprecatedFlyString const&) const override;
|
||||
virtual Vector<DeprecatedString> supported_property_names() const override;
|
||||
|
||||
struct NameValuePair {
|
||||
|
|
|
@ -9,17 +9,17 @@
|
|||
|
||||
namespace Web::HTML {
|
||||
|
||||
ErrorEvent* ErrorEvent::create(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init)
|
||||
ErrorEvent* ErrorEvent::create(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init)
|
||||
{
|
||||
return realm.heap().allocate<ErrorEvent>(realm, realm, event_name, event_init);
|
||||
}
|
||||
|
||||
ErrorEvent* ErrorEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init)
|
||||
ErrorEvent* ErrorEvent::construct_impl(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init)
|
||||
{
|
||||
return create(realm, event_name, event_init);
|
||||
}
|
||||
|
||||
ErrorEvent::ErrorEvent(JS::Realm& realm, FlyString const& event_name, ErrorEventInit const& event_init)
|
||||
ErrorEvent::ErrorEvent(JS::Realm& realm, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init)
|
||||
: DOM::Event(realm, event_name)
|
||||
, m_message(event_init.message)
|
||||
, m_filename(event_init.filename)
|
||||
|
|
|
@ -24,8 +24,8 @@ class ErrorEvent final : public DOM::Event {
|
|||
WEB_PLATFORM_OBJECT(ErrorEvent, DOM::Event);
|
||||
|
||||
public:
|
||||
static ErrorEvent* create(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init = {});
|
||||
static ErrorEvent* construct_impl(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init);
|
||||
static ErrorEvent* create(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init = {});
|
||||
static ErrorEvent* construct_impl(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init);
|
||||
|
||||
virtual ~ErrorEvent() override;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
JS::Value error() const { return m_error; }
|
||||
|
||||
private:
|
||||
ErrorEvent(JS::Realm&, FlyString const& event_name, ErrorEventInit const& event_init);
|
||||
ErrorEvent(JS::Realm&, DeprecatedFlyString const& event_name, ErrorEventInit const& event_init);
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web::HTML::EventNames {
|
||||
|
||||
#define __ENUMERATE_HTML_EVENT(name) FlyString name;
|
||||
#define __ENUMERATE_HTML_EVENT(name) DeprecatedFlyString name;
|
||||
ENUMERATE_HTML_EVENTS
|
||||
#undef __ENUMERATE_HTML_EVENT
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/FlyString.h>
|
||||
#include <AK/DeprecatedFlyString.h>
|
||||
|
||||
namespace Web::HTML::EventNames {
|
||||
|
||||
|
@ -60,7 +60,7 @@ namespace Web::HTML::EventNames {
|
|||
__ENUMERATE_HTML_EVENT(unload) \
|
||||
__ENUMERATE_HTML_EVENT(visibilitychange)
|
||||
|
||||
#define __ENUMERATE_HTML_EVENT(name) extern FlyString name;
|
||||
#define __ENUMERATE_HTML_EVENT(name) extern DeprecatedFlyString name;
|
||||
ENUMERATE_HTML_EVENTS
|
||||
#undef __ENUMERATE_HTML_EVENT
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ public:
|
|||
#undef __ENUMERATE
|
||||
|
||||
protected:
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) = 0;
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) = 0;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ HTMLAnchorElement::HTMLAnchorElement(DOM::Document& document, DOM::QualifiedName
|
|||
|
||||
HTMLAnchorElement::~HTMLAnchorElement() = default;
|
||||
|
||||
void HTMLAnchorElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void HTMLAnchorElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
HTMLElement::parse_attribute(name, value);
|
||||
if (name == HTML::AttributeNames::href) {
|
||||
|
@ -85,7 +85,7 @@ i32 HTMLAnchorElement::default_tab_index_value() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
FlyString HTMLAnchorElement::default_role() const
|
||||
DeprecatedFlyString HTMLAnchorElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-a-no-href
|
||||
if (!href().is_null())
|
||||
|
|
|
@ -35,7 +35,7 @@ private:
|
|||
void run_activation_behavior(Web::DOM::Event const&);
|
||||
|
||||
// ^DOM::Element
|
||||
virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual i32 default_tab_index_value() const override;
|
||||
|
||||
// ^HTML::HTMLHyperlinkElementUtils
|
||||
|
@ -51,7 +51,7 @@ private:
|
|||
queue_an_element_task(source, move(steps));
|
||||
}
|
||||
|
||||
virtual FlyString default_role() const override;
|
||||
virtual DeprecatedFlyString default_role() const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ HTMLAreaElement::HTMLAreaElement(DOM::Document& document, DOM::QualifiedName qua
|
|||
|
||||
HTMLAreaElement::~HTMLAreaElement() = default;
|
||||
|
||||
void HTMLAreaElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void HTMLAreaElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
HTMLElement::parse_attribute(name, value);
|
||||
if (name == HTML::AttributeNames::href) {
|
||||
|
@ -43,7 +43,7 @@ i32 HTMLAreaElement::default_tab_index_value() const
|
|||
return 0;
|
||||
}
|
||||
|
||||
FlyString HTMLAreaElement::default_role() const
|
||||
DeprecatedFlyString HTMLAreaElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-area-no-href
|
||||
if (!href().is_null())
|
||||
|
|
|
@ -24,7 +24,7 @@ private:
|
|||
HTMLAreaElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
// ^DOM::Element
|
||||
virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
virtual i32 default_tab_index_value() const override;
|
||||
|
||||
// ^HTML::HTMLHyperlinkElementUtils
|
||||
|
@ -40,7 +40,7 @@ private:
|
|||
queue_an_element_task(source, move(steps));
|
||||
}
|
||||
|
||||
virtual FlyString default_role() const override;
|
||||
virtual DeprecatedFlyString default_role() const override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ void HTMLBaseElement::removed_from(Node* parent)
|
|||
document().update_base_element({});
|
||||
}
|
||||
|
||||
void HTMLBaseElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void HTMLBaseElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
HTMLElement::parse_attribute(name, value);
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
virtual void inserted() override;
|
||||
virtual void removed_from(Node*) override;
|
||||
virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
private:
|
||||
HTMLBaseElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -38,7 +38,7 @@ void HTMLBodyElement::apply_presentational_hints(CSS::StyleProperties& style) co
|
|||
});
|
||||
}
|
||||
|
||||
void HTMLBodyElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void HTMLBodyElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
HTMLElement::parse_attribute(name, value);
|
||||
if (name.equals_ignoring_case("link"sv)) {
|
||||
|
@ -71,7 +71,7 @@ void HTMLBodyElement::parse_attribute(FlyString const& name, DeprecatedString co
|
|||
#undef __ENUMERATE
|
||||
}
|
||||
|
||||
DOM::EventTarget& HTMLBodyElement::global_event_handlers_to_event_target(FlyString const& event_name)
|
||||
DOM::EventTarget& HTMLBodyElement::global_event_handlers_to_event_target(DeprecatedFlyString const& event_name)
|
||||
{
|
||||
// NOTE: This is a little weird, but IIUC document.body.onload actually refers to window.onload
|
||||
// NOTE: document.body can return either a HTMLBodyElement or HTMLFrameSetElement, so both these elements must support this mapping.
|
||||
|
|
|
@ -20,17 +20,17 @@ class HTMLBodyElement final
|
|||
public:
|
||||
virtual ~HTMLBodyElement() override;
|
||||
|
||||
virtual void parse_attribute(FlyString const&, DeprecatedString const&) override;
|
||||
virtual void parse_attribute(DeprecatedFlyString const&, DeprecatedString const&) override;
|
||||
virtual void apply_presentational_hints(CSS::StyleProperties&) const override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-body
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; };
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; };
|
||||
|
||||
private:
|
||||
HTMLBodyElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual EventTarget& global_event_handlers_to_event_target(FlyString const& event_name) override;
|
||||
virtual EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const& event_name) override;
|
||||
|
||||
// ^HTML::WindowEventHandlers
|
||||
virtual EventTarget& window_event_handlers_to_event_target() override;
|
||||
|
|
|
@ -55,7 +55,7 @@ public:
|
|||
virtual bool is_labelable() const override { return true; }
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-button
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::button; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::button; }
|
||||
|
||||
private:
|
||||
HTMLButtonElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual ~HTMLDataElement() override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-data
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; }
|
||||
|
||||
private:
|
||||
HTMLDataElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -17,7 +17,7 @@ class HTMLDataListElement final : public HTMLElement {
|
|||
public:
|
||||
virtual ~HTMLDataListElement() override;
|
||||
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::listbox; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::listbox; }
|
||||
|
||||
private:
|
||||
HTMLDataListElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual ~HTMLDetailsElement() override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-details
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::group; };
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::group; };
|
||||
|
||||
private:
|
||||
HTMLDetailsElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual ~HTMLDialogElement() override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-dialog
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::dialog; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::dialog; }
|
||||
|
||||
private:
|
||||
HTMLDialogElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -18,7 +18,7 @@ public:
|
|||
virtual ~HTMLDivElement() override;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-div
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::generic; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::generic; }
|
||||
|
||||
private:
|
||||
HTMLDivElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -232,7 +232,7 @@ bool HTMLElement::cannot_navigate() const
|
|||
return !is<HTML::HTMLAnchorElement>(this) && !is_connected();
|
||||
}
|
||||
|
||||
void HTMLElement::parse_attribute(FlyString const& name, DeprecatedString const& value)
|
||||
void HTMLElement::parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value)
|
||||
{
|
||||
Element::parse_attribute(name, value);
|
||||
|
||||
|
@ -270,7 +270,7 @@ void HTMLElement::focus()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-pointer-event
|
||||
bool HTMLElement::fire_a_synthetic_pointer_event(FlyString const& type, DOM::Element& target, bool not_trusted)
|
||||
bool HTMLElement::fire_a_synthetic_pointer_event(DeprecatedFlyString const& type, DOM::Element& target, bool not_trusted)
|
||||
{
|
||||
// 1. Let event be the result of creating an event using PointerEvent.
|
||||
// 2. Initialize event's type attribute to e.
|
||||
|
@ -328,7 +328,7 @@ void HTMLElement::blur()
|
|||
// User agents may selectively or uniformly ignore calls to this method for usability reasons.
|
||||
}
|
||||
|
||||
FlyString HTMLElement::default_role() const
|
||||
DeprecatedFlyString HTMLElement::default_role() const
|
||||
{
|
||||
// https://www.w3.org/TR/html-aria/#el-article
|
||||
if (local_name() == TagNames::article)
|
||||
|
|
|
@ -54,19 +54,19 @@ public:
|
|||
|
||||
void blur();
|
||||
|
||||
bool fire_a_synthetic_pointer_event(FlyString const& type, DOM::Element& target, bool not_trusted);
|
||||
bool fire_a_synthetic_pointer_event(DeprecatedFlyString const& type, DOM::Element& target, bool not_trusted);
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/forms.html#category-label
|
||||
virtual bool is_labelable() const { return false; }
|
||||
|
||||
virtual FlyString default_role() const override;
|
||||
virtual DeprecatedFlyString default_role() const override;
|
||||
|
||||
protected:
|
||||
HTMLElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual void parse_attribute(FlyString const& name, DeprecatedString const& value) override;
|
||||
virtual void parse_attribute(DeprecatedFlyString const& name, DeprecatedString const& value) override;
|
||||
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
|
@ -74,7 +74,7 @@ private:
|
|||
virtual bool is_html_element() const final { return true; }
|
||||
|
||||
// ^HTML::GlobalEventHandlers
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(FlyString const&) override { return *this; }
|
||||
virtual DOM::EventTarget& global_event_handlers_to_event_target(DeprecatedFlyString const&) override { return *this; }
|
||||
|
||||
enum class ContentEditableState {
|
||||
True,
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
// https://html.spec.whatwg.org/multipage/forms.html#category-autocapitalize
|
||||
virtual bool is_auto_capitalize_inheriting() const override { return true; }
|
||||
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::group; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::group; }
|
||||
|
||||
private:
|
||||
HTMLFieldSetElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
|
@ -38,7 +38,7 @@ public:
|
|||
unsigned length() const;
|
||||
|
||||
// https://www.w3.org/TR/html-aria/#el-form
|
||||
virtual FlyString default_role() const override { return DOM::ARIARoleNames::form; }
|
||||
virtual DeprecatedFlyString default_role() const override { return DOM::ARIARoleNames::form; }
|
||||
|
||||
private:
|
||||
HTMLFormElement(DOM::Document&, DOM::QualifiedName);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue