mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb/HTML: Update worker construction spec steps
This is largely editorial. One behaviour change is that events are now
sent from a global task on the DOMManipulation task source.
Somewhat awkwardly, the spec refers to `this` before the Worker exists.
As it's for getting the relevant global object / settings object, I've
had to work around that.
Corresponds to:
917c2f6a73
This commit is contained in:
parent
edac716e91
commit
62d7011f45
Notes:
github-actions[bot]
2025-12-01 14:03:44 +00:00
Author: https://github.com/AtkinsSJ
Commit: 62d7011f45
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6956
Reviewed-by: https://github.com/awesomekling
6 changed files with 129 additions and 103 deletions
|
|
@ -27,7 +27,12 @@ public:
|
|||
|
||||
virtual ~SharedWorker();
|
||||
|
||||
GC::Ref<MessagePort> port() { return m_port; }
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#dom-sharedworker-port
|
||||
GC::Ref<MessagePort> port()
|
||||
{
|
||||
// The port getter steps are to return this's port.
|
||||
return m_port;
|
||||
}
|
||||
|
||||
void set_agent(WorkerAgentParent& agent) { m_agent = agent; }
|
||||
|
||||
|
|
@ -42,7 +47,11 @@ private:
|
|||
|
||||
URL::URL m_script_url;
|
||||
WorkerOptions m_options;
|
||||
|
||||
// Each SharedWorker has a port, a MessagePort set when the object is created.
|
||||
// https://html.spec.whatwg.org/multipage/workers.html#concept-sharedworker-port
|
||||
GC::Ref<MessagePort> m_port;
|
||||
|
||||
GC::Ptr<WorkerAgentParent> m_agent;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue