vendor: 45,521 bytes, lines 1-1222
1/*! 2 * Modernizr v2.8.3 3 * www.modernizr.com 4 * 5 * Copyright (c) Faruk Ates, Paul Irish, Alex Sexton 6 * Available under the BSD and MIT licenses: www.modernizr.com/license/ 7 */ 8 9/* 10 * Modernizr tests which native CSS3 and HTML5 features are available in 11 * the current UA and makes the results available to you in two ways: 12 * as properties on a global Modernizr object, and as classes on the 13 * <html> element. This information allows you to progressively enhance 14 * your pages with a granular level of control over the experience. 15 * 16 * Modernizr has an optional (not included) conditional resource loader 17 * called Modernizr.load(), based on Yepnope.js (yepnopejs.com). 18 * To get a build that includes Modernizr.load(), as well as choosing 19 * which tests to include, go to www.modernizr.com/download/ 20 * 21 * Authors Faruk Ates, Paul Irish, Alex Sexton 22 * Contributors Ryan Seddon, Ben Alman 23 */ 24 25window.Modernizr = (function (window, document, undefined) { 26 27 var version = '2.8.3', 28 29 Modernizr = {}, 30 31 /*>>cssclasses*/ 32 // option for enabling the HTML classes to be added 33 enableClasses = true, 34 /*>>cssclasses*/ 35 36 docElement = document.documentElement, 37 38 /** 39 * Create our "modernizr" element that we do most feature tests on. 40 */ 41 mod = 'modernizr', 42 modElem = document.createElement(mod), 43 mStyle = modElem.style, 44 45 /** 46 * Create the input element for various Web Forms feature tests. 47 */ 48 inputElem /*>>inputelem*/ = document.createElement('input') /*>>inputelem*/, 49 50 /*>>smile*/ 51 smile = ':)', 52 /*>>smile*/ 53 54 toString = {}.toString, 55 56 // TODO :: make the prefixes more granular 57 /*>>prefixes*/ 58 // List of property values to set for css tests. See ticket #21 59 prefixes = ' -webkit- -moz- -o- -ms- '.split(' '), 60 /*>>prefixes*/ 61 62 /*>>domprefixes*/ 63 // Following spec is to expose vendor-specific style properties as: 64 // elem.style.WebkitBorderRadius 65 // and the following would be incorrect: 66 // elem.style.webkitBorderRadius 67 68 // Webkit ghosts their properties in lowercase but Opera & Moz do not. 69 // Microsoft uses a lowercase `ms` instead of the correct `Ms` in IE8+ 70 // erik.eae.net/archives/2008/03/10/21.48.10/ 71 72 // More here: github.com/Modernizr/Modernizr/issues/issue/21 73 omPrefixes = 'Webkit Moz O ms', 74 75 cssomPrefixes = omPrefixes.split(' '), 76 77 domPrefixes = omPrefixes.toLowerCase().split(' '), 78 /*>>domprefixes*/ 79 80 /*>>ns*/ 81 ns = {'svg': 'http://www.w3.org/2000/svg'}, 82 /*>>ns*/ 83 84 tests = {}, 85 inputs = {}, 86 attrs = {}, 87 88 classes = [], 89 90 slice = classes.slice, 91 92 featureName, // used in testing loop 93 94 95 /*>>teststyles*/ 96 // Inject element with style element and some CSS rules 97 injectElementWithStyles = function (rule, callback, nodes, testnames) { 98 99 var style, ret, node, docOverflow, 100 div = document.createElement('div'), 101 // After page load injecting a fake body doesn't work so check if body exists 102 body = document.body, 103 // IE6 and 7 won't return offsetWidth or offsetHeight unless it's in the body element, so we fake it. 104 fakeBody = body || document.createElement('body'); 105 106 if (parseInt(nodes, 10)) { 107 // In order not to give false positives we create a node for each test 108 // This also allows the method to scale for unspecified uses 109 while (nodes--) { 110 node = document.createElement('div'); 111 node.id = testnames ? testnames[nodes] : mod + (nodes + 1); 112 div.appendChild(node); 113 } 114 } 115 116 // <style> elements in IE6-9 are considered 'NoScope' elements and therefore will be removed 117 // when injected with innerHTML. To get around this you need to prepend the 'NoScope' element 118 // with a 'scoped' element, in our case the soft-hyphen entity as it won't mess with our measurements. 119 // msdn.microsoft.com/en-us/library/ms533897%28VS.85%29.aspx 120 // Documents served as xml will throw if using ­ so use xml friendly encoded version. See issue #277 121 style = ['­', '<style id="s', mod, '">', rule, '</style>'].join(''); 122 div.id = mod; 123 // IE6 will false positive on some tests due to the style element inside the test div somehow interfering offsetHeight, so insert it into body or fakebody. 124 // Opera will act all quirky when injecting elements in documentElement when page is served as xml, needs fakebody too. #270 125 (body ? div : fakeBody).innerHTML += style; 126 fakeBody.appendChild(div); 127 if (!body) { 128 //avoid crashing IE8, if background image is used 129 fakeBody.style.background = ''; 130 //Safari 5.13/5.1.4 OSX stops loading if ::-webkit-scrollbar is used and scrollbars are visible 131 fakeBody.style.overflow = 'hidden'; 132 docOverflow = docElement.style.overflow; 133 docElement.style.overflow = 'hidden'; 134 docElement.appendChild(fakeBody); 135 } 136 137 ret = callback(div, rule); 138 // If this is done after page load we don't want to remove the body so check if body exists 139 if (!body) { 140 fakeBody.parentNode.removeChild(fakeBody); 141 docElement.style.overflow = docOverflow; 142 } else { 143 div.parentNode.removeChild(div); 144 } 145 146 return !!ret; 147 148 }, 149 /*>>teststyles*/ 150 151 /*>>mq*/ 152 // adapted from matchMedia polyfill 153 // by Scott Jehl and Paul Irish 154 // gist.github.com/786768 155 testMediaQuery = function (mq) { 156 157 var matchMedia = window.matchMedia || window.msMatchMedia; 158 if (matchMedia) { 159 return matchMedia(mq) && matchMedia(mq).matches || false; 160 } 161 162 var bool; 163 164 injectElementWithStyles('@media ' + mq + ' { #' + mod + ' { position: absolute; } }', function (node) { 165 bool = (window.getComputedStyle ? 166 getComputedStyle(node, null) : 167 node.currentStyle)['position'] == 'absolute'; 168 }); 169 170 return bool; 171 172 }, 173 /*>>mq*/ 174 175 176 /*>>hasevent*/ 177 // 178 // isEventSupported determines if a given element supports the given event 179 // kangax.github.com/iseventsupported/ 180 // 181 // The following results are known incorrects: 182 // Modernizr.hasEvent("webkitTransitionEnd", elem) // false negative 183 // Modernizr.hasEvent("textInput") // in Webkit. github.com/Modernizr/Modernizr/issues/333 184 // ... 185 isEventSupported = (function () { 186 187 var TAGNAMES = { 188 'select': 'input', 'change': 'input', 189 'submit': 'form', 'reset': 'form', 190 'error': 'img', 'load': 'img', 'abort': 'img' 191 }; 192 193 function isEventSupported(eventName, element) { 194 195 element = element || document.createElement(TAGNAMES[eventName] || 'div'); 196 eventName = 'on' + eventName; 197 198 // When using `setAttribute`, IE skips "unload", WebKit skips "unload" and "resize", whereas `in` "catches" those 199 var isSupported = eventName in element; 200 201 if (!isSupported) { 202 // If it has no `setAttribute` (i.e. doesn't implement Node interface), try generic element 203 if (!element.setAttribute) { 204 element = document.createElement('div'); 205 } 206 if (element.setAttribute && element.removeAttribute) { 207 element.setAttribute(eventName, ''); 208 isSupported = is(element[eventName], 'function'); 209 210 // If property was created, "remove it" (by setting value to `undefined`) 211 if (!is(element[eventName], 'undefined')) { 212 element[eventName] = undefined; 213 } 214 element.removeAttribute(eventName); 215 } 216 } 217 218 element = null; 219 return isSupported; 220 } 221 222 return isEventSupported; 223 })(), 224 /*>>hasevent*/ 225 226 // TODO :: Add flag for hasownprop ? didn't last time 227 228 // hasOwnProperty shim by kangax needed for Safari 2.0 support 229 _hasOwnProperty = ({}).hasOwnProperty, hasOwnProp; 230 231 if (!is(_hasOwnProperty, 'undefined') && !is(_hasOwnProperty.call, 'undefined')) { 232 hasOwnProp = function (object, property) { 233 return _hasOwnProperty.call(object, property); 234 }; 235 } else { 236 hasOwnProp = function (object, property) { /* yes, this can give false positives/negatives, but most of the time we don't care about those */ 237 return ((property in object) && is(object.constructor.prototype[property], 'undefined')); 238 }; 239 } 240 241 // Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js 242 // es5.github.com/#x15.3.4.5 243 244 if (!Function.prototype.bind) { 245 Function.prototype.bind = function bind(that) { 246 247 var target = this; 248 249 if (typeof target != "function") { 250 throw new TypeError(); 251 } 252 253 var args = slice.call(arguments, 1), 254 bound = function () { 255 256 if (this instanceof bound) { 257 258 var F = function () { 259 }; 260 F.prototype = target.prototype; 261 var self = new F(); 262 263 var result = target.apply( 264 self, 265 args.concat(slice.call(arguments)) 266 ); 267 if (Object(result) === result) { 268 return result; 269 } 270 return self; 271 272 } else { 273 274 return target.apply( 275 that, 276 args.concat(slice.call(arguments)) 277 ); 278 279 } 280 281 }; 282 283 return bound; 284 }; 285 } 286 287 /** 288 * setCss applies given styles to the Modernizr DOM node. 289 */ 290 function setCss(str) { 291 mStyle.cssText = str; 292 } 293 294 /** 295 * setCssAll extrapolates all vendor-specific css strings. 296 */ 297 function setCssAll(str1, str2) { 298 return setCss(prefixes.join(str1 + ';') + (str2 || '')); 299 } 300 301 /** 302 * is returns a boolean for if typeof obj is exactly type. 303 */ 304 function is(obj, type) { 305 return typeof obj === type; 306 } 307 308 /** 309 * contains returns a boolean for if substr is found within str. 310 */ 311 function contains(str, substr) { 312 return !!~('' + str).indexOf(substr); 313 } 314 315 /*>>testprop*/ 316 317 // testProps is a generic CSS / DOM property test. 318 319 // In testing support for a given CSS property, it's legit to test: 320 // `elem.style[styleName] !== undefined` 321 // If the property is supported it will return an empty string, 322 // if unsupported it will return undefined. 323 324 // We'll take advantage of this quick test and skip setting a style 325 // on our modernizr element, but instead just testing undefined vs 326 // empty string. 327 328 // Because the testing of the CSS property names (with "-", as 329 // opposed to the camelCase DOM properties) is non-portable and 330 // non-standard but works in WebKit and IE (but not Gecko or Opera), 331 // we explicitly reject properties with dashes so that authors 332 // developing in WebKit or IE first don't end up with 333 // browser-specific content by accident. 334 335 function testProps(props, prefixed) { 336 for (var i in props) { 337 var prop = props[i]; 338 if (!contains(prop, "-") && mStyle[prop] !== undefined) { 339 return prefixed == 'pfx' ? prop : true; 340 } 341 } 342 return false; 343 } 344 345 /*>>testprop*/ 346 347 // TODO :: add testDOMProps 348 /** 349 * testDOMProps is a generic DOM property test; if a browser supports 350 * a certain property, it won't return undefined for it. 351 */ 352 function testDOMProps(props, obj, elem) { 353 for (var i in props) { 354 var item = obj[props[i]]; 355 if (item !== undefined) { 356 357 // return the property name as a string 358 if (elem === false) return props[i]; 359 360 // let's bind a function 361 if (is(item, 'function')) { 362 // default to autobind unless override 363 return item.bind(elem || obj); 364 } 365 366 // return the unbound function or obj or value 367 return item; 368 } 369 } 370 return false; 371 } 372 373 /*>>testallprops*/ 374 /** 375 * testPropsAll tests a list of DOM properties we want to check against. 376 * We specify literally ALL possible (known and/or likely) properties on 377 * the element including the non-vendor prefixed one, for forward- 378 * compatibility. 379 */ 380 function testPropsAll(prop, prefixed, elem) { 381 382 var ucProp = prop.charAt(0).toUpperCase() + prop.slice(1), 383 props = (prop + ' ' + cssomPrefixes.join(ucProp + ' ') + ucProp).split(' '); 384 385 // did they call .prefixed('boxSizing') or are we just testing a prop? 386 if (is(prefixed, "string") || is(prefixed, "undefined")) { 387 return testProps(props, prefixed); 388 389 // otherwise, they called .prefixed('requestAnimationFrame', window[, elem]) 390 } else { 391 props = (prop + ' ' + (domPrefixes).join(ucProp + ' ') + ucProp).split(' '); 392 return testDOMProps(props, prefixed, elem); 393 } 394 } 395 396 /*>>testallprops*/ 397 398 399 /** 400 * Tests 401 * ----- 402 */ 403 404 // The *new* flexbox 405 // dev.w3.org/csswg/css3-flexbox 406 407 tests['flexbox'] = function () { 408 return testPropsAll('flexWrap'); 409 }; 410 411 // The *old* flexbox 412 // www.w3.org/TR/2009/WD-css3-flexbox-20090723/ 413 414 tests['flexboxlegacy'] = function () { 415 return testPropsAll('boxDirection'); 416 }; 417 418 // On the S60 and BB Storm, getContext exists, but always returns undefined 419 // so we actually have to call getContext() to verify 420 // github.com/Modernizr/Modernizr/issues/issue/97/ 421 422 tests['canvas'] = function () { 423 var elem = document.createElement('canvas'); 424 return !!(elem.getContext && elem.getContext('2d')); 425 }; 426 427 tests['canvastext'] = function () { 428 return !!(Modernizr['canvas'] && is(document.createElement('canvas').getContext('2d').fillText, 'function')); 429 }; 430 431 // webk.it/70117 is tracking a legit WebGL feature detect proposal 432 433 // We do a soft detect which may false positive in order to avoid 434 // an expensive context creation: bugzil.la/732441 435 436 tests['webgl'] = function () { 437 return !!window.WebGLRenderingContext; 438 }; 439 440 /* 441 * The Modernizr.touch test only indicates if the browser supports 442 * touch events, which does not necessarily reflect a touchscreen 443 * device, as evidenced by tablets running Windows 7 or, alas, 444 * the Palm Pre / WebOS (touch) phones. 445 * 446 * Additionally, Chrome (desktop) used to lie about its support on this, 447 * but that has since been rectified: crbug.com/36415 448 * 449 * We also test for Firefox 4 Multitouch Support. 450 * 451 * For more info, see: modernizr.github.com/Modernizr/touch.html 452 */ 453 454 tests['touch'] = function () { 455 var bool; 456 457 if (('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) { 458 bool = true; 459 } else { 460 injectElementWithStyles(['@media (', prefixes.join('touch-enabled),('), mod, ')', '{#modernizr{top:9px;position:absolute}}'].join(''), function (node) { 461 bool = node.offsetTop === 9; 462 }); 463 } 464 465 return bool; 466 }; 467 468 469 // geolocation is often considered a trivial feature detect... 470 // Turns out, it's quite tricky to get right: 471 // 472 // Using !!navigator.geolocation does two things we don't want. It: 473 // 1. Leaks memory in IE9: github.com/Modernizr/Modernizr/issues/513 474 // 2. Disables page caching in WebKit: webk.it/43956 475 // 476 // Meanwhile, in Firefox < 8, an about:config setting could expose 477 // a false positive that would throw an exception: bugzil.la/688158 478 479 tests['geolocation'] = function () { 480 return 'geolocation' in navigator; 481 }; 482 483 484 tests['postmessage'] = function () { 485 return !!window.postMessage; 486 }; 487 488 489 // Chrome incognito mode used to throw an exception when using openDatabase 490 // It doesn't anymore. 491 tests['websqldatabase'] = function () { 492 return !!window.openDatabase; 493 }; 494 495 // Vendors had inconsistent prefixing with the experimental Indexed DB: 496 // - Webkit's implementation is accessible through webkitIndexedDB 497 // - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB 498 // For speed, we don't test the legacy (and beta-only) indexedDB 499 tests['indexedDB'] = function () { 500 return !!testPropsAll("indexedDB", window); 501 }; 502 503 // documentMode logic from YUI to filter out IE8 Compat Mode 504 // which false positives. 505 tests['hashchange'] = function () { 506 return isEventSupported('hashchange', window) && (document.documentMode === undefined || document.documentMode > 7); 507 }; 508 509 // Per 1.6: 510 // This used to be Modernizr.historymanagement but the longer 511 // name has been deprecated in favor of a shorter and property-matching one. 512 // The old API is still available in 1.6, but as of 2.0 will throw a warning, 513 // and in the first release thereafter disappear entirely. 514 tests['history'] = function () { 515 return !!(window.history && history.pushState); 516 }; 517 518 tests['draganddrop'] = function () { 519 var div = document.createElement('div'); 520 return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div); 521 }; 522 523 // FF3.6 was EOL'ed on 4/24/12, but the ESR version of FF10 524 // will be supported until FF19 (2/12/13), at which time, ESR becomes FF17. 525 // FF10 still uses prefixes, so check for it until then. 526 // for more ESR info, see: mozilla.org/en-US/firefox/organizations/faq/ 527 tests['websockets'] = function () { 528 return 'WebSocket' in window || 'MozWebSocket' in window; 529 }; 530 531 532 // css-tricks.com/rgba-browser-support/ 533 tests['rgba'] = function () { 534 // Set an rgba() color and check the returned value 535 536 setCss('background-color:rgba(150,255,150,.5)'); 537 538 return contains(mStyle.backgroundColor, 'rgba'); 539 }; 540 541 tests['hsla'] = function () { 542 // Same as rgba(), in fact, browsers re-map hsla() to rgba() internally, 543 // except IE9 who retains it as hsla 544 545 setCss('background-color:hsla(120,40%,100%,.5)'); 546 547 return contains(mStyle.backgroundColor, 'rgba') || contains(mStyle.backgroundColor, 'hsla'); 548 }; 549 550 tests['multiplebgs'] = function () { 551 // Setting multiple images AND a color on the background shorthand property 552 // and then querying the style.background property value for the number of 553 // occurrences of "url(" is a reliable method for detecting ACTUAL support for this! 554 555 setCss('background:url(https://),url(https://),red url(https://)'); 556 557 // If the UA supports multiple backgrounds, there should be three occurrences 558 // of the string "url(" in the return value for elemStyle.background 559 560 return (/(url\s*\(.*?){3}/).test(mStyle.background); 561 }; 562 563 564 // this will false positive in Opera Mini 565 // github.com/Modernizr/Modernizr/issues/396 566 567 tests['backgroundsize'] = function () { 568 return testPropsAll('backgroundSize'); 569 }; 570 571 tests['borderimage'] = function () { 572 return testPropsAll('borderImage'); 573 }; 574 575 576 // Super comprehensive table about all the unique implementations of 577 // border-radius: muddledramblings.com/table-of-css3-border-radius-compliance 578 579 tests['borderradius'] = function () { 580 return testPropsAll('borderRadius'); 581 }; 582 583 // WebOS unfortunately false positives on this test. 584 tests['boxshadow'] = function () { 585 return testPropsAll('boxShadow'); 586 }; 587 588 // FF3.0 will false positive on this test 589 tests['textshadow'] = function () { 590 return document.createElement('div').style.textShadow === ''; 591 }; 592 593 594 tests['opacity'] = function () { 595 // Browsers that actually have CSS Opacity implemented have done so 596 // according to spec, which means their return values are within the 597 // range of [0.0,1.0] - including the leading zero. 598 599 setCssAll('opacity:.55'); 600 601 // The non-literal . in this regex is intentional: 602 // German Chrome returns this value as 0,55 603 // github.com/Modernizr/Modernizr/issues/#issue/59/comment/516632 604 return (/^0.55$/).test(mStyle.opacity); 605 }; 606 607 608 // Note, Android < 4 will pass this test, but can only animate 609 // a single property at a time 610 // goo.gl/v3V4Gp 611 tests['cssanimations'] = function () { 612 return testPropsAll('animationName'); 613 }; 614 615 616 tests['csscolumns'] = function () { 617 return testPropsAll('columnCount'); 618 }; 619 620 621 tests['cssgradients'] = function () { 622 /** 623 * For CSS Gradients syntax, please see: 624 * webkit.org/blog/175/introducing-css-gradients/ 625 * developer.mozilla.org/en/CSS/-moz-linear-gradient 626 * developer.mozilla.org/en/CSS/-moz-radial-gradient 627 * dev.w3.org/csswg/css3-images/#gradients- 628 */ 629 630 var str1 = 'background-image:', 631 str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));', 632 str3 = 'linear-gradient(left top,#9f9, white);'; 633 634 setCss( 635 // legacy webkit syntax (FIXME: remove when syntax not in use anymore) 636 (str1 + '-webkit- '.split(' ').join(str2 + str1) + 637 // standard syntax // trailing 'background-image:' 638 prefixes.join(str3 + str1)).slice(0, -str1.length) 639 ); 640 641 return contains(mStyle.backgroundImage, 'gradient'); 642 }; 643 644 645 tests['cssreflections'] = function () { 646 return testPropsAll('boxReflect'); 647 }; 648 649 650 tests['csstransforms'] = function () { 651 return !!testPropsAll('transform'); 652 }; 653 654 655 tests['csstransforms3d'] = function () { 656 657 var ret = !!testPropsAll('perspective'); 658 659 // Webkit's 3D transforms are passed off to the browser's own graphics renderer. 660 // It works fine in Safari on Leopard and Snow Leopard, but not in Chrome in 661 // some conditions. As a result, Webkit typically recognizes the syntax but 662 // will sometimes throw a false positive, thus we must do a more thorough check: 663 if (ret && 'webkitPerspective' in docElement.style) { 664 665 // Webkit allows this media query to succeed only if the feature is enabled. 666 // `@media (transform-3d),(-webkit-transform-3d){ ... }` 667 injectElementWithStyles('@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}', function (node, rule) { 668 ret = node.offsetLeft === 9 && node.offsetHeight === 3; 669 }); 670 } 671 return ret; 672 }; 673 674 675 tests['csstransitions'] = function () { 676 return testPropsAll('transition'); 677 }; 678 679 680 /*>>fontface*/ 681 // @font-face detection routine by Diego Perini 682 // javascript.nwbox.com/CSSSupport/ 683 684 // false positives: 685 // WebOS github.com/Modernizr/Modernizr/issues/342 686 // WP7 github.com/Modernizr/Modernizr/issues/538 687 tests['fontface'] = function () { 688 var bool; 689 690 injectElementWithStyles('@font-face {font-family:"font";src:url("https://")}', function (node, rule) { 691 var style = document.getElementById('smodernizr'), 692 sheet = style.sheet || style.styleSheet, 693 cssText = sheet ? (sheet.cssRules && sheet.cssRules[0] ? sheet.cssRules[0].cssText : sheet.cssText || '') : ''; 694 695 bool = /src/i.test(cssText) && cssText.indexOf(rule.split(' ')[0]) === 0; 696 }); 697 698 return bool; 699 }; 700 /*>>fontface*/ 701 702 // CSS generated content detection 703 tests['generatedcontent'] = function () { 704 var bool; 705 706 injectElementWithStyles(['#', mod, '{font:0/0 a}#', mod, ':after{content:"', smile, '";visibility:hidden;font:3px/1 a}'].join(''), function (node) { 707 bool = node.offsetHeight >= 3; 708 }); 709 710 return bool; 711 }; 712 713 714 // These tests evaluate support of the video/audio elements, as well as 715 // testing what types of content they support. 716 // 717 // We're using the Boolean constructor here, so that we can extend the value 718 // e.g. Modernizr.video // true 719 // Modernizr.video.ogg // 'probably' 720 // 721 // Codec values from : github.com/NielsLeenheer/html5test/blob/9106a8/index.html#L845 722 // thx to NielsLeenheer and zcorpan 723 724 // Note: in some older browsers, "no" was a return value instead of empty string. 725 // It was live in FF3.5.0 and 3.5.1, but fixed in 3.5.2 726 // It was also live in Safari 4.0.0 - 4.0.4, but fixed in 4.0.5 727 728 tests['video'] = function () { 729 var elem = document.createElement('video'), 730 bool = false; 731 732 // IE9 Running on Windows Server SKU can cause an exception to be thrown, bug #224 733 try { 734 if (bool = !!elem.canPlayType) { 735 bool = Boolean(bool); 736 bool.ogg = elem.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, ''); 737 738 // Without QuickTime, this value will be `undefined`. github.com/Modernizr/Modernizr/issues/546 739 bool.h264 = elem.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/, ''); 740 741 bool.webm = elem.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/, ''); 742 } 743 744 } catch (e) { 745 } 746 747 return bool; 748 }; 749 750 tests['audio'] = function () { 751 var elem = document.createElement('audio'), 752 bool = false; 753 754 try { 755 if (bool = !!elem.canPlayType) { 756 bool = Boolean(bool); 757 bool.ogg = elem.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/, ''); 758 bool.mp3 = elem.canPlayType('audio/mpeg;').replace(/^no$/, ''); 759 760 // Mimetypes accepted: 761 // developer.mozilla.org/En/Media_formats_supported_by_the_audio_and_video_elements 762 // bit.ly/iphoneoscodecs 763 bool.wav = elem.canPlayType('audio/wav; codecs="1"').replace(/^no$/, ''); 764 bool.m4a = (elem.canPlayType('audio/x-m4a;') || 765 elem.canPlayType('audio/aac;')).replace(/^no$/, ''); 766 } 767 } catch (e) { 768 } 769 770 return bool; 771 }; 772 773 774 // In FF4, if disabled, window.localStorage should === null. 775 776 // Normally, we could not test that directly and need to do a 777 // `('localStorage' in window) && ` test first because otherwise Firefox will 778 // throw bugzil.la/365772 if cookies are disabled 779 780 // Also in iOS5 Private Browsing mode, attempting to use localStorage.setItem 781 // will throw the exception: 782 // QUOTA_EXCEEDED_ERRROR DOM Exception 22. 783 // Peculiarly, getItem and removeItem calls do not throw. 784 785 // Because we are forced to try/catch this, we'll go aggressive. 786 787 // Just FWIW: IE8 Compat mode supports these features completely: 788 // www.quirksmode.org/dom/html5.html 789 // But IE8 doesn't support either with local files 790 791 tests['localstorage'] = function () { 792 try { 793 localStorage.setItem(mod, mod); 794 localStorage.removeItem(mod); 795 return true; 796 } catch (e) { 797 return false; 798 } 799 }; 800 801 tests['sessionstorage'] = function () { 802 try { 803 sessionStorage.setItem(mod, mod); 804 sessionStorage.removeItem(mod); 805 return true; 806 } catch (e) { 807 return false; 808 } 809 }; 810 811 812 tests['webworkers'] = function () { 813 return !!window.Worker; 814 }; 815 816 817 tests['applicationcache'] = function () { 818 return !!window.applicationCache; 819 }; 820 821 822 // Thanks to Erik Dahlstrom 823 tests['svg'] = function () { 824 return !!document.createElementNS && !!document.createElementNS(ns.svg, 'svg').createSVGRect; 825 }; 826 827 // specifically for SVG inline in HTML, not within XHTML 828 // test page: paulirish.com/demo/inline-svg 829 tests['inlinesvg'] = function () { 830 var div = document.createElement('div'); 831 div.innerHTML = '<svg/>'; 832 return (div.firstChild && div.firstChild.namespaceURI) == ns.svg; 833 }; 834 835 // SVG SMIL animation 836 tests['smil'] = function () { 837 return !!document.createElementNS && /SVGAnimate/.test(toString.call(document.createElementNS(ns.svg, 'animate'))); 838 }; 839 840 // This test is only for clip paths in SVG proper, not clip paths on HTML content 841 // demo: srufaculty.sru.edu/david.dailey/svg/newstuff/clipPath4.svg 842 843 // However read the comments to dig into applying SVG clippaths to HTML content here: 844 // github.com/Modernizr/Modernizr/issues/213#issuecomment-1149491 845 tests['svgclippaths'] = function () { 846 return !!document.createElementNS && /SVGClipPath/.test(toString.call(document.createElementNS(ns.svg, 'clipPath'))); 847 }; 848 849 /*>>webforms*/ 850 // input features and input types go directly onto the ret object, bypassing the tests loop. 851 // Hold this guy to execute in a moment. 852 function webforms() { 853 /*>>input*/ 854 // Run through HTML5's new input attributes to see if the UA understands any. 855 // We're using f which is the <input> element created early on 856 // Mike Taylr has created a comprehensive resource for testing these attributes 857 // when applied to all input types: 858 // miketaylr.com/code/input-type-attr.html 859 // spec: www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary 860 861 // Only input placeholder is tested while textarea's placeholder is not. 862 // Currently Safari 4 and Opera 11 have support only for the input placeholder 863 // Both tests are available in feature-detects/forms-placeholder.js 864 Modernizr['input'] = (function (props) { 865 for (var i = 0, len = props.length; i < len; i++) { 866 attrs[props[i]] = !!(props[i] in inputElem); 867 } 868 if (attrs.list) { 869 // safari false positive's on datalist: webk.it/74252 870 // see also github.com/Modernizr/Modernizr/issues/146 871 attrs.list = !!(document.createElement('datalist') && window.HTMLDataListElement); 872 } 873 return attrs; 874 })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' ')); 875 /*>>input*/ 876 877 /*>>inputtypes*/ 878 // Run through HTML5's new input types to see if the UA understands any. 879 // This is put behind the tests runloop because it doesn't return a 880 // true/false like all the other tests; instead, it returns an object 881 // containing each input type with its corresponding true/false value 882 883 // Big thanks to @miketaylr for the html5 forms expertise. miketaylr.com/ 884 Modernizr['inputtypes'] = (function (props) { 885 886 for (var i = 0, bool, inputElemType, defaultView, len = props.length; i < len; i++) { 887 888 inputElem.setAttribute('type', inputElemType = props[i]); 889 bool = inputElem.type !== 'text'; 890 891 // We first check to see if the type we give it sticks.. 892 // If the type does, we feed it a textual value, which shouldn't be valid. 893 // If the value doesn't stick, we know there's input sanitization which infers a custom UI 894 if (bool) { 895 896 inputElem.value = smile; 897 inputElem.style.cssText = 'position:absolute;visibility:hidden;'; 898 899 if (/^range$/.test(inputElemType) && inputElem.style.WebkitAppearance !== undefined) { 900 901 docElement.appendChild(inputElem); 902 defaultView = document.defaultView; 903 904 // Safari 2-4 allows the smiley as a value, despite making a slider 905 bool = defaultView.getComputedStyle && 906 defaultView.getComputedStyle(inputElem, null).WebkitAppearance !== 'textfield' && 907 // Mobile android web browser has false positive, so must 908 // check the height to see if the widget is actually there. 909 (inputElem.offsetHeight !== 0); 910 911 docElement.removeChild(inputElem); 912 913 } else if (/^(search|tel)$/.test(inputElemType)) { 914 // Spec doesn't define any special parsing or detectable UI 915 // behaviors so we pass these through as true 916 917 // Interestingly, opera fails the earlier test, so it doesn't 918 // even make it here. 919 920 } else if (/^(url|email)$/.test(inputElemType)) { 921 // Real url and email support comes with prebaked validation. 922 bool = inputElem.checkValidity && inputElem.checkValidity() === false; 923 924 } else { 925 // If the upgraded input compontent rejects the :) text, we got a winner 926 bool = inputElem.value != smile; 927 } 928 } 929 930 inputs[props[i]] = !!bool; 931 } 932 return inputs; 933 })('search tel url email datetime date month week time datetime-local number range color'.split(' ')); 934 /*>>inputtypes*/ 935 } 936 937 /*>>webforms*/ 938 939 940 // End of test definitions 941 // ----------------------- 942 943 944 // Run through all tests and detect their support in the current UA. 945 // todo: hypothetically we could be doing an array of tests and use a basic loop here. 946 for (var feature in tests) { 947 if (hasOwnProp(tests, feature)) { 948 // run the test, throw the return value into the Modernizr, 949 // then based on that boolean, define an appropriate className 950 // and push it into an array of classes we'll join later. 951 featureName = feature.toLowerCase(); 952 Modernizr[featureName] = tests[feature](); 953 954 classes.push((Modernizr[featureName] ? '' : 'no-') + featureName); 955 } 956 } 957 958 /*>>webforms*/ 959 // input tests need to run. 960 Modernizr.input || webforms(); 961 /*>>webforms*/ 962 963 964 /** 965 * addTest allows the user to define their own feature tests 966 * the result will be added onto the Modernizr object, 967 * as well as an appropriate className set on the html element 968 * 969 * @param feature - String naming the feature 970 * @param test - Function returning true if feature is supported, false if not 971 */ 972 Modernizr.addTest = function (feature, test) { 973 if (typeof feature == 'object') { 974 for (var key in feature) { 975 if (hasOwnProp(feature, key)) { 976 Modernizr.addTest(key, feature[key]); 977 } 978 } 979 } else { 980 981 feature = feature.toLowerCase(); 982 983 if (Modernizr[feature] !== undefined) { 984 // we're going to quit if you're trying to overwrite an existing test 985 // if we were to allow it, we'd do this: 986 // var re = new RegExp("\\b(no-)?" + feature + "\\b"); 987 // docElement.className = docElement.className.replace( re, '' ); 988 // but, no rly, stuff 'em. 989 return Modernizr; 990 } 991 992 test = typeof test == 'function' ? test() : test; 993 994 if (typeof enableClasses !== "undefined" && enableClasses) { 995 docElement.className += ' ' + (test ? '' : 'no-') + feature; 996 } 997 Modernizr[feature] = test; 998 999 } 1000 1001 return Modernizr; // allow chaining. 1002 }; 1003 1004 1005 // Reset modElem.cssText to nothing to reduce memory footprint. 1006 setCss(''); 1007 modElem = inputElem = null; 1008 1009 /*>>shiv*/ 1010 (function (window, document) { 1011 /*jshint evil:true */ 1012 /** version */ 1013 var version = '3.7.0'; 1014 1015 /** Preset options */ 1016 var options = window.html5 || {}; 1017 1018 /** Used to skip problem elements */ 1019 var reSkip = /^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i; 1020 1021 /** Not all elements can be cloned in IE **/ 1022 var saveClones = /^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i; 1023 1024 /** Detect whether the browser supports default html5 styles */ 1025 var supportsHtml5Styles; 1026 1027 /** Name of the expando, to work with multiple documents or to re-shiv one document */ 1028 var expando = '_html5shiv'; 1029 1030 /** The id for the the documents expando */ 1031 var expanID = 0; 1032 1033 /** Cached data for each document */ 1034 var expandoData = {}; 1035 1036 /** Detect whether the browser supports unknown elements */ 1037 var supportsUnknownElements; 1038 1039 (function () { 1040 try { 1041 var a = document.createElement('a'); 1042 a.innerHTML = '<xyz></xyz>'; 1043 //if the hidden property is implemented we can assume, that the browser supports basic HTML5 Styles 1044 supportsHtml5Styles = ('hidden' in a); 1045 1046 supportsUnknownElements = a.childNodes.length == 1 || (function () { 1047 // assign a false positive if unable to shiv 1048 (document.createElement)('a'); 1049 var frag = document.createDocumentFragment(); 1050 return ( 1051 typeof frag.cloneNode == 'undefined' || 1052 typeof frag.createDocumentFragment == 'undefined' || 1053 typeof frag.createElement == 'undefined' 1054 ); 1055 }()); 1056 } catch (e) { 1057 // assign a false positive if detection fails => unable to shiv 1058 supportsHtml5Styles = true; 1059 supportsUnknownElements = true; 1060 } 1061 1062 }()); 1063 1064 /*--------------------------------------------------------------------------*/ 1065 1066 /** 1067 * Creates a style sheet with the given CSS text and adds it to the document. 1068 * @private 1069 * @param {Document} ownerDocument The document. 1070 * @param {String} cssText The CSS text. 1071 * @returns {StyleSheet} The style element. 1072 */ 1073 function addStyleSheet(ownerDocument, cssText) { 1074 var p = ownerDocument.createElement('p'), 1075 parent = ownerDocument.getElementsByTagName('head')[0] || ownerDocument.documentElement; 1076 1077 p.innerHTML = 'x<style>' + cssText + '</style>'; 1078 return parent.insertBefore(p.lastChild, parent.firstChild); 1079 } 1080 1081 /** 1082 * Returns the value of `html5.elements` as an array. 1083 * @private 1084 * @returns {Array} An array of shived element node names. 1085 */ 1086 function getElements() { 1087 var elements = html5.elements; 1088 return typeof elements == 'string' ? elements.split(' ') : elements; 1089 } 1090 1091 /** 1092 * Returns the data associated to the given document 1093 * @private 1094 * @param {Document} ownerDocument The document. 1095 * @returns {Object} An object of data. 1096 */ 1097 function getExpandoData(ownerDocument) { 1098 var data = expandoData[ownerDocument[expando]]; 1099 if (!data) { 1100 data = {}; 1101 expanID++; 1102 ownerDocument[expando] = expanID; 1103 expandoData[expanID] = data; 1104 } 1105 return data; 1106 } 1107 1108 /** 1109 * returns a shived element for the given nodeName and document 1110 * @memberOf html5 1111 * @param {String} nodeName name of the element 1112 * @param {Document} ownerDocument The context document. 1113 * @returns {Object} The shived element. 1114 */ 1115 function createElement(nodeName, ownerDocument, data) { 1116 if (!ownerDocument) { 1117 ownerDocument = document; 1118 } 1119 if (supportsUnknownElements) { 1120 return ownerDocument.createElement(nodeName); 1121 } 1122 if (!data) { 1123 data = getExpandoData(ownerDocument); 1124 } 1125 var node; 1126 1127 if (data.cache[nodeName]) { 1128 node = data.cache[nodeName].cloneNode(); 1129 } else if (saveClones.test(nodeName)) { 1130 node = (data.cache[nodeName] = data.createElem(nodeName)).cloneNode(); 1131 } else { 1132 node = data.createElem(nodeName); 1133 } 1134 1135 // Avoid adding some elements to fragments in IE < 9 because 1136 // * Attributes like `name` or `type` cannot be set/changed once an element 1137 // is inserted into a document/fragment 1138 // * Link elements with `src` attributes that are inaccessible, as with 1139 // a 403 response, will cause the tab/window to crash 1140 // * Script elements appended to fragments will execute when their `src` 1141 // or `text` property is set 1142 return node.canHaveChildren && !reSkip.test(nodeName) && !node.tagUrn ? data.frag.appendChild(node) : node; 1143 } 1144 1145 /** 1146 * returns a shived DocumentFragment for the given document 1147 * @memberOf html5 1148 * @param {Document} ownerDocument The context document. 1149 * @returns {Object} The shived DocumentFragment. 1150 */ 1151 function createDocumentFragment(ownerDocument, data) { 1152 if (!ownerDocument) { 1153 ownerDocument = document; 1154 } 1155 if (supportsUnknownElements) { 1156 return ownerDocument.createDocumentFragment(); 1157 } 1158 data = data || getExpandoData(ownerDocument); 1159 var clone = data.frag.cloneNode(), 1160 i = 0, 1161 elems = getElements(), 1162 l = elems.length; 1163 for (; i < l; i++) { 1164 clone.createElement(elems[i]); 1165 } 1166 return clone; 1167 } 1168 1169 /** 1170 * Shivs the `createElement` and `createDocumentFragment` methods of the document. 1171 * @private 1172 * @param {Document|DocumentFragment} ownerDocument The document. 1173 * @param {Object} data of the document. 1174 */ 1175 function shivMethods(ownerDocument, data) { 1176 if (!data.cache) { 1177 data.cache = {}; 1178 data.createElem = ownerDocument.createElement; 1179 data.createFrag = ownerDocument.createDocumentFragment; 1180 data.frag = data.createFrag(); 1181 } 1182 1183 1184 ownerDocument.createElement = function (nodeName) { 1185 //abort shiv 1186 if (!html5.shivMethods) { 1187 return data.createElem(nodeName); 1188 } 1189 return createElement(nodeName, ownerDocument, data); 1190 }; 1191 1192 ownerDocument.createDocumentFragment = Function('h,f', 'return function(){' + 1193 'var n=f.cloneNode(),c=n.createElement;' + 1194 'h.shivMethods&&(' + 1195 // unroll the `createElement` calls 1196 getElements().join().replace(/[\w\-]+/g, function (nodeName) { 1197 data.createElem(nodeName); 1198 data.frag.createElement(nodeName); 1199 return 'c("' + nodeName + '")'; 1200 }) + 1201 ');return n}' 1202 )(html5, data.frag); 1203 } 1204 1205 /*--------------------------------------------------------------------------*/ 1206 1207 /** 1208 * Shivs the given document. 1209 * @memberOf html5 1210 * @param {Document} ownerDocument The document to shiv. 1211 * @returns {Document} The shived document. 1212 */ 1213 function shivDocument(ownerDocument) { 1214 if (!ownerDocument) { 1215 ownerDocument = document; 1216 } 1217 var data = getExpandoData(ownerDocument); 1218 1219 if (html5.shivCSS && !supportsHtml5Styles && !data.hasCSS) { 1220 data.hasCSS = !!addStyleSheet(ownerDocument, 1221 // corrects block display not defined in IE6/7/8/9 1222 'article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{dis
1222play:block}' + 1223 // adds styling not present in IE6/7/8/9 1224 'mark{background:#FF0;color:#000}' + 1225 // hides non-rendered elements 1226 'template{display:none}' 1227 ); 1228 } 1229 if (!supportsUnknownElements) { 1230 shivMethods(ownerDocument, data); 1231 } 1232 return ownerDocument; 1233 } 1234 1235 /*--------------------------------------------------------------------------*/ 1236 1237 /** 1238 * The `html5` object is exposed so that more elements can be shived and 1239 * existing shiving can be detected on iframes. 1240 * @type Object 1241 * @example 1242 * 1243 * // options can be changed before the script is included 1244 * html5 = { 'elements': 'mark section', 'shivCSS': false, 'shivMethods': false }; 1245 */ 1246 var html5 = { 1247 1248 /** 1249 * An array or space separated string of node names of the elements to shiv. 1250 * @memberOf html5 1251 * @type Array|String 1252 */ 1253 'elements': options.elements || 'abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video', 1254 1255 /** 1256 * current version of html5shiv 1257 */ 1258 'version': version, 1259 1260 /** 1261 * A flag to indicate that the HTML5 style sheet should be inserted. 1262 * @memberOf html5 1263 * @type Boolean 1264 */ 1265 'shivCSS': (options.shivCSS !== false), 1266 1267 /** 1268 * Is equal to true if a browser supports creating unknown/HTML5 elements 1269 * @memberOf html5 1270 * @type boolean 1271 */ 1272 'supportsUnknownElements': supportsUnknownElements, 1273 1274 /** 1275 * A flag to indicate that the document's `createElement` and `createDocumentFragment` 1276 * methods should be overwritten. 1277 * @memberOf html5 1278 * @type Boolean 1279 */ 1280 'shivMethods': (options.shivMethods !== false), 1281 1282 /** 1283 * A string to describe the type of `html5` object ("default" or "default print"). 1284 * @memberOf html5
1285 * @type String 1286 */ 1287 'type': 'default', 1288 1289 // shivs the document according to the specified `html5` object options 1290 'shivDocument': shivDocument, 1291 1292 //creates a shived element 1293 createElement: createElement, 1294 1295 //creates a shived documentFragment 1296 createDocumentFragment: createDocumentFragment 1297 }; 1298 1299 /*--------------------------------------------------------------------------*/ 1300 1301 // expose html5 1302 window.html5 = html5; 1303 1304 // shiv the document 1305 shivDocument(document); 1306 1307 }(this, document)); 1308 /*>>shiv*/ 1309 1310 // Assign private properties to the return object with prefix 1311 Modernizr._version = version; 1312 1313 // expose these for the plugin API. Look in the source for how to join() them against your input 1314 /*>>prefixes*/ 1315 Modernizr._prefixes = prefixes; 1316 /*>>prefixes*/ 1317 /*>>domprefixes*/ 1318 Modernizr._domPrefixes = domPrefixes; 1319 Modernizr._cssomPrefixes = cssomPrefixes; 1320 /*>>domprefixes*/ 1321 1322 /*>>mq*/ 1323 // Modernizr.mq tests a given media query, live against the current state of the window 1324 // A few important notes: 1325 // * If a browser does not support media queries at all (eg. oldIE) the mq() will always return false 1326 // * A max-width or orientation query will be evaluated against the current state, which may change later. 1327 // * You must specify values. Eg. If you are testing support for the min-width media query use: 1328 // Modernizr.mq('(min-width:0)') 1329 // usage: 1330 // Modernizr.mq('only screen and (max-width:768)') 1331 Modernizr.mq = testMediaQuery; 1332 /*>>mq*/ 1333 1334 /*>>hasevent*/ 1335 // Modernizr.hasEvent() detects support for a given event, with an optional element to test on 1336 // Modernizr.hasEvent('gesturestart', elem) 1337 Modernizr.hasEvent = isEventSupported; 1338 /*>>hasevent*/ 1339 1340 /*>>testprop*/ 1341 // Modernizr.testProp() investigates whether a given style property is recognized 1342 // Note that the property names must be provided in the camelCase variant. 1343 // Modernizr.testProp('pointerEvents') 1344 Modernizr.testProp = function (prop) { 1345 return testProps([prop]); 1346 }; 1347 /*>>testprop*/ 1348 1349 /*>>testallprops*/ 1350 // Modernizr.testAllProps() investigates whether a given style property, 1351 // or any of its vendor-prefixed variants, is recognized 1352 // Note that the property names must be provided in the camelCase variant. 1353 // Modernizr.testAllProps('boxSizing') 1354 Modernizr.testAllProps = testPropsAll; 1355 /*>>testallprops*/ 1356 1357 1358 /*>>teststyles*/ 1359 // Modernizr.testStyles() allows you to add custom styles to the document and test an element afterwards 1360 // Modernizr.testStyles('#modernizr { position:absolute }', function(elem, rule){ ... }) 1361 Modernizr.testStyles = injectElementWithStyles; 1362 /*>>teststyles*/ 1363 1364 1365 /*>>prefixed*/ 1366 // Modernizr.prefixed() returns the prefixed or nonprefixed property name variant of your input 1367 // Modernizr.prefixed('boxSizing') // 'MozBoxSizing' 1368 1369 // Properties must be passed as dom-style camelcase, rather than `box-sizing` hypentated style. 1370 // Return values will also be the camelCase variant, if you need to translate that to hypenated style use: 1371 // 1372 // str.replace(/([A-Z])/g, function(str,m1){ return '-' + m1.toLowerCase(); }).replace(/^ms-/,'-ms-'); 1373 1374 // If you're trying to ascertain which transition end event to bind to, you might do something like... 1375 // 1376 // var transEndEventNames = { 1377 // 'WebkitTransition' : 'webkitTransitionEnd', 1378 // 'MozTransition' : 'transitionend', 1379 // 'OTransition' : 'oTransitionEnd', 1380 // 'msTransition' : 'MSTransitionEnd', 1381 // 'transition' : 'transitionend' 1382 // }, 1383 // transEndEventName = transEndEventNames[ Modernizr.prefixed('transition') ]; 1384 1385 Modernizr.prefixed = function (prop, obj, elem) { 1386 if (!obj) { 1387 return testPropsAll(prop, 'pfx'); 1388 } else { 1389 // Testing DOM property e.g. Modernizr.prefixed('requestAnimationFrame', window) // 'mozRequestAnimationFrame' 1390 return testPropsAll(prop, obj, elem); 1391 } 1392 }; 1393 /*>>prefixed*/ 1394 1395 1396 /*>>cssclasses*/ 1397 // Remove "no-js" class from <html> element, if it exists: 1398 docElement.className = docElement.className.replace(/(^|\s)no-js(\s|$)/, '$1$2') + 1399 1400 // Add the new classes to the <html> element. 1401 (enableClasses ? ' js ' + classes.join(' ') : ''); 1402 /*>>cssclasses*/ 1403 1404 return Modernizr; 1405 1406})(this, this.document);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.