From 94c144c251ab53c5c1d8066ea970e2359264f8e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Wed, 3 Nov 2021 12:43:54 -0700 Subject: [PATCH] Add showPicker() method to HTMLInputElement interface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This CL adds an experimental method to the HTMLInputElement interface to allow web developers to show the browser picker for temporal, color, and file input elements. It requires a user gesture and is disallowed for cross-origin iframes except for file and color input elements for now. Intent to prototype: https://groups.google.com/a/chromium.org/g/blink-dev/c/fEebe5uXQ1I/m/ox6SBEQ5AAAJ Test: https://show-picker.glitch.me/ Spec: https://github.com/whatwg/html/issues/6909 Bug: 939561 Change-Id: Icd59429c069ce5c70903f708f5d6da41a16ba90f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3056920 Commit-Queue: François Beaufort Reviewed-by: Mason Freed Cr-Commit-Position: refs/heads/main@{#937999} --- .../resources/show-picker-child-iframe.html | 20 ++++++++ ...-picker-cross-origin-iframe.tentative.html | 46 +++++++++++++++++++ .../show-picker.tentative.html | 29 ++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 html/semantics/forms/the-input-element/resources/show-picker-child-iframe.html create mode 100644 html/semantics/forms/the-input-element/show-picker-cross-origin-iframe.tentative.html create mode 100644 html/semantics/forms/the-input-element/show-picker.tentative.html diff --git a/html/semantics/forms/the-input-element/resources/show-picker-child-iframe.html b/html/semantics/forms/the-input-element/resources/show-picker-child-iframe.html new file mode 100644 index 000000000000000..f298c3a9376dad7 --- /dev/null +++ b/html/semantics/forms/the-input-element/resources/show-picker-child-iframe.html @@ -0,0 +1,20 @@ + +Test showPicker() in an iframe + diff --git a/html/semantics/forms/the-input-element/show-picker-cross-origin-iframe.tentative.html b/html/semantics/forms/the-input-element/show-picker-cross-origin-iframe.tentative.html new file mode 100644 index 000000000000000..4dd9dfce0ccab82 --- /dev/null +++ b/html/semantics/forms/the-input-element/show-picker-cross-origin-iframe.tentative.html @@ -0,0 +1,46 @@ + +Test showPicker() called from cross-origin iframe + + + + + + + diff --git a/html/semantics/forms/the-input-element/show-picker.tentative.html b/html/semantics/forms/the-input-element/show-picker.tentative.html new file mode 100644 index 000000000000000..11cac872d9b8433 --- /dev/null +++ b/html/semantics/forms/the-input-element/show-picker.tentative.html @@ -0,0 +1,29 @@ + +Test showPicker() user gesture requirement + + + + + +