mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibWeb: Actually initialize ShadowRoot bindings
`mode` and `host` attributes were always undefined.
This commit is contained in:
parent
d4cb089acb
commit
34913c48d3
Notes:
sideshowbarker
2024-07-17 00:53:39 +09:00
Author: https://github.com/krkk Commit: https://github.com/SerenityOS/serenity/commit/34913c48d3 Pull-request: https://github.com/SerenityOS/serenity/pull/17225
@ -18,6 +18,13 @@ ShadowRoot::ShadowRoot(Document& document, Element& host)
|
||||
set_host(&host);
|
||||
}
|
||||
|
||||
JS::ThrowCompletionOr<void> ShadowRoot::initialize(JS::Realm& realm)
|
||||
{
|
||||
MUST_OR_THROW_OOM(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
|
||||
EventTarget* ShadowRoot::get_parent(Event const& event)
|
||||
{
|
||||
|
@ -33,6 +33,7 @@ public:
|
||||
|
||||
private:
|
||||
ShadowRoot(Document&, Element&);
|
||||
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
|
||||
|
||||
// ^Node
|
||||
virtual DeprecatedFlyString node_name() const override { return "#shadow-root"; }
|
||||
|
Loading…
Reference in New Issue
Block a user