W3C home > Mailing lists > Public > public-pointer-events@w3.org > January to March 2014

Re: Clarification on "cancelling" pointerdown

From: Matt Brubeck <mbrubeck@mozilla.com>
Date: Wed, 22 Jan 2014 10:51:00 -0800
Message-ID: <52E01314.7080502@mozilla.com>
To: "Patrick H. Lauke" <redux@splintered.co.uk>, "public-pointer-events@w3.org" <public-pointer-events@w3.org>
On 1/22/2014 2:39 AM, Patrick H. Lauke wrote:
> "Authors can prevent the production of compatibility mouse events by 
> cancelling the pointerdown event."
>
> Do we mean preventDefault? return false? event.returnValue = false?

Yes.  :)   We mean the "canceled flag" on the event, which is set and 
returned by the DOM preventDefault method and defaultPrevented 
attribute.  From DOM4:

    The |preventDefault()| method must set the canceled flag
    <http://www.w3.org/TR/dom/#canceled-flag> if the |cancelable
    <http://www.w3.org/TR/dom/#dom-event-cancelable>| attribute value is
    true.

    The |defaultPrevented| attribute must return true if the canceled
    flag <http://www.w3.org/TR/dom/#canceled-flag> is set and false
    otherwise.

    http://www.w3.org/TR/dom/#canceled-flag

The HTML standard also specifies that "return false" in certain 
conditions should cancel an event:

    If return value is a WebIDL boolean false value, then cancel the event.

    http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#the-event-handler-processing-algorithm
Received on Wednesday, 22 January 2014 18:50:59 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:20:26 UTC