/usr/share/perl5/CSS/Declare.pm is in libweb-simple-perl 0.031-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | package CSS::Declare;
use strict;
use warnings;
use Syntax::Keyword::Gather;
my $IN_SCOPE = 0;
sub import {
die "Can't import CSS::Declare into a scope when already compiling one that uses it"
if $IN_SCOPE;
my ($class, @args) = @_;
my $opts = shift(@args) if ref($args[0]) eq 'HASH';
my $target = $class->_find_target(0, $opts);
my $unex = $class->_export_tags_into($target);
$class->_install_unexporter($unex);
$IN_SCOPE = 1;
}
sub _find_target {
my ($class, $extra_levels, $opts) = @_;
return $opts->{into} if defined($opts->{into});
my $level = ($opts->{into_level} || 1) + $extra_levels;
return (caller($level))[0];
}
my @properties = qw{
accelerator
azimuth
background
background_attachment
background_color
background_image
background_position
background_position_x
background_position_y
background_repeat
behavior
border
border_bottom
border_bottom_color
border_bottom_style
border_bottom_width
border_collapse
border_color
border_left
border_left_color
border_left_style
border_left_width
border_right
border_right_color
border_right_style
border_right_width
border_spacing
border_style
border_top
border_top_color
border_top_style
border_top_width
border_width
bottom
caption_side
clear
clip
color
content
counter_increment
counter_reset
cue
cue_after
cue_before
cursor
direction
display
elevation
empty_cells
filter
float
font
font_family
font_size
font_size_adjust
font_stretch
font_style
font_variant
font_weight
height
ime_mode
include_source
layer_background_color
layer_background_image
layout_flow
layout_grid
layout_grid_char
layout_grid_char_spacing
layout_grid_line
layout_grid_mode
layout_grid_type
left
letter_spacing
line_break
line_height
list_style
list_style_image
list_style_position
list_style_type
margin
margin_bottom
margin_left
margin_right
margin_top
marker_offset
marks
max_height
max_width
min_height
min_width
orphans
outline
outline_color
outline_style
outline_width
overflow
overflow_X
overflow_Y
padding
padding_bottom
padding_left
padding_right
padding_top
page
page_break_after
page_break_before
page_break_inside
pause
pause_after
pause_before
pitch
pitch_range
play_during
position
quotes
_replace
richness
right
ruby_align
ruby_overhang
ruby_position
size
speak
speak_header
speak_numeral
speak_punctuation
speech_rate
stress
scrollbar_arrow_color
scrollbar_base_color
scrollbar_dark_shadow_color
scrollbar_face_color
scrollbar_highlight_color
scrollbar_shadow_color
scrollbar_3d_light_color
scrollbar_track_color
table_layout
text_align
text_align_last
text_decoration
text_indent
text_justify
text_overflow
text_shadow
text_transform
text_autospace
text_kashida_space
text_underline_position
top
unicode_bidi
vertical_align
visibility
voice_family
volume
white_space
widows
width
word_break
word_spacing
word_wrap
writing_mode
z_index
zoom
};
sub _export_tags_into {
my ($class, $into) = @_;
for my $property (@properties) {
my $property_name = $property;
$property_name =~ tr/_/-/;
no strict 'refs';
*{"$into\::$property"} = sub ($) { return ($property_name => $_[0]) };
}
return sub {
foreach my $property (@properties) {
no strict 'refs';
delete ${"${into}::"}{$property}
}
$IN_SCOPE = 0;
};
}
sub _install_unexporter {
my ($class, $unex) = @_;
$^H |= 0x20000; # localize %^H
$^H{'CSS::Declare::Unex'} = bless($unex, 'CSS::Declare::Unex');
}
sub to_css_string {
my @css = @_;
return join q{ }, gather {
while (my ($selector, $declarations) = splice(@css, 0, 2)) {
take "$selector "._generate_declarations($declarations)
}
};
}
sub _generate_declarations {
my $declarations = shift;
return '{'.join(q{;}, gather {
while (my ($property, $value) = splice(@{$declarations}, 0, 2)) {
take "$property:$value"
}
}).'}';
}
package CSS::Declare::Unex;
sub DESTROY { local $@; eval { $_[0]->(); 1 } || warn "ARGH: $@" }
1;
|