{"ScriptPreparationCode":null,"TestCases":[{"Name":"While on class","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n while(source) {\r\n if (source.classList.contains(\u0027targetclass1\u0027)\r\n || source.classList.contains(\u0027targetclass2\u0027)\r\n || source.classList.contains(\u0027targetclass3\u0027)) {\r\n \treturn true; \r\n }\r\n \r\n source = source.parentElement;\r\n }\r\n \r\n return false;\r\n}","IsDeferred":false},{"Name":"Closest on class","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n return !!source.closest(\u0027.targetclass1,.targetclass2,.targetclass3\u0027);\r\n}","IsDeferred":false},{"Name":"Closest on id","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n return !!source.closest(\u0027#target1,#target2,#target3\u0027);\r\n}","IsDeferred":false},{"Name":"While on reference","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n while(source) {\r\n if (source === target1 || source === target2 || source === target3) {\r\n \treturn true; \r\n }\r\n \r\n source = source.parentElement;\r\n }\r\n \r\n return false;\r\n}","IsDeferred":false},{"Name":"While on id","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n while(source) {\r\n if (source.id === \u0027target1\u0027 || source.id === \u0027target2\u0027 || source.id === \u0027target3\u0027) {\r\n \treturn true; \r\n }\r\n \r\n source = source.parentElement;\r\n }\r\n \r\n return false;\r\n}","IsDeferred":false},{"Name":"Closest separate on id","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n let result = source.closest(\u0027#target1\u0027);\r\n result = source.closest(\u0027#target2\u0027) || result;\r\n result = source.closest(\u0027#target3\u0027) || result;\r\n return result;\r\n}","IsDeferred":false},{"Name":"Closest separate on class","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n let result = source.closest(\u0027.targetclass1\u0027);\r\n result = source.closest(\u0027.targetclass2\u0027) || result;\r\n result = source.closest(\u0027.targetclass3\u0027) || result;\r\n return result;\r\n}","IsDeferred":false},{"Name":"While on type","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n while(source) {\r\n if (source.nodeName === \u0027article\u0027 || source.nodeName === \u0027main\u0027 || source.nodeName === \u0027section\u0027) {\r\n \treturn true; \r\n }\r\n \r\n source = source.parentElement;\r\n }\r\n \r\n return false;\r\n}","IsDeferred":false},{"Name":"Closest separate on type","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n let result = source.closest(\u0027article\u0027);\r\n result = source.closest(\u0027main\u0027) || result;\r\n result = source.closest(\u0027section\u0027) || result;\r\n return result;\r\n}","IsDeferred":false},{"Name":"Closest on type","Code":"call(source1);\r\ncall(source2);\r\ncall(source3);\r\n\r\nfunction call(source) {\r\n return source.closest(\u0027article,main,section\u0027);\r\n}","IsDeferred":false}]}