Support.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-is'>/**
  19. </span> * @class Ext.is
  20. *
  21. * Determines information about the current platform the application is running on.
  22. *
  23. * @singleton
  24. */
  25. Ext.is = {
  26. init : function(navigator) {
  27. var platforms = this.platforms,
  28. ln = platforms.length,
  29. i, platform;
  30. navigator = navigator || window.navigator;
  31. for (i = 0; i &lt; ln; i++) {
  32. platform = platforms[i];
  33. this[platform.identity] = platform.regex.test(navigator[platform.property]);
  34. }
  35. <span id='Ext-is-property-Desktop'> /**
  36. </span> * @property Desktop True if the browser is running on a desktop machine
  37. * @type {Boolean}
  38. */
  39. this.Desktop = this.Mac || this.Windows || (this.Linux &amp;&amp; !this.Android);
  40. <span id='Ext-is-property-Tablet'> /**
  41. </span> * @property Tablet True if the browser is running on a tablet (iPad)
  42. */
  43. this.Tablet = this.iPad;
  44. <span id='Ext-is-property-Phone'> /**
  45. </span> * @property Phone True if the browser is running on a phone.
  46. * @type {Boolean}
  47. */
  48. this.Phone = !this.Desktop &amp;&amp; !this.Tablet;
  49. <span id='Ext-is-property-iOS'> /**
  50. </span> * @property iOS True if the browser is running on iOS
  51. * @type {Boolean}
  52. */
  53. this.iOS = this.iPhone || this.iPad || this.iPod;
  54. <span id='Ext-is-property-Standalone'> /**
  55. </span> * @property Standalone Detects when application has been saved to homescreen.
  56. * @type {Boolean}
  57. */
  58. this.Standalone = !!window.navigator.standalone;
  59. },
  60. <span id='Ext-is-property-iPhone'> /**
  61. </span> * @property iPhone True when the browser is running on a iPhone
  62. * @type {Boolean}
  63. */
  64. platforms: [{
  65. property: 'platform',
  66. regex: /iPhone/i,
  67. identity: 'iPhone'
  68. },
  69. <span id='Ext-is-property-iPod'> /**
  70. </span> * @property iPod True when the browser is running on a iPod
  71. * @type {Boolean}
  72. */
  73. {
  74. property: 'platform',
  75. regex: /iPod/i,
  76. identity: 'iPod'
  77. },
  78. <span id='Ext-is-property-iPad'> /**
  79. </span> * @property iPad True when the browser is running on a iPad
  80. * @type {Boolean}
  81. */
  82. {
  83. property: 'userAgent',
  84. regex: /iPad/i,
  85. identity: 'iPad'
  86. },
  87. <span id='Ext-is-property-Blackberry'> /**
  88. </span> * @property Blackberry True when the browser is running on a Blackberry
  89. * @type {Boolean}
  90. */
  91. {
  92. property: 'userAgent',
  93. regex: /Blackberry/i,
  94. identity: 'Blackberry'
  95. },
  96. <span id='Ext-is-property-Android'> /**
  97. </span> * @property Android True when the browser is running on an Android device
  98. * @type {Boolean}
  99. */
  100. {
  101. property: 'userAgent',
  102. regex: /Android/i,
  103. identity: 'Android'
  104. },
  105. <span id='Ext-is-property-Mac'> /**
  106. </span> * @property Mac True when the browser is running on a Mac
  107. * @type {Boolean}
  108. */
  109. {
  110. property: 'platform',
  111. regex: /Mac/i,
  112. identity: 'Mac'
  113. },
  114. <span id='Ext-is-property-Windows'> /**
  115. </span> * @property Windows True when the browser is running on Windows
  116. * @type {Boolean}
  117. */
  118. {
  119. property: 'platform',
  120. regex: /Win/i,
  121. identity: 'Windows'
  122. },
  123. <span id='Ext-is-property-Linux'> /**
  124. </span> * @property Linux True when the browser is running on Linux
  125. * @type {Boolean}
  126. */
  127. {
  128. property: 'platform',
  129. regex: /Linux/i,
  130. identity: 'Linux'
  131. }]
  132. };
  133. Ext.is.init();
  134. <span id='Ext-supports'>/**
  135. </span> * @class Ext.supports
  136. *
  137. * Determines information about features are supported in the current environment
  138. *
  139. * @singleton
  140. */
  141. (function(){
  142. // this is a local copy of certain logic from (Abstract)Element.getStyle
  143. // to break a dependancy between the supports mechanism and Element
  144. // use this instead of element references to check for styling info
  145. var getStyle = function(element, styleName){
  146. var view = element.ownerDocument.defaultView,
  147. style = (view ? view.getComputedStyle(element, null) : element.currentStyle) || element.style;
  148. return style[styleName];
  149. };
  150. Ext.supports = {
  151. <span id='Ext-supports-method-init'> /**
  152. </span> * Runs feature detection routines and sets the various flags. This is called when
  153. * the scripts loads (very early) and again at {@link Ext#onReady}. Some detections
  154. * are flagged as `early` and run immediately. Others that require the document body
  155. * will not run until ready.
  156. *
  157. * Each test is run only once, so calling this method from an onReady function is safe
  158. * and ensures that all flags have been set.
  159. * @markdown
  160. * @private
  161. */
  162. init : function() {
  163. var me = this,
  164. doc = document,
  165. tests = me.tests,
  166. n = tests.length,
  167. div = n &amp;&amp; Ext.isReady &amp;&amp; doc.createElement('div'),
  168. test, notRun = [];
  169. if (div) {
  170. div.innerHTML = [
  171. '&lt;div style=&quot;height:30px;width:50px;&quot;&gt;',
  172. '&lt;div style=&quot;height:20px;width:20px;&quot;&gt;&lt;/div&gt;',
  173. '&lt;/div&gt;',
  174. '&lt;div style=&quot;width: 200px; height: 200px; position: relative; padding: 5px;&quot;&gt;',
  175. '&lt;div style=&quot;position: absolute; top: 0; left: 0; width: 100%; height: 100%;&quot;&gt;&lt;/div&gt;',
  176. '&lt;/div&gt;',
  177. '&lt;div style=&quot;position: absolute; left: 10%; top: 10%;&quot;&gt;&lt;/div&gt;',
  178. '&lt;div style=&quot;float:left; background-color:transparent;&quot;&gt;&lt;/div&gt;'
  179. ].join('');
  180. doc.body.appendChild(div);
  181. }
  182. while (n--) {
  183. test = tests[n];
  184. if (div || test.early) {
  185. me[test.identity] = test.fn.call(me, doc, div);
  186. } else {
  187. notRun.push(test);
  188. }
  189. }
  190. if (div) {
  191. doc.body.removeChild(div);
  192. }
  193. me.tests = notRun;
  194. },
  195. <span id='Ext-supports-property-PointerEvents'> /**
  196. </span> * @property PointerEvents True if document environment supports the CSS3 pointer-events style.
  197. * @type {Boolean}
  198. */
  199. PointerEvents: 'pointerEvents' in document.documentElement.style,
  200. <span id='Ext-supports-property-CSS3BoxShadow'> /**
  201. </span> * @property CSS3BoxShadow True if document environment supports the CSS3 box-shadow style.
  202. * @type {Boolean}
  203. */
  204. CSS3BoxShadow: 'boxShadow' in document.documentElement.style || 'WebkitBoxShadow' in document.documentElement.style || 'MozBoxShadow' in document.documentElement.style,
  205. <span id='Ext-supports-property-ClassList'> /**
  206. </span> * @property ClassList True if document environment supports the HTML5 classList API.
  207. * @type {Boolean}
  208. */
  209. ClassList: !!document.documentElement.classList,
  210. <span id='Ext-supports-property-OrientationChange'> /**
  211. </span> * @property OrientationChange True if the device supports orientation change
  212. * @type {Boolean}
  213. */
  214. OrientationChange: ((typeof window.orientation != 'undefined') &amp;&amp; ('onorientationchange' in window)),
  215. <span id='Ext-supports-property-DeviceMotion'> /**
  216. </span> * @property DeviceMotion True if the device supports device motion (acceleration and rotation rate)
  217. * @type {Boolean}
  218. */
  219. DeviceMotion: ('ondevicemotion' in window),
  220. <span id='Ext-supports-property-Touch'> /**
  221. </span> * @property Touch True if the device supports touch
  222. * @type {Boolean}
  223. */
  224. // is.Desktop is needed due to the bug in Chrome 5.0.375, Safari 3.1.2
  225. // and Safari 4.0 (they all have 'ontouchstart' in the window object).
  226. Touch: ('ontouchstart' in window) &amp;&amp; (!Ext.is.Desktop),
  227. <span id='Ext-supports-property-TimeoutActualLateness'> /**
  228. </span> * @property TimeoutActualLateness True if the browser passes the &quot;actualLateness&quot; parameter to
  229. * setTimeout. See: https://developer.mozilla.org/en/DOM/window.setTimeout
  230. * @type {Boolean}
  231. */
  232. TimeoutActualLateness: (function(){
  233. setTimeout(function(){
  234. Ext.supports.TimeoutActualLateness = arguments.length !== 0;
  235. }, 0);
  236. }()),
  237. tests: [
  238. <span id='Ext-supports-property-Transitions'> /**
  239. </span> * @property Transitions True if the device supports CSS3 Transitions
  240. * @type {Boolean}
  241. */
  242. {
  243. identity: 'Transitions',
  244. fn: function(doc, div) {
  245. var prefix = [
  246. 'webkit',
  247. 'Moz',
  248. 'o',
  249. 'ms',
  250. 'khtml'
  251. ],
  252. TE = 'TransitionEnd',
  253. transitionEndName = [
  254. prefix[0] + TE,
  255. 'transitionend', //Moz bucks the prefixing convention
  256. prefix[2] + TE,
  257. prefix[3] + TE,
  258. prefix[4] + TE
  259. ],
  260. ln = prefix.length,
  261. i = 0,
  262. out = false;
  263. for (; i &lt; ln; i++) {
  264. if (getStyle(div, prefix[i] + &quot;TransitionProperty&quot;)) {
  265. Ext.supports.CSS3Prefix = prefix[i];
  266. Ext.supports.CSS3TransitionEnd = transitionEndName[i];
  267. out = true;
  268. break;
  269. }
  270. }
  271. return out;
  272. }
  273. },
  274. <span id='Ext-supports-property-RightMargin'> /**
  275. </span> * @property RightMargin True if the device supports right margin.
  276. * See https://bugs.webkit.org/show_bug.cgi?id=13343 for why this is needed.
  277. * @type {Boolean}
  278. */
  279. {
  280. identity: 'RightMargin',
  281. fn: function(doc, div) {
  282. var view = doc.defaultView;
  283. return !(view &amp;&amp; view.getComputedStyle(div.firstChild.firstChild, null).marginRight != '0px');
  284. }
  285. },
  286. <span id='Ext-supports-property-DisplayChangeInputSelectionBug'> /**
  287. </span> * @property DisplayChangeInputSelectionBug True if INPUT elements lose their
  288. * selection when their display style is changed. Essentially, if a text input
  289. * has focus and its display style is changed, the I-beam disappears.
  290. *
  291. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  292. * bug. This has been observed in Safari 4.0.4 and older, and appears to be fixed
  293. * in Safari 5. It's not clear if Safari 4.1 has the bug, but it has the same WebKit
  294. * version number as Safari 5 (according to http://unixpapa.com/js/gecko.html).
  295. */
  296. {
  297. identity: 'DisplayChangeInputSelectionBug',
  298. early: true,
  299. fn: function() {
  300. var webKitVersion = Ext.webKitVersion;
  301. // WebKit but older than Safari 5 or Chrome 6:
  302. return 0 &lt; webKitVersion &amp;&amp; webKitVersion &lt; 533;
  303. }
  304. },
  305. <span id='Ext-supports-property-DisplayChangeTextAreaSelectionBug'> /**
  306. </span> * @property DisplayChangeTextAreaSelectionBug True if TEXTAREA elements lose their
  307. * selection when their display style is changed. Essentially, if a text area has
  308. * focus and its display style is changed, the I-beam disappears.
  309. *
  310. * This bug is encountered due to the work around in place for the {@link #RightMargin}
  311. * bug. This has been observed in Chrome 10 and Safari 5 and older, and appears to
  312. * be fixed in Chrome 11.
  313. */
  314. {
  315. identity: 'DisplayChangeTextAreaSelectionBug',
  316. early: true,
  317. fn: function() {
  318. var webKitVersion = Ext.webKitVersion;
  319. /*
  320. Has bug w/textarea:
  321. (Chrome) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-US)
  322. AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.127
  323. Safari/534.16
  324. (Safari) Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us)
  325. AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5
  326. Safari/533.21.1
  327. No bug:
  328. (Chrome) Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_7)
  329. AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.57
  330. Safari/534.24
  331. */
  332. return 0 &lt; webKitVersion &amp;&amp; webKitVersion &lt; 534.24;
  333. }
  334. },
  335. <span id='Ext-supports-property-TransparentColor'> /**
  336. </span> * @property TransparentColor True if the device supports transparent color
  337. * @type {Boolean}
  338. */
  339. {
  340. identity: 'TransparentColor',
  341. fn: function(doc, div, view) {
  342. view = doc.defaultView;
  343. return !(view &amp;&amp; view.getComputedStyle(div.lastChild, null).backgroundColor != 'transparent');
  344. }
  345. },
  346. <span id='Ext-supports-property-ComputedStyle'> /**
  347. </span> * @property ComputedStyle True if the browser supports document.defaultView.getComputedStyle()
  348. * @type {Boolean}
  349. */
  350. {
  351. identity: 'ComputedStyle',
  352. fn: function(doc, div, view) {
  353. view = doc.defaultView;
  354. return view &amp;&amp; view.getComputedStyle;
  355. }
  356. },
  357. <span id='Ext-supports-property-Svg'> /**
  358. </span> * @property Svg True if the device supports SVG
  359. * @type {Boolean}
  360. */
  361. {
  362. identity: 'Svg',
  363. fn: function(doc) {
  364. return !!doc.createElementNS &amp;&amp; !!doc.createElementNS( &quot;http:/&quot; + &quot;/www.w3.org/2000/svg&quot;, &quot;svg&quot;).createSVGRect;
  365. }
  366. },
  367. <span id='Ext-supports-property-Canvas'> /**
  368. </span> * @property Canvas True if the device supports Canvas
  369. * @type {Boolean}
  370. */
  371. {
  372. identity: 'Canvas',
  373. fn: function(doc) {
  374. return !!doc.createElement('canvas').getContext;
  375. }
  376. },
  377. <span id='Ext-supports-property-Vml'> /**
  378. </span> * @property Vml True if the device supports VML
  379. * @type {Boolean}
  380. */
  381. {
  382. identity: 'Vml',
  383. fn: function(doc) {
  384. var d = doc.createElement(&quot;div&quot;);
  385. d.innerHTML = &quot;&lt;!--[if vml]&gt;&lt;br/&gt;&lt;br/&gt;&lt;![endif]--&gt;&quot;;
  386. return (d.childNodes.length == 2);
  387. }
  388. },
  389. <span id='Ext-supports-property-Float'> /**
  390. </span> * @property Float True if the device supports CSS float
  391. * @type {Boolean}
  392. */
  393. {
  394. identity: 'Float',
  395. fn: function(doc, div) {
  396. return !!div.lastChild.style.cssFloat;
  397. }
  398. },
  399. <span id='Ext-supports-property-AudioTag'> /**
  400. </span> * @property AudioTag True if the device supports the HTML5 audio tag
  401. * @type {Boolean}
  402. */
  403. {
  404. identity: 'AudioTag',
  405. fn: function(doc) {
  406. return !!doc.createElement('audio').canPlayType;
  407. }
  408. },
  409. <span id='Ext-supports-property-History'> /**
  410. </span> * @property History True if the device supports HTML5 history
  411. * @type {Boolean}
  412. */
  413. {
  414. identity: 'History',
  415. fn: function() {
  416. var history = window.history;
  417. return !!(history &amp;&amp; history.pushState);
  418. }
  419. },
  420. <span id='Ext-supports-property-CSS3DTransform'> /**
  421. </span> * @property CSS3DTransform True if the device supports CSS3DTransform
  422. * @type {Boolean}
  423. */
  424. {
  425. identity: 'CSS3DTransform',
  426. fn: function() {
  427. return (typeof WebKitCSSMatrix != 'undefined' &amp;&amp; new WebKitCSSMatrix().hasOwnProperty('m41'));
  428. }
  429. },
  430. <span id='Ext-supports-property-CSS3LinearGradient'> /**
  431. </span> * @property CSS3LinearGradient True if the device supports CSS3 linear gradients
  432. * @type {Boolean}
  433. */
  434. {
  435. identity: 'CSS3LinearGradient',
  436. fn: function(doc, div) {
  437. var property = 'background-image:',
  438. webkit = '-webkit-gradient(linear, left top, right bottom, from(black), to(white))',
  439. w3c = 'linear-gradient(left top, black, white)',
  440. moz = '-moz-' + w3c,
  441. opera = '-o-' + w3c,
  442. options = [property + webkit, property + w3c, property + moz, property + opera];
  443. div.style.cssText = options.join(';');
  444. return (&quot;&quot; + div.style.backgroundImage).indexOf('gradient') !== -1;
  445. }
  446. },
  447. <span id='Ext-supports-property-CSS3BorderRadius'> /**
  448. </span> * @property CSS3BorderRadius True if the device supports CSS3 border radius
  449. * @type {Boolean}
  450. */
  451. {
  452. identity: 'CSS3BorderRadius',
  453. fn: function(doc, div) {
  454. var domPrefixes = ['borderRadius', 'BorderRadius', 'MozBorderRadius', 'WebkitBorderRadius', 'OBorderRadius', 'KhtmlBorderRadius'],
  455. pass = false,
  456. i;
  457. for (i = 0; i &lt; domPrefixes.length; i++) {
  458. if (document.body.style[domPrefixes[i]] !== undefined) {
  459. return true;
  460. }
  461. }
  462. return pass;
  463. }
  464. },
  465. <span id='Ext-supports-property-GeoLocation'> /**
  466. </span> * @property GeoLocation True if the device supports GeoLocation
  467. * @type {Boolean}
  468. */
  469. {
  470. identity: 'GeoLocation',
  471. fn: function() {
  472. return (typeof navigator != 'undefined' &amp;&amp; typeof navigator.geolocation != 'undefined') || (typeof google != 'undefined' &amp;&amp; typeof google.gears != 'undefined');
  473. }
  474. },
  475. <span id='Ext-supports-property-MouseEnterLeave'> /**
  476. </span> * @property MouseEnterLeave True if the browser supports mouseenter and mouseleave events
  477. * @type {Boolean}
  478. */
  479. {
  480. identity: 'MouseEnterLeave',
  481. fn: function(doc, div){
  482. return ('onmouseenter' in div &amp;&amp; 'onmouseleave' in div);
  483. }
  484. },
  485. <span id='Ext-supports-property-MouseWheel'> /**
  486. </span> * @property MouseWheel True if the browser supports the mousewheel event
  487. * @type {Boolean}
  488. */
  489. {
  490. identity: 'MouseWheel',
  491. fn: function(doc, div) {
  492. return ('onmousewheel' in div);
  493. }
  494. },
  495. <span id='Ext-supports-property-Opacity'> /**
  496. </span> * @property Opacity True if the browser supports normal css opacity
  497. * @type {Boolean}
  498. */
  499. {
  500. identity: 'Opacity',
  501. fn: function(doc, div){
  502. // Not a strict equal comparison in case opacity can be converted to a number.
  503. if (Ext.isIE6 || Ext.isIE7 || Ext.isIE8) {
  504. return false;
  505. }
  506. div.firstChild.style.cssText = 'opacity:0.73';
  507. return div.firstChild.style.opacity == '0.73';
  508. }
  509. },
  510. <span id='Ext-supports-property-Placeholder'> /**
  511. </span> * @property Placeholder True if the browser supports the HTML5 placeholder attribute on inputs
  512. * @type {Boolean}
  513. */
  514. {
  515. identity: 'Placeholder',
  516. fn: function(doc) {
  517. return 'placeholder' in doc.createElement('input');
  518. }
  519. },
  520. <span id='Ext-supports-property-Direct2DBug'> /**
  521. </span> * @property Direct2DBug True if when asking for an element's dimension via offsetWidth or offsetHeight,
  522. * getBoundingClientRect, etc. the browser returns the subpixel width rounded to the nearest pixel.
  523. * @type {Boolean}
  524. */
  525. {
  526. identity: 'Direct2DBug',
  527. fn: function() {
  528. return Ext.isString(document.body.style.msTransformOrigin);
  529. }
  530. },
  531. <span id='Ext-supports-property-BoundingClientRect'> /**
  532. </span> * @property BoundingClientRect True if the browser supports the getBoundingClientRect method on elements
  533. * @type {Boolean}
  534. */
  535. {
  536. identity: 'BoundingClientRect',
  537. fn: function(doc, div) {
  538. return Ext.isFunction(div.getBoundingClientRect);
  539. }
  540. },
  541. {
  542. identity: 'IncludePaddingInWidthCalculation',
  543. fn: function(doc, div){
  544. return div.childNodes[1].firstChild.offsetWidth == 210;
  545. }
  546. },
  547. {
  548. identity: 'IncludePaddingInHeightCalculation',
  549. fn: function(doc, div){
  550. return div.childNodes[1].firstChild.offsetHeight == 210;
  551. }
  552. },
  553. <span id='Ext-supports-property-ArraySort'> /**
  554. </span> * @property ArraySort True if the Array sort native method isn't bugged.
  555. * @type {Boolean}
  556. */
  557. {
  558. identity: 'ArraySort',
  559. fn: function() {
  560. var a = [1,2,3,4,5].sort(function(){ return 0; });
  561. return a[0] === 1 &amp;&amp; a[1] === 2 &amp;&amp; a[2] === 3 &amp;&amp; a[3] === 4 &amp;&amp; a[4] === 5;
  562. }
  563. },
  564. <span id='Ext-supports-property-Range'> /**
  565. </span> * @property Range True if browser support document.createRange native method.
  566. * @type {Boolean}
  567. */
  568. {
  569. identity: 'Range',
  570. fn: function() {
  571. return !!document.createRange;
  572. }
  573. },
  574. <span id='Ext-supports-property-CreateContextualFragment'> /**
  575. </span> * @property CreateContextualFragment True if browser support CreateContextualFragment range native methods.
  576. * @type {Boolean}
  577. */
  578. {
  579. identity: 'CreateContextualFragment',
  580. fn: function() {
  581. var range = Ext.supports.Range ? document.createRange() : false;
  582. return range &amp;&amp; !!range.createContextualFragment;
  583. }
  584. },
  585. <span id='Ext-supports-property-WindowOnError'> /**
  586. </span> * @property WindowOnError True if browser supports window.onerror.
  587. * @type {Boolean}
  588. */
  589. {
  590. identity: 'WindowOnError',
  591. fn: function () {
  592. // sadly, we cannot feature detect this...
  593. return Ext.isIE || Ext.isGecko || Ext.webKitVersion &gt;= 534.16; // Chrome 10+
  594. }
  595. },
  596. <span id='Ext-supports-property-TextAreaMaxLength'> /**
  597. </span> * @property TextAreaMaxLength True if the browser supports maxlength on textareas.
  598. * @type {Boolean}
  599. */
  600. {
  601. identity: 'TextAreaMaxLength',
  602. fn: function(){
  603. var el = document.createElement('textarea');
  604. return ('maxlength' in el);
  605. }
  606. },
  607. <span id='Ext-supports-property-GetPositionPercentage'> /**
  608. </span> * @property GetPositionPercentage True if the browser will return the left/top/right/bottom
  609. * position as a percentage when explicitly set as a percentage value.
  610. * @type {Boolean}
  611. */
  612. // Related bug: https://bugzilla.mozilla.org/show_bug.cgi?id=707691#c7
  613. {
  614. identity: 'GetPositionPercentage',
  615. fn: function(doc, div){
  616. return getStyle(div.childNodes[2], 'left') == '10%';
  617. }
  618. }
  619. ]
  620. };
  621. }());
  622. Ext.supports.init(); // run the &quot;early&quot; detections now
  623. </pre>
  624. </body>
  625. </html>