toolactivated" event.
+1. [=Fire an event=] named {{ModelContext/toolactivated}} at |targetDocument|'s [=Document/associated
+ ModelContext|associated ModelContext=], using {{ToolActivatedEvent}}, with its
+ {{ToolActivatedEvent/toolName}} attribute initialized to |tool|'s {{ModelContextTool/name}}.
1. Let |toolPromise| be the result of [=invoke|invoking=] |tool|'s {{ModelContextTool/execute}} with
|inputObject|.
@@ -526,6 +528,8 @@ interface ModelContext : EventTarget {
PromiseDocument=].
+
1. Let |promise| be [=a new promise=] created in [=this=]'s [=relevant realm=].
1. If |options|'s {{ModelContextExecuteToolOptions/signal}} [=map/exists=], then:
@@ -841,15 +850,13 @@ The executeTool(tool, inputArgument
1. [=Reject=] |promise| with |signal|'s [=AbortSignal/abort reason=].
- Issue(#48): Wire up |signal| to the tool execution callback in the tool host's document, so
- that tool abort is communicated all the way through. This should also fire the
- "toolcanceled" event in the target document. See also issue #146.
-
-1. Let |targetWindow| be |tool|'s {{RegisteredTool/window}}.
+ 1. [=Fire an event=] named {{ModelContext/toolcancel}} at |targetDocument|'s
+ [=Document/associated ModelContext|associated ModelContext=], using
+ {{ToolCancelEvent}}, with its {{ToolCancelEvent/toolName}} attribute initialized to
+ |tool|'s {{RegisteredTool/name}}.
-1. Let |targetDocument| be |targetWindow|'s [=associated Document|associated
- Document=].
+ Issue(#48): Wire up |signal| to the tool execution callback in the tool host's document, so
+ that tool abort is communicated all the way through.
1. Run the following steps [=in parallel=]:
@@ -1158,6 +1165,56 @@ dictionary RegisteredTool {
+