/[suikacvs]/markup/html/whatpm/Whatpm/CSS/Parser.pm
Suika

Diff of /markup/html/whatpm/Whatpm/CSS/Parser.pm

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

revision 1.43 by wakaba, Fri Jan 25 16:04:39 2008 UTC revision 1.44 by wakaba, Sat Jan 26 04:50:05 2008 UTC
# Line 3254  $Attr->{outline_style} = $Prop->{'outlin Line 3254  $Attr->{outline_style} = $Prop->{'outlin
3254  $Key->{outline_style} = $Prop->{'outline-style'};  $Key->{outline_style} = $Prop->{'outline-style'};
3255  delete $Prop->{'outline-style'}->{keyword}->{hidden};  delete $Prop->{'outline-style'}->{keyword}->{hidden};
3256    
3257  my $generic_font_keywords => {  my $generic_font_keywords = {
3258    serif => 1, 'sans-serif' => 1, cursive => 1,    serif => 1, 'sans-serif' => 1, cursive => 1,
3259    fantasy => 1, monospace => 1, '-manakai-default' => 1,    fantasy => 1, monospace => 1, '-manakai-default' => 1,
3260    '-manakai-caption' => 1, '-manakai-icon' => 1,    '-manakai-caption' => 1, '-manakai-icon' => 1,
# Line 5121  $Prop->{font} = { Line 5121  $Prop->{font} = {
5121    
5122      return ($t, \%prop_value);      return ($t, \%prop_value);
5123    },    },
5124    serialize => sub {    serialize_shorthand => sub {
5125      my ($self, $prop_name, $value) = @_;      my $self = shift;
5126            
5127      local $Error::Depth = $Error::Depth + 1;      local $Error::Depth = $Error::Depth + 1;
5128      my $style = $self->font_style;      my $style = $self->font_style;
5129      my $i = $self->get_property_priority ('font-style');      my $i = $self->get_property_priority ('font-style');
5130      return '' unless length $style;      return {} unless length $style;
5131      my $variant = $self->font_variant;      my $variant = $self->font_variant;
5132      return '' unless length $variant;      return {} unless length $variant;
5133      return '' if $i ne $self->get_property_priority ('font-variant');      return {} if $i ne $self->get_property_priority ('font-variant');
5134      my $weight = $self->font_weight;      my $weight = $self->font_weight;
5135      return '' unless length $weight;      return {} unless length $weight;
5136      return '' if $i ne $self->get_property_priority ('font-weight');      return {} if $i ne $self->get_property_priority ('font-weight');
5137      my $size = $self->font_size;      my $size = $self->font_size;
5138      return '' unless length $size;      return {} unless length $size;
5139      return '' if $i ne $self->get_property_priority ('font-size');      return {} if $i ne $self->get_property_priority ('font-size');
5140      my $height = $self->line_height;      my $height = $self->line_height;
5141      return '' unless length $height;      return {} unless length $height;
5142      return '' if $i ne $self->get_property_priority ('line-height');      return {} if $i ne $self->get_property_priority ('line-height');
5143      my $family = $self->font_family;      my $family = $self->font_family;
5144      return '' unless length $family;      return {} unless length $family;
5145      return '' if $i ne $self->get_property_priority ('font-family');      return {} if $i ne $self->get_property_priority ('font-family');
5146    
5147        my $v = 0;
5148        for ($style, $variant, $weight, $size, $height, $family) {
5149          $v++ if $_ eq 'inherit';
5150        }
5151        if ($v == 6) {
5152          return {font => ['inherit', length $i ? ' ! ' . $i : '']};
5153        } elsif ($v) {
5154          return {};
5155        }
5156            
5157      my @v;      my @v;
5158      push @v, $style unless $style eq 'normal';      push @v, $style unless $style eq 'normal';
# Line 5150  $Prop->{font} = { Line 5160  $Prop->{font} = {
5160      push @v, $weight unless $weight eq 'normal';      push @v, $weight unless $weight eq 'normal';
5161      push @v, $size.($height eq 'normal' ? '' : '/'.$height);      push @v, $size.($height eq 'normal' ? '' : '/'.$height);
5162      push @v, $family;      push @v, $family;
5163      push @v, '! '.$i if length $i;      return {font => [(join ' ', @v), length $i ? ' ! ' . $i : '']};
     return join ' ', @v;  
5164    },    },
5165  };  };
5166  $Attr->{font} = $Prop->{font};  $Attr->{font} = $Prop->{font};

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24