diff --git a/extensions/amp-carousel/0.1/slidescroll.js b/extensions/amp-carousel/0.1/slidescroll.js
index 22e40e56043f..e98aeacfc16d 100644
--- a/extensions/amp-carousel/0.1/slidescroll.js
+++ b/extensions/amp-carousel/0.1/slidescroll.js
@@ -211,7 +211,7 @@ export class AmpSlideScroll extends BaseSlides {
if (args) {
this.showSlideWhenReady(args['index']);
}
- }, ActionTrust.LOW);
+ }, ActionTrust.MEDIUM); // TODO(choumx, #9699): LOW.
}
/** @override */
diff --git a/extensions/amp-form/0.1/amp-form.js b/extensions/amp-form/0.1/amp-form.js
index 5d8b518b5ce6..1d1e798dbad8 100644
--- a/extensions/amp-form/0.1/amp-form.js
+++ b/extensions/amp-form/0.1/amp-form.js
@@ -191,8 +191,9 @@ export class AmpForm {
this.verifier_ = getFormVerifier(
this.form_, () => this.handleXhrVerify_());
+ // TODO(choumx, #9699): HIGH.
this.actions_.installActionHandler(
- this.form_, this.actionHandler_.bind(this), ActionTrust.HIGH);
+ this.form_, this.actionHandler_.bind(this), ActionTrust.MEDIUM);
this.installEventHandlers_();
/** @private {?Promise} */
@@ -348,7 +349,7 @@ export class AmpForm {
event.preventDefault();
}
// Submits caused by user input have high trust.
- this.submit_(ActionTrust.HIGH);
+ this.submit_(ActionTrust.MEDIUM); // TODO(choumx, #9699): HIGH.
}
/**
diff --git a/extensions/amp-live-list/0.1/amp-live-list.js b/extensions/amp-live-list/0.1/amp-live-list.js
index 10d9c654a0b3..72d69f2dcd9b 100644
--- a/extensions/amp-live-list/0.1/amp-live-list.js
+++ b/extensions/amp-live-list/0.1/amp-live-list.js
@@ -224,8 +224,9 @@ export class AmpLiveList extends AMP.BaseElement {
this.curNumOfLiveItems_ = this.validateLiveListItems_(
this.itemsSlot_, true);
+ // TODO(choumx, #9699): LOW.
this.registerAction(
- 'update', this.updateAction_.bind(this), ActionTrust.LOW);
+ 'update', this.updateAction_.bind(this), ActionTrust.MEDIUM);
if (!this.element.hasAttribute('aria-live')) {
this.element.setAttribute('aria-live', 'polite');
diff --git a/extensions/amp-selector/0.1/amp-selector.js b/extensions/amp-selector/0.1/amp-selector.js
index 0aa33eedf999..36bf1dd873ea 100644
--- a/extensions/amp-selector/0.1/amp-selector.js
+++ b/extensions/amp-selector/0.1/amp-selector.js
@@ -292,8 +292,9 @@ export class AmpSelector extends AMP.BaseElement {
targetOption: el.getAttribute('option'),
selectedOptions: selectedValues,
});
+ // TODO(choumx, #9699): HIGH.
this.action_.trigger(this.element, name, selectEvent,
- ActionTrust.HIGH);
+ ActionTrust.MEDIUM);
}
});
}
diff --git a/spec/amp-actions-and-events.md b/spec/amp-actions-and-events.md
index 50800f23ee79..2940ec1b3e48 100644
--- a/spec/amp-actions-and-events.md
+++ b/spec/amp-actions-and-events.md
@@ -58,11 +58,13 @@ You can listen to multiple events on an element by separating the two events wit
Example: `on="submit-success:lightbox1;submit-error:lightbox2"`
+
## Multiple Actions For One Event
You can execute multiple actions in sequence for the same event by separating the two actions with a comma ','.
Example: `on="tap:target1.actionA,target2.actionB"`
+
## Globally defined Events and Actions
Currently AMP defines `tap` event globally that you can listen to on any HTML element (including amp-elements).
@@ -78,18 +80,6 @@ For example, the following is possible in AMP.
```
-## Trust
-
-Each event has a "trust" level that corresponds to the user's intentionality
-behind that event. Each action has a "required trust" which is the minimum trust
-level of an event to trigger the action.
-
-For example, a medium-trust event (e.g. `slideChange`) cannot trigger a
-high-required-trust action (e.g. `navigateTo`).
-
-See the tables below for the trust levels of each event and required trust for
-each action.
-
## Element Specific Events
### * - all elements
@@ -97,12 +87,10 @@ each action.
Event
Description
-
Trust
tap
Fired when the element is clicked/tapped.
-
High
@@ -113,40 +101,29 @@ each action.
Description
Elements
Data
-
Trust
-
change
-
Fired when the value of the element is changed and committed.
+
change
+
Fired when the value of the element is changed and committed.
input[type="range"]
event.min : The minimum value of the range event.value : The current value of the range event.max : The maximum value of the range
-
Medium
input[type="radio"], input[type="checkbox"]
event.checked : If the element is checked
-
Medium
-
input[type="text"]
-
- event.value : String of the text or selected option
-
-
Medium
-
-
-
select
+
input[type="text"], select
event.value : String of the text or selected option
-
High
@@ -154,7 +131,6 @@ each action.
Fired when the value of the element is changed. This is similar to the standard input event, but it only fires when 300ms have passed after the value of the input has stopped changing.
Elements that fire input event.
Same as above.
-
Medium
@@ -164,13 +140,11 @@ each action.
Event
Description
Data
-
Trust
slideChange
Fired when the user manually changes the carousel's current slide. Does not fire on autoplay or the goToSlide action.
event.index : slide number
-
Medium
@@ -180,13 +154,11 @@ each action.
Event
Description
Data
-
Trust
select
Fired when the user manually selects an option.
event.targetOption : The option attribute value of the selected element
-
High
@@ -196,51 +168,43 @@ each action.
Event
Description
Data
-
Trust
submit
Fired when the form is submitted.
-
High
submit-success
Fired when the form submission response is success.
event.response : JSON response
-
Medium
submit-error
Fired when the form submission response is an error.
event.response : JSON response
-
Medium
-## Element Specific Actions
+## Element Specific Actions
### * (all elements)
Action
Description
-
Required Trust
hide
Hides the target element.
-
Medium
show
Shows the target element.
-
Medium
toggleVisibility
Toggles the visibility of the target element.
-
Medium
@@ -249,12 +213,10 @@ each action.
Action
Description
-
Required Trust
goToSlide(index=INTEGER)
Advances the carousel to a specified slide index.
-
Low
@@ -263,12 +225,10 @@ each action.
Action
Description
-
Required Trust
open (default)
Opens the image lightbox with the source image being the one that triggered the action.
-
Medium
@@ -277,17 +237,14 @@ each action.
Action
Description
-
Required Trust
open (default)
Opens the lightbox.
-
Medium
close
Closes the lightbox.
-
Medium
@@ -296,12 +253,10 @@ each action.
Action
Description
-
Required Trust
update (default)
Updates the DOM items to show updated content.
-
Low
@@ -310,22 +265,32 @@ each action.
Action
Description
-
Required Trust
open (default)
Opens the sidebar.
-
Medium
close
Closes the sidebar.
-
Medium
toggle
Toggles the state of the sidebar.
-
Medium
+
+
+
+### amp-state
+
+
+
Action
+
Description
+
+
+
(default)
+
Updates the amp-state's data with the data contained in the event. Requires
+ amp-bind.
+
@@ -334,12 +299,10 @@ each action.
Action
Description
-
Required Trust
dismiss (default)
Hides the referenced user notification element.
-
Medium
@@ -348,27 +311,22 @@ each action.
Action
Description
-
Required Trust
play
Plays the video.
-
High
pause
Pauses the video.
-
Low
mute
Mutes the video.
-
Low
unmute
Unmutes the video.
-
High
@@ -377,12 +335,10 @@ each action.
Action
Description
-
Required Trust
submit
Submits the form.
-
High
@@ -399,22 +355,18 @@ actions that apply to the whole document.
Action
Description
-
Required Trust
navigateTo(url=STRING)
Navigates current window to given URL. Supports standard URL subsitutions. Can only be invoked via tap or change events.