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