| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package CSS::Property; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = 1.02; |
|
4
|
|
|
|
|
|
|
|
|
5
|
8
|
|
|
8
|
|
75
|
use strict; |
|
|
8
|
|
|
|
|
14
|
|
|
|
8
|
|
|
|
|
246
|
|
|
6
|
8
|
|
|
8
|
|
43
|
use warnings; |
|
|
8
|
|
|
|
|
19
|
|
|
|
8
|
|
|
|
|
192
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
4349
|
use CSS::Value; |
|
|
8
|
|
|
|
|
19
|
|
|
|
8
|
|
|
|
|
2183
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new { |
|
11
|
79
|
|
|
79
|
1
|
346182
|
my $class = shift; |
|
12
|
79
|
|
|
|
|
316
|
my $self = bless {}, $class; |
|
13
|
|
|
|
|
|
|
|
|
14
|
79
|
|
|
|
|
241
|
$self->{options} = shift; |
|
15
|
|
|
|
|
|
|
|
|
16
|
79
|
|
|
|
|
159
|
$self->{property} = ''; |
|
17
|
79
|
|
|
|
|
164
|
$self->{simple_value} = ''; |
|
18
|
79
|
|
|
|
|
228
|
$self->{adaptor} = 'CSS::Adaptor'; |
|
19
|
|
|
|
|
|
|
|
|
20
|
79
|
100
|
|
|
|
384
|
$self->{property} = $self->{options}->{property} if defined $self->{options}->{property}; |
|
21
|
79
|
100
|
|
|
|
308
|
$self->{simple_value} = $self->{options}->{value} if defined $self->{options}->{value}; |
|
22
|
79
|
100
|
|
|
|
272
|
$self->{adaptor} = $self->{options}->{adaptor} if defined $self->{options}->{adaptor}; |
|
23
|
79
|
|
|
|
|
338
|
$self->{values} = []; |
|
24
|
|
|
|
|
|
|
|
|
25
|
79
|
50
|
|
|
|
258
|
if (defined $self->{simple_value}){ |
|
26
|
79
|
|
|
|
|
617
|
my $value_obj = new CSS::Value({ |
|
27
|
|
|
|
|
|
|
'value' => $self->{simple_value}, |
|
28
|
|
|
|
|
|
|
'adaptor' => $self->{adaptor}, |
|
29
|
|
|
|
|
|
|
}); |
|
30
|
79
|
|
|
|
|
116
|
push @{$self->{values}}, $value_obj; |
|
|
79
|
|
|
|
|
211
|
|
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
79
|
|
|
|
|
385
|
return $self; |
|
34
|
|
|
|
|
|
|
} |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub set_adaptor { |
|
37
|
74
|
|
|
74
|
1
|
112
|
my $self = shift; |
|
38
|
74
|
|
|
|
|
120
|
my $adaptor = shift; |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# set adaptor |
|
41
|
74
|
|
|
|
|
711
|
$self->{adaptor} = $adaptor; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub values { |
|
45
|
7
|
|
|
7
|
1
|
13
|
my $self = shift; |
|
46
|
7
|
|
|
|
|
21
|
my $adaptor_obj = new $self->{adaptor}; |
|
47
|
7
|
|
|
|
|
33
|
return $adaptor_obj->output_values($self->{values}); |
|
48
|
|
|
|
|
|
|
} |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
__END__ |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 NAME |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
CSS::Property - A property in a CSS object tree |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
use CSS; |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
This module represents a property in a CSS object tree. |
|
65
|
|
|
|
|
|
|
Read the CSS.pm pod for information about the CSS object tree. |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 METHODS |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 CONSTRUCTORS |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=over 4 |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item C<new()> or C<new( { ..options.. } )> |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This constructor returns a new C<CSS::Property> object, with |
|
76
|
|
|
|
|
|
|
an optional hash of options. |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
property property name (as string) |
|
79
|
|
|
|
|
|
|
value simple value string |
|
80
|
|
|
|
|
|
|
adaptor adaptor to use for serialization |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
If the C<value> option is passed, a C<CSS::Value> object is automatically |
|
83
|
|
|
|
|
|
|
created and added to the object's values list. |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=back |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 ACCESSORS |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=over 4 |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=item C<set_adaptor( 'CSS::Adaptor::Foo' )> |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This method sets the current adaptor for the object. |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item C<values()> |
|
96
|
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This method is used to serialize the property's values, using the current |
|
98
|
|
|
|
|
|
|
adaptor. It returns a string which comes from the adaptor's C<output_values()> |
|
99
|
|
|
|
|
|
|
method. |
|
100
|
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
=back |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 AUTHOR |
|
104
|
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Copyright (C) 2003-2004, Cal Henderson <cal@iamcal.com> |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
L<CSS>, http://www.w3.org/TR/REC-CSS1 |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut |
|
112
|
|
|
|
|
|
|
|