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

Conditional abort edge case #565

Open
alexmturner opened this issue Apr 20, 2023 · 2 comments
Open

Conditional abort edge case #565

alexmturner opened this issue Apr 20, 2023 · 2 comments

Comments

@alexmturner
Copy link

Hi!

I noticed a slight disparity between the conditional abort definition and example: https://infra.spec.whatwg.org/#algorithm-conditional-abort.

The definition's prose indicates that the "If aborted" step must be run if any steps were skipped. (And I assume therefore must not be run unless any steps are skipped?) However, in the case that the user clicks "Cancel" during the computation of φ, the 'more verbose formulation' in the example indicates that it would be valid to have the result contain the digits of π, the digits of e, the digits of φ and "Didn't finish".

I'm assuming that result isn't intended to be allowed, but I just wanted to check. Thanks!

@annevk
Copy link
Member

annevk commented Apr 21, 2023

That's right.

I think we could fix this by instead checking if the user pressed cancelled before appending. That formulation is black-box-indistinguishable, though if naively implemented would have much worse performance. Not sure if we need to point that out as well.

@alexmturner
Copy link
Author

Thanks!

Another (verbose) fix could be to add identical "Otherwise" branches for each if statement. For the naive implementation performance risk, I think the existing note probably covers us.

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

No branches or pull requests

2 participants