Changed feature detection in order to properly detect the mutable Element prototypes in IE8.

This commit is contained in:
Andrew Dupont 2009-01-21 20:29:23 -06:00
parent 44287477cc
commit 4af7dc0f5d
1 changed files with 19 additions and 5 deletions

24
src/prototype.js vendored
View File

@ -16,11 +16,25 @@ var Prototype = {
BrowserFeatures: {
XPath: !!document.evaluate,
SelectorsAPI: !!document.querySelector,
ElementExtensions: !!window.HTMLElement,
SpecificElementExtensions:
document.createElement('div')['__proto__'] &&
document.createElement('div')['__proto__'] !==
document.createElement('form')['__proto__']
ElementExtensions: (function() {
if (window.HTMLElement && window.HTMLElement.prototype)
return true;
if (window.Element && window.Element.prototype)
return true;
})(),
SpecificElementExtensions: (function() {
// First, try the named class
if (typeof window.HTMLDivElement !== 'undefined')
return true;
var div = document.createElement('div');
if (div['__proto__'] && div['__proto__'] !==
document.createElement('form')['__proto__']) {
return true;
}
return false;
})()
},
ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',