This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
/
rings.min.js
3 lines (3 loc) · 63.2 KB
/
rings.min.js
1
2
3
/*! ringmark - v1.4.0 - 10/8/2013
* Copyright ( c ) 2013 Facebook Licensed W3C 3-clause BSD License, W3C Test Suite License */
Hat.ring({ring:0,features:26,test:function(){module("ring:0"),feature("appcache",0,"Application Cache ‽"),window.spec="appcache",test("applicationCache (Offline Support)",function(){var a=H.API(window,"applicationCache",!0);assert(a,"applicationCache supported")}),feature("canvas",0,"Canvas"),window.spec="canvas",test("Canvas",function(){var a=document.createElement("canvas");assert("getContext"in a,"canvas getContext supported"),assert("toDataURL"in a,"canvas toDataURL supported")}),test("Canvas 2D Context",function(){var a=window.CanvasRenderingContext2D,b=document.createElement("canvas"),c=b.getContext("2d");assert(!!a,"CanvasRenderingContext2D supported"),assert(c instanceof a,"context instanceof CanvasRenderingContext2D")}),test("Canvas 2D Text",function(){var a=document.createElement("canvas"),b=a.getContext("2d");assert(!!b.fillText,"2D Text supported")}),feature("css2-1selectors",0,"CSS 2.1"),window.spec="css2-1selectors",asyncTest("CSS 2.1 Selectors",function(a){function c(d){var e=JSON.parse(d.data);e.which==="selectors"&&!b&&(b=!0,a.step(function(){assert(e.results==="truetruetruetrue","CSS 2.1 Selectors are supported"),H.off(window,"message",c),a.done()}))}var b=!1;H.on(window,"message",c),document.getElementById("css2-1selectors").src="/tests/css2-1selectors/iframe.html"}),asyncTest("CSS Generated Content",function(a){function c(d){var e=JSON.parse(d.data);e.which==="generated"&&!b&&(b=!0,a.step(function(){assert(e.results>=1,"CSS generated content modifies the offsetHeight as expected"),H.off(window,"message",c),a.done()}))}var b=!1;H.on(window,"message",c),document.getElementById("css2-1selectors").src="/tests/css2-1selectors/iframe.html"}),feature("css3dtransforms",0,"CSS 3D Transforms ‽"),window.spec="css3dtransforms",test("CSS 3D Transforms: perspective",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspective",!0),"perspective supported")}),test("CSS 3D Transforms: perspective-origin",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspectiveOrigin",!0),"perspectiveOrigin supported")}),test("CSS 3D Transforms: transform",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transform",!0),"transform supported")}),test("CSS 3D Transforms: transform-origin",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transformOrigin",!0),"transformOrigin supported")}),test("CSS 3D Transforms: backfaceVisibility",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"backfaceVisibility",!0),"backfaceVisibility supported")}),feature("cssanimation",0,"CSS3 Animation ‽"),window.spec="cssanimation",test("CSS Animation",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"animationName",!0),"animationName supported")}),feature("cssbackground",0,"CSS3 Background ‽"),window.spec="cssbackground",test("CSS background shorthand property supports multiple images",function(){var a=document.createElement("div");a.style.cssText="background:url(https://),url(https://),red url(https://)",assert(/(url\s*\(.*?){3}/.test(a.style.background),"background shorthand, multiple images supported")}),test("CSS box-shadow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"boxShadow",!0),"CSS box-shadow supported")}),test("CSS border-radius",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"borderRadius",!0),"CSS border-radius supported")}),feature("csscolor",0,"CSS3 Color"),window.spec="csscolor",test("CSS opacity",function(){var a=document.createElement("div"),b="opacity:.55",c=H.prefixes.expandCss(b);a.style.cssText=c,assert(/^0.55$/.test(a.style.opacity),"CSS opacity supported")}),test("CSS color properties, RGBA support",function(){var a=document.createElement("div");a.style.cssText="background-color:rgba(150,255,150,.5)",assert(H.test.string(a.style.backgroundColor,"rgba"),"RGBA color supported")}),test("CSS color properties, HSLA support",function(){var a,b=document.createElement("div");b.style.cssText="background-color:hsla(120,40%,100%,.5)",a=b.style.backgroundColor,assert(H.test.string(a,"rgba")||H.test.string(a,"hsla"),"HSLA color supported")}),feature("cssminmax",0,"CSS Min, Max"),window.spec="cssminmax",test("CSS min-width",function(){var a=document.querySelector("#cssminmax #css-min-width");assert(getComputedStyle(a).getPropertyValue("width")==="20px","min-width supported")}),test("CSS max-width",function(){var a=document.querySelector("#cssminmax #css-max-width");assert(getComputedStyle(a).getPropertyValue("width")==="20px","max-width supported")}),test("CSS min-height",function(){var a=document.querySelector("#cssminmax #css-min-height");assert(getComputedStyle(a).getPropertyValue("height")==="20px","min-height supported")}),test("CSS max-height",function(){var a=document.querySelector("#cssminmax #css-max-height");assert(getComputedStyle(a).getPropertyValue("height")==="20px","max-height supported")}),feature("cssopacity",0,"CSS Opacity"),window.spec="cssopacity",test("CSS opacity",function(){var a=document.createElement("div");a.style.cssText="opacity:.55",assert(/^0.55$/.test(a.style.opacity),"opacity supported")}),feature("csstext",0,"CSS3 Text ‽"),window.spec="csstext",test("CSS text-shadow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"textShadow",!0),"textShadow supported")}),test("CSS word-wrap",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordWrap",!0),"wordWrap supported")}),test("CSS word-break",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordBreak",!0),"wordBreak supported")}),test("CSS word-spacing",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordSpacing",!0),"wordSpacing supported")}),feature("csstransforms",0,"CSS3 2D Transforms ‽"),window.spec="csstransforms",test("CSS Transform (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transform",!0),"transform supported")}),test("CSS transform-origin (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transformOrigin",!0),"transformOrigin supported")}),test("CSS transform-style (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transformStyle",!0),"transformStyle supported")}),test("CSS Perspective (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspective",!0),"perspective supported")}),test("CSS perspective-origin (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspectiveOrigin",!0),"perspectiveOrigin supported")}),test("CSS backface-visibility (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"backfaceVisibility",!0),"backfaceVisibility supported")}),feature("csstransitions",0,"CSS3 Transitions ‽"),window.spec="csstransitions",test("CSS Transitions",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transition",!0),"transitions supported")}),feature("cssui",0,"CSS3 UI ‽"),window.spec="cssui",test("CSS UI text-overflow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"textOverflow",!0),"textOverflow")}),test("CSS UI box-sizing",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"boxSizing",!0),"boxSizing")}),test("CSS UI Pointer Events",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"pointerEvents",!0),"pointerEvents supported")}),feature("cssvalues",0,"CSS3 Values"),window.spec="cssvalues",test("CSS Values Root EM",function(){var a,b=null,c=null;a=document.getElementById("cssvalues"),b=parseInt(getComputedStyle(a).getPropertyValue("font-size"),10),a.style.cssText="font-size: 1rem",c=parseInt(getComputedStyle(a).getPropertyValue("font-size"),10),a.style.cssText="font-size: 2rem",c=parseInt(getComputedStyle(a).getPropertyValue("font-size"),10),assert(b<c,"Root EM values supported"),a.style.cssText="font-size: 1rem",c=parseInt(getComputedStyle(a).getPropertyValue("font-size"),10),assert(b===c,"Root EM restored to expected size")}),feature("dataurl",0,"Data URL"),window.spec="dataurl",asyncTest("Data URL",function(a){var b=document.getElementById("dataurl"),c=document.getElementById("dataurl-data").cloneNode(!0);b.appendChild(c),c.onload=c.onerror=function(){a.step(function(){c.width===1&&c.height===1?assert(!0,"Data URL Loading: success"):assert(!1,"Data URL Loading: failed"),a.done()})}}),feature("doctype",0,"Doctype"),window.spec="doctype",test("Doctype CSS1Compat",function(){assert(document.compatMode==="CSS1Compat","doctype html supported")}),feature("geolocation",0,"Geolocation"),window.spec="geolocation",test("Geolocation exists",function(){var a=H.API(navigator,"geolocation",!0);assert(navigator.geolocation,"navigator.geolocation supported")}),test("Geolocation getCurrentPosition exists and is a function",function(){var a=H.API(navigator,"geolocation",!0),b;a?(b=H.API(a,"getCurrentPosition",!0),assert(H.isFunction(b),"getCurrentPosition supported")):assert(!1,"geolocation not supported, skipping tests.")}),test("Geolocation watchPosition exists and is a function",function(){var a=H.API(navigator,"geolocation",!0),b;a?(b=H.API(a,"watchPosition",!0),assert(H.isFunction(b),"watchPosition supported")):assert(!1,"geolocation not supported, skipping tests.")}),test("Geolocation clearWatch exists and is a function",function(){var a=H.API(navigator,"geolocation",!0),b;a?(b=H.API(a,"clearWatch",!0),assert(H.isFunction(b),"clearWatch supported")):assert(!1,"geolocation not supported, skipping tests.")}),feature("json",0,"JSON"),window.spec="json";var a=function(a){return Object.prototype.toString.call(a)};test("JSON",function(){assert("JSON"in window,"JSON supported"),assert(!!JSON.stringify,"JSON.stringify supported"),assert(!!JSON.parse,"JSON.parse supported")}),test("JSON.parse properly parses a JSON string into an object",function(){var a={string:"foo",bool:!0,num:1,arr:[1,2,"Three"]},b='{ "string":"foo", "bool": true, "num":1, "arr":[ 1, 2, "Three" ] }';assert(JSON.stringify(JSON.parse(b)),JSON.stringify(a),"JSON.parse (functional) supported")}),test("JSON.parse reviver is applied when processing JSON string to object",function(){var a='{ "t": "True", "f": "False" }',b=JSON.parse(a,function(a,b){return b==="True"?!0:b});assert(b.t===!0,"JSON.parse reviver supported(1)"),assert(b.f==="False","JSON.parse reviver supported(2)")}),test("JSON.stringify serializes an object, removing functions and 'undefined' ",function(){var a={t:!0,a:[1,"Two"],bar:function(){},bam:undefined},b='{"t":true,"a":[1,"Two"]}';assert(JSON.stringify(a)===b,"JSON.stringify (functional) supported")}),test("JSON.stringify replacer accepts array of strings to corresponding to keys to include in serialized string",function(){var a={t:!0,a:[1,"Two"]},b='{"t":true}';assert(JSON.stringify(a,["t"])===b,"JSON.stringify replacer supported(1)")}),test("JSON.stringify replacer accepts a function to replace keys as object is being serialized ",function(){var a={foo:"bar"},b='{"foo":"BAR"}',c=JSON.stringify(a,function(a,b){return typeof b=="string"?b.toUpperCase():b});assert(c===b,"JSON.stringify replacer supported(2)")}),feature("masking",0,"Masking Images ‽"),window.spec="masking",test("CSS Masks",function(){var a="http://www.w3.org/2000/svg",b=document.createElement("div"),c=H.test.cssProp(b,"maskImage",!0),d,e;c?assert(c,"image masking supported"):(d=document.createElementNS(a,"svg"),e=document.createElementNS(a,"mask"),"ownerSVGElement"in d?assert("maskContentUnits"in e&&"maskUnits"in e,"image masking supported"):assert(!1,"no image masking is supported"))}),feature("postmessage",0,"Web Messaging"),window.spec="postmessage",test("postMessage",function(){var a=window.postMessage;assert(!!a,"postMessage supported")}),test("onmessage",function(){assert("onmessage"in window,"onmessage supported")}),asyncTest("postMessage/onmessage In Practice",function(a){window.onmessage=function(b){a.step(function(){assert(!0,"onmessage event fired"),assert(b.data==="This is Ground Control","message content matched expected"),window.onmessage=null,a.done()})},window.postMessage("This is Ground Control","*")}),feature("progress",0,"Progress Event ‽"),window.spec="progress",test("ProgressEvent",function(){var a=H.API(window,"ProgressEvent",!0);assert(a,"A ProgressEvent constructor supported")}),asyncTest("ProgressEvent in Practice",function(a){var b=H.API(window,"ProgressEvent",!0),c=new XMLHttpRequest;b?(c.open("GET","/tests/_server/echo.php",!0),c.onload=function(c){this.status===200&&a.step(function(){assert(c instanceof b,"XHR onload callback event argument is instanceof ProgressEvent"),assert("lengthComputable"in c,"event.lengthComputable supported"),assert("loaded"in c,"event.loaded supported"),assert("total"in c,"event.total supported"),assert(typeof c.lengthComputable=="boolean","event.lengthComputable is boolean"),assert(typeof c.loaded=="number","event.loaded is number"),assert(typeof c.total=="number","event.total is number"),a.done()})},c.send()):(assert(!1,"ProgressEvent is not supported, skipping tests"),a.done())}),feature("prompts",0,"Prompts"),window.spec="prompts",test("window.alert is treated as a function",function(){assert(H.isFunction(window.alert),"alert supported")}),test("window.confirm is treated as a function",function(){assert(H.isFunction(window.confirm),"confirm supported")}),test("window.prompt is treated as a function",function(){assert(H.isFunction(window.prompt),"prompt supported")}),feature("selector",0,"Selectors 2 ‽"),window.spec="selector",test("matchesSelector",function(){var a=window.document.body,b=H.API(document.documentElement,"matchesSelector",!0);assert(!!b,"matchesSelector exists in some form as a property of document.body"),assert(typeof b,"matchesSelector is a function")}),test("matchesSelector In Practice",function(){var a=window.document.body,b=H.API(document.documentElement,"matchesSelector",!0);assert(b.call(a,"body"),"Expected ( body, 'body' )"),assert(b.call(a,"html body"),"Expected ( body, 'html body' )"),assert(b.call(a,"html > body"),"Expected ( body, 'html > body' )")}),test("querySelector",function(){var a=window.document;assert(!!a.querySelector,"document.querySelector exists in some form"),assert(typeof a.querySelector=="function","document.querySelector is a function")}),test("querySelector In Practice",function(){var a=window.document,b=a.querySelector("body");assert(!!b,"querySelector('body') returns something (element)"),assert(b.nodeType===1,"querySelector('body') returns an element with nodeType === 1")}),test("querySelectorAll",function(){var a=window.document;assert(!!a.querySelectorAll,"querySelectorAll exists in some form"),assert(typeof a.querySelectorAll=="function","querySelectorAll is a function")}),test("querySelectorAll In Practice",function(){var a=window.NodeList,b=window.document,c=b.querySelectorAll("body"),d=b.body,e=H.API(b.documentElement,"matchesSelector",!0);assert(!!c.length,"querySelectorAll('body') returns something with length (list)"),assert(c instanceof a,"list instanceof NodeList"),assert(e.call(c[0],"body"),"list[ 0 ].matchesSelector('body')")}),feature("video",0,"Video"),window.spec="video",test("Video",function(){var a=document.createElement("video");assert(!!a.canPlayType,"video supported")}),test("Video Codec: mp4/MPEG-4",function(){var a=document.createElement("video");assert(a.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.8"')!=="no",'MPEG-4 supported (codecs="avc1.42E01E, mp4a.40.8")')}),test("Video Codec: mp4/H.264",function(){var a=document.createElement("video");assert(a.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')!=="no",'H.264 supported (codecs="avc1.42E01E, mp4a.40.2")'),assert(a.canPlayType('video/mp4; codecs="avc1.42E01E"')!=="no",'H.264 supported (codecs="avc1.42E01E")')}),test("Video Codec: ogg",function(){var a=document.createElement("video");assert(a.canPlayType('video/ogg; codecs="theora"')!=="no",'OGG supported (codecs="theora")')}),test("Video Codec: WebM",function(){var a=document.createElement("video");assert(a.canPlayType('video/webm; codecs="vp8, vorbis"')!=="no",'WebM supported (codecs="vp8, vorbis")'),assert(a.canPlayType('video/webm; codecs="vp8"')!=="no",'WebM supported (codecs="vp8")')}),feature("viewport",0,"Viewport"),window.spec="viewport",asyncTest("Meta: Viewport",function(a){a.step(function(){assert(!0,"meta, viewport dictated the size of a window"),a.done()})}),feature("webstorage",0,"Web Storage ‽"),window.spec="webstorage",test("localStorage",function(){var a=window.localStorage;assert(!!a,"localStorage supported")}),test("localStorage In Practice",function(){var a=window.localStorage,b=a&&a.setItem("foo","bar")||a.getItem("foo")==="bar";assert(b,"localStorage.setItem supported"),assert(b,"localStorage.getItem supported")}),test("StorageEvent",function(){var a=H.API(window,"StorageEvent",!0);assert(a,"StorageEvent in window")}),test("Storage Events in Practice",function(a){var b=H.API(window,"StorageEvent",!0),c;b?(c=typeof b=="function"?document.createEvent("StorageEvent"):b.prototype,!("key"in c)&&typeof b=="object"&&(c=document.createEvent("StorageEvent")),assert("key"in c,"event.key supported"),assert("oldValue"in c,"event.oldValue supported"),assert("newValue"in c,"event.newValue supported")):assert(!1,"StorageEvent not supported, skipping tests")})}}),Hat.ring({ring:1,features:24,test:function(){module("ring:1"),feature("audio-multi",1,"Audio, Multi-Track"),window.spec="audio-multi",asyncTest("Audio: Multiple Playback",function(a){var b,c=!1,d=0,e=0,f={mp3:'audio/mpeg; codecs="mp3"',ogg:'audio/ogg; codecs="vorbis"',wav:'audio/wav; codecs="1"',aac:'audio/mp4; codecs="mp4a.40.2"'},g=[new Audio,new Audio];b=Object.keys(f).filter(function(a){return/probably|maybe/.test(g[0].canPlayType(f[a]))})[0],g[0].src="/tests/audio-multi/amp."+b,g[1].src="/tests/audio-multi/chirp."+b,a.step(function(){g.forEach(function(f){f.addEventListener("playing",function(){d++,d===g.length&&!c&&a.step(function(){assert(!0,"Multiple audio playback supported (used: "+b+")"),c=!0,a.done()})},!1),f.addEventListener("loadeddata",function(){e++,f.play(),f.volume=0,f.muted=!0,e===g.length&&setTimeout(function(){c||a.step(function(){assert(!1,"Browser failed to load audio"),c=!0,a.done()})},1e3)},!1)})}),setTimeout(function(){c||a.step(function(){assert(!1,"Browser failed to load audio"),c=!0,a.done()})},5e3)}),feature("blob",1,"Blob ‽"),window.spec="blob",test("Blob",function(){var a=H.API(window,"Blob",!0);assert(!!a,"Blob supported")}),feature("cssbackground-standard",1,"CSS3 Background, Standard"),window.spec="cssbackground-standard",test("CSS border-image, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"borderImageSource"),"border-image-source standard, supported"),assert(H.test.cssProp(a,"borderImageSlice"),"border-image-slice standard, supported"),assert(H.test.cssProp(a,"borderImageWidth"),"border-image-width standard, supported"),assert(H.test.cssProp(a,"borderImageOutset"),"border-image-outset standard, supported"),assert(H.test.cssProp(a,"borderImageRepeat"),"border-image-repeat standard, supported"),assert(H.test.cssProp(a,"borderImage"),"Shorthand border-image standard, supported")}),test("CSS box-shadow, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"boxShadow"),"CSS box-shadow standard, supported")}),test("CSS border-radius, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"borderRadius"),"CSS border-radius standard, supported")}),feature("cssfont",1,"CSS3 Fonts"),window.spec="cssfont",asyncTest("CSS Font Face",function(a){function c(d){var e=JSON.parse(d.data);e.which==="fontface"&&!b&&(b=!0,a.step(function(){e.results.forEach(function(a){assert(a.result,a.desc)}),H.off(window,"message",c),a.done()}))}var b=!1;H.on(window,"message",c),document.getElementById("cssfont-face").src="/tests/cssfont/fontface.html"}),asyncTest("CSS EOT/OTF/SVG",function(a){function c(d){var e=JSON.parse(d.data);e.which==="practical"&&!b&&(b=!0,a.step(function(){e.results.forEach(function(a){assert(a.result,a.desc)}),H.off(window,"message",c),a.done()}))}var b=!1;H.on(window,"message",c),document.getElementById("cssfont-load").src="/tests/cssfont/iframe.html"}),feature("cssmediaqueries",1,"CSS3 MediaQueries ‽"),window.spec="cssmediaqueries",test("Media Queries matchMedia API exists",function(){assert(H.API(window,"matchMedia",!0),"matchMedia supported")}),test("Media Queries matchMedia querying",function(a){var b=document.getElementById("cssmediaqueries"),c=b.contentWindow,d={};c.matchMedia?(d.pass=c.matchMedia("screen and (max-width: 500px)"),d.fail=c.matchMedia("example { body { background:red } }"),assert(d.pass&&d.pass.matches,"matchMedia expects passing results"),assert(d.fail&&!d.fail.matches,"matchMedia expects failing results")):assert(!1,"matchMedia is not supported, skipping tests")}),feature("cssoverflow",1,"CSS Overflow Scrolling ‽"),window.spec="cssoverflow",test("CSS Overflow Scrolling",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"overflowScrolling",!0),"overflowScrolling supported")}),feature("cssposition",1,"CSS Position Fixed"),window.spec="cssposition",asyncTest("CSS Fixed Position",function(a){function b(c){a.step(function(){assert(c.data,"Fixed Position supported"),H.off(window,"message",b),a.done()})}H.on(window,"message",b),document.getElementById("cssposition").src="/tests/cssposition/iframe.html"}),feature("csstext-standard",1,"CSS3 Text, Standard"),window.spec="csstext-standard",test("CSS text-shadow, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"textShadow"),"textShadow supported, standard")}),test("CSS word-wrap, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordWrap"),"wordWrap supported, standard")}),test("CSS word-break, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordBreak"),"wordBreak supported, standard")}),test("CSS word-spacing, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"wordSpacing"),"wordSpacing supported, standard")}),feature("cssui-standard",1,"CSS3 UI, Standard"),window.spec="cssui-standard",test("CSS text-overflow, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"textOverflow"),"textOverflow standard, supported")}),test("CSS box-sizing, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"boxSizing"),"boxSizing standard, supported")}),feature("deviceorientation",1,"Device Orientation Event"),window.spec="deviceorientation",test("DeviceOrientationEvent",function(){assert("DeviceOrientationEvent"in window,"DeviceOrientationEvent supported")}),test("DeviceMotionEvent",function(){assert("DeviceMotionEvent"in window,"DeviceMotionEvent supported")}),feature("filereader",1,"FileReader ‽"),window.spec="filereader",test("FileReader",function(){var a=H.API(window,"FileReader",!0);assert(a,"FileReader supported")}),test("FileReader Events",function(){var a=H.API(window,"FileReader",!0),b;a?(b=new a,["onabort","onerror","onload","onloadend","onloadstart","onprogress"].forEach(function(a){assert(a in b,a+" supported")})):assert(!1,"FileReader not supported, skipping tests")}),test("FileReader API",function(){var a=H.API(window,"FileReader",!0),b;a?(b=new a,["readAsText","readAsDataURL","readAsArrayBuffer"].forEach(function(a){assert(a in b,a+" supported")})):assert(!1,"FileReader not supported, skipping tests")}),feature("formdata",1,"FormData ‽"),window.spec="formdata",test("FormData",function(){var a=H.API(window,"FormData",!0);assert(!!a,"FormData supported")}),asyncTest("FormData Send and Receive",function(a){var b=H.API(window,"FormData",!0),c,d;b?(c=new b,d=new XMLHttpRequest,c.append("a","alpha"),c.append("b","beta"),d.onreadystatechange=function(){var b;this.readyState===4&&this.status===200&&(b=JSON.parse(this.responseText),a.step(function(){assert(b.a==="alpha","Expected value, 'alpha'"),assert(b.b==="beta","Expected value, 'beta'"),a.done()}))},d.open("POST","/tests/_server/echo.php"),d.send(c)):(assert(!1,"FormData not supported, skipping tests"),a.done())}),asyncTest("FormData from HTMLFormElement",function(a){var b=H.API(window,"FormData",!0),c=document.getElementById("simpleForm"),d,e;b?(d=new b(c),e=new XMLHttpRequest,d.append("d","delta"),e.onreadystatechange=function(){var b;this.readyState===4&&this.status===200&&(b=JSON.parse(this.responseText),a.step(function(){assert(b.a==="alpha","Expected value, 'alpha'"),assert(b.b==="beta","Expected value, 'beta'"),assert(b.d==="delta","Expected value, 'delta'"),a.done()}))},e.open("POST","/tests/_server/echo.php"),e.send(d)):(assert(!1,"FormData not supported, skipping tests"),a.done())}),feature("forms",1,"HTML5 Forms, Inputs"),window.spec="forms";var a=":|",b={email:{ui:!1,useValidity:!0},tel:{ui:!1,useValidity:!1},url:{ui:!1,useValidity:!0},search:{ui:!1,useValidity:!1},number:{ui:!1,useValidity:!1},range:{ui:!0,useValidity:!0,workaround:function(b){var c,d,e;return"WebkitAppearance"in b.style?(c=document.documentElement,d=document.defaultView,c.appendChild(b),e=d.getComputedStyle&&d.getComputedStyle(b,null).WebkitAppearance!=="textfield"&&b.offsetHeight!==0,c.removeChild(b),e):b.value!==a}},datetime:{ui:!0,useValidity:!1},"datetime-local":{ui:!0,useValidity:!1},date:{ui:!0,useValidity:!1},week:{ui:!0,useValidity:!1},month:{ui:!0,useValidity:!1},color:{ui:!0,useValidity:!1}};for(var c in b)(function(b,c){var d=document.createElement("input");test("Input Types: <input type='"+c+"'>",function(){var e=!1,f=!1;d.setAttribute("type",c),e=d.type!=="text",e&&(d.value=a,d.style.cssText="position:absolute;visibility:hidden;",b.workaround?f=b.workaround(d):!b.ui&&!b.validity?f=!0:b.useValidity?f=d.checkValidity&&d.checkValidity()===!1:f=d.value!==a),assert(e&&f,"input type='"+c+"' supported")})})(b[c],c);"autocomplete autofocus list placeholder max maxLength min multiple pattern required step".split(" ").forEach(function(a){var b=document.createElement("input");test("Input Attributes: <input "+a.toLowerCase()+">",function(){a==="list"?assert(!!document.createElement("datalist")&&!!window.HTMLDataListElement,"input has corresponding property for list attribute"):assert(a in b,"input has corresponding property for "+a.toLowerCase()+" attribute")})}),test("Input Attributes: :required psuedoselector",function(){var a,b;if(!document.querySelectorAll)assert(!1,"querySelectorAll not supported, skipping tests");else try{a=document.querySelectorAll("#requiredtest"),b=document.querySelectorAll("#requiredtest:required"),assert(b[0]===a[0],"Search with :required yields proper element")}catch(c){assert(!1,":required selector throws exception from querySelectorAll")}}),feature("hashchange",1,"Hashchange"),window.spec="hashchange",test("HashChangeEvent",function(){var a=window.HashChangeEvent;assert(!!a,"HashChangeEvent supported")}),test("onhashchange",function(){assert("onhashchange"in window,"onhashchange exists in some form"),assert(window.onhashchange==null,"onhashchange is TreatNonCallableAsNull")}),asyncTest("onhashchange In Practice",function(a){var b=document.getElementById("hashchange").contentWindow,c=!1;b.onhashchange=function(d){c||a.step(function(){assert(!0,"onhashchange event fired"),c=!0,b.onhashchange=null,a.done()})},setTimeout(function(){c||a.step(function(){assert(!1,"onhashchange event did not fire"),c=!0,a.done()})},1e3)}),feature("history",1,"History"),window.spec="history",test("history",function(){var a=window.history;assert(!!a,"history supported")}),test("history.pushState",function(){var a=window.history;assert(!!a.pushState,"history.pushState supported"),assert(typeof a.pushState=="function","history.pushState is a function")}),test("history.replaceState",function(){var a=window.history;assert(typeof a.replaceState=="function","history.replaceState is a function")}),test("history PopStateEvent",function(){var a=window.PopStateEvent,b;a?(b=document.createEvent("PopStateEvent"),assert("state"in b,"event.state supported")):assert(!1,"PopStateEvent not supported, skipping tests")}),feature("html-media-capture",1,"Media Capture Input"),window.spec="html-media-capture",test("Input File Capture",function(){var a=document.createElement("input");a.type="file",assert("capture"in a,"Input File Capture supported")}),feature("indexeddb",1,"IndexedDB ‽"),window.spec="indexeddb",test("IndexedDB, basic support",function(){assert(H.API(window,"indexedDB",!0),"indexedDB supported"),assert(H.API(window,"IDBTransaction",!0),"IDBTransaction supported"),assert(H.API(window,"IDBRequest",!0),"IDBRequest supported")}),feature("multitouch",1,"Multi Touch Event ‽"),window.spec="multitouch",test("Multi Touch Events in Practice",function(a){var b=H.API(window,"TouchEvent",!0),c={};if(!b)assert(!1,"TouchEvent not supported, skipping tests");else if(window.MozTouchEvent)assert(!0,"TouchEvent supported, cannot confirm implementation");else{try{c=document.createEvent("TouchEvent")}catch(d){}assert("touches"in c,"event.touches supported"),assert("changedTouches"in c,"event.changedTouches supported"),assert("targetTouches"in c,"event.targetTouches supported")}}),feature("offline",1,"Offline Mode"),window.spec="offline",test("Online Events, basic support",function(){assert("onLine"in navigator,"navigator.onLine supported"),assert("ononline"in document.body,"document.body.ononline supported"),assert("onoffline"in document.body,"document.body.onoffline supported")}),feature("ring-1-performance",1,"Ring 1 Performance"),window.spec="ring-1-performance",asyncTest("Framerate for 50 sprites",function(a){function d(e){var f=JSON.parse(e.data);f.avg&&f.avg.fps&&!b&&!c&&(b=!0,a.step(function(){assert(f.avg.fps>=30,"Moving 50 sprites, with 10 frames each ("+f.avg.fps+")"),H.off(window,"message",d),a.done()})),a.done()}var b=!1,c=!1;H.on(window,"message",d),setTimeout(function(){c||(H.off(window,"message",d),a.step(function(){assert(!1,"Browser failed to complete performance test in allotted time"),c=!0,a.done()}))},7e3)}),feature("touchevents",1,"Touch Event ‽"),window.spec="touchevents",test("TouchEvent",function(){var a=H.API(window,"TouchEvent",!0);assert(!!a,"TouchEvent supported")}),test("createTouch",function(){assert("createTouch"in document,"createTouch supported")}),["touchstart","touchend","touchcancel","touchmove"].forEach(function(a){a="on"+a,test("Touch Events: "+a,function(){assert(a in window,a+" supported")})}),feature("url",1,"URL"),window.spec="url",test("URL",function(){var a=H.API(window,"URL",!0);assert(a,"URL.create supported")}),test("URL createObjectURL",function(){var a=H.API(window,"URL",!0),b;a===undefined?assert(!1,"URL.createObjectURL not supported, skipping tests"):(b=H.API(a,"createObjectURL",!0),assert(a.createObjectURL,"URL.createObjectURL supported"))}),feature("webworkers",1,"Web Workers ‽"),window.spec="webworkers",test("Web Workers",function(){var a=H.API(window,"Worker",!0);assert(!!a,"Worker supported")}),asyncTest("Web Worker navigator",function(a){var b=H.API(window,"Worker",!0),c;b?(c=new b("/tests/webworkers/worker.js"),c.postMessage({test:"navigator"}),c.onmessage=function(b){a.step(function(){var d=b.data,e=!1;e=["appName","appVersion","platform","userAgent"].every(function(a){return assert(d[a]===navigator[a],d[a]+" === "+navigator[a]),d[a]===navigator[a]}),assert(e,"Worker correctly implements navigator"),a.done(),c.terminate(),c=null})}):(assert(!1,"Workers not supported, skipping tests"),a.done())}),asyncTest("Web Worker location",function(a){var b=H.API(window,"Worker",!0),c;b?(c=new b("/tests/webworkers/worker.js"),c.postMessage({test:"location"}),c.onmessage=function(b){a.step(function(){var d=b.data,e=!1;e=Object.keys(d).every(function(a){return assert(a in location,a+" in location"),a in location}),assert(e,"Worker implements location"),a.done(),c.terminate(),c=null})}):(assert(!1,"Workers not supported, skipping tests"),a.done())}),asyncTest("Web Worker global",function(a){var b=H.API(window,"Worker",!0),c;b?(c=new b("/tests/webworkers/worker.js"),c.postMessage({test:"worker"}),c.onmessage=function(b){a.step(function(){var d=b.data,e=!1;e=Object.keys(d).every(function(a){return assert(a,"WorkerGlobalScope implements "+a),d[a]}),assert(e,"Worker implements global properties"),a.done(),c.terminate(),c=null})}):(assert(!1,"Workers not supported, skipping tests"),a.done())}),asyncTest("Web Worker data messaging",function(a){var b=H.API(window,"Worker",!0),c,d,e,f;if(!b)assert(!1,"Workers not supported, skipping tests"),a.done();else{f=new b("/tests/webworkers/worker.js"),d=[],e={objectA:{a:1,b:null,c:[{}],d:{a:3.14159,b:!1,c:{d:0,f:[[[]]],g:{j:{k:{n:{r:"r",s:[1,2,3],u:0,v:{w:{x:{y:"Yahoo!",z:null}}}},o:99,q:[]},m:null}},h:"false",i:!0}},e:String("constructed string"),f:{},g:"",h:"h",i:[]},array:[1,2,3,4,5,6,7,8,9,[1,2,3,4,5,6,7,8,9,[1,2,3,4,5,[[6,7,8,9,[[1,2,3,4,[2,3,4,[1,2,[1,2,3,4,[1,2,3,4,5,6,7,8,9,[0],1,2,3,4,5,6,7,8,9],5,6,7,8,9],4,5,6,7,8,9],5,6,7,8,9],5,6,7]]]]]]],string:"this is a standard string",bool:!0,loc:{},ua:navigator.userAgent};for(c in e)d.push(e[c]);f.postMessage({test:"messaging",args:d}),f.onmessage=function(b){a.step(function(){assert(JSON.stringify(b.data)===JSON.stringify(e),"Worker supports complex data objects"),a.done(),f.terminate(),f=null})}}}),asyncTest("Web Worker Blob URL",function(a){var b=H.API(window,"Worker",!0),c=H.API(window,"URL",!0),d=H.API(window,"Blob",!0),e,f;!b||!d?(assert(!1,"Workers or Blob not supported, skipping tests"),a.done()):(e=new b("/tests/webworkers/worker.js"),f=new d(["onmessage = function( event ) { postMessage( event.data ) };"],{type:"text/plain"}),e=new b(c.createObjectURL(f)),e.postMessage("The Blob!"),e.onmessage=function(b){a.step(function(){assert(b.data==="The Blob!","Blob Web Worker"),a.done(),e.terminate(),e=null})})}),feature("xhr2",1,"XHR2 ‽"),window.spec="xhr2",test("XHR2",function(){var a=new XMLHttpRequest;assert("upload"in a,"xhr.upload is supported")}),test("XHR2 Prerequisite: ArrayBuffer",function(){var a=H.API(window,"ArrayBuffer",!0);assert(a,"ArrayBuffer supported")}),test("XHR2 Prerequisite: Blob",function(){var a=H.API(window,"Blob",!0);assert(a,"Blob supported")}),test("XHR2 Prerequisite: URL",function(){var a=H.API(window,"URL",!0);assert(!!a,"URL supported")}),test("XHR2 Upload",function(){var a=new XMLHttpRequest;a.upload?["onabort","onerror","onload","onloadstart","onprogress"].forEach(function(b){assert(b in a.upload,"xhr.upload."+b+" supported"),assert(a.upload[b]==null,"xhr.upload."+b+" is TreatNonCallableAsNull")}):assert(!1,"xhr.upload not supported, skipping tests")}),asyncTest("XHR2 ArrayBuffer Response Type",function(a){var b=H.API(window,"Blob",!0),c=new XMLHttpRequest,d=!1;b?(c.open("GET","/tests/xhr2/png.png",!0),c.responseType="arraybuffer",c.onload=function(c){var e,f=this;!d&&f.status===200&&a.step(function(){assert(f.response instanceof ArrayBuffer,"ArrayBuffer data.response supported"),assert("byteLength"in f.response,"data.response.byteLength supported"),assert(typeof f.response.byteLength=="number","data.response.byteLength is number"),b?(e=new b([f.response],{type:"image/png"}),assert(e instanceof b,"blob is an instance of Blob"),assert("size"in e,"blob.size supported"),assert("type"in e,"blob.type supported"),assert(typeof e.size=="number","typeof blob.size is number"),assert(e.size===23115,"blob.size of fixture png.png is 23115"),assert(typeof e.type=="string","typeof blob.type is string"),assert(e.type==="image/png","blob.type of fixture png.png is image/png"),assert({}.toString.call(e)==="[object Blob]","Correct Blob type"),d=!0,a.done()):(assert(!1,"Blob not supported, skipping tests"),a.done())})},c.send()):(assert(!1,"Blob not supported, skipping tests"),d=!0,a.done()),setTimeout(function(){d||a.step(function(){assert(!1,"Browser ArrayBuffer Response test in allotted time"),d=!0,a.done()})},7e3)}),asyncTest("XHR2 Text Send/Response Type",function(a){var b=new XMLHttpRequest,c=!1;"responseType"in b?(b.open("POST","/tests/_server/data.php",!0),b.responseType="text",b.onload=function(b){var d=this;!c&&d.status===200&&a.step(function(){assert(typeof d.response=="string","Text Response supported (strings)"),c=!0,a.done()})},b.send("Just a string")):(assert(!1,"xhr.responseType not supported, skipping tests"),c=!0,a.done()),setTimeout(function(){c||a.step(function(){assert(!1,"Browser Text Response test in allotted time"),c=!0,a.done()})},7e3)}),asyncTest("XHR2 Blob Response Type",function(a){var b=H.API(window,"Blob",!0),c=H.API(window,"URL",!0),d=new XMLHttpRequest,e=!1;b?(d.open("GET","/tests/xhr2/png.png",!0),d.responseType="blob",d.onload=function(c){var d=this;!e&&d.status===200&&a.step(function(){assert(d.response instanceof b,"Blob Response supported (images)"),e=!0,a.done()})},d.send()):(assert(!1,"Blob not supported, skipping tests"),e=!0,a.done()),setTimeout(function(){e||a.step(function(){assert(!1,"Browser Blob Response test in allotted time"),e=!0,a.done()})},7e3)}),asyncTest("XHR2 Document Response Type",function(a){var b=new XMLHttpRequest,c=window.Document,d=!1;"responseType"in b?(b.open("GET",window.location.href,!0),b.responseType="document",b.onload=function(b){var e=this;!d&&e.status===200&&a.step(function(){assert(e.responseXML instanceof c,"Document Response supported (XML, HTML documents)"),d=!0,a.done()})},b.send()):(assert(!1,"xhr.responseType not supported, skipping tests"),a.done()),setTimeout(function(){d||a.step(function(){assert(!1,"Browser Document Response test in allotted time"),d=!0,a.done()})},7e3)})}}),Hat.ring({ring:2,features:31,test:function(){module("ring:2"),feature("animationtiming",2,"Animation Timing ‽"),window.spec="animationtiming",test("Animation Timing requestAnimationFrame",function(){var a=H.API(window,"requestAnimationFrame",!0);assert(a,"requestAnimationFrame supported")}),test("Animation Timing cancelAnimationFrame",function(){var a=H.API(window,"cancelAnimationFrame",!0)||H.API(window,"cancelRequestAnimationFrame",!0);assert(a,"cancelAnimationFrame supported")}),asyncTest("Animation Timing in Practice",function(a){var b,c,d,e,f=0,g=0,h=document.getElementById("animationtiming"),i=H.API(window,"requestAnimationFrame",!0),j=H.API(window,"cancelAnimationFrame",!0)||H.API(window,"cancelRequestAnimationFrame",!0);!i||!j?(assert(!1,"requestAnimationFrame or cancelAnimationFrame is not supported, skipping tests"),a.done()):(b=function(a){g++,h.style.left=(Date.now()-e)%2e3/4+"px",f=i(b)},c=function(){e=Date.now(),f=i(b)},d=function(){f&&j(f),f=0},c(),setTimeout(function(){d(),a.step(function(){assert(g/3>30,"> 30 fps"),a.done()})},3e3))}),feature("canvas-3d",2,"Canvas 3D"),window.spec="canvas-3d",test("Canvas 3D",function(){var a=window.WebGLRenderingContext;assert(!!a,"WebGLRenderingContext supported")}),test("Canvas 3D Context",function(){var a=window.WebGLRenderingContext,b=document.createElement("canvas"),c=["3d","webgl","experimental-webgl","moz-webgl","webkit-3d","opera-3d","ms-webgl","ms-3d"],d,e;while(c.length){d=c.pop(),e=b.getContext(d);if(e)break}assert(!!a,"WebGLRenderingContext supported ("+d+")")}),feature("canvas-3d-standard",2,"Canvas 3D, Standard"),window.spec="canvas-3d-standard",test("Canvas 3D Context, standard",function(){assert(document.createElement("canvas").getContext("webgl"),"webgl standard, supported")}),feature("css-unspecified",2,"CSS Unspecified ‽"),window.spec="css-unspecified",test("CSS Text Stroke",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"textStroke",!0),"textStroke supported"),assert(H.test.cssProp(a,"textStrokeColor",!0),"textStrokeColor supported"),assert(H.test.cssProp(a,"textStrokeWidth",!0),"textStrokeWidth supported")}),feature("cssanimation-standard",2,"CSS3 Animation, Standard"),window.spec="cssanimation-standard",test("CSS Animation, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"animationName"),"animationName standard, supported")}),feature("cssborderimage",2,"CSS3 BorderImage ‽"),window.spec="cssborderimage",test("CSS border-image",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"borderImageSource",!0),"border-image-source supported"),assert(H.test.cssProp(a,"borderImageSlice",!0),"border-image-slice supported"),assert(H.test.cssProp(a,"borderImageWidth",!0),"border-image-width supported"),assert(H.test.cssProp(a,"borderImageOutset",!0),"border-image-outset supported"),assert(H.test.cssProp(a,"borderImageRepeat",!0),"border-image-repeat supported"),assert(H.test.cssProp(a,"borderImage",!0),"Shorthand border-image supported")}),test("CSS border-image shorthand property",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"borderImage",!0),"CSS border-image shorthand property supported")}),feature("csselement",2,"CSS Element ‽"),window.spec="csselement",test("CSS Element",function(){var a=document.createElement("div"),b=H.prefixes.expandCss("element(#csselement)").split(";"),c="",d;b.forEach(function(a){a&&(c+="background: "+a+";")}),a.style.cssText=c,/-element/.test(a.style.background)&&/csselement/.test(a.style.background)?d="CSS Element supported via (possibly prefixed) -element() rule":H.API(document,"getCSSCanvasContext",!0)&&(d="CSS Element supported via document.getCSSCanvasContext"),assert(d,d||"CSS Element not supported")}),feature("cssflexbox",2,"CSS3 Flexbox ‽"),window.spec="cssflexbox",test("CSS Flexbox, align-content",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignContent",!0),"alignContent supported")}),test("CSS Flexbox, align-items",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignItems",!0),"alignItems supported")}),test("CSS Flexbox, align-self",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignSelf",!0),"alignSelf supported")}),test("CSS Flexbox, flex",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flex",!0),"flex supported")}),test("CSS Flexbox, flex-basis",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexBasis",!0),"flexBasis supported")}),test("CSS Flexbox, flex-direction",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexDirection",!0),"flexDirection supported")}),test("CSS Flexbox, flex-flow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexFlow",!0),"flexFlow supported")}),test("CSS Flexbox, flex-grow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexGrow",!0),"flexGrow supported")}),test("CSS Flexbox, flex-shrink",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexShrink",!0),"flexShrink supported")}),test("CSS Flexbox, flex-wrap",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexWrap",!0),"flexWrap supported")}),test("CSS Flexbox, justify-content",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"justifyContent",!0),"justifyContent supported")}),test("CSS Flexbox, order",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"order",!0),"order supported")}),test("CSS Flexbox, align-flow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignFlow",!0),"alignFlow supported")}),test("CSS Flexbox, align-pack",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignPack",!0),"alignPack supported")}),test("CSS Flexbox, align-order",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignOrder",!0),"alignOrder supported")}),feature("cssflexbox-standard",2,"CSS3 Flexbox, Standard"),window.spec="cssflexbox-standard",test("CSS Flexbox, align-content",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignContent"),"alignContent supported")}),test("CSS Flexbox, align-items",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignItems"),"alignItems supported")}),test("CSS Flexbox, align-self",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"alignSelf"),"alignSelf supported")}),test("CSS Flexbox, flex",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flex"),"flex supported")}),test("CSS Flexbox, flex-basis",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexBasis"),"flexBasis supported")}),test("CSS Flexbox, flex-direction",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexDirection"),"flexDirection supported")}),test("CSS Flexbox, flex-flow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexFlow"),"flexFlow supported")}),test("CSS Flexbox, flex-grow",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexGrow"),"flexGrow supported")}),test("CSS Flexbox, flex-shrink",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexShrink"),"flexShrink supported")}),test("CSS Flexbox, flex-wrap",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"flexWrap"),"flexWrap supported")}),test("CSS Flexbox, justify-content",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"justifyContent"),"justifyContent supported")}),test("CSS Flexbox, order",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"order"),"order supported")}),feature("cssimages",2,"CSS3 Images ‽"),window.spec="cssimages",test("CSS Images url()",function(){var a=document.createElement("div");a.style.cssText="background-image: url(https://);",assert(H.test.string(a.style.backgroundImage,"url"),"images with url() supported")}),test("CSS Images linear-gradient",function(){var a=document.createElement("div"),b="background-image:",c="gradient(linear,left top,right bottom,from(#9f9),to(white));",d="linear-gradient(left top,#9f9, white);",e=(b+"-webkit- ".split(" ").join(c+b)+H.prefixes.css.join(d+b)).slice(0,-b.length);a.style.cssText=e,assert(H.test.string(a.style.backgroundImage,"gradient"),"linear-gradient supported")}),test("CSS Images repeating-linear-gradient",function(){var a=document.createElement("div"),b="background-image:",c="repeating-linear-gradient(-22deg, #f99 20px, #fff 40px)",d=H.prefixes.css.length-1,e=H.prefixes.css.slice(0,d).map(function(a){return b+a+c}).join(";")+";";a.style.cssText=e,assert(H.test.string(a.style.backgroundImage,"repeating"),"repeating-linear-gradient supported")}),test("CSS Images radial-gradient",function(){var a=document.createElement("div"),b="background-image:",c="radial-gradient(75% 50%, ellipse closest-side, #99ff99, #ffffff 50%)",d=H.prefixes.css.length-1,e=H.prefixes.css.slice(0,d).map(function(a){return b+a+c}).join(";")+";";a.style.cssText=e,assert(H.test.string(a.style.backgroundImage,"gradient"),"radial-gradient supported")}),test("CSS Images repeating-radial-gradient",function(){var a=document.createElement("div"),b="background-image:",c="repeating-radial-gradient(75% 50%, ellipse closest-side, #99ff99, #ffffff 50%)",d=H.prefixes.css.length-1,e=H.prefixes.css.slice(0,d).map(function(a){return b+a+c}).join(";")+";";a.style.cssText=e,assert(H.test.string(a.style.backgroundImage,"repeating"),"repeating-radial-gradient supported")}),test("CSS Images object-fit",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"objectFit",!0),"object-fit supported")}),test("CSS Images object-position",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"objectPosition",!0),"object-position supported")}),test("CSS Images image-orientation",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"imageOrientation",!0),"imageOrientation supported")}),test("CSS Images image-resolution",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"imageResolution",!0),"imageResolution supported")}),feature("cssimages-standard",2,"CSS3 Images, Standard"),window.spec="cssimages-standard",test("CSS Images linear-gradient, standard",function(){var a=document.createElement("div"),b="background-image:linear-gradient(to bottom right, #9f9, white);";a.style.cssText=b,assert(H.test.string(a.style.backgroundImage,"gradient"),"linear-gradient standard, supported")}),test("CSS Images repeating-linear-gradient, standard",function(){var a=document.createElement("div"),b="background-image:repeating-linear-gradient(-22deg, #f99 20px, #fff 40px)";a.style.cssText=b,assert(H.test.string(a.style.backgroundImage,"repeating"),"repeating-linear-gradient standard, supported")}),test("CSS Images radial-gradient, standard",function(){var a=document.createElement("div"),b="background-image:radial-gradient(ellipse closest-side at 75% 50%, #99ff99, #ffffff 50%);";a.style.cssText=b,assert(H.test.string(a.style.backgroundImage,"gradient"),"radial-gradient standard, supported")}),test("CSS Images repeating-radial-gradient, standard",function(){var a=document.createElement("div"),b="background-image:repeating-radial-gradient(ellipse closest-side at 75% 50%, #99ff99, #ffffff 50%);";a.style.cssText=b,assert(H.test.string(a.style.backgroundImage,"repeating"),"repeating-radial-gradient standard, supported")}),test("CSS Images object-fit, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"objectFit"),"object-fit standard, supported")}),test("CSS Images object-position, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"objectPosition"),"object-position standard, supported")}),test("CSS Images image-orientation",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"imageOrientation"),"imageOrientation supported")}),test("CSS Images image-resolution",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"imageResolution"),"imageResolution supported")}),feature("cssoverflow-standard",2,"CSS Overflow Scrolling, Standard"),window.spec="cssoverflow-standard",test("CSS Overflow Scrolling, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"overflowScrolling"),"overflowScrolling standard, supported")}),feature("csstransforms-standard",2,"CSS3 2D Transforms, Standard"),window.spec="csstransforms-standard",test("CSS Transform (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transform"),"transform supported")}),test("CSS transform-origin (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transformOrigin"),"transformOrigin supported")}),test("CSS transform-style (2d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transformStyle"),"transformStyle supported")}),test("CSS Perspective (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspective"),"perspective supported")}),test("CSS perspective-origin (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"perspectiveOrigin"),"perspectiveOrigin supported")}),test("CSS backface-visibility (3d)",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"backfaceVisibility"),"backfaceVisibility supported")}),feature("csstransitions-standard",2,"CSS3 Transitions, Standard"),window.spec="csstransitions-standard",test("CSS Transitions, standard",function(){var a=document.createElement("div");assert(H.test.cssProp(a,"transition"),"transitions standard, supported")}),feature("dataset",2,"Custom Data Attributes"),window.spec="dataset",test("Dataset",function(){assert(!!document.createElement("div").dataset,"Dataset supported")}),test("Dataset Implementation",function(){var a=window.DOMStringMap,b=document.createElement("div"),c,d;b.dataset?(b.dataset.beta="b",c=b.dataset instanceof a,d=Object.keys(b.dataset).length):(c=!1,d=0),assert(c,"fixture.dataset property is DOMStringMap"),assert(d===1,"fixture.dataset.length expects 1")}),test("Dataset Interop with Attributes",function(){var a=document.createElement("div"),b,c;a.dataset?(a.setAttribute("data-alpha","a"),a.dataset.beta="b",b=a.getAttribute("data-beta"),c=a.dataset.alpha):(b="",c=""),assert(b==="b","fixture.getAttribute('data-beta') === 'b' (set with dataset)"),assert(c==="a","fixture.dataset.alpha === 'a' (set with setAttribute)")}),test("Dataset Get*",function(){var a=document.createElement("div");a.dataset?(a.setAttribute("data-alpha","a"),a.dataset.beta="b",assert(a.getAttribute("data-beta")==="b","compatible get with getAttribute"),assert(a.dataset.alpha==="a","compatible set with setAttribute"),[["data-foo","foo"],["data-foo-bar","fooBar"],["data--","-"],["data--foo","Foo"],["data---foo","-Foo"],["data-Foo","foo"],["data-",""],["data-à","à"]].forEach(function(a,b){var c=document.createElement("div"),d=b+"";c.setAttribute(a[0],d),assert(c.dataset[a[1]]===d,"Expected: "+a.join(" = "))})):assert(!1,"Dataset not supported, not running get* tests")}),test("Dataset Enumerable",function(){var a=document.createElement("div"),b=["hello","helloWorld","ohHai"],c=b.length,d;if(!a.dataset)assert(!1,"Dataset not supported, not running Enumerable tests");else{a.setAttribute("data-hello",1),a.setAttribute("data-hello-world",2),a.setAttribute("data-oh-hai",2);for(d in a.dataset)b.splice(b.indexOf(d),1),c--,assert(b.length===c,d);assert(!b.length,"Expecting length === 0")}}),feature("fullscreen",2,"Fullscreen ‽"),window.spec="fullscreen",test("FullScreen",function(){var a=document.createElement("div"),b=H.API(a,"requestFullScreen",!0);b=b||H.API(a,"requestFullscreen",!0),assert(b,"requestFullScreen supported"),assert(H.isFunction(b),"requestFullScreen or requestFullscreen is a function")}),test("FullScreen document",function(){var a=H.get.domProp(document,"fullscreenElement",!0)!==!1,b=H.API(document,"fullscreenEnabled",!0),c=H.API(document,"exitFullscreen",!0);assert(a,"fullscreenElement supported"),assert(b,"fullscreenEnabled supported"),assert(H.isFunction(c),"exitFullscreen is a function")}),feature("html5",2,"HTML5 Layout & Semantic"),window.spec="html5",[{display:"block",names:"article aside details figure figcaption footer header hgroup nav section summary"},{display:"inline",names:"abbr audio bdi data mark output time video"},{display:"inline-block",names:"meter progress"}].forEach(function(a){a.names.split(" ").forEach(function(a){test("HTML5: "+a,function(){var b=document.getElementById("html5"),c=b.querySelector(a);assert(c instanceof HTMLElement,a+" instanceof HTMLElement"),assert(c.outerHTML!=="<:"+a+"></:"+a+">",a+" node created")})})}),test("HTML5: bdi dir",function(){}),test("HTML5: details & summary",function(){var a=document.getElementById("html5"),b=document.createElement("details"),c=document.createElement("summary"),d=b.offsetHeight;a.appendChild(b),assert("open"in b,"details.open supported"),assert(b.open===!1,"details.open === false"),assert(d===0,"details height === 0"),c.textContent="Oh HAI!",b.appendChild(c),b.open=!0,assert(d!==b.offsetHeight,"details height as expected")}),test("HTML5: mark background",function(){var a=document.getElementById("html5"),b=a.querySelector("mark"),c=getComputedStyle(b).getPropertyValue("background-color");assert(["rgb(255, 255, 0)","yellow","#ffff00"].some(function(a){return c===a}),"mark background is yellow")}),feature("iframe",2,"Iframe Sandboxing"),window.spec="iframe",test("IFrame",function(){var a=document.createElement("iframe");assert(!!a,"iframe supported")}),test("IFrame Sandbox",function(){var a=document.createElement("iframe");assert("sandbox"in a,"Sandbox iframe supported")}),asyncTest("IFrame Sandbox Sanity",function(a){var b=document.getElementById("regular"),c=document.getElementById("sandbox"),d=document.createElement("iframe");"sandbox"in d?(assert(!!b.contentWindow,"regular iframe is accessible"),assert(!c.contentWindow,"sandbox iframe is blocked"),a.done()):(assert(!1,"Sandbox iframe not support, skipping tests"),a.done())}),asyncTest("IFrame Sandbox allow-scripts",function(a){function e(b){!d&&b.data.type==="allow-scripts"&&a.step(function(){assert(b.data.result==="?allow-scripts","allowScripts allowed JS to execute in iframe"),H.off(window,"message",e),d=!0,a.done()})}var b=document.getElementById("iframe"),c=document.createElement("iframe"),d=!1;"sandbox"in c?(H.on(window,"message",e),c.sandbox="allow-scripts",c.src="/tests/iframe/allow-scripts.html?allow-scripts",b.appendChild(c),setTimeout(function(){d||a.step(function(){assert(!1,"allowScripts failed"),H.off(window,"message",e),d=!0,a.done()})},1e3)):(assert(!1,"Sandbox iframe not support, skipping tests"),a.done())}),asyncTest("IFrame Sandbox allow-scripts allow-forms",function(a){function e(b){a.step(function(){!d&&b.data.type==="allow-scripts-forms"&&(assert(!0,"allowScripts allowed JS to execute in iframe and submit a form"),H.off(window,"message",e),d=!0,a.done())})}var b=document.getElementById("iframe"),c=document.createElement("iframe"),d=!1;"sandbox"in c?(H.on(window,"message",e),c.sandbox="allow-scripts allow-forms",c.src="/tests/iframe/allow-scripts-forms.html?allow-scripts-forms",b.appendChild(c),setTimeout(function(){d||a.step(function(){assert(!1,"allowScriptsForms failed"),H.off(window,"message",e),d=!0,a.done()})},1e3)):(assert(!1,"Sandbox iframe not support, skipping tests"),a.done())}),feature("indexeddb-standard",2,"IndexedDB, Standard"),window.spec="indexeddb-standard",test("IndexedDB, basic support, standard",function(){assert(H.API(window,"indexedDB"),"indexedDB standard, supported")}),feature("navigationtiming",2,"Performance Timing ‽"),window.spec="navigationtiming",test("performance",function(){var a=H.API(window,"performance",!0);assert(!!a,"performance supported")}),test("performance navigation",function(){var a=H.API(window,"performance",!0),b=a&&H.API(a,"navigation",!0);!a||!b?assert(!1,"performance not supported, skipping tests"):(b=H.API(a,"navigation",!0),assert(b,"performance.navigation supported"))}),test("performance navigation instance",function(){var a=H.API(window,"performance",!0),b=a&&H.API(a,"navigation",!0);!a||!b?assert(!1,"performance.navigation not supported, skipping tests"):["redirectCount","type"].forEach(function(b){assert(b in a.navigation,"performance.navigation "+b+" supported"),assert(typeof a.navigation[b]=="number","performance.navigation "+b+" is a number")})}),test("performance navigation sanity",function(){var a=H.API(window,"performance",!0);assert(a&&a.navigation.redirectCount===0,"performance.navigation.redirectCount matched expected")}),test("performance timing",function(){var a=H.API(window,"performance",!0);assert(a&&a.timing,"performance.timing exists in some form")}),test("performance timing instance",function(){var a,b=H.API(window,"performance",!0),c=b&&H.API(b,"timing",!0);!b||!c?assert(!1,"performance.timing not supported, skipping tests"):["connectEnd","connectStart","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","domLoading","domainLookupEnd","domainLookupStart","fetchStart","loadEventEnd","loadEventStart","navigationStart","redirectEnd","redirectStart","requestStart","responseEnd","responseStart","unloadEventEnd","unloadEventStart"].forEach(function(a){assert(a in c,"performance.navigation.timing "+a+" supported"),assert(typeof c[a]=="number","performance.navigation.timing "+a+" is a number")})}),test("performance timing sanity",function(){var a=H.API(window,"performance",!0),b=a&&H.API(a,"timing",!0);!a||!b?assert(!1,"performance.timing is not supported, skipping tests"):[[b.connectEnd>=b.connectStart,"connectEnd >= connectStart"],[b.domainLookupEnd>=b.domainLookupStart,"domainLookupEnd >= domainLookupStart"],[b.loadEventEnd>=b.loadEventStart,"loadEventEnd >= loadEventStart"],[b.unloadEventEnd>=b.unloadEventStart,"unloadEventEnd >= unloadEventStart"],[b.domComplete>=b.domContentLoadedEventStart,"domComplete >= domContentLoadedEventStart"],[b.domComplete>=b.domContentLoadedEventEnd,"domComplete >= domContentLoadedEventEnd"],[b.domContentLoadedEventEnd>=b.domContentLoadedEventStart,"domContentLoadedEventEnd >= domContentLoadedEventStart"]].forEach(function(a){assert(a[0],a[1])})}),feature("network",2,"Network Info ‽"),window.spec="network",test("Network Connection",function(){var a=H.API(navigator,"connection",!0);assert(a,"navigator.connection supported")}),test("Network Connection bandwidth",function(){var a=H.API(navigator,"connection",!0);a?assert("bandwidth"in a,"navigator.connection.bandwidth supported"):assert(!1,"navigator.connection not supported, skipping tests")}),test("Network Connection metered",function(){var a=H.API(navigator,"connection",!0);a?assert("metered"in a,"navigator.connection.metered supported"):assert(!1,"navigator.connection not supported, skipping tests")}),test("Network Connection onchange",function(){var a=H.API(navigator,"connection",!0);a?assert("onchange"in a,"navigator.connection.onchange supported"):assert(!1,"navigator.connection not supported, skipping tests")}),feature("notifications",2,"Notifications ‽"),window.spec="notifications",test("Notifications",function(){var a=H.API(window,"Notification",!0);a=a||H.API(window,"notifications",!0),assert(a,"Notification supported")}),feature("ring-2-performance",2,"Ring 2 Performance"),window.spec="ring-2-performance",asyncTest("Framerate for 100 sprites",function(a){function d(e){var f=JSON.parse(e.data);f.avg&&f.avg.fps&&!b&&!c&&(b=!0,a.step(function(){assert(f.avg.fps>=30,"Moving 100 sprites, with 10 frames each ("+f.avg.fps+")"),H.off(window,"message",d),a.done()})),a.done()}var b=!1,c=!1;H.on(window,"message",d),setTimeout(function(){c||(H.off(window,"message",d),a.step(function(){assert(!1,"Browser failed to complete performance test in allotted time"),c=!0,a.done()}))},7e3)}),feature("sharedworkers",2,"SharedWorkers ‽"),window.spec="sharedworkers",test("Shared Web Workers",function(){var a=H.API(window,"SharedWorker",!0),b;a?(b=new a("/tests/webworkers/worker.js"),assert(!!a,"SharedWorker supported"),assert(b instanceof a,"shared instanceof SharedWorker")):assert(!1,"SharedWorker not supported, skipping tests")}),feature("svg",2,"SVG"),window.spec="svg",test("SVG",function(){var a=document.createElementNS;assert(!!a,"SVG createElementNS supported")}),test("SVG Element (Namespace)",function(){var a="http://www.w3.org/2000/svg",b=document.createElementNS(a,"svg");assert(!!b,"svg supported"),assert(!!b.getCurrentTime,"svg Namespace getCurrentTime"),assert(b.ownerSVGElement===null,"svg Namespace ownerSVGElement supported")}),feature("svganimation",2,"SVG Animation"),window.spec="svganimation",test("SVG Element (Animation)",function(){var a="http://www.w3.org/2000/svg",b=document.createElementNS(a,"animate");assert(!!b,"svg animate")}),feature("svginline",2,"SVG Inline"),window.spec="svginline",test("SVG Element (Inline)",function(){var a=document.createElement("div"),b;a.innerHTML="<svg>",b=a.children[0],assert(!!b,"svg inline"),assert(b.nodeName==="svg","svg inline nodeName is correct"),assert(!!b.getCurrentTime,"svg Inline getCurrentTime"),assert(b.ownerSVGElement===null,"svg Inline ownerSVGElement supported")}),feature("track",2,"Video Tracks"),window.spec="track",test("Video Track",function(){var a=document.createElement("video"),b=document.createElement("track");assert(!!a.addTextTrack,"video.addTextTrack supported"),b?(assert("kind"in b,"track.kind supported"),assert("src"in b,"track.src supported"),assert("srclang"in b,"track.srclang supported"),assert("label"in b,"track.label supported"),assert("default"in b,"track.default supported")):assert(!1,"track elements are not supported, skipping tests")}),feature("vibration",2,"Vibration ‽"),window.spec="vibration",test("Vibration",function(){var a=H.API(navigator,"vibrate",!0);assert(a,"vibrate supported")}),feature("visibilitystate",2,"Page Visibility ‽"),window.spec="visibilitystate",test("visibilityState",function(){var a=H.API(document,"visibilityState",!0);assert(a,"visibilityState supported")}),test("visibilityState visible",function(){var a=H.API(document,"visibilityState",!0);a?assert(a==="visible","document is visible"):assert(!1,"visibilityState not supported, skipping tests")}),test("visibilityState hidden",function(){var a=H.API(document,"hidden",!0,!1);assert(a!==undefined,"hidden supported")}),feature("webrtc",2,"WebRTC (Real time Audio & Video) ‽"),window.spec="webrtc",test("WebRTC getUserMedia",function(){var a=H.API(navigator,"getUserMedia",!0);assert(a,"navigator.getUserMedia supported")})}});