Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MAYs and MUSTs #40

Open
jyasskin opened this issue Sep 21, 2020 · 0 comments
Open

MAYs and MUSTs #40

jyasskin opened this issue Sep 21, 2020 · 0 comments

Comments

@jyasskin
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant