From: Mischa POSLAWSKY Date: Wed, 10 Nov 2010 18:16:00 +0000 (+0100) Subject: caniuse: recognise missing support combinations X-Git-Tag: v1.4~110 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/92c23f29d582b9776292bb186f20c3f4dba4c9f3 caniuse: recognise missing support combinations --- diff --git a/browser.plp b/browser.plp index 0f5b704..e82e69e 100644 --- a/browser.plp +++ b/browser.plp @@ -47,9 +47,11 @@ my $caniuse = from_json($source, { my %CSTATS = ( n => 'di-b', y => 'di-aa', - a => 'di-d', - j => 'di-prop', - p => 'di-prop', + a => 'di-d', + 'a x' => 'di-d', + j => 'di-prop', + p => 'di-prop', + 'p j' => 'di-prop', 'y x' => 'di-a', ); my %CSTATUS = ( @@ -68,10 +70,10 @@ if (my ($somerow) = values %{ $caniuse->{data} }) { } } -my $canihas = do 'browser-usage.inc.pl'; -for ($! || $@ || ()) { - printf "

Browser usage data not found: %s.

\n", $_; -} +my $canihas = do 'browser-usage.inc.pl' or do { + printf "

Browser usage data not found: %s.

\n", $_ + for $! || $@; +}; my $scorediv = (max(map { sum(values %$_) } values %$canihas) // 1) / 100; print ''; @@ -91,7 +93,7 @@ print "\n"; sub featurescore { # relative amount of support for given feature - state $statspts = { y=>10, 'y x'=>9, a=>5, j=>2, p=>1 }; + state $statspts = { y=>10, 'y x'=>9, a=>5, 'a x'=>5, j=>2, 'p j'=>2, p=>1 }; my $rank = 0; if (my $row = shift) { while (my ($browser, $vercols) = each %versions) {