MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

src/service/action-impl.js:166–198  ·  view source on GitHub ↗

* For example: * * * Submit * * * `node` is #myForm. * `method` is "submit". * `args` is {'foo': 'bar'}. * `source` is #btn. * `caller` is #div. * `event` is a "click" Event objec

(
    node,
    method,
    args,
    source,
    caller,
    event,
    trust,
    actionEventType = '?',
    tagOrTarget = null,
    sequenceId = Math.random()
  )

Source from the content-addressed store, hash-verified

164 * actions triggered by one event e.g. "tap:form1.submit, form2.submit").
165 */
166 constructor(
167 node,
168 method,
169 args,
170 source,
171 caller,
172 event,
173 trust,
174 actionEventType = '?',
175 tagOrTarget = null,
176 sequenceId = Math.random()
177 ) {
178 /** @type {!Node} */
179 this.node = node;
180 /** @const {string} */
181 this.method = method;
182 /** @const {?JsonObject} */
183 this.args = args;
184 /** @const {?Element} */
185 this.source = source;
186 /** @const {?Element} */
187 this.caller = caller;
188 /** @const {?ActionEventDef} */
189 this.event = event;
190 /** @const {!ActionTrust_Enum} */
191 this.trust = trust;
192 /** @const {?string} */
193 this.actionEventType = actionEventType;
194 /** @const {string} */
195 this.tagOrTarget = tagOrTarget || node.tagName;
196 /** @const {number} */
197 this.sequenceId = sequenceId;
198 }
199
200 /**
201 * Returns true if the trigger event has a trust equal to or greater than

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected