This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10897 - In general, synthetic events dispatched from script do not trigger default actions - click is the exception for compatibility
Summary: In general, synthetic events dispatched from script do not trigger default ac...
Status: RESOLVED DUPLICATE of bug 12230
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://dev.w3.org/html5/spec/content-...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-30 20:20 UTC by Adrian Bateman [MSFT]
Modified: 2014-05-20 15:10 UTC (History)
6 users (show)

See Also:


Attachments

Description Adrian Bateman [MSFT] 2010-09-30 20:20:26 UTC
The spec says: "Note: The above doesn't happen for arbitrary synthetic events dispatched by author script. However, the click() method can be used to make it happen programmatically."

However, for compatibility with web content we had to make this work with click as an exception. Other synthetic events do not trigger default action but click does.

See also the test case at: http://www.hixie.ch/tests/adhoc/dom/events/click/002.html

Without handling the default action from the synthetic click event, the checkboxes do not get checked.
Comment 1 Ian 'Hixie' Hickson 2010-10-12 06:13:27 UTC
That test is invalid.

Can you elaborate on exactly what features require this? It's obviously not the case that _all_ synthetic click events must trigger the same behaviour as the user agent would do by default if an event _it_ dispatched was not canceled and thus had its default action executed, since otherwise that would allow for popups by sending a fake click event to a link with a target="" attribute.

In general it seems highly unlikely that pages actually depend on the behaviour you describe since IE has not previously supported this feature at all. Do you have specific URLs showing that there is content depending on this behaviour?

(This behaviour has long been a violation of the whole DOM Events model, though it's indeed true that a number of implementations have often gotten this wrong to some extent or another.)
Comment 2 Ian 'Hixie' Hickson 2010-10-12 10:43:32 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Did Not Understand Request
Change Description: no spec change
Rationale: see comment 1
Comment 3 Anne 2014-05-20 15:10:49 UTC

*** This bug has been marked as a duplicate of bug 12230 ***