1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibWeb: Add ports attribute to MessageEvent and MessageEventInit

Still some FIXMEs left though, as the IDL generator doesn't know what
a FrozenArray is, nor how to properly create a sequence of a Platform
Object.
This commit is contained in:
Andrew Kaster 2023-12-12 13:28:38 -07:00 committed by Andrew Kaster
parent e464d484c4
commit 73697058b0
3 changed files with 21 additions and 0 deletions

View file

@ -20,6 +20,7 @@ struct MessageEventInit : public DOM::EventInit {
String origin {};
String last_event_id {};
Optional<MessageEventSource> source;
Vector<JS::Handle<JS::Object>> ports;
};
class MessageEvent : public DOM::Event {
@ -36,6 +37,7 @@ public:
JS::Value data() const { return m_data; }
String const& origin() const { return m_origin; }
String const& last_event_id() const { return m_last_event_id; }
JS::NonnullGCPtr<JS::Object> ports() const;
Variant<JS::Handle<WindowProxy>, JS::Handle<MessagePort>, Empty> source() const;
private:
@ -46,6 +48,8 @@ private:
String m_origin;
String m_last_event_id;
Optional<MessageEventSource> m_source;
Vector<JS::Handle<JS::Object>> m_ports;
mutable JS::GCPtr<JS::Array> m_ports_array;
};
}