diff --git a/index.bs b/index.bs
index 014e8de86..f4738e122 100644
--- a/index.bs
+++ b/index.bs
@@ -112,6 +112,7 @@ spec: WEBDRIVER; urlPrefix: https://w3c.github.io/webdriver/
text: unable to capture screen; url: dfn-unable-to-capture-screen
text: unknown command; url: dfn-unknown-command
text: unknown error; url: dfn-unknown-error
+ text: user prompt handler; url: dfn-user-prompt-handler
text: unsupported operation; url: dfn-unsupported-operation
text: web element reference; url: dfn-web-element-reference
text: webdriver-active flag; url: dfn-webdriver-active-flag
@@ -1711,6 +1712,7 @@ session.UserPromptHandler = {
? beforeUnload: session.UserPromptHandlerType,
? confirm: session.UserPromptHandlerType,
? default: session.UserPromptHandlerType,
+ ? file: session.UserPromptHandlerType,
? prompt: session.UserPromptHandlerType,
};
@@ -1718,6 +1720,9 @@ session.UserPromptHandler = {
The session.UserPromptHandler type represents the configuration of
the user prompt handler.
+Note: file handles file picker. "accept" and "dismiss" dismisses
+the picker. "ignore" keeps the picker open.
+
#### The session.UserPromptHandlerType Type #### {#type-session-UserPromptHandlerType}
[=Remote end definition=] and [=local end definition=]
@@ -2282,7 +2287,7 @@ BrowserResult = (
Each [=/top-level traversable=] is associated with a single client
window which represents a rectangular area containing the
-viewport that will be used to render that [=/top-level
+viewport that will be used to render that [=/top-level
traversable=]'s [=active document=] when its [=visibility state=] is
"visible", as well as any browser-specific user interface elements
associated with displaying the traversable (e.g. any URL bar, toolbars, or OS
@@ -11705,6 +11710,81 @@ The [=remote end steps=] given |session| and |command parameters| are:
+### Events ### {#module-input-events}
+
+#### The input.fileDialogOpened Event #### {#event-input-fileDialogOpened}
+
+
+ input.FileDialogOpened = (
+ method: "input.fileDialogOpened",
+ params: input.FileDialogInfo
+ )
+
+ input.FileDialogInfo = {
+ context: browsingContext.BrowsingContext,
+ element: script.SharedReference,
+ multiple: bool,
+ }
+
+ true if |element|'s <{input/multiple}> attribute is
+ set, or false otherwise.
+
+1. Let |related navigables| be a [=/set=] containing |navigable|.
+
+1. For each |session| in the [=set of sessions for which an event is enabled=] given
+ "input.fileDialogOpened" and |related navigables|:
+
+ 1. Let |shared id| be [=get shared id for a node=] with |element| and |session|.
+
+ 1. Let |params| be a [=/map=] matching the input.FileDialogInfo
+ production with the context field set to |navigable id|, the
+ element field set to |shared id| and multiple field
+ set to |multiple|.
+
+ 1. Let |body| be a [=/map=] matching the input.fileDialogOpened
+ production, with the params field set to |params|.
+
+ 1. [=Emit an event=] with |session| and |body|.
+
+1. Let |dismissed| be false.
+
+1. For each |session| in [=active BiDI sessions=]:
+
+ 1. Let |user prompt handler| be |session|'s [=user prompt handler=].
+
+ 1. If |user prompt handler| is not null:
+
+ 1. Assert |user prompt handler| is a [=/map=].
+
+ 1. If |user prompt handler| [=map/contains=] "file":
+
+ 1. if |user prompt handler|["file"] is not equal to
+ "ignore", set |dismissed| to true.
+
+ 1. Otherwise if |user prompt handler| [=map/contains=] "default" and
+ |user prompt handler|["default"] is not equal to
+ "ignore", set |dismissed| to true.
+
+1. Return |dismissed|.
+
+