154 |
if (defined $prop_def) { |
if (defined $prop_def) { |
155 |
my $specified = $self->get_specified_value ($element, $prop_name); |
my $specified = $self->get_specified_value ($element, $prop_name); |
156 |
if (defined $specified and $specified->[0] eq 'INHERIT') { |
if (defined $specified and $specified->[0] eq 'INHERIT') { |
157 |
|
## ISSUE: CSS 2.1 does not say to resolve computed value of the parent. |
158 |
|
## However, it is necessary for some cases (see |
159 |
|
## <http://suika.fam.cx/gate/2005/sw/inherit>). In addition, |
160 |
|
## the initial value is not a computed value for some properties. |
161 |
my $parent_element = $element->manakai_parent_element; |
my $parent_element = $element->manakai_parent_element; |
162 |
if (defined $parent_element) { |
if (defined $parent_element) { |
163 |
$self->{computed_value}->{$eid}->{$prop_name} |
$specified = $self->get_computed_value ($parent_element, $prop_name); |
|
= $self->get_computed_value ($parent_element, $prop_name); |
|
164 |
} else { |
} else { |
165 |
## ISSUE: CSS 2.1 says that the computed value is the initial |
$specified = $prop_def->{compute}->($self, $element, $prop_name, |
166 |
## value in this case. However, the initial value is not |
$prop_def->{initial}); |
|
## necessariliy a computed value. |
|
|
$self->{computed_value}->{$eid}->{$prop_name} |
|
|
= $prop_def->{compute}->($self, $element, $prop_name, |
|
|
$prop_def->{initial}); |
|
167 |
} |
} |
168 |
} else { |
## NOTE: Because of this handling, {compute} codes must be |
169 |
$self->{computed_value}->{$eid}->{$prop_name} |
## idempotent. |
|
= $prop_def->{compute}->($self, $element, $prop_name, $specified); |
|
170 |
} |
} |
171 |
|
|
172 |
|
$self->{computed_value}->{$eid}->{$prop_name} |
173 |
|
= $prop_def->{compute}->($self, $element, $prop_name, $specified); |
174 |
} else { |
} else { |
175 |
$self->{computed_value}->{$eid}->{$prop_name} = undef; |
$self->{computed_value}->{$eid}->{$prop_name} = undef; |
176 |
} |
} |