Skip to content
This repository has been archived by the owner on Mar 19, 2018. It is now read-only.

Replace mayCancel with blocksScroll? #14

Closed
RByers opened this issue Jul 6, 2015 · 6 comments
Closed

Replace mayCancel with blocksScroll? #14

RByers opened this issue Jul 6, 2015 · 6 comments
Labels

Comments

@RByers
Copy link
Member

RByers commented Jul 6, 2015

My original proposal on public-pointerevents suggested a blocksScroll option instead of this mayCancel option. Maybe that would be better after all?

Benefits:

Disadvantages:

  • Not broadly useful enough to justify changing the core event handler model.
    • How compelling are the other uses cases for mayCancel?
  • Attempting to spec threaded scrolling behavior explicitly may be opening a Pandora's box of spec hassle. Threaded scrolling is otherwise an implementation detail not directly exposed to the platform.

Previously Olli Pettay argued:

Definitely not this. This is not a strong enough case to change an API which has existed for 15+ years, IMO.

And then

So, "I'm not going to call preventDefault()" might be such, useful also in other cases than just with wheel. A bit odd API, but might be useful, really useful.

Anyone else have opinions here?

@ojanvafai
Copy link
Member

I actually tend to agree with Olli's desire for a more general name. My intuition is that we will find other non-scroll-related uses for this in the future. How about "blocksDefaultAction"? That clearly associates with preventDefault, would also be usable in the future for the scroll event handler case you mention and would hopefully avoid the potential confusion I mention in #13.

@RByers
Copy link
Member Author

RByers commented Jul 8, 2015

I'm trying to separate a bit the debate over the right name / spec wording (#13) from the fundamental semantics (this bug). It sounds like 'blocksDefaultAction' would have more of the semantics I'm proposing here for blocksScroll, right? Eg. what would the behavior be for events like 'scroll' and 'mousemove' which have no default action - do we need some mechanism to indicate failure? What would the default value be when unspecified (do we need to reintroduce a third "auto" value)?

Also I'm not sure "blocksDefaultAction" would really make sense for "scroll". I don't think we could add a default action to "scroll" - what would it mean for the page to call preventDefault on it (we can't, for example, undo the scroll)? But maybe we could fudge it to be close enough?

@smaug----
Copy link
Collaborator

indicate failure? What failure? There isn't anything to cancel on "scroll". "scroll" event happens after actually scrolling.

@RByers
Copy link
Member Author

RByers commented Jul 8, 2015

Right, my point exactly. So you're suggesting that blocksDefaultAction=true for scroll or mousemove events would be silently ignored since there is no default action, right? Ojan was suggesting that we might want to use blocksDefaultsAction=true on scroll events in the future to enable JS synchronized scrolling (one of my original goals with scroll-blocks-on but not something I'm actively pursuing at the moment).

@RByers
Copy link
Member Author

RByers commented Jul 9, 2015

@esprehn says:

I don't like making this specific to scrolling, that doesn't explain what it really means in terms of the capabilities of the event handler. We probably want to use this for other event types where we want to change the time the event dispatches based on if you require the ability to cancel or not as well.

@RByers
Copy link
Member Author

RByers commented Jul 10, 2015

Consensus seems to be to stick with the general semantics of mayCancel (but we can still debate the exact name in #13).

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

No branches or pull requests

3 participants