| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
################################################################################################### |
|
2
|
|
|
|
|
|
|
# Copyright 2013/2014 by Marcel Greter |
|
3
|
|
|
|
|
|
|
# This file is part of OCBNET-CSS3 (GPL3) |
|
4
|
|
|
|
|
|
|
#################################################################################################### |
|
5
|
|
|
|
|
|
|
package OCBNET::CSS3::Styles::Margin; |
|
6
|
|
|
|
|
|
|
#################################################################################################### |
|
7
|
|
|
|
|
|
|
our $VERSION = '0.2.5'; |
|
8
|
|
|
|
|
|
|
#################################################################################################### |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
9845
|
use strict; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
41
|
|
|
11
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
32
|
|
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#################################################################################################### |
|
14
|
|
|
|
|
|
|
# import regular expressions |
|
15
|
|
|
|
|
|
|
#################################################################################################### |
|
16
|
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
6
|
use OCBNET::CSS3::Regex::Colors; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
124
|
|
|
18
|
1
|
|
|
1
|
|
5
|
use OCBNET::CSS3::Regex::Numbers; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
453
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#################################################################################################### |
|
21
|
|
|
|
|
|
|
# define local regular expression for borders |
|
22
|
|
|
|
|
|
|
#################################################################################################### |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
# regular expression to match border style (without inherit keyword) |
|
25
|
|
|
|
|
|
|
#************************************************************************************************** |
|
26
|
|
|
|
|
|
|
my $re_border_style = qr/(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset)/si; |
|
27
|
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
#################################################################################################### |
|
29
|
|
|
|
|
|
|
# register longhand properties for border |
|
30
|
|
|
|
|
|
|
#################################################################################################### |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# register longhand properties for border widths |
|
33
|
|
|
|
|
|
|
#************************************************************************************************** |
|
34
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-top-width', $re_length, '0'); |
|
35
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-left-width', $re_length, '0'); |
|
36
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-right-width', $re_length, '0'); |
|
37
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-bottom-width', $re_length, '0'); |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# register longhand properties for border colors |
|
40
|
|
|
|
|
|
|
#************************************************************************************************** |
|
41
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-top-color', $re_color, 'transparent'); |
|
42
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-left-color', $re_color, 'transparent'); |
|
43
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-right-color', $re_color, 'transparent'); |
|
44
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-bottom-color', $re_color, 'transparent'); |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# register longhand properties for border styles |
|
47
|
|
|
|
|
|
|
#************************************************************************************************** |
|
48
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-top-style', $re_border_style, 'none'); |
|
49
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-left-style', $re_border_style, 'none'); |
|
50
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-right-style', $re_border_style, 'none'); |
|
51
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-bottom-style', $re_border_style, 'none'); |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
#################################################################################################### |
|
54
|
|
|
|
|
|
|
# register shorthand properties for border |
|
55
|
|
|
|
|
|
|
#################################################################################################### |
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# register shorthand property for border-width |
|
58
|
|
|
|
|
|
|
#************************************************************************************************** |
|
59
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-width', |
|
60
|
|
|
|
|
|
|
{ |
|
61
|
|
|
|
|
|
|
# needed in order |
|
62
|
|
|
|
|
|
|
'ordered' => |
|
63
|
|
|
|
|
|
|
[ |
|
64
|
|
|
|
|
|
|
# always needed |
|
65
|
|
|
|
|
|
|
[ 'border-top-width' ], |
|
66
|
|
|
|
|
|
|
# additional optional values |
|
67
|
|
|
|
|
|
|
# may evaluate to other value |
|
68
|
|
|
|
|
|
|
[ 'border-right-width', 'border-top-width'], |
|
69
|
|
|
|
|
|
|
[ 'border-bottom-width', 'border-top-width'], |
|
70
|
|
|
|
|
|
|
[ 'border-left-width', 'border-right-width'] |
|
71
|
|
|
|
|
|
|
], |
|
72
|
|
|
|
|
|
|
# needed for own shorthand |
|
73
|
|
|
|
|
|
|
'matcher' => $re_length |
|
74
|
|
|
|
|
|
|
}, |
|
75
|
|
|
|
|
|
|
# default |
|
76
|
|
|
|
|
|
|
'0'); |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# register shorthand property for border-color |
|
79
|
|
|
|
|
|
|
#************************************************************************************************** |
|
80
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-color', |
|
81
|
|
|
|
|
|
|
{ |
|
82
|
|
|
|
|
|
|
# needed in order |
|
83
|
|
|
|
|
|
|
'ordered' => |
|
84
|
|
|
|
|
|
|
[ |
|
85
|
|
|
|
|
|
|
# always needed |
|
86
|
|
|
|
|
|
|
[ 'border-top-color' ], |
|
87
|
|
|
|
|
|
|
# additional optional values |
|
88
|
|
|
|
|
|
|
# may evaluate to other value |
|
89
|
|
|
|
|
|
|
[ 'border-right-color', 'border-top-color'], |
|
90
|
|
|
|
|
|
|
[ 'border-bottom-color', 'border-top-color'], |
|
91
|
|
|
|
|
|
|
[ 'border-left-color', 'border-right-color'] |
|
92
|
|
|
|
|
|
|
], |
|
93
|
|
|
|
|
|
|
# needed for own shorthand |
|
94
|
|
|
|
|
|
|
'matcher' => $re_color |
|
95
|
|
|
|
|
|
|
}, |
|
96
|
|
|
|
|
|
|
# default |
|
97
|
|
|
|
|
|
|
'transparent'); |
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
# register shorthand property for border-style |
|
100
|
|
|
|
|
|
|
#************************************************************************************************** |
|
101
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border-style', |
|
102
|
|
|
|
|
|
|
{ |
|
103
|
|
|
|
|
|
|
# needed in order |
|
104
|
|
|
|
|
|
|
'ordered' => |
|
105
|
|
|
|
|
|
|
[ |
|
106
|
|
|
|
|
|
|
# always needed |
|
107
|
|
|
|
|
|
|
[ 'border-top-style' ], |
|
108
|
|
|
|
|
|
|
# additional optional values |
|
109
|
|
|
|
|
|
|
# may evaluate to other value |
|
110
|
|
|
|
|
|
|
[ 'border-right-style', 'border-top-style'], |
|
111
|
|
|
|
|
|
|
[ 'border-bottom-style', 'border-top-style'], |
|
112
|
|
|
|
|
|
|
[ 'border-left-style', 'border-right-style'] |
|
113
|
|
|
|
|
|
|
], |
|
114
|
|
|
|
|
|
|
# needed for own shorthand |
|
115
|
|
|
|
|
|
|
'matcher' => $re_border_style |
|
116
|
|
|
|
|
|
|
}, |
|
117
|
|
|
|
|
|
|
# default |
|
118
|
|
|
|
|
|
|
'none'); |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
#################################################################################################### |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
# register shorthand property for border |
|
123
|
|
|
|
|
|
|
#************************************************************************************************** |
|
124
|
|
|
|
|
|
|
OCBNET::CSS3::Styles::register('border', |
|
125
|
|
|
|
|
|
|
{ |
|
126
|
|
|
|
|
|
|
# random order |
|
127
|
|
|
|
|
|
|
'prefix' => |
|
128
|
|
|
|
|
|
|
[ |
|
129
|
|
|
|
|
|
|
'border-width', |
|
130
|
|
|
|
|
|
|
'border-style', |
|
131
|
|
|
|
|
|
|
'border-color' |
|
132
|
|
|
|
|
|
|
] |
|
133
|
|
|
|
|
|
|
}); |
|
134
|
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
#################################################################################################### |
|
136
|
|
|
|
|
|
|
#################################################################################################### |
|
137
|
|
|
|
|
|
|
1; |