[webkit-dev] Event listeners of the same type in DOM Level 0 event handling,

Myles C. Maxfield mmaxfield at apple.com
Fri May 13 11:01:01 PDT 2016


Given that both Mozilla Firefox and Microsoft Edge both agree with WebKit, it is unlikely we would accept a change to this behavior.

—Myles

> On May 10, 2016, at 7:31 PM, jongdeok.kim <jongdeok.kim at navercorp.com> wrote:
> 
> Hi Everyone,
>  
> A web page that I'm testing with webkit, uses two event listeners about load event.
> It registered those by assigning to window.onload and setting as an 'onload' attribute of body element.
>  
> On webkit, last registered one replaces previous one, in this case 'onload' attribute wins.
> I checked other browsers, but only chrome permits two listeners on same event type.
>  
> I googled and found out that it's DOM Level 0 event handling.
> And I'm wondering this is a webkit bug when using a mix of traditional model and inline model (as referred to below), or implementor dependent.
>  
> https://en.wikipedia.org/wiki/DOM_events#DOM_Level_0 <https://en.wikipedia.org/wiki/DOM_events#DOM_Level_0> 
>  
> <html> 
> <head> 
> <title>onloadload</title> 
> <script type="text/javascript"> 
> function load() {
>     alert("body.onload");
> }
> window.onload = function () { // traditional model
>     alert("window.onload");
> };
> </script> 
> </head> 
> <body onload="load()"> <!-- inline model -->
> <p>onload.</p> 
> </body> 
> </html> 
>  
> Thanks in advance.
> jongdeok.
>  
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org <mailto:webkit-dev at lists.webkit.org>
> https://lists.webkit.org/mailman/listinfo/webkit-dev <https://lists.webkit.org/mailman/listinfo/webkit-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-dev/attachments/20160513/9d2ae372/attachment.html>


More information about the webkit-dev mailing list