is-input-pending
is-input-pending copied to clipboard
MAYs and MUSTs
The current spec has:
- Let pendingResult be false.
- If isInputPendingOptions is undefined, assign it to a newly-instantiated IsInputPendingOptions with the default constructor.
- The user agent MAY at this step continue to step 5 for any reason.
- If the surrounding agent's event loop has any task queues that contain a task that will dispatch an event that is a UIEvent or TouchEvent or a child of either, or if the user agent determines that it MAY soon enqueue such a task, and the dispatched event would have an EventTarget that exists within a window of the same origin, then the user agent MUST run the following steps:
- If the user agent considers the task to be a continuous event task and isInputPendingOptions.includeContinuous is false, continue to step 5.
- The user agent MAY let pendingResult be true.
- Return pendingResult.
The
- MAY at this step continue to step 5 for any reason.
- MAY let pendingResult be true.
are redundant, and
- MUST run the following steps:
is somewhat inconsistent.
It looks like you're trying to say that isInputPending MAY return false even when the correct answer is true. In that case, just make the first step:
- The user agent MAY return false.
And write the rest of the steps as if it's trying to give an accurate answer.
https://infra.spec.whatwg.org/#algorithm-conformance says you can replace "then the user agent MUST run the following steps:" by just "then:".