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

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


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.

Received on Wednesday, 22 January 2014 18:50:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:48:09 UTC