X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/068f457f9a60a17ca141d3b90bd7dee9aa7267bc..a8ea234262b3b8a847e64c334524e56f8aa36a0c:/browser.plp diff --git a/browser.plp b/browser.plp index 16aad08..29002d0 100644 --- a/browser.plp +++ b/browser.plp @@ -1,5 +1,6 @@ <(common.inc.plp)><: use 5.010; +use utf8; use List::Util qw(sum max); Html({ @@ -8,7 +9,7 @@ Html({ description => "caniuse.", keywords => [qw'html css browser feature'], - stylesheet => [qw'light dark circus mono red'], + stylesheet => [qw'circus dark mono red'], data => ['browser-support.inc.pl'], }); @@ -23,22 +24,22 @@ browser usage statistics.

my $caniuse = do 'browser-support.inc.pl' or die $! || $@; my %CSTATS = ( - n => 'di-b', - y => 'di-aa', - a => 'di-d', - 'a x' => 'di-d', - j => 'di-prop', - p => 'di-prop', - 'p j' => 'di-prop', - 'y x' => 'di-a', + 'n' => 'l0', + 'y' => 'l6', + 'y x' => 'l5', + 'a' => 'l4', + 'a x' => 'l4', + 'p j' => 'l2', + 'j' => 'l2', + 'p' => 'l2', ); my %CSTATUS = ( - unoff => 'di-rare', # unofficial - wd => 'di-b', # draft - pr => 'di-prop', # proposed - cr => 'di-d', # candidate - rec => 'di-a', # recommendation - ietf => 'di-aa', # standard + unoff => 'ex', # unofficial + wd => 'l0', # draft + pr => 'l2', # proposed + cr => 'l4', # candidate + rec => 'l5', # recommendation + ietf => 'l6', # standard ); my @browsers = qw(trident gecko webkit_saf webkit_chr presto); my %versions; @@ -59,16 +60,22 @@ print '' x 3; printf '', scalar @{ $versions{$_} } for @browsers; print "\n"; -print ''; -print 'feature'; -printf('%s', - scalar @{ $versions{$_} }, - do { - my $name = $caniuse->{agents}->{$_}->{browser}; - length $name < 16 ? $name : $caniuse->{agents}->{$_}->{abbr}; - }, -) for @browsers; -print '%'; +my $header = join('', + '', + 'feature', + (map { + sprintf('%s', + scalar @{ $versions{$_} }, + sum(values %{ $canihas->{$_} }), + do { + my $name = $caniuse->{agents}->{$_}->{browser}; + length $name < 16 ? $name : $caniuse->{agents}->{$_}->{abbr}; + }, + ) + } @browsers), + '%', +); +print '', $header; # preceding row without any colspan to work around gecko bug print "\n"; print '' x 3; @@ -156,6 +163,7 @@ for my $id (sort { }); print '', int featurescore($caniuse->{data}->{$id}->{stats}) / $maxscore * 100; } +print '', $header; print ''; sub paddedver { @@ -174,15 +182,28 @@ sub showversions { } :> +
-
supported - prefixed - partial - external (js/plugin) - missing + supported + prefixed + partial + external (js/plugin) + missing