Skip to content

Commit

Permalink
ie html5 enabling should check for attachEvent too. speeds up non-IE
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Oct 9, 2010
1 parent 9522bb7 commit 14ea43a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ window.Modernizr = (function(window,doc,undefined){
// Enable HTML 5 elements for styling in IE.
// fyi: jscript version does not reflect trident version
// therefore ie9 in ie7 mode will still have a jScript v.9
if ( enableHTML5 && (function(){ var elem = doc.createElement("div");
if ( enableHTML5 && window.attachEvent && (function(){ var elem = doc.createElement("div");
elem.innerHTML = "<elem></elem>";
return elem.childNodes.length !== 1; })()) {
// iepp v1.5.1 MIT @jon_neal http://code.google.com/p/ie-print-protector/
Expand Down

3 comments on commit 14ea43a

@miketaylr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will run in Opera as well.

@paulirish
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aye. I thought so. (it's still in, post 10.00??)
but oh well. saves the DOM work from FF/Webkit which is worth it.

@miketaylr
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeap, still there. You could add an extra && !window.opera, though. ;)

Please sign in to comment.