--- test/html-webhacc/cc.cgi 2008/02/10 04:08:04 1.35 +++ test/html-webhacc/cc.cgi 2008/03/16 11:38:47 1.41 @@ -86,6 +86,8 @@
$char_length byte@{[$char_length == 1 ? '' : 's']}
+ + ]; $input->{id_prefix} = ''; @@ -132,6 +134,8 @@ } elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { $result->{$layer}->{unsupported}++; $result->{unsupported} = 1; + } elsif ($err->{level} eq 'i') { + # } else { $result->{$layer}->{must}++; $result->{$layer}->{score_max} -= 2; @@ -213,6 +217,7 @@ } elsif (defined $cssom) { print_structure_dump_cssom_section ($input, $cssom); ## TODO: CSSOM validation + add_error ('structure', {level => 'u'} => $result); } elsif (defined $manifest) { print_structure_dump_manifest_section ($input, $manifest); print_structure_error_manifest_section ($input, $manifest, $result); @@ -289,18 +294,14 @@

Parse Errors

-
]; +
]; push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; my $onerror = sub { my (%opt) = @_; my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); - if ($opt{column} > 0) { - print STDOUT qq[
Line $opt{line} column $opt{column}
\n]; - } else { - $opt{line} = $opt{line} - 1 || 1; - print STDOUT qq[
Line $opt{line}
\n]; - } + print STDOUT qq[
], get_error_label ($input, \%opt), + qq[
]; $type =~ tr/ /-/; $type =~ s/\|/%7C/g; $msg .= qq[ [Description]]; @@ -347,7 +348,7 @@

Parse Errors

-
]; +
]; push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{prefix}; my $onerror = sub { @@ -387,12 +388,8 @@ require Whatpm::CSS::Parser; my $p = Whatpm::CSS::Parser->new; -# if ($parse_mode eq 'q') { -# $p->{unitless_px} = 1; -# $p->{hashless_color} = 1; -# } - $p->{prop}->{$_} = 1 for qw/ + alignment-baseline background background-attachment background-color background-image background-position background-position-x background-position-y background-repeat border border-bottom border-bottom-color @@ -404,7 +401,7 @@ border-style border-top border-top-color border-top-style border-top-width border-width bottom caption-side clear clip color content counter-increment counter-reset - cursor direction display empty-cells float font + cursor direction display dominant-baseline empty-cells float font font-family font-size font-size-adjust font-stretch font-style font-variant font-weight height left letter-spacing line-height @@ -416,9 +413,9 @@ padding padding-bottom padding-left padding-right padding-top page page-break-after page-break-before page-break-inside position quotes right size table-layout - text-align text-decoration text-indent text-transform + text-align text-anchor text-decoration text-indent text-transform top unicode-bidi vertical-align visibility white-space width widows - word-spacing z-index + word-spacing writing-mode z-index /; $p->{prop_value}->{display}->{$_} = 1 for qw/ block clip inline inline-block inline-table list-item none @@ -493,7 +490,22 @@ capitalize uppercase lowercase none /; $p->{prop_value}->{'white-space'}->{$_} = 1 for qw/ - normal pre nowrap pre-line pre-wrap + normal pre nowrap pre-line pre-wrap -moz-pre-wrap + /; + $p->{prop_value}->{'writing-mode'}->{$_} = 1 for qw/ + lr rl tb lr-tb rl-tb tb-rl + /; + $p->{prop_value}->{'text-anchor'}->{$_} = 1 for qw/ + start middle end + /; + $p->{prop_value}->{'dominant-baseline'}->{$_} = 1 for qw/ + auto use-script no-change reset-size ideographic alphabetic + hanging mathematical central middle text-after-edge text-before-edge + /; + $p->{prop_value}->{'alignment-baseline'}->{$_} = 1 for qw/ + auto baseline before-edge text-before-edge middle central + after-edge text-after-edge ideographic alphabetic hanging + mathematical /; $p->{prop_value}->{'text-decoration'}->{$_} = 1 for qw/ none blink underline overline line-through @@ -503,7 +515,7 @@ /; $p->{prop_value}->{'table-layout'}->{auto} = 1; $p->{prop_value}->{'table-layout'}->{fixed} = 1; - $p->{prop_value}->{'border-collapse'}->{collapase} = 1; + $p->{prop_value}->{'border-collapse'}->{collapse} = 1; $p->{prop_value}->{'border-collapse'}->{separate} = 1; $p->{prop_value}->{'empty-cells'}->{show} = 1; $p->{prop_value}->{'empty-cells'}->{hide} = 1; @@ -547,10 +559,11 @@

Parse Errors

-
]; +
]; push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; my $p = get_css_parser (); + $p->init; $p->{onerror} = sub { my (%opt) = @_; my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level}); @@ -575,6 +588,13 @@ $p->{href} = $input->{uri}; $p->{base_uri} = $input->{base_uri}; +# if ($parse_mode eq 'q') { +# $p->{unitless_px} = 1; +# $p->{hashless_color} = 1; +# } + +## TODO: Make $input->{s} a ref. + my $s = \$input->{s}; my $charset; unless ($input->{is_char_string}) { @@ -605,7 +625,7 @@

Parse Errors

-
]; +
]; push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested}; my $onerror = sub { @@ -651,19 +671,20 @@

Document Source

    \n]; if (length $$s) { - while ($$s =~ /\G([^\x0A]*?)\x0D?\x0A/gc) { + while ($$s =~ /\G([^\x0D\x0A]*?)(?>\x0D\x0A?|\x0A)/gc) { print STDOUT qq[
  1. ], htescape $1, "
  2. \n"; $i++; } - if ($$s =~ /\G([^\x0A]+)/gc) { + if ($$s =~ /\G([^\x0D\x0A]+)/gc) { print STDOUT qq[
  3. ], htescape $1, "
  4. \n"; } } else { print STDOUT q[
  5. ]; } - print STDOUT "
"; + print STDOUT "
+"; } # print_input_string_section sub print_document_tree ($$) { @@ -801,9 +822,10 @@ unless $input->{nested}; print STDOUT qq[
Explicit entries
]; + my $i = 0; for my $uri (@{$manifest->[0]}) { my $euri = htescape ($uri); - print STDOUT qq[
<$euri>
]; + print STDOUT qq[
<$euri>
]; } print STDOUT qq[
Fallback entries
@@ -812,14 +834,14 @@ for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) { my $euri = htescape ($uri); my $euri2 = htescape ($manifest->[1]->{$uri}); - print STDOUT qq[<$euri> - <$euri2>]; + print STDOUT qq[<$euri> + <$euri2>]; } print STDOUT qq[
Online whitelist
]; for my $uri (@{$manifest->[2]}) { my $euri = htescape ($uri); - print STDOUT qq[
<$euri>
]; + print STDOUT qq[
<$euri>
]; } print STDOUT qq[
]; @@ -1099,7 +1121,14 @@ my $r = ''; - if (defined $err->{line}) { + if (defined $err->{token} and defined $err->{token}->{line}) { + if ($err->{token}->{column} > 0) { + $r = qq[Line $err->{token}->{line} column $err->{token}->{column}]; + } else { + $err->{token}->{line} = $err->{token}->{line} - 1 || 1; + $r = qq[Line $err->{token}->{line}]; + } + } elsif (defined $err->{line}) { if ($err->{column} > 0) { $r = qq[Line $err->{line} column $err->{column}]; } else { @@ -1114,8 +1143,12 @@ } if (defined $err->{index}) { - $r .= ' ' if length $r; - $r .= 'Index ' . (0+$err->{index}); + if (length $r) { + $r .= ', Index ' . (0+$err->{index}); + } else { + $r .= "Index " + . (0+$err->{index}) . ''; + } } if (defined $err->{value}) { @@ -1143,6 +1176,8 @@ } elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') { $r = qq[Not supported: ]; + } elsif ($err->{level} eq 'i') { + $r = qq[Information: ]; } else { my $elevel = htescape ($err->{level}); $r = qq[$elevel: @@ -1428,4 +1463,4 @@ =cut -## $Date: 2008/02/10 04:08:04 $ +## $Date: 2008/03/16 11:38:47 $