87 |
$serialized{$prop_def->{serialize_multiple}} = 1; |
$serialized{$prop_def->{serialize_multiple}} = 1; |
88 |
my $v = $prop_def->{serialize_multiple}->($self); |
my $v = $prop_def->{serialize_multiple}->($self); |
89 |
for my $prop_name (sort {$a cmp $b} keys %$v) { |
for my $prop_name (sort {$a cmp $b} keys %$v) { |
90 |
$r .= ' ' . $prop_name . ': ' . $v->{$prop_name}->[0] |
$r .= ' ' . $prop_name . ': ' . $v->{$prop_name}->[0]; |
91 |
. $v->{$prop_name}->[1] . ";\n" |
$r .= ' ! ' . $v->{$prop_name}->[1] if length $v->{$prop_name}->[1]; |
92 |
|
$r .= ";\n"; |
93 |
} |
} |
94 |
} |
} |
95 |
} else { |
} else { |
128 |
my $prop_def = $Whatpm::CSS::Parser::Prop->{$prop_name}; |
my $prop_def = $Whatpm::CSS::Parser::Prop->{$prop_name}; |
129 |
return '' unless defined $prop_def; |
return '' unless defined $prop_def; |
130 |
|
|
131 |
my $v = ${$_[0]}->{$prop_def->{key}}; |
if ($prop_def->{serialize}) { |
132 |
return $v ? $v->[1] : ''; |
my $v = ${$_[0]}->{$prop_def->{key}}; |
133 |
|
return $v ? $v->[1] : ''; |
134 |
|
} elsif ($prop_def->{serialize_shorthand} or |
135 |
|
$prop_def->{serialize_multiple}) { |
136 |
|
my $v = ($prop_def->{serialize_shorthand} or |
137 |
|
$prop_def->{serialize_multiple})->($_[0]); |
138 |
|
if (defined $v->{$prop_def->{css}}) { |
139 |
|
return $v->{$prop_def->{css}}->[1]; |
140 |
|
} else { |
141 |
|
return ''; |
142 |
|
} |
143 |
|
} else { |
144 |
|
die "Implementation error: No serializer for property '$prop_name'"; |
145 |
|
} |
146 |
} # get_property_priority |
} # get_property_priority |
147 |
|
|
148 |
sub item ($$) { |
sub item ($$) { |
265 |
$serialized{$prop_def->{serialize_multiple}} = 1; |
$serialized{$prop_def->{serialize_multiple}} = 1; |
266 |
my $v = $prop_def->{serialize_multiple}->($self); |
my $v = $prop_def->{serialize_multiple}->($self); |
267 |
for my $prop_name (sort {$a cmp $b} keys %$v) { |
for my $prop_name (sort {$a cmp $b} keys %$v) { |
268 |
$r .= ' ' . $prop_name . ': ' . $v->{$prop_name}->[0] |
$r .= ' ' . $prop_name . ': ' . $v->{$prop_name}->[0]; |
269 |
. $v->{$prop_name}->[1] . ";\n" |
$r .= ' ! ' . $v->{$prop_name}->[1] if length $v->{$prop_name}->[1]; |
270 |
|
$r .= ";\n"; |
271 |
} |
} |
272 |
} |
} |
273 |
} else { |
} else { |