is-input-pending icon indicating copy to clipboard operation
is-input-pending copied to clipboard

MAYs and MUSTs

Open jyasskin opened this issue 5 years ago • 0 comments

The current spec has:

  1. Let pendingResult be false.
  2. If isInputPendingOptions is undefined, assign it to a newly-instantiated IsInputPendingOptions with the default constructor.
  3. The user agent MAY at this step continue to step 5 for any reason.
  4. 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:
    1. If the user agent considers the task to be a continuous event task and isInputPendingOptions.includeContinuous is false, continue to step 5.
    2. The user agent MAY let pendingResult be true.
  5. 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:

  1. 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:".

jyasskin avatar Sep 21 '20 23:09 jyasskin