132 |
} elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { |
} elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { |
133 |
$result->{$layer}->{unsupported}++; |
$result->{$layer}->{unsupported}++; |
134 |
$result->{unsupported} = 1; |
$result->{unsupported} = 1; |
135 |
|
} elsif ($err->{level} eq 'i') { |
136 |
|
# |
137 |
} else { |
} else { |
138 |
$result->{$layer}->{must}++; |
$result->{$layer}->{must}++; |
139 |
$result->{$layer}->{score_max} -= 2; |
$result->{$layer}->{score_max} -= 2; |
298 |
my $onerror = sub { |
my $onerror = sub { |
299 |
my (%opt) = @_; |
my (%opt) = @_; |
300 |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
301 |
if ($opt{column} > 0) { |
print STDOUT qq[<dt class="$cls">], get_error_label ($input, \%opt), |
302 |
print STDOUT qq[<dt class="$cls"><a href="#$input->{id_prefix}line-$opt{line}">Line $opt{line}</a> column $opt{column}</dt>\n]; |
qq[</dt>]; |
|
} else { |
|
|
$opt{line} = $opt{line} - 1 || 1; |
|
|
print STDOUT qq[<dt class="$cls"><a href="#$input->{id_prefix}line-$opt{line}">Line $opt{line}</a></dt>\n]; |
|
|
} |
|
303 |
$type =~ tr/ /-/; |
$type =~ tr/ /-/; |
304 |
$type =~ s/\|/%7C/g; |
$type =~ s/\|/%7C/g; |
305 |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
$msg .= qq[ [<a href="../error-description#@{[htescape ($type)]}">Description</a>]]; |
386 |
require Whatpm::CSS::Parser; |
require Whatpm::CSS::Parser; |
387 |
my $p = Whatpm::CSS::Parser->new; |
my $p = Whatpm::CSS::Parser->new; |
388 |
|
|
|
# if ($parse_mode eq 'q') { |
|
|
# $p->{unitless_px} = 1; |
|
|
# $p->{hashless_color} = 1; |
|
|
# } |
|
|
|
|
389 |
$p->{prop}->{$_} = 1 for qw/ |
$p->{prop}->{$_} = 1 for qw/ |
390 |
|
alignment-baseline |
391 |
background background-attachment background-color background-image |
background background-attachment background-color background-image |
392 |
background-position background-position-x background-position-y |
background-position background-position-x background-position-y |
393 |
background-repeat border border-bottom border-bottom-color |
background-repeat border border-bottom border-bottom-color |
399 |
border-style border-top border-top-color border-top-style border-top-width |
border-style border-top border-top-color border-top-style border-top-width |
400 |
border-width bottom |
border-width bottom |
401 |
caption-side clear clip color content counter-increment counter-reset |
caption-side clear clip color content counter-increment counter-reset |
402 |
cursor direction display empty-cells float font |
cursor direction display dominant-baseline empty-cells float font |
403 |
font-family font-size font-size-adjust font-stretch |
font-family font-size font-size-adjust font-stretch |
404 |
font-style font-variant font-weight height left |
font-style font-variant font-weight height left |
405 |
letter-spacing line-height |
letter-spacing line-height |
411 |
padding padding-bottom padding-left padding-right padding-top |
padding padding-bottom padding-left padding-right padding-top |
412 |
page page-break-after page-break-before page-break-inside |
page page-break-after page-break-before page-break-inside |
413 |
position quotes right size table-layout |
position quotes right size table-layout |
414 |
text-align text-decoration text-indent text-transform |
text-align text-anchor text-decoration text-indent text-transform |
415 |
top unicode-bidi vertical-align visibility white-space width widows |
top unicode-bidi vertical-align visibility white-space width widows |
416 |
word-spacing z-index |
word-spacing writing-mode z-index |
417 |
/; |
/; |
418 |
$p->{prop_value}->{display}->{$_} = 1 for qw/ |
$p->{prop_value}->{display}->{$_} = 1 for qw/ |
419 |
block clip inline inline-block inline-table list-item none |
block clip inline inline-block inline-table list-item none |
490 |
$p->{prop_value}->{'white-space'}->{$_} = 1 for qw/ |
$p->{prop_value}->{'white-space'}->{$_} = 1 for qw/ |
491 |
normal pre nowrap pre-line pre-wrap -moz-pre-wrap |
normal pre nowrap pre-line pre-wrap -moz-pre-wrap |
492 |
/; |
/; |
493 |
|
$p->{prop_value}->{'writing-mode'}->{$_} = 1 for qw/ |
494 |
|
lr rl tb lr-tb rl-tb tb-rl |
495 |
|
/; |
496 |
|
$p->{prop_value}->{'text-anchor'}->{$_} = 1 for qw/ |
497 |
|
start middle end |
498 |
|
/; |
499 |
|
$p->{prop_value}->{'dominant-baseline'}->{$_} = 1 for qw/ |
500 |
|
auto use-script no-change reset-size ideographic alphabetic |
501 |
|
hanging mathematical central middle text-after-edge text-before-edge |
502 |
|
/; |
503 |
|
$p->{prop_value}->{'alignment-baseline'}->{$_} = 1 for qw/ |
504 |
|
auto baseline before-edge text-before-edge middle central |
505 |
|
after-edge text-after-edge ideographic alphabetic hanging |
506 |
|
mathematical |
507 |
|
/; |
508 |
$p->{prop_value}->{'text-decoration'}->{$_} = 1 for qw/ |
$p->{prop_value}->{'text-decoration'}->{$_} = 1 for qw/ |
509 |
none blink underline overline line-through |
none blink underline overline line-through |
510 |
/; |
/; |
561 |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; |
562 |
|
|
563 |
my $p = get_css_parser (); |
my $p = get_css_parser (); |
564 |
|
$p->init; |
565 |
$p->{onerror} = sub { |
$p->{onerror} = sub { |
566 |
my (%opt) = @_; |
my (%opt) = @_; |
567 |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); |
586 |
$p->{href} = $input->{uri}; |
$p->{href} = $input->{uri}; |
587 |
$p->{base_uri} = $input->{base_uri}; |
$p->{base_uri} = $input->{base_uri}; |
588 |
|
|
589 |
|
# if ($parse_mode eq 'q') { |
590 |
|
# $p->{unitless_px} = 1; |
591 |
|
# $p->{hashless_color} = 1; |
592 |
|
# } |
593 |
|
|
594 |
|
## TODO: Make $input->{s} a ref. |
595 |
|
|
596 |
my $s = \$input->{s}; |
my $s = \$input->{s}; |
597 |
my $charset; |
my $charset; |
598 |
unless ($input->{is_char_string}) { |
unless ($input->{is_char_string}) { |
819 |
unless $input->{nested}; |
unless $input->{nested}; |
820 |
|
|
821 |
print STDOUT qq[<dl><dt>Explicit entries</dt>]; |
print STDOUT qq[<dl><dt>Explicit entries</dt>]; |
822 |
|
my $i = 0; |
823 |
for my $uri (@{$manifest->[0]}) { |
for my $uri (@{$manifest->[0]}) { |
824 |
my $euri = htescape ($uri); |
my $euri = htescape ($uri); |
825 |
print STDOUT qq[<dd><code class=uri><<a href="$euri">$euri</a>></code></dd>]; |
print STDOUT qq[<dd id="$input->{id_prefix}index-@{[$i++]}"><code class=uri><<a href="$euri">$euri</a>></code></dd>]; |
826 |
} |
} |
827 |
|
|
828 |
print STDOUT qq[<dt>Fallback entries</dt><dd> |
print STDOUT qq[<dt>Fallback entries</dt><dd> |
831 |
for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) { |
for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) { |
832 |
my $euri = htescape ($uri); |
my $euri = htescape ($uri); |
833 |
my $euri2 = htescape ($manifest->[1]->{$uri}); |
my $euri2 = htescape ($manifest->[1]->{$uri}); |
834 |
print STDOUT qq[<tr><td><code class=uri><<a href="$euri">$euri</a>></code></td> |
print STDOUT qq[<tr><td id="$input->{id_prefix}index-@{[$i++]}"><code class=uri><<a href="$euri">$euri</a>></code></td> |
835 |
<td><code class=uri><<a href="$euri2">$euri2</a>></code></td>]; |
<td id="$input->{id_prefix}index-@{[$i++]}"><code class=uri><<a href="$euri2">$euri2</a>></code></td>]; |
836 |
} |
} |
837 |
|
|
838 |
print STDOUT qq[</table><dt>Online whitelist</dt>]; |
print STDOUT qq[</table><dt>Online whitelist</dt>]; |
839 |
for my $uri (@{$manifest->[2]}) { |
for my $uri (@{$manifest->[2]}) { |
840 |
my $euri = htescape ($uri); |
my $euri = htescape ($uri); |
841 |
print STDOUT qq[<dd><code class=uri><<a href="$euri">$euri</a>></code></dd>]; |
print STDOUT qq[<dd id="$input->{id_prefix}index-@{[$i++]}"><code class=uri><<a href="$euri">$euri</a>></code></dd>]; |
842 |
} |
} |
843 |
|
|
844 |
print STDOUT qq[</dl></div>]; |
print STDOUT qq[</dl></div>]; |
1133 |
} |
} |
1134 |
|
|
1135 |
if (defined $err->{index}) { |
if (defined $err->{index}) { |
1136 |
$r .= ' ' if length $r; |
if (length $r) { |
1137 |
$r .= 'Index ' . (0+$err->{index}); |
$r .= ', Index ' . (0+$err->{index}); |
1138 |
|
} else { |
1139 |
|
$r .= "<a href='#$input->{id_prefix}index-@{[0+$err->{index}]}'>Index " |
1140 |
|
. (0+$err->{index}) . '</a>'; |
1141 |
|
} |
1142 |
} |
} |
1143 |
|
|
1144 |
if (defined $err->{value}) { |
if (defined $err->{value}) { |
1166 |
} elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { |
} elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { |
1167 |
$r = qq[<strong><a href="../error-description#level-u">Not |
$r = qq[<strong><a href="../error-description#level-u">Not |
1168 |
supported</a></strong>: ]; |
supported</a></strong>: ]; |
1169 |
|
} elsif ($err->{level} eq 'i') { |
1170 |
|
$r = qq[<strong><a href="../error-description#level-i">Information</a></strong>: ]; |
1171 |
} else { |
} else { |
1172 |
my $elevel = htescape ($err->{level}); |
my $elevel = htescape ($err->{level}); |
1173 |
$r = qq[<strong><a href="../error-description#level-$elevel">$elevel</a></strong>: |
$r = qq[<strong><a href="../error-description#level-$elevel">$elevel</a></strong>: |