Re: Clarification on "cancelling" pointerdown

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