Skip to content

Instantly share code, notes, and snippets.

@cahnory
Created February 2, 2012 13:56
Show Gist options
  • Save cahnory/1723575 to your computer and use it in GitHub Desktop.
Save cahnory/1723575 to your computer and use it in GitHub Desktop.
// Need jQuery
var res = {
'userAgent': navigator.userAgent,
'results': {}
};
$('.tests dl').each(function() {
var el = $(this),
test = {};
el.children().each(function() {
test[$(this).text()] = $(this).attr('class');
});
res.results[$(this).children('dt').text()] = test;
});
alert(JSON.stringify(res));
//My result:
{"userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7","results":{"background-repeat":{"background-repeat":"pass","space":"pass","round":"pass","repeat repeat":"pass","space repeat":"pass","round repeat":"pass","no-repeat repeat":"pass","repeat space":"pass","space space":"pass","round space":"pass","no-repeat space":"pass","repeat round":"pass","space round":"pass","round round":"pass","no-repeat round":"pass","repeat no-repeat":"pass","space no-repeat":"pass","round no-repeat":"pass","no-repeat no-repeat":"pass"},"background-attachment":{"background-attachment":"pass","local":"pass"},"background-position":{"background-position":"epic-fail","bottom 10px right 20px":"epic-fail","bottom 10px right":"epic-fail","top right 10px":"epic-fail"},"background-clip":{"background-clip":"pass","border-box":"pass","padding-box":"pass","content-box":"pass"},"background-origin":{"background-origin":"pass","border-box":"pass","padding-box":"pass","content-box":"pass"},"background-size":{"background-size":"pass","auto":"pass","cover":"pass","contain":"pass","10px":"pass","50%":"pass","10px auto":"pass","auto 10%":"pass","50em 50%":"pass"},"background":{"background":"very-buggy","url(foo.png), url(bar.svg)":"pass","top left / 50% 60%":"epic-fail","border-box":"pass","border-box padding-box":"pass","url(foo.png) bottom right / cover padding-box content-box":"epic-fail"},"border-radius":{"border-radius":"pass","10px":"...pass","red":"pass"},"column-rule-style":{"column-rule-style":"pass","none":"pass","solid":"pass","dotted":"pass"},"column-rule-width":{"column-rule-width":"pass","1px":"pass"},"column-rule":{"column-rule":"pass","transparent":"pass","1px solid black":"pass"},"break-before":{"break-before":"epic-fail","auto":"epic-fail","always":"epic-fail","avoid":"epic-fail","left":"epic-fail","right":"epic-fail","page":"epic-fail","column":"epic-fail","avoid-page":"epic-fail","avoid-column":"epic-fail"},"break-after":{"break-after":"epic-fail","auto":"epic-fail","always":"epic-fail","avoid":"epic-fail","left":"epic-fail","right":"epic-fail","page":"epic-fail","column":"epic-fail","avoid-page":"epic-fail","avoid-column":"epic-fail"},"break-inside":{"break-inside":"epic-fail","auto":"epic-fail","avoid":"epic-fail","avoid-page":"epic-fail","avoid-column":"epic-fail"},"column-span":{"column-span":"very-buggy","none":"epic-fail","all":"pass"},"column-fill":{"column-fill":"epic-fail","auto":"epic-fail","balance":"epic-fail"},"rem":{"rem":"pass","5rem":"pass"},"ch":{"ch":"epic-fail","5ch":"epic-fail"},"vh":{"vh":"epic-fail","5vh":"epic-fail"},"vw":{"vw":"epic-fail","5vw":"epic-fail"},"attr()":{"attr()":"epic-fail","attr(data-px)":"epic-fail"},"calc()":{"calc()":"epic-fail","calc(1px + 2px)":"epic-fail","calc(5px*2)":"epic-fail","calc(5px/2)":"epic-fail","calc(100%/3 - 2*1em - 2*1px)":"epic-fail","calc(attr(data-px)*2)":"epic-fail"},"cycle()":{"cycle()":"epic-fail","cycle(1px, 2x)":"epic-fail"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment