Re: [whatwg/dom] Standardize certain Microsoft event extensions (#334)

> do we know how often assigning the return value from false to true occurs?
> 
> I'd prefer if the implementation was essentially pollyfill-able;
> 
> For example:
> bool legacyReturnValue() const { return !defaultPrevented(); }
> void setLegacyReturnValue(bool returnValue) { if (!returnValue) preventDefault(); }
> 
> Which specifically disallows the false->true transition. (much like the setCancelBubble debate)

The current spec-text in my PR doesn't say anything about this, but @cvrebert wrote a wpt test to ensure that setting `returnValue` to true after `preventDefault()` was called should no-op. 

Safari, Chrome and Edge will all unset the canceled flag, however: 
https://miketaylr.com/bzla/canceled-returnValue-false-true.html

@dtapuska do we want to spec reality here, or stick with your original suggestion (which means I should add some language to ensure `returnValue=true` does nothing if the canceled flag was set).

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/334#issuecomment-341529830

Received on Thursday, 2 November 2017 19:18:28 UTC