diff --git a/CHANGELOG b/CHANGELOG index 59f5020..43db9e1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Add Prototype.Browser.MobileSafari which evaluates to true on the iPhone's browser. [sam] + * Optimize Selector#match and Element#match for simple selectors. Closes #9082. [Andrew Dupont] * Remove the dependency on Element.ClassNames from Element#addClassName/removeClassName/toggleClassName, and deprecate Element.ClassNames. Closes #9073. [Tobie Langel] diff --git a/src/prototype.js b/src/prototype.js index 9ff3816..e65893c 100644 --- a/src/prototype.js +++ b/src/prototype.js @@ -7,16 +7,16 @@ var Prototype = { IE: !!(window.attachEvent && !window.opera), Opera: !!window.opera, WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1, - Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1 + Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1, + MobileSafari: !!navigator.userAgent.match(/iPhone.*Mobile.*Safari/) }, BrowserFeatures: { XPath: !!document.evaluate, ElementExtensions: !!window.HTMLElement, SpecificElementExtensions: - navigator.userAgent.indexOf('iPhone') == -1 && - (document.createElement('div').__proto__ !== - document.createElement('form').__proto__) + document.createElement('div').__proto__ !== + document.createElement('form').__proto__ }, ScriptFragment: ']*>([\\S\\s]*?)<\/script>', @@ -24,7 +24,10 @@ var Prototype = { emptyFunction: function() { }, K: function(x) { return x } -} +}; + +if (Prototype.Browser.MobileSafari) + Prototype.BrowserFeatures.SpecificElementExtensions = false; <%= include 'base.js', 'string.js' %>