From b7284db83529d01a1754e3b3009ff108b4d1d52c Mon Sep 17 00:00:00 2001 From: Dave Tapuska Date: Thu, 5 Jul 2018 10:59:46 -0700 Subject: [PATCH] Add an API to query whether the window has seen a user gesture. Add a variable on the navigator object to query whether the frame has seen a user activation ever. The postMessage part of the proposal will be done in a separate patch, this change is limited to just adding the object definition and exposing it on navigator. https://github.com/dtapuska/useractivation https://github.com/whatwg/html/issues/1983 BUG=846858 Change-Id: I6ca4c80f4096bfae9ca13b175b46df6b4486a6dd --- .../activation-api-click.tentative.html | 34 +++++++++++ ...ation-api-iframe-no-activate.tenative.html | 58 +++++++++++++++++++ .../activation-api-iframe.tenative.html | 52 +++++++++++++++++ .../activation-api-setTimeout.tentative.html | 36 ++++++++++++ html/user-activation/resources/child-one.html | 20 +++++++ html/user-activation/resources/child-two.html | 7 +++ 6 files changed, 207 insertions(+) create mode 100644 html/user-activation/activation-api-click.tentative.html create mode 100644 html/user-activation/activation-api-iframe-no-activate.tenative.html create mode 100644 html/user-activation/activation-api-iframe.tenative.html create mode 100644 html/user-activation/activation-api-setTimeout.tentative.html create mode 100644 html/user-activation/resources/child-one.html create mode 100644 html/user-activation/resources/child-two.html diff --git a/html/user-activation/activation-api-click.tentative.html b/html/user-activation/activation-api-click.tentative.html new file mode 100644 index 000000000000000..7f170a04ab1c207 --- /dev/null +++ b/html/user-activation/activation-api-click.tentative.html @@ -0,0 +1,34 @@ + + + + + + + + + + +

Clicking on document sets user activation

+

Click anywhere in the document.

+ + + diff --git a/html/user-activation/activation-api-iframe-no-activate.tenative.html b/html/user-activation/activation-api-iframe-no-activate.tenative.html new file mode 100644 index 000000000000000..8c7610e28b0be7c --- /dev/null +++ b/html/user-activation/activation-api-iframe-no-activate.tenative.html @@ -0,0 +1,58 @@ + + + + + + + + + + +

Clicking in parent frame does not propagate state to child

+
    +
  1. Click this instruction text. +
+ + + + diff --git a/html/user-activation/activation-api-iframe.tenative.html b/html/user-activation/activation-api-iframe.tenative.html new file mode 100644 index 000000000000000..2202048ae9166d0 --- /dev/null +++ b/html/user-activation/activation-api-iframe.tenative.html @@ -0,0 +1,52 @@ + + + + + + + + + + +

Clicking in iframe has activation state in child

+
    +
  1. Click inside the red area. +
+ + + + diff --git a/html/user-activation/activation-api-setTimeout.tentative.html b/html/user-activation/activation-api-setTimeout.tentative.html new file mode 100644 index 000000000000000..a8eba38c60eeef7 --- /dev/null +++ b/html/user-activation/activation-api-setTimeout.tentative.html @@ -0,0 +1,36 @@ + + + + + + + + + + +

Clicking on document sets user activation even after setTimeout

+

Click anywhere in the document.

+ + + diff --git a/html/user-activation/resources/child-one.html b/html/user-activation/resources/child-one.html new file mode 100644 index 000000000000000..9c99729b6a98022 --- /dev/null +++ b/html/user-activation/resources/child-one.html @@ -0,0 +1,20 @@ + + + + diff --git a/html/user-activation/resources/child-two.html b/html/user-activation/resources/child-two.html new file mode 100644 index 000000000000000..7d48789878a902e --- /dev/null +++ b/html/user-activation/resources/child-two.html @@ -0,0 +1,7 @@ + + + +