line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## CSS Object Oriented - ~/lib/CSS/Object/Rule.pm |
3
|
|
|
|
|
|
|
## Version v0.1.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2020 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <@sitael.local> |
6
|
|
|
|
|
|
|
## Created 2020/06/21 |
7
|
|
|
|
|
|
|
## Modified 2020/06/21 |
8
|
|
|
|
|
|
|
## |
9
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
10
|
|
|
|
|
|
|
package CSS::Object::Rule::At; |
11
|
|
|
|
|
|
|
BEGIN |
12
|
|
|
|
|
|
|
{ |
13
|
6
|
|
|
6
|
|
102
|
use strict; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
164
|
|
14
|
6
|
|
|
6
|
|
28
|
use warnings; |
|
6
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
153
|
|
15
|
6
|
|
|
6
|
|
28
|
use parent qw( CSS::Object::Rule ); |
|
6
|
|
|
|
|
8
|
|
|
6
|
|
|
|
|
26
|
|
16
|
6
|
|
|
6
|
|
321
|
use Devel::Confess; |
|
6
|
|
|
|
|
10
|
|
|
6
|
|
|
|
|
28
|
|
17
|
|
|
|
|
|
|
use overload ( |
18
|
6
|
|
|
|
|
34
|
'""' => 'as_string', |
19
|
|
|
|
|
|
|
fallback => 1, |
20
|
6
|
|
|
6
|
|
338
|
); |
|
6
|
|
|
|
|
11
|
|
21
|
6
|
|
|
6
|
|
3165
|
our $VERSION = 'v0.1.0'; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub init |
25
|
|
|
|
|
|
|
{ |
26
|
1
|
|
|
1
|
1
|
2
|
my $self = shift( @_ ); |
27
|
1
|
|
|
|
|
80
|
$self->{_init_strict_use_sub} = 1; |
28
|
1
|
|
|
|
|
9
|
$self->SUPER::init( @_ ); |
29
|
1
|
50
|
|
|
|
3
|
return( $self->error( "No css object was shared with us." ) ) if( !$self->css ); |
30
|
1
|
|
|
|
|
15
|
return( $self ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
9
|
|
|
9
|
0
|
40
|
sub css { return( shift->_set_get_object( 'css', 'CSS::Object', @_ ) ); } |
34
|
|
|
|
|
|
|
|
35
|
18
|
|
|
18
|
1
|
139
|
sub name { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
## e.g. keyframe |
38
|
0
|
|
|
0
|
1
|
|
sub value { return( shift->_set_get_scalar_as_object( 'value', @_ ) ); } |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=encoding utf-8 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
CSS::Object::Rule::At - CSS Object Oriented At-Rule |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 SYNOPSIS |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
use CSS::Object::Rule::At; |
54
|
|
|
|
|
|
|
my $rule = CSS::Object::Rule::At->new( debug => 3, format => $format_object ) || |
55
|
|
|
|
|
|
|
die( CSS::Object::Rule::At->error ); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 VERSION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
v0.1.0 |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 DESCRIPTION |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
L<CSS::Object::Rule::At> is a base class for at-rule type of objects, such as C<@counter-style>, C<@document>, C<@font-face>, C<@font-feature-values>, C<@import>, C<@keyframes>, C<media>, C<@namespace>, C<@page>, C<supports>, C<@viewport> and some other experimental ones such as C<@annotation>, C<@character-variant>, C<@ornaments>, C<@stylistic>, C<@styleset>, C<@swash>, |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
See here for more information: L<https://developer.mozilla.org/en-US/docs/Web/CSS/At-rule> |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 CONSTRUCTOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 new |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
To instantiate a new L<CSS::Object::Rule::At> object, pass an hash reference of following parameters: |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item I<debug> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is an integer. The bigger it is and the more verbose is the output. |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item I<format> |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is a L<CSS::Object::Format> object or one of its child modules. |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=back |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 METHODS |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head2 name |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
Sets or gets the name of this at-rule. It returns a L<Module::Generic::Scalar> |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head2 value |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
Sets or gets this at-rule's value. It returns a L<Module::Generic::Scalar> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
head1 AUTHOR |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=head1 SEE ALSO |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
L<CSS::Object> |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
Copyright (c) 2020 DEGUEST Pte. Ltd. |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
You can use, copy, modify and redistribute this package and associated |
108
|
|
|
|
|
|
|
files under the same terms as Perl itself. |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |