Re: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events]
On Thu, 22 Jul 2010 02:07:42 +0200, Ian Hickson i...@hixie.ch wrote: On Wed, Jul 21, 2010 at 10:11 AM, Web Applications Working Group Issue Tracker sysbot+trac...@w3.org wrote: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events] http://www.w3.org/2008/webapps/track/issues/118 Raised by: Doug Schepers On product: DOM3 Events Simon Pieters wrote in http://lists.w3.org/Archives/Public/www-dom/2010AprJun/0041.html : [[ Is it defined what should happen in the following case? div onclick=document.links[0].dispatchEvent(event)click me/div a href=http://example.org/;test/a It seems Firefox and Opera throw an exception, while WebKit allows the event to be dispatched. I think it seems like a neat thing to be able to do, for making table rows or canvas clickable. (However the event shouldn't be a 'trusted' event in that case, of course.) To make it work today you'd have to create a new event and copy over all properties, which is annoying. ]] Even if we make this dispatch the event, it wouldn't make the link be followed — since the event isn't dispatched by the UA, there's no default action. Chrome follows the link, though. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/573 There is, in any case, a simpler solution to the above: div onclick=document.links[0].click()click me/div a href=http://example.org/;test/a True. -- Simon Pieters Opera Software
Re: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events]
On Thu, 22 Jul 2010, Simon Pieters wrote: Even if we make this dispatch the event, it wouldn't make the link be followed — since the event isn't dispatched by the UA, there's no default action. Chrome follows the link, though. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/573 File a bug. :-) -- Ian Hickson U+1047E)\._.,--,'``.fL http://ln.hixie.ch/ U+263A/, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Re: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events]
On Thu, 22 Jul 2010 20:27:00 +0200, Ian Hickson i...@hixie.ch wrote: On Thu, 22 Jul 2010, Simon Pieters wrote: Even if we make this dispatch the event, it wouldn't make the link be followed — since the event isn't dispatched by the UA, there's no default action. Chrome follows the link, though. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/573 File a bug. :-) http://code.google.com/p/chromium/issues/detail?id=49976 -- Simon Pieters Opera Software
ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events]
ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events] http://www.w3.org/2008/webapps/track/issues/118 Raised by: Doug Schepers On product: DOM3 Events Simon Pieters wrote in http://lists.w3.org/Archives/Public/www-dom/2010AprJun/0041.html : [[ Is it defined what should happen in the following case? div onclick=document.links[0].dispatchEvent(event)click me/div a href=http://example.org/;test/a It seems Firefox and Opera throw an exception, while WebKit allows the event to be dispatched. I think it seems like a neat thing to be able to do, for making table rows or canvas clickable. (However the event shouldn't be a 'trusted' event in that case, of course.) To make it work today you'd have to create a new event and copy over all properties, which is annoying. ]]
Re: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events]
On Wed, Jul 21, 2010 at 10:11 AM, Web Applications Working Group Issue Tracker sysbot+trac...@w3.org wrote: ISSUE-118 (dispatchEvent links): Consider allowing dispatchEvent for generic event duplication for links [DOM3 Events] http://www.w3.org/2008/webapps/track/issues/118 Raised by: Doug Schepers On product: DOM3 Events Simon Pieters wrote in http://lists.w3.org/Archives/Public/www-dom/2010AprJun/0041.html : [[ Is it defined what should happen in the following case? div onclick=document.links[0].dispatchEvent(event)click me/div a href=http://example.org/;test/a It seems Firefox and Opera throw an exception, while WebKit allows the event to be dispatched. I think it seems like a neat thing to be able to do, for making table rows or canvas clickable. (However the event shouldn't be a 'trusted' event in that case, of course.) To make it work today you'd have to create a new event and copy over all properties, which is annoying. ]] Even if we make this dispatch the event, it wouldn't make the link be followed — since the event isn't dispatched by the UA, there's no default action. There is, in any case, a simpler solution to the above: div onclick=document.links[0].click()click me/div a href=http://example.org/;test/a -- Ian Hickson