/[suikacvs]/test/html-webhacc/cc.cgi
Suika

Diff of /test/html-webhacc/cc.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.36 by wakaba, Sun Feb 10 07:35:23 2008 UTC revision 1.37 by wakaba, Sun Feb 24 02:17:51 2008 UTC
# Line 132  sub add_error ($$$) { Line 132  sub add_error ($$$) {
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;
# Line 388  sub get_css_parser () { Line 390  sub get_css_parser () {
390    require Whatpm::CSS::Parser;    require Whatpm::CSS::Parser;
391    my $p = Whatpm::CSS::Parser->new;    my $p = Whatpm::CSS::Parser->new;
392    
 #  if ($parse_mode eq 'q') {  
 #    $p->{unitless_px} = 1;  
 #    $p->{hashless_color} = 1;  
 #  }  
   
393    $p->{prop}->{$_} = 1 for qw/    $p->{prop}->{$_} = 1 for qw/
394        alignment-baseline
395      background background-attachment background-color background-image      background background-attachment background-color background-image
396      background-position background-position-x background-position-y      background-position background-position-x background-position-y
397      background-repeat border border-bottom border-bottom-color      background-repeat border border-bottom border-bottom-color
# Line 405  sub get_css_parser () { Line 403  sub get_css_parser () {
403      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
404      border-width bottom      border-width bottom
405      caption-side clear clip color content counter-increment counter-reset      caption-side clear clip color content counter-increment counter-reset
406      cursor direction display empty-cells float font      cursor direction display dominant-baseline empty-cells float font
407      font-family font-size font-size-adjust font-stretch      font-family font-size font-size-adjust font-stretch
408      font-style font-variant font-weight height left      font-style font-variant font-weight height left
409      letter-spacing line-height      letter-spacing line-height
# Line 417  sub get_css_parser () { Line 415  sub get_css_parser () {
415      padding padding-bottom padding-left padding-right padding-top      padding padding-bottom padding-left padding-right padding-top
416      page page-break-after page-break-before page-break-inside      page page-break-after page-break-before page-break-inside
417      position quotes right size table-layout      position quotes right size table-layout
418      text-align text-decoration text-indent text-transform      text-align text-anchor text-decoration text-indent text-transform
419      top unicode-bidi vertical-align visibility white-space width widows      top unicode-bidi vertical-align visibility white-space width widows
420      word-spacing z-index      word-spacing writing-mode z-index
421    /;    /;
422    $p->{prop_value}->{display}->{$_} = 1 for qw/    $p->{prop_value}->{display}->{$_} = 1 for qw/
423      block clip inline inline-block inline-table list-item none      block clip inline inline-block inline-table list-item none
# Line 496  sub get_css_parser () { Line 494  sub get_css_parser () {
494    $p->{prop_value}->{'white-space'}->{$_} = 1 for qw/    $p->{prop_value}->{'white-space'}->{$_} = 1 for qw/
495      normal pre nowrap pre-line pre-wrap -moz-pre-wrap      normal pre nowrap pre-line pre-wrap -moz-pre-wrap
496    /;    /;
497      $p->{prop_value}->{'writing-mode'}->{$_} = 1 for qw/
498        lr rl tb lr-tb rl-tb tb-rl
499      /;
500      $p->{prop_value}->{'text-anchor'}->{$_} = 1 for qw/
501        start middle end
502      /;
503      $p->{prop_value}->{'dominant-baseline'}->{$_} = 1 for qw/
504        auto use-script no-change reset-size ideographic alphabetic
505        hanging mathematical central middle text-after-edge text-before-edge
506      /;
507      $p->{prop_value}->{'alignment-baseline'}->{$_} = 1 for qw/
508        auto baseline before-edge text-before-edge middle central
509        after-edge text-after-edge ideographic alphabetic hanging
510        mathematical
511      /;
512    $p->{prop_value}->{'text-decoration'}->{$_} = 1 for qw/    $p->{prop_value}->{'text-decoration'}->{$_} = 1 for qw/
513      none blink underline overline line-through      none blink underline overline line-through
514    /;    /;
# Line 552  sub print_syntax_error_css_section ($$) Line 565  sub print_syntax_error_css_section ($$)
565    push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested};    push @nav, ['#parse-errors' => 'Parse Error'] unless $input->{nested};
566    
567    my $p = get_css_parser ();    my $p = get_css_parser ();
568      $p->init;
569    $p->{onerror} = sub {    $p->{onerror} = sub {
570      my (%opt) = @_;      my (%opt) = @_;
571      my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level});      my ($type, $cls, $msg) = get_text ($opt{type}, $opt{level});
# Line 576  sub print_syntax_error_css_section ($$) Line 590  sub print_syntax_error_css_section ($$)
590    $p->{href} = $input->{uri};    $p->{href} = $input->{uri};
591    $p->{base_uri} = $input->{base_uri};    $p->{base_uri} = $input->{base_uri};
592    
593    #  if ($parse_mode eq 'q') {
594    #    $p->{unitless_px} = 1;
595    #    $p->{hashless_color} = 1;
596    #  }
597    
598    ## TODO: Make $input->{s} a ref.
599    
600    my $s = \$input->{s};    my $s = \$input->{s};
601    my $charset;    my $charset;
602    unless ($input->{is_char_string}) {    unless ($input->{is_char_string}) {
# Line 802  sub print_structure_dump_manifest_sectio Line 823  sub print_structure_dump_manifest_sectio
823        unless $input->{nested};        unless $input->{nested};
824    
825    print STDOUT qq[<dl><dt>Explicit entries</dt>];    print STDOUT qq[<dl><dt>Explicit entries</dt>];
826      my $i = 0;
827    for my $uri (@{$manifest->[0]}) {    for my $uri (@{$manifest->[0]}) {
828      my $euri = htescape ($uri);      my $euri = htescape ($uri);
829      print STDOUT qq[<dd><code class=uri>&lt;<a href="$euri">$euri</a>></code></dd>];      print STDOUT qq[<dd id="$input->{id_prefix}index-@{[$i++]}"><code class=uri>&lt;<a href="$euri">$euri</a>></code></dd>];
830    }    }
831    
832    print STDOUT qq[<dt>Fallback entries</dt><dd>    print STDOUT qq[<dt>Fallback entries</dt><dd>
# Line 813  sub print_structure_dump_manifest_sectio Line 835  sub print_structure_dump_manifest_sectio
835    for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) {    for my $uri (sort {$a cmp $b} keys %{$manifest->[1]}) {
836      my $euri = htescape ($uri);      my $euri = htescape ($uri);
837      my $euri2 = htescape ($manifest->[1]->{$uri});      my $euri2 = htescape ($manifest->[1]->{$uri});
838      print STDOUT qq[<tr><td><code class=uri>&lt;<a href="$euri">$euri</a>></code></td>      print STDOUT qq[<tr><td id="$input->{id_prefix}index-@{[$i++]}"><code class=uri>&lt;<a href="$euri">$euri</a>></code></td>
839          <td><code class=uri>&lt;<a href="$euri2">$euri2</a>></code></td>];          <td id="$input->{id_prefix}index-@{[$i++]}"><code class=uri>&lt;<a href="$euri2">$euri2</a>></code></td>];
840    }    }
841    
842    print STDOUT qq[</table><dt>Online whitelist</dt>];    print STDOUT qq[</table><dt>Online whitelist</dt>];
843    for my $uri (@{$manifest->[2]}) {    for my $uri (@{$manifest->[2]}) {
844      my $euri = htescape ($uri);      my $euri = htescape ($uri);
845      print STDOUT qq[<dd><code class=uri>&lt;<a href="$euri">$euri</a>></code></dd>];      print STDOUT qq[<dd id="$input->{id_prefix}index-@{[$i++]}"><code class=uri>&lt;<a href="$euri">$euri</a>></code></dd>];
846    }    }
847    
848    print STDOUT qq[</dl></div>];    print STDOUT qq[</dl></div>];
# Line 1115  sub get_error_label ($$) { Line 1137  sub get_error_label ($$) {
1137    }    }
1138    
1139    if (defined $err->{index}) {    if (defined $err->{index}) {
1140      $r .= ' ' if length $r;      if (length $r) {
1141      $r .= 'Index ' . (0+$err->{index});        $r .= ', Index ' . (0+$err->{index});
1142        } else {
1143          $r .= "<a href='#$input->{id_prefix}index-@{[0+$err->{index}]}'>Index "
1144              . (0+$err->{index}) . '</a>';
1145        }
1146    }    }
1147    
1148    if (defined $err->{value}) {    if (defined $err->{value}) {
# Line 1144  sub get_error_level_label ($) { Line 1170  sub get_error_level_label ($) {
1170    } elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') {    } elsif ($err->{level} eq 'u' or $err->{level} eq 'unsupported') {
1171      $r = qq[<strong><a href="../error-description#level-u">Not      $r = qq[<strong><a href="../error-description#level-u">Not
1172          supported</a></strong>: ];          supported</a></strong>: ];
1173      } elsif ($err->{level} eq 'i') {
1174        $r = qq[<strong><a href="../error-description#level-i">Information</a></strong>: ];
1175    } else {    } else {
1176      my $elevel = htescape ($err->{level});      my $elevel = htescape ($err->{level});
1177      $r = qq[<strong><a href="../error-description#level-$elevel">$elevel</a></strong>:      $r = qq[<strong><a href="../error-description#level-$elevel">$elevel</a></strong>:

Legend:
Removed from v.1.36  
changed lines
  Added in v.1.37

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24