showAlert() patch

Re http://krijnhoetmer.nl/irc-logs/whatwg/20120604#l-615

The script is inline in the spec. In the showAlert() function, just after  
the line:

        document.body.appendChild(currentAlert);

add:

        x.focus();


also change:

    window.addEventListener('keydown', function (event) {
      if (event.keyCode == 27) {
        if (currentAlert)
          closeAlert2();
      } else {
        closeAlert();
      }
    }, false);

to:

    window.addEventListener('keydown', function (event) {
      if (event.keyCode == 27) {
        if (currentAlert)
          closeAlert2();
      }
    }, false);


and remove:

    window.addEventListener('scroll', function (event) {
      closeAlert();
    }, false);


Thanks!

-- 
Simon Pieters
Opera Software

Received on Wednesday, 15 August 2012 09:51:25 UTC