This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The four consecutive if statements might be more clear as 3 nested ones... (so a toplevel if, and then one if in each branch).
So like this? 3. If token is in the list of tokens, run these substeps: 3.1 If force is not true (force is either false or omitted), then remove token from the list of tokens, run the update steps, and return false. 3.2 Otherwise, return true. 4. Otherwise, run these substeps: 4.1 If force is false (false is neither true nor omitted), return false. 4.2 Otherwise, append token to the list of tokens, run the update steps, and return true.
Yes, though I'd probably invert the test in 3.1 to look more like 4.1 (so "if force is false"). A terminology question: are we using "omitted" or "not passed" for optional arguments? As in, could "force is false (false is neither true nor omitted)" be more clearly written as "force was passed and is false"? Or "force was not omitted and is false"?
So that "is not true" means something different from "is false" given the ability to be omitted, making it a tri-state effectively. Thanks for the suggestion though, the new text seems much clearer: https://github.com/whatwg/dom/commit/acbce28fb425dddaa657f5c3ee304c4bd3d67ea5