+say "<h1>Browser compatibility</h1>\n";
+
+my $caniuse = do 'data/browser/support.inc.pl' or die $@ || $!;
+$_->{verrelease} = {
+ # mark last three (future) versions as unreleased, ensure current isn't
+ map {
+ $_->[-1] => 0, $_->[-2] => 0, $_->[-3] => 0,
+ $_->[-4] => undef,
+ } $_->{versions}
+} for values %{ $caniuse->{agents} };
+
+my %CSTATS = (
+ 'n' => 'l1',
+ 'n d' => 'l2',
+ 'n x d' => 'l2 ex',
+ 'p d' => 'l2',
+ 'a d' => 'l2',
+ 'y' => 'l5',
+ 'y x' => 'l5 ex',
+ 'a' => 'l3',
+ 'a x' => 'l3 ex',
+ 'p' => 'l2',
+ 'u' => 'l0',
+);
+my %DSTATS = (
+ u => 'unknown',
+ n => 'unsupported',
+ p => 'plugin required',
+ a => 'partial',
+ y => 'supported',
+ d => '(disabled by default)',
+ x => sub {
+ join(' ',
+ 'with prefix',
+ map {"-$_-"}
+ ($caniuse->{agents}->{$_[0]}->{prefix_exceptions} // {})->{$_[1]}
+ // $caniuse->{agents}->{$_[0]}->{prefix} // (),
+ );
+ },
+);
+my %PSTATS = ( # score percentage
+ y => 1, 'y x' => .9,
+ a => .5, 'a x' => .5, 'a d' => .2,
+ p => .2, 'p d' => .1,
+ n => 0, 'n d' => .2, 'n x d' => .2,
+ u => 0,
+);
+my %CSTATUS = (
+ unoff => 'l1', # unofficial
+ wd => 'l2', # draft
+ cr => 'l3', # candidate
+ pr => 'l3', # proposed
+ rec => 'l5', # recommendation
+ ls => 'l4', # whatwg
+ ietf => 'l0', # standard
+ other => 'l0', # non-w3
+);
+my %versions;
+while (my ($browser, $row) = each %{ $caniuse->{agents} }) {
+ $versions{$browser} = [
+ sort { paddedver($a) cmp paddedver($b) } grep { defined }
+ @{ $row->{versions} }
+ ];
+}
+
+print <<'';
+<p id="intro">Alternate rendition of Fyrd's <a href="http://caniuse.com/">when can I use...</a> page