Html({
title => 'browser compatibility cheat sheet',
- version => '1.5',
+ version => '1.6',
description => [
"Compatibility table of new web features (HTML5, CSS3, SVG, Javascript)",
"comparing support and usage share for all popular browser versions.",
say "<h1>Browser compatibility</h1>\n";
-my $caniuse = do 'data/browser/support.inc.pl' or die $@ || $!;
+my $caniuse = Data('data/browser/support');
my %CSTATS = (
'n' => 'l1',
);
my %versions;
while (my ($browser, $row) = each %{ $caniuse->{agents} }) {
- $versions{$browser} = [
- sort { paddedver($a) cmp paddedver($b) } grep { defined }
- @{ $row->{versions} }
- ];
+ $versions{$browser} = [@{ $row->{versions} }];
}
my $ref = showlink('Can I use', 'https://caniuse.com/');
'Identifier must be alphanumeric name or <q>0</q>.',
]);
}
- $canihas = do "data/browser/usage-$_.inc.pl" or do {
- Alert('Browser usage data not found', $@ || $!);
+ $canihas = eval { Data("data/browser/usage-$_") } or do {
+ Alert('Browser usage data not found', $@);
break;
};
$usage = $_;
# normalised version number comparable as string (cmp)
$_[0] =~ m/(?:.*-|^)(\d*)(.*)/;
# matched (major)(.minor) of last value in range (a-B)
- return sprintf('%02d', length $1 ? $1 : 99) . $2;
+ return sprintf('%03d', length $1 ? $1 : 999) . $2;
}
sub showversions {