[Webkit-unassigned] [Bug 141456] New: TouchEvent.cancelable is always true

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 10 18:17:03 PST 2015


https://bugs.webkit.org/show_bug.cgi?id=141456

            Bug ID: 141456
           Summary: TouchEvent.cancelable is always true
    Classification: Unclassified
           Product: WebKit
           Version: 528+ (Nightly build)
          Hardware: Unspecified
                OS: iOS 8.1
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: HTML Events
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: rbyers at chromium.org

Event.cancelable is defined as follows:
http://www.w3.org/TR/DOM-Level-3-Events/#event-flow-default-cancel

When an event is canceled, then the conditional default actions associated with the event must be skipped (or as mentioned above, if the default actions are carried out before the dispatch, their effect must be undone). Whether an event object is cancelable must be indicated by the Event.cancelable attribute.

For TouchEvents, knowing whether calling preventDefault is going to have an effect can be valuable (eg. when detecting that it's too late to prevent scrolling from starting).  Chromium now sets cancelable=true if and only if the event is sent synchronously and therefore calling preventDefault will prevent/suspend an action like scrolling (eg. see https://crrev.com/266470).  You can see this in action here: http://rbyers.github.io/touch-action.html (ignore the touch-action bit - just scroll the document or the 'auto' box).  You'll see something like:

touchstart cancelable 493672ms
touchmove cancelable 124ms
touchmove 17ms
touchmove 228ms
touchend 0ms

The TouchEvents community group agrees there's currently a bug in the spec here, and will be updating the spec soon: https://github.com/w3c/touch-events/issues/6

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150211/d122b51f/attachment-0002.html>


More information about the webkit-unassigned mailing list