{"ScriptPreparationCode":"//Add 100,000 elements\r\nvar frag = document.createDocumentFragment();\r\nfor (var i=0; i\u003C10; i\u002B\u002B){\r\n var outDiv = document.createElement(\u0027div\u0027);\r\n for (var j=0; j\u003C100; j\u002B\u002B){\r\n var midDiv = document.createElement(\u0027div\u0027);\r\n for (var k=0; k\u003C100; k\u002B\u002B){\r\n var inDiv = document.createElement(\u0027div\u0027);\r\n if(i==6 \u0026\u0026 j==60){\r\n if(k==60)\r\n inDiv.id=\u0022one\u0022;\r\n else if(k==61)\r\n inDiv.id=\u0022two\u0022;\r\n }\r\n midDiv.appendChild(inDiv)\r\n }\r\n outDiv.appendChild(midDiv)\r\n }\r\n frag.appendChild(outDiv);\r\n}\r\ndocument.body.appendChild(frag);\r\nvar $innerOne = $(document.getElementById(\u0027one\u0027));\r\nvar $body = $(document.body)\r\nvar isOrIn = function isOrIn(container, contained){\r\n var found = false;\r\n if(typeof container === \u0027string\u0027){\r\n if(!container || !contained){\r\n }else if($(contained).is(container)){\r\n found=true;\r\n } else{\r\n var pointer = contained;\r\n var parent = pointer.parentNode;\r\n\r\n while(parent){\r\n if($(parent).is(container)){\r\n found=true;\r\n break;\r\n }\r\n pointer = parent;\r\n parent = pointer.parentNode;\r\n }\r\n\r\n }\r\n }else{\r\n if(!container || !contained){\r\n }else if(contained===container){\r\n found=true;\r\n } else{\r\n var pointer = contained;\r\n var parent = pointer.parentNode;\r\n\r\n while(parent \u0026\u0026 pointer!==container){\r\n if(parent === container){\r\n found=true;\r\n break;\r\n }\r\n pointer = parent;\r\n parent = pointer.parentNode;\r\n }\r\n\r\n }\r\n }\r\n return found;\r\n}","TestCases":[{"Name":"!!closest.length","Code":"var found = !!$innerOne.closest($body).length;\r\nif(!found)throw new Error(\u0027BOOM\u0027);","IsDeferred":false},{"Name":"== and parentNodes","Code":"var found = isOrIn($body[0],$innerOne[0]);\r\nif(!found)throw new Error(\u0027BOOM\u0027);","IsDeferred":false},{"Name":"!!closest.length selector","Code":"var found = !!$innerOne.closest(\u0027body\u0027).length;\r\nif(!found)throw new Error(\u0027BOOM\u0027);","IsDeferred":false},{"Name":"== and parentNodes selector","Code":"var found = isOrIn(\u0027body\u0027,$innerOne[0]);\r\nif(!found)throw new Error(\u0027BOOM\u0027);","IsDeferred":false}]}