mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:17:44 +00:00
LibJS: Make Cell::initialize() return void
Stop worrying about tiny OOMs. Work towards #20405
This commit is contained in:
parent
fde26c53f0
commit
18c54d8d40
804 changed files with 1330 additions and 2171 deletions
|
@ -19,15 +19,13 @@ AudioConstructor::AudioConstructor(JS::Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> AudioConstructor::initialize(JS::Realm& realm)
|
||||
void AudioConstructor::initialize(JS::Realm& realm)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
|
||||
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLAudioElementPrototype>(realm, "HTMLAudioElement"), 0);
|
||||
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<JS::Value> AudioConstructor::call()
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::Bindings {
|
|||
class AudioConstructor final : public JS::NativeFunction {
|
||||
public:
|
||||
explicit AudioConstructor(JS::Realm&);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~AudioConstructor() override = default;
|
||||
|
||||
virtual JS::ThrowCompletionOr<JS::Value> call() override;
|
||||
|
|
|
@ -19,15 +19,13 @@ ImageConstructor::ImageConstructor(JS::Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> ImageConstructor::initialize(JS::Realm& realm)
|
||||
void ImageConstructor::initialize(JS::Realm& realm)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
Base::initialize(realm);
|
||||
|
||||
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
|
||||
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLImageElementPrototype>(realm, "HTMLImageElement"), 0);
|
||||
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<JS::Value> ImageConstructor::call()
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::Bindings {
|
|||
class ImageConstructor final : public JS::NativeFunction {
|
||||
public:
|
||||
explicit ImageConstructor(JS::Realm&);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~ImageConstructor() override = default;
|
||||
|
||||
virtual JS::ThrowCompletionOr<JS::Value> call() override;
|
||||
|
|
|
@ -21,15 +21,13 @@ OptionConstructor::OptionConstructor(JS::Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> OptionConstructor::initialize(JS::Realm& realm)
|
||||
void OptionConstructor::initialize(JS::Realm& realm)
|
||||
{
|
||||
auto& vm = this->vm();
|
||||
Base::initialize(realm);
|
||||
|
||||
MUST_OR_THROW_OOM(NativeFunction::initialize(realm));
|
||||
define_direct_property(vm.names.prototype, &ensure_web_prototype<Bindings::HTMLOptionElementPrototype>(realm, "HTMLOptionElement"), 0);
|
||||
define_direct_property(vm.names.length, JS::Value(0), JS::Attribute::Configurable);
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<JS::Value> OptionConstructor::call()
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace Web::Bindings {
|
|||
class OptionConstructor final : public JS::NativeFunction {
|
||||
public:
|
||||
explicit OptionConstructor(JS::Realm&);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual ~OptionConstructor() override = default;
|
||||
|
||||
virtual JS::ThrowCompletionOr<JS::Value> call() override;
|
||||
|
|
|
@ -28,12 +28,10 @@ void CSSConditionRule::for_each_effective_keyframes_at_rule(Function<void(CSSKey
|
|||
CSSGroupingRule::for_each_effective_keyframes_at_rule(callback);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSConditionRule::initialize(JS::Realm& realm)
|
||||
void CSSConditionRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSConditionRulePrototype>(realm, "CSSConditionRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
protected:
|
||||
CSSConditionRule(JS::Realm&, CSSRuleList&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -25,12 +25,10 @@ CSSFontFaceRule::CSSFontFaceRule(JS::Realm& realm, FontFace&& font_face)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSFontFaceRule::initialize(JS::Realm& realm)
|
||||
void CSSFontFaceRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSFontFaceRulePrototype>(realm, "CSSFontFaceRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
CSSStyleDeclaration* CSSFontFaceRule::style()
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
private:
|
||||
CSSFontFaceRule(JS::Realm&, FontFace&&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
FontFace m_font_face;
|
||||
|
|
|
@ -22,12 +22,10 @@ CSSGroupingRule::CSSGroupingRule(JS::Realm& realm, CSSRuleList& rules)
|
|||
rule->set_parent_rule(this);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSGroupingRule::initialize(JS::Realm& realm)
|
||||
void CSSGroupingRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSGroupingRulePrototype>(realm, "CSSGroupingRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSGroupingRule::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
protected:
|
||||
CSSGroupingRule(JS::Realm&, CSSRuleList&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -40,12 +40,10 @@ CSSImportRule::CSSImportRule(AK::URL url, DOM::Document& document)
|
|||
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSImportRule::initialize(JS::Realm& realm)
|
||||
void CSSImportRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSImportRulePrototype>(realm, "CSSImportRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSImportRule::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
private:
|
||||
CSSImportRule(AK::URL, DOM::Document&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
|
|
@ -22,11 +22,10 @@ void CSSKeyframeRule::visit_edges(Visitor& visitor)
|
|||
visitor.visit(m_declarations);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSKeyframeRule::initialize(JS::Realm& realm)
|
||||
void CSSKeyframeRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSKeyframeRulePrototype>(realm, "CSSKeyframeRule"));
|
||||
return {};
|
||||
}
|
||||
|
||||
DeprecatedString CSSKeyframeRule::serialized() const
|
||||
|
|
|
@ -48,7 +48,7 @@ private:
|
|||
}
|
||||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
CSS::Percentage m_key;
|
||||
|
|
|
@ -22,12 +22,10 @@ void CSSKeyframesRule::visit_edges(Visitor& visitor)
|
|||
visitor.visit(keyframe);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSKeyframesRule::initialize(JS::Realm& realm)
|
||||
void CSSKeyframesRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSKeyframesRulePrototype>(realm, "CSSKeyframesRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
DeprecatedString CSSKeyframesRule::serialized() const
|
||||
|
|
|
@ -46,7 +46,7 @@ private:
|
|||
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
FlyString m_name;
|
||||
|
|
|
@ -23,12 +23,10 @@ CSSMediaRule::CSSMediaRule(JS::Realm& realm, MediaList& media, CSSRuleList& rule
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSMediaRule::initialize(JS::Realm& realm)
|
||||
void CSSMediaRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSMediaRulePrototype>(realm, "CSSMediaRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSMediaRule::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
private:
|
||||
CSSMediaRule(JS::Realm&, MediaList&, CSSRuleList&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
|
|
|
@ -25,12 +25,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSNamespaceRule>> CSSNamespaceRule::create
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<CSSNamespaceRule>(realm, realm, prefix, namespace_uri));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSNamespaceRule::initialize(JS::Realm& realm)
|
||||
void CSSNamespaceRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSNamespaceRulePrototype>(realm, "CSSNamespaceRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-rule
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
private:
|
||||
CSSNamespaceRule(JS::Realm&, Optional<StringView> prefix, StringView namespace_uri);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual DeprecatedString serialized() const override;
|
||||
DeprecatedString m_namespace_uri;
|
||||
|
|
|
@ -36,12 +36,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<CSSRuleList>> CSSRuleList::create_empty(JS:
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<CSSRuleList>(realm, realm));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSRuleList::initialize(JS::Realm& realm)
|
||||
void CSSRuleList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSRuleListPrototype>(realm, "CSSRuleList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSRuleList::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -66,7 +66,7 @@ public:
|
|||
private:
|
||||
explicit CSSRuleList(JS::Realm&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
|
|
|
@ -20,11 +20,10 @@ CSSStyleDeclaration::CSSStyleDeclaration(JS::Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSStyleDeclaration::initialize(JS::Realm& realm)
|
||||
void CSSStyleDeclaration::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSStyleDeclarationPrototype>(realm, "CSSStyleDeclaration"));
|
||||
return {};
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::NonnullGCPtr<PropertyOwningCSSStyleDeclaration>> PropertyOwningCSSStyleDeclaration::create(JS::Realm& realm, Vector<StyleProperty> properties, HashMap<DeprecatedString, StyleProperty> custom_properties)
|
||||
|
|
|
@ -19,7 +19,7 @@ class CSSStyleDeclaration : public Bindings::PlatformObject {
|
|||
|
||||
public:
|
||||
virtual ~CSSStyleDeclaration() = default;
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual size_t length() const = 0;
|
||||
virtual DeprecatedString item(size_t index) const = 0;
|
||||
|
|
|
@ -24,12 +24,10 @@ CSSStyleRule::CSSStyleRule(JS::Realm& realm, Vector<NonnullRefPtr<Selector>>&& s
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSStyleRule::initialize(JS::Realm& realm)
|
||||
void CSSStyleRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSStyleRulePrototype>(realm, "CSSStyleRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSStyleRule::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
private:
|
||||
CSSStyleRule(JS::Realm&, Vector<NonnullRefPtr<Selector>>&&, CSSStyleDeclaration&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
|
|
|
@ -37,12 +37,10 @@ CSSStyleSheet::CSSStyleSheet(JS::Realm& realm, CSSRuleList& rules, MediaList& me
|
|||
};
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSStyleSheet::initialize(JS::Realm& realm)
|
||||
void CSSStyleSheet::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSStyleSheetPrototype>(realm, "CSSStyleSheet"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CSSStyleSheet::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -54,7 +54,7 @@ public:
|
|||
private:
|
||||
CSSStyleSheet(JS::Realm&, CSSRuleList&, MediaList&, Optional<AK::URL> location);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
void recalculate_namespaces();
|
||||
|
|
|
@ -22,12 +22,10 @@ CSSSupportsRule::CSSSupportsRule(JS::Realm& realm, NonnullRefPtr<Supports>&& sup
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CSSSupportsRule::initialize(JS::Realm& realm)
|
||||
void CSSSupportsRule::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CSSSupportsRulePrototype>(realm, "CSSSupportsRule"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
DeprecatedString CSSSupportsRule::condition_text() const
|
||||
|
|
|
@ -32,7 +32,7 @@ public:
|
|||
private:
|
||||
CSSSupportsRule(JS::Realm&, NonnullRefPtr<Supports>&&, CSSRuleList&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual DeprecatedString serialized() const override;
|
||||
|
||||
NonnullRefPtr<Supports> m_supports;
|
||||
|
|
|
@ -24,12 +24,10 @@ MediaList::MediaList(JS::Realm& realm, Vector<NonnullRefPtr<MediaQuery>>&& media
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> MediaList::initialize(JS::Realm& realm)
|
||||
void MediaList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MediaListPrototype>(realm, "MediaList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom-1/#dom-medialist-mediatext
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
private:
|
||||
MediaList(JS::Realm&, Vector<NonnullRefPtr<MediaQuery>>&&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
virtual bool supports_indexed_properties() const override { return true; }
|
||||
|
|
|
@ -28,12 +28,10 @@ MediaQueryList::MediaQueryList(DOM::Document& document, Vector<NonnullRefPtr<Med
|
|||
evaluate();
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> MediaQueryList::initialize(JS::Realm& realm)
|
||||
void MediaQueryList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MediaQueryListPrototype>(realm, "MediaQueryList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void MediaQueryList::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
private:
|
||||
MediaQueryList(DOM::Document&, Vector<NonnullRefPtr<MediaQuery>>&&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<DOM::Document> m_document;
|
||||
|
|
|
@ -24,12 +24,10 @@ MediaQueryListEvent::MediaQueryListEvent(JS::Realm& realm, FlyString const& even
|
|||
|
||||
MediaQueryListEvent::~MediaQueryListEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> MediaQueryListEvent::initialize(JS::Realm& realm)
|
||||
void MediaQueryListEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MediaQueryListEventPrototype>(realm, "MediaQueryListEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
private:
|
||||
MediaQueryListEvent(JS::Realm&, FlyString const& event_name, MediaQueryListEventInit const& event_init);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
String m_media;
|
||||
bool m_matches;
|
||||
|
|
|
@ -24,12 +24,10 @@ Screen::Screen(HTML::Window& window)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Screen::initialize(JS::Realm& realm)
|
||||
void Screen::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ScreenPrototype>(realm, "Screen"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Screen::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
private:
|
||||
explicit Screen(HTML::Window&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
HTML::Window const& window() const { return *m_window; }
|
||||
|
|
|
@ -74,12 +74,10 @@ StyleSheetList::StyleSheetList(DOM::Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> StyleSheetList::initialize(JS::Realm& realm)
|
||||
void StyleSheetList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::StyleSheetListPrototype>(realm, "StyleSheetList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void StyleSheetList::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
private:
|
||||
explicit StyleSheetList(DOM::Document&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
|
|
|
@ -26,12 +26,10 @@ VisualViewport::VisualViewport(DOM::Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> VisualViewport::initialize(JS::Realm& realm)
|
||||
void VisualViewport::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::VisualViewportPrototype>(realm, "VisualViewport"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void VisualViewport::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -40,7 +40,7 @@ public:
|
|||
private:
|
||||
explicit VisualViewport(DOM::Document&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<DOM::Document> m_document;
|
||||
|
|
|
@ -27,15 +27,11 @@ Crypto::Crypto(JS::Realm& realm)
|
|||
|
||||
Crypto::~Crypto() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> Crypto::initialize(JS::Realm& realm)
|
||||
void Crypto::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CryptoPrototype>(realm, "Crypto"));
|
||||
m_subtle = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() {
|
||||
return SubtleCrypto::create(realm);
|
||||
}));
|
||||
|
||||
return {};
|
||||
m_subtle = MUST(SubtleCrypto::create(realm));
|
||||
}
|
||||
|
||||
JS::NonnullGCPtr<SubtleCrypto> Crypto::subtle() const
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
WebIDL::ExceptionOr<String> random_uuid() const;
|
||||
|
||||
protected:
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -26,12 +26,10 @@ SubtleCrypto::SubtleCrypto(JS::Realm& realm)
|
|||
|
||||
SubtleCrypto::~SubtleCrypto() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> SubtleCrypto::initialize(JS::Realm& realm)
|
||||
void SubtleCrypto::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::SubtleCryptoPrototype>(realm, "SubtleCrypto"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://w3c.github.io/webcrypto/#dfn-SubtleCrypto-method-digest
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
private:
|
||||
explicit SubtleCrypto(JS::Realm&);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -25,12 +25,10 @@ AbortController::AbortController(JS::Realm& realm, JS::NonnullGCPtr<AbortSignal>
|
|||
|
||||
AbortController::~AbortController() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> AbortController::initialize(JS::Realm& realm)
|
||||
void AbortController::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::AbortControllerPrototype>(realm, "AbortController"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void AbortController::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -28,7 +28,7 @@ public:
|
|||
private:
|
||||
AbortController(JS::Realm&, JS::NonnullGCPtr<AbortSignal>);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// https://dom.spec.whatwg.org/#abortcontroller-signal
|
||||
|
|
|
@ -22,12 +22,10 @@ AbortSignal::AbortSignal(JS::Realm& realm)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> AbortSignal::initialize(JS::Realm& realm)
|
||||
void AbortSignal::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::AbortSignalPrototype>(realm, "AbortSignal"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#abortsignal-add
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
private:
|
||||
explicit AbortSignal(JS::Realm&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
// https://dom.spec.whatwg.org/#abortsignal-abort-reason
|
||||
|
|
|
@ -21,12 +21,10 @@ AbstractRange::AbstractRange(Node& start_container, u32 start_offset, Node& end_
|
|||
|
||||
AbstractRange::~AbstractRange() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> AbstractRange::initialize(JS::Realm& realm)
|
||||
void AbstractRange::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::AbstractRangePrototype>(realm, "AbstractRange"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void AbstractRange::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
protected:
|
||||
AbstractRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
JS::NonnullGCPtr<Node> m_start_container;
|
||||
|
|
|
@ -38,12 +38,10 @@ Attr::Attr(Document& document, QualifiedName qualified_name, DeprecatedString va
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Attr::initialize(JS::Realm& realm)
|
||||
void Attr::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::AttrPrototype>(realm, "Attr"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Attr::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
private:
|
||||
Attr(Document&, QualifiedName, DeprecatedString value, Element*);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
QualifiedName m_qualified_name;
|
||||
|
|
|
@ -16,12 +16,10 @@ CDATASection::CDATASection(Document& document, DeprecatedString const& data)
|
|||
|
||||
CDATASection::~CDATASection() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> CDATASection::initialize(JS::Realm& realm)
|
||||
void CDATASection::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CDATASectionPrototype>(realm, "CDATASection"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
CDATASection(Document&, DeprecatedString const&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -19,12 +19,10 @@ CharacterData::CharacterData(Document& document, NodeType type, DeprecatedString
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> CharacterData::initialize(JS::Realm& realm)
|
||||
void CharacterData::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CharacterDataPrototype>(realm, "CharacterData"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-characterdata-data
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
protected:
|
||||
CharacterData(Document&, NodeType, DeprecatedString const&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
private:
|
||||
DeprecatedString m_data;
|
||||
|
|
|
@ -23,12 +23,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Comment>> Comment::construct_impl(JS::Realm
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<Comment>(realm, window.associated_document(), data));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Comment::initialize(JS::Realm& realm)
|
||||
void Comment::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CommentPrototype>(realm, "Comment"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
private:
|
||||
Comment(Document&, DeprecatedString const&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
template<>
|
||||
|
|
|
@ -29,12 +29,10 @@ CustomEvent::CustomEvent(JS::Realm& realm, FlyString const& event_name, CustomEv
|
|||
|
||||
CustomEvent::~CustomEvent() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> CustomEvent::initialize(JS::Realm& realm)
|
||||
void CustomEvent::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::CustomEventPrototype>(realm, "CustomEvent"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void CustomEvent::visit_edges(JS::Cell::Visitor& visitor)
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
// https://dom.spec.whatwg.org/#dom-customevent-detail
|
||||
JS::Value detail() const { return m_detail; }
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
|
||||
void init_custom_event(String const& type, bool bubbles, bool cancelable, JS::Value detail);
|
||||
|
|
|
@ -31,12 +31,10 @@ DOMImplementation::DOMImplementation(Document& document)
|
|||
|
||||
DOMImplementation::~DOMImplementation() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> DOMImplementation::initialize(JS::Realm& realm)
|
||||
void DOMImplementation::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::DOMImplementationPrototype>(realm, "DOMImplementation"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void DOMImplementation::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -30,7 +30,7 @@ public:
|
|||
private:
|
||||
explicit DOMImplementation(Document&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Document& document() { return m_document; }
|
||||
|
|
|
@ -68,12 +68,10 @@ DOMTokenList::DOMTokenList(Element& associated_element, DeprecatedFlyString asso
|
|||
associated_attribute_changed(value);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> DOMTokenList::initialize(JS::Realm& realm)
|
||||
void DOMTokenList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::DOMTokenListPrototype>(realm, "DOMTokenList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void DOMTokenList::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
private:
|
||||
DOMTokenList(Element& associated_element, DeprecatedFlyString associated_attribute);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
|
|
|
@ -336,16 +336,14 @@ Document::~Document()
|
|||
HTML::main_thread_event_loop().unregister_document({}, *this);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Document::initialize(JS::Realm& realm)
|
||||
void Document::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::DocumentPrototype>(realm, "Document"));
|
||||
|
||||
m_selection = MUST_OR_THROW_OOM(heap().allocate<Selection::Selection>(realm, realm, *this));
|
||||
m_selection = MUST(heap().allocate<Selection::Selection>(realm, realm, *this));
|
||||
|
||||
m_list_of_available_images = TRY_OR_THROW_OOM(realm.vm(), try_make<HTML::ListOfAvailableImages>());
|
||||
|
||||
return {};
|
||||
m_list_of_available_images = make<HTML::ListOfAvailableImages>();
|
||||
}
|
||||
|
||||
void Document::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -500,7 +500,7 @@ public:
|
|||
void shared_declarative_refresh_steps(StringView input, JS::GCPtr<HTML::HTMLMetaElement const> meta_element = nullptr);
|
||||
|
||||
protected:
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Document(JS::Realm&, AK::URL const&);
|
||||
|
|
|
@ -14,12 +14,10 @@ DocumentFragment::DocumentFragment(Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> DocumentFragment::initialize(JS::Realm& realm)
|
||||
void DocumentFragment::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::DocumentFragmentPrototype>(realm, "DocumentFragment"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void DocumentFragment::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
protected:
|
||||
explicit DocumentFragment(Document& document);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,12 +19,10 @@ DocumentType::DocumentType(Document& document)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> DocumentType::initialize(JS::Realm& realm)
|
||||
void DocumentType::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::DocumentTypePrototype>(realm, "DocumentType"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
private:
|
||||
explicit DocumentType(Document&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
DeprecatedString m_name;
|
||||
DeprecatedString m_public_id;
|
||||
|
|
|
@ -70,16 +70,12 @@ Element::Element(Document& document, DOM::QualifiedName qualified_name)
|
|||
|
||||
Element::~Element() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> Element::initialize(JS::Realm& realm)
|
||||
void Element::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ElementPrototype>(realm, "Element"));
|
||||
|
||||
m_attributes = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() {
|
||||
return NamedNodeMap::create(*this);
|
||||
}));
|
||||
|
||||
return {};
|
||||
m_attributes = MUST(NamedNodeMap::create(*this));
|
||||
}
|
||||
|
||||
void Element::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -324,7 +324,7 @@ public:
|
|||
|
||||
protected:
|
||||
Element(Document&, DOM::QualifiedName);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
virtual void children_changed() override;
|
||||
virtual i32 default_tab_index_value() const;
|
||||
|
|
|
@ -41,12 +41,10 @@ Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_ini
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Event::initialize(JS::Realm& realm)
|
||||
void Event::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::EventPrototype>(realm, "Event"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Event::visit_edges(Visitor& visitor)
|
||||
|
|
|
@ -146,7 +146,7 @@ public:
|
|||
protected:
|
||||
void initialize_event(String const&, bool, bool);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -52,16 +52,14 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<EventTarget>> EventTarget::construct_impl(J
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<EventTarget>(realm, realm));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> EventTarget::initialize(JS::Realm& realm)
|
||||
void EventTarget::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
|
||||
// FIXME: We can't do this for HTML::Window currently, as this will run when creating the initial global object.
|
||||
// During this time, the ESO is not setup, so it will cause a nullptr dereference in host_defined_intrinsics.
|
||||
if (!is<HTML::Window>(this))
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::EventTargetPrototype>(realm, "EventTarget"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void EventTarget::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -64,7 +64,7 @@ protected:
|
|||
|
||||
void element_event_handler_attribute_changed(FlyString const& local_name, Optional<String> const& value);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -28,12 +28,10 @@ HTMLCollection::HTMLCollection(ParentNode& root, Scope scope, Function<bool(Elem
|
|||
|
||||
HTMLCollection::~HTMLCollection() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> HTMLCollection::initialize(JS::Realm& realm)
|
||||
void HTMLCollection::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::HTMLCollectionPrototype>(realm, "HTMLCollection"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void HTMLCollection::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -52,7 +52,7 @@ public:
|
|||
protected:
|
||||
HTMLCollection(ParentNode& root, Scope, Function<bool(Element const&)> filter);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
JS::NonnullGCPtr<ParentNode> root() { return *m_root; }
|
||||
|
||||
|
|
|
@ -31,12 +31,10 @@ MutationObserver::MutationObserver(JS::Realm& realm, JS::GCPtr<WebIDL::CallbackT
|
|||
|
||||
MutationObserver::~MutationObserver() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> MutationObserver::initialize(JS::Realm& realm)
|
||||
void MutationObserver::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MutationObserverPrototype>(realm, "MutationObserver"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void MutationObserver::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
private:
|
||||
MutationObserver(JS::Realm&, JS::GCPtr<WebIDL::CallbackType>);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// https://dom.spec.whatwg.org/#concept-mo-callback
|
||||
|
|
|
@ -33,12 +33,10 @@ MutationRecord::MutationRecord(JS::Realm& realm, FlyString const& type, Node con
|
|||
|
||||
MutationRecord::~MutationRecord() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> MutationRecord::initialize(JS::Realm& realm)
|
||||
void MutationRecord::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::MutationRecordPrototype>(realm, "MutationRecord"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void MutationRecord::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
private:
|
||||
MutationRecord(JS::Realm& realm, FlyString const& type, Node const& 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 JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
FlyString m_type;
|
||||
|
|
|
@ -25,12 +25,10 @@ NamedNodeMap::NamedNodeMap(Element& element)
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> NamedNodeMap::initialize(JS::Realm& realm)
|
||||
void NamedNodeMap::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::NamedNodeMapPrototype>(realm, "NamedNodeMap"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void NamedNodeMap::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
private:
|
||||
explicit NamedNodeMap(Element&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
|
|
|
@ -21,12 +21,10 @@ NodeIterator::NodeIterator(Node& root)
|
|||
|
||||
NodeIterator::~NodeIterator() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> NodeIterator::initialize(JS::Realm& realm)
|
||||
void NodeIterator::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::NodeIteratorPrototype>(realm, "NodeIterator"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void NodeIterator::finalize()
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
private:
|
||||
explicit NodeIterator(Node& root);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
virtual void finalize() override;
|
||||
|
||||
|
|
|
@ -17,12 +17,10 @@ NodeList::NodeList(JS::Realm& realm)
|
|||
|
||||
NodeList::~NodeList() = default;
|
||||
|
||||
JS::ThrowCompletionOr<void> NodeList::initialize(JS::Realm& realm)
|
||||
void NodeList::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::NodeListPrototype>(realm, "NodeList"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
WebIDL::ExceptionOr<JS::Value> NodeList::item_value(size_t index) const
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
protected:
|
||||
explicit NodeList(JS::Realm&);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
// ^Bindings::LegacyPlatformObject
|
||||
virtual bool supports_indexed_properties() const final override { return true; }
|
||||
|
|
|
@ -17,12 +17,10 @@ ProcessingInstruction::ProcessingInstruction(Document& document, DeprecatedStrin
|
|||
{
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> ProcessingInstruction::initialize(JS::Realm& realm)
|
||||
void ProcessingInstruction::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ProcessingInstructionPrototype>(realm, "ProcessingInstruction"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
private:
|
||||
ProcessingInstruction(Document&, DeprecatedString const& data, DeprecatedString const& target);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
DeprecatedString m_target;
|
||||
};
|
||||
|
|
|
@ -70,12 +70,10 @@ Range::~Range()
|
|||
live_ranges().remove(this);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> Range::initialize(JS::Realm& realm)
|
||||
void Range::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::RangePrototype>(realm, "Range"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
void Range::visit_edges(Cell::Visitor& visitor)
|
||||
|
|
|
@ -95,7 +95,7 @@ private:
|
|||
explicit Range(Document&);
|
||||
Range(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset);
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
virtual void visit_edges(Cell::Visitor&) override;
|
||||
|
||||
Node& root();
|
||||
|
|
|
@ -19,11 +19,10 @@ ShadowRoot::ShadowRoot(Document& document, Element& host, Bindings::ShadowRootMo
|
|||
set_host(&host);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> ShadowRoot::initialize(JS::Realm& realm)
|
||||
void ShadowRoot::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::ShadowRootPrototype>(realm, "ShadowRoot"));
|
||||
return {};
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#ref-for-get-the-parent%E2%91%A6
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
|
||||
private:
|
||||
ShadowRoot(Document&, Element& host, Bindings::ShadowRootMode);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
|
||||
// ^Node
|
||||
virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; }
|
||||
|
|
|
@ -35,12 +35,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<StaticRange>> StaticRange::construct_impl(J
|
|||
return MUST_OR_THROW_OOM(realm.heap().allocate<StaticRange>(realm, *init.start_container, init.start_offset, *init.end_container, init.end_offset));
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> StaticRange::initialize(JS::Realm& realm)
|
||||
void StaticRange::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(Base::initialize(realm));
|
||||
Base::initialize(realm);
|
||||
set_prototype(&Bindings::ensure_web_prototype<Bindings::StaticRangePrototype>(realm, "StaticRange"));
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
StaticRange(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset);
|
||||
virtual ~StaticRange() override;
|
||||
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
virtual void initialize(JS::Realm&) override;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
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