1 commit 7dda09313a63c4c64563f582844d7b04302d94bd
2 Author: Yves Orton <demerphq@gmail.com>
3 Date: Wed Feb 22 13:28:01 2023 +0100
5 Replace apostrophe with :: as package separator
7 In 5.37.9 this is deprecated, and in 5.40 it will be forbidden
9 diff --git a/lib/CSS/DOM/Parser.pm b/lib/CSS/DOM/Parser.pm
10 index 473992c..d688f19 100644
11 --- a/lib/CSS/DOM/Parser.pm
12 +++ b/lib/CSS/DOM/Parser.pm
13 @@ -369,7 +369,7 @@ sub _parse_at_rule { for (shift) { for my $tokens (shift) {
15 $selector =~ s/s\z// and pop @selector;
17 - require CSS'DOM'Rule;
18 + require CSS::DOM::Rule;
19 (my $rule = new CSS::DOM::Rule $_[0]||())
22 @@ -413,7 +413,7 @@ sub _parse_at_rule { for (shift) { for my $tokens (shift) {
23 my ($types,@tokens) = ("\@$1",$at,splice @$tokens,0,$+[0]);
24 $types =~ /"/ and return; # ignore rules w/invalid strings
25 $types =~ s/s\z// and pop @tokens;
26 - require CSS'DOM'Rule;
27 + require CSS::DOM::Rule;
28 (my $rule = new CSS::DOM::Rule $_[0]||())
31 diff --git a/lib/CSS/DOM/PropertyParser.pm b/lib/CSS/DOM/PropertyParser.pm
32 index 258158f..76b0d99 100644
33 --- a/lib/CSS/DOM/PropertyParser.pm
34 +++ b/lib/CSS/DOM/PropertyParser.pm
35 @@ -6,8 +6,8 @@ use warnings; no warnings qw 'utf8 parenthesis';
38 use constant 1.03 (); # multiple
39 -use CSS::DOM'Constants ':primitive', ':value';
40 -use CSS'DOM'Util<unescape unescape_str unescape_url>;
41 +use CSS::DOM::Constants ':primitive', ':value';
42 +use CSS::DOM::Util<unescape unescape_str unescape_url>;
44 use constant old_perl => $] < 5.01;
45 { no strict 'refs'; delete ${__PACKAGE__.'::'}{old_perl} }
46 @@ -19,7 +19,7 @@ use constant old_perl => $] < 5.01;
47 use constant naughty_perl => 0+$] eq 5.01;
48 { no strict 'refs'; delete ${__PACKAGE__.'::'}{naughty_perl} }
50 -*s2c = *CSS'DOM'Constants'SuffixToConst;
51 +*s2c = *CSS::DOM::Constants::SuffixToConst;
54 our %compiled; # compiled formats
55 @@ -60,7 +60,7 @@ sub clone {
56 # exists &dclone or require Storable, "Storable"->import('dclone');
57 # return dclone($_[0]);
59 - return Clone'clone($_[0]);
60 + return Clone::clone($_[0]);
63 # Declare the variables that the re-evals use. Some nasty hacker went and
64 @@ -202,7 +202,7 @@ sub _make_arg_list {
65 my($stypes,$stokens) = _space_out($types, $tokens);
66 my $css = join "", @$stokens;
67 if(@_ == 1) { # list property
68 - my $list = shift @'_;
69 + my $list = shift @_;
70 my $sep = @$list <= 1 ? '' : do {
71 my $range_start = $$list[0][4];
72 my $range_end = $$list[1][4] - length($$list[1][4]) - 1;
73 @@ -301,7 +301,7 @@ sub _make_arg_list {
76 my($types,$tokens) = @_;
77 -Carp'cluck() if ref $tokens ne 'ARRAY';
78 +Carp::cluck() if ref $tokens ne 'ARRAY';
81 $types =~ s/(?<=[^(f])(?![),]|\z)/
82 @@ -328,7 +328,7 @@ sub _prep_val {
85 require CSS::DOM::Parser;
86 - ($types, $tokens) = CSS::DOM::Parser'tokenise($_[0]);
87 + ($types, $tokens) = CSS::DOM::Parser::tokenise($_[0]);
90 # strip out all whitespace tokens
91 diff --git a/lib/CSS/DOM/Rule.pm b/lib/CSS/DOM/Rule.pm
92 index 921efb0..666fb08 100644
93 --- a/lib/CSS/DOM/Rule.pm
94 +++ b/lib/CSS/DOM/Rule.pm
95 @@ -46,7 +46,7 @@ sub _parse { # This method parses the code passed to it and checks to see
96 # the rule data from the new rule.
98 require CSS::DOM::Parser;
99 - my $new_rule = CSS::DOM::Parser'parse_statement(shift)
100 + my $new_rule = CSS::DOM::Parser::parse_statement(shift)
101 || die CSS::DOM::Exception->new(SYNTAX_ERR, $@);
103 ref $new_rule eq ref $self or die CSS::DOM::Exception->new(
104 diff --git a/lib/CSS/DOM/Rule/Import.pm b/lib/CSS/DOM/Rule/Import.pm
105 index 1afdcdc..75c8505 100644
106 --- a/lib/CSS/DOM/Rule/Import.pm
107 +++ b/lib/CSS/DOM/Rule/Import.pm
108 @@ -45,7 +45,7 @@ sub cssText {
111 $self->[hrfe] ||= do {
112 - require CSS'DOM'Parser;
113 + require CSS::DOM::Parser;
114 if($self->[urlt][00] eq 'u') {
115 # ~~~ I probably ought to put things like this in a
116 # Parser::token_val function.
117 @@ -53,10 +53,10 @@ sub href {
118 $url =~ s/^url\([ \t\r\n\f]*//;
119 $url =~ s/[ \t\r\n\f]*\)\z//;
120 $url =~ s/^['"]// and chop $url;
121 - CSS'DOM'Parser'unescape($url);
122 + CSS::DOM::Parser::unescape($url);
125 - CSS'DOM'Parser'unescape(
126 + CSS::DOM::Parser::unescape(
127 substr $$self[urlt][1], 1, -1
130 diff --git a/lib/CSS/DOM/Rule/Style.pm b/lib/CSS/DOM/Rule/Style.pm
131 index dfa7501..54da057 100644
132 --- a/lib/CSS/DOM/Rule/Style.pm
133 +++ b/lib/CSS/DOM/Rule/Style.pm
134 @@ -93,8 +93,8 @@ sub _selector_matches { # ~~~ Does this work with initial space in the selector?
136 # tokenise if necessary
137 unless(ref $self->[selc]) {
138 - require CSS'DOM'Parser;
139 - $self->[selc] = [ CSS'DOM'tokenise($self->[selc]) ];
140 + require CSS::DOM::Parser;
141 + $self->[selc] = [ CSS::DOM::tokenise($self->[selc]) ];
144 # parse selector tokens if necessary
145 @@ -130,7 +130,7 @@ sub _selector_matches { # ~~~ Does this work with initial space in the selector?
148 if($types =~ s/^#//) {
149 - push @subsel, '#', CSS'DOM'Util'unescape( substr shift @tokens, 1 ),
150 + push @subsel, '#', CSS::DOM::Util::unescape( substr shift @tokens, 1 ),
154 @@ -138,12 +138,12 @@ sub _selector_matches { # ~~~ Does this work with initial space in the selector?
155 elsif($types =~ /^di/ && $tokens[0] eq '.') {
156 $types =~ s/^..//; shift @tokens;
157 push @subsel, '~', 'class',
158 - CSS'DOM'Util'unescape( shift @tokens );
159 + CSS::DOM::Util::unescape( shift @tokens );
162 # pseudo-elems and classes
163 elsif($types =~ s/^(::?)i//) {
164 - push @subsel, $1,lc CSS'DOM'Util'unescape($tokens[length $1]), undef;
165 + push @subsel, $1,lc CSS::DOM::Util::unescape($tokens[length $1]), undef;
166 splice @tokens, 0, $+[0];
169 @@ -151,14 +151,14 @@ sub _selector_matches { # ~~~ Does this work with initial space in the selector?
170 elsif($types =~ s/^:fi\)//) {
173 - lc CSS'DOM'Util'unescape(substr $tokens[1], 0, -1),
174 - lc CSS'DOM'Util'unescape($tokens[2]);
175 + lc CSS::DOM::Util::unescape(substr $tokens[1], 0, -1),
176 + lc CSS::DOM::Util::unescape($tokens[2]);
177 splice @tokens, 0, 4;
181 elsif($types =~ s/^\[i]//) {
182 - push @subsel, '=', lc CSS'DOM'Util'unescape($tokens[1]), undef;
183 + push @subsel, '=', lc CSS::DOM::Util::unescape($tokens[1]), undef;
184 splice @tokens, 0, 3;
187 @@ -166,16 +166,16 @@ sub _selector_matches { # ~~~ Does this work with initial space in the selector?
188 elsif($types =~ /^\[id']/ && $tokens[2] eq '=') {
191 - lc CSS'DOM'Util'unescape($tokens[1]),
192 - CSS'DOM'Util'unescape_str($tokens[3]);
193 + lc CSS::DOM::Util::unescape($tokens[1]),
194 + CSS::DOM::Util::unescape_str($tokens[3]);
195 splice @tokens, 0, 5;
198 # [attr~='value'], [attr|='value']
199 elsif($types =~ s/^\[i[~|]']//) {
200 push @subsel, $tokens[2],
201 - lc CSS'DOM'Util'unescape($tokens[1]),
202 - CSS'DOM'Util'unescape_str($tokens[3]);
203 + lc CSS::DOM::Util::unescape($tokens[1]),
204 + CSS::DOM::Util::unescape_str($tokens[3]);
205 splice @tokens, 0, 5;
208 diff --git a/lib/CSS/DOM/Style.pm b/lib/CSS/DOM/Style.pm
209 index 47d1291..b42b8db 100644
210 --- a/lib/CSS/DOM/Style.pm
211 +++ b/lib/CSS/DOM/Style.pm
212 @@ -171,9 +171,9 @@ sub setProperty {
213 # short-circuit for the common case
214 length $value or $self->removeProperty($name),return;
216 - require CSS'DOM'Parser;
217 - my @tokens = eval { CSS'DOM'Parser'tokenise_value($value); }
218 - or die CSS::DOM'Exception->new( SYNTAX_ERR, $@);
219 + require CSS::DOM::Parser;
220 + my @tokens = eval { CSS::DOM::Parser::tokenise_value($value); }
221 + or die CSS::DOM::Exception->new( SYNTAX_ERR, $@);
223 # check for whitespace/comment assignment
224 $tokens[0] =~ /^s+\z/ and $self->removeProperty($name),return;
225 diff --git a/lib/CSS/DOM/Value.pm b/lib/CSS/DOM/Value.pm
226 index 45f89e9..83b04e7 100644
227 --- a/lib/CSS/DOM/Value.pm
228 +++ b/lib/CSS/DOM/Value.pm
229 @@ -7,9 +7,9 @@ use strict;
232 use CSS::DOM::Constants;
233 -use CSS'DOM'Exception 'NO_MODIFICATION_ALLOWED_ERR';
234 +use CSS::DOM::Exception 'NO_MODIFICATION_ALLOWED_ERR';
235 use Exporter 5.57 'import';
236 -use Scalar'Util < weaken reftype >;
237 +use Scalar::Util < weaken reftype >;
239 use constant 1.03 our $_const = {
241 @@ -46,11 +46,11 @@ sub cssText {
242 ? $self->[valu] : 'inherit'
243 if defined wantarray;
245 - die new CSS'DOM'Exception
246 + die new CSS::DOM::Exception
247 NO_MODIFICATION_ALLOWED_ERR,
248 "Unowned value objects cannot be modified"
249 unless my $owner = $self->[ownr];
250 - die new CSS'DOM'Exception
251 + die new CSS::DOM::Exception
252 NO_MODIFICATION_ALLOWED_ERR,
253 "CSS::DOM::Value objects that do not know to which "
254 ."property they belong cannot be modified"
255 diff --git a/lib/CSS/DOM/Value/List.pm b/lib/CSS/DOM/Value/List.pm
256 index 85f5ef5..e681fa2 100644
257 --- a/lib/CSS/DOM/Value/List.pm
258 +++ b/lib/CSS/DOM/Value/List.pm
259 @@ -2,8 +2,8 @@ package CSS::DOM::Value::List;
263 -use CSS'DOM'Constants <CSS_VALUE_LIST NO_MODIFICATION_ALLOWED_ERR>;
264 -use Scalar'Util 'weaken';
265 +use CSS::DOM::Constants <CSS_VALUE_LIST NO_MODIFICATION_ALLOWED_ERR>;
266 +use Scalar::Util 'weaken';
268 # Object of this class are hashes, with the following keys:
270 @@ -14,7 +14,7 @@ use Scalar'Util 'weaken';
273 return 1 if $_[1] eq 'CSS::DOM::Value';
274 - goto &UNIVERSAL'DOES if defined &UNIVERSAL'DOES;
275 + goto &UNIVERSAL::DOES if defined &UNIVERSAL::DOES;
279 @@ -37,14 +37,14 @@ sub cssText {
280 if(defined wantarray) {{
281 if(!defined $$self{c} || grep ref ne 'ARRAY', @{$$self{v}}) {
282 @{$$self{v}} or $old = 'none', last;
283 - require CSS'DOM'Value'Primitive;
284 + require CSS::DOM::Value::Primitive;
285 my @args; my $index = 0;
287 next unless ref eq 'ARRAY';
289 (owner => property => @$self{<o p>})[0,2,1,3], index => $index
291 - $_ = new CSS'DOM'Value'Primitive @$_, @args;
292 + $_ = new CSS::DOM::Value::Primitive @$_, @args;
294 no warnings 'uninitialized';
295 $old = join length $$self{s} ? $$self{s} : ' ',
296 @@ -53,11 +53,11 @@ sub cssText {
297 else { $old = $$self{c} }
299 if(@_) { # assignment
300 - die new CSS'DOM'Exception
301 + die new CSS::DOM::Exception
302 NO_MODIFICATION_ALLOWED_ERR,
303 "Unowned value objects cannot be modified"
304 unless my $owner = $self->{o};
305 - die new CSS'DOM'Exception
306 + die new CSS::DOM::Exception
307 NO_MODIFICATION_ALLOWED_ERR,
308 "CSS::DOM::Value objects that do not know to which "
309 ."property they belong cannot be modified"
310 @@ -67,8 +67,8 @@ sub cssText {
312 = $owner->property_parser->match($prop, $_[0])
314 - require CSS'DOM'Value;
315 - CSS'DOM'Value::_apply_args_to_self($self,$owner,$prop,@arsg);
316 + require CSS::DOM::Value;
317 + CSS::DOM::Value::_apply_args_to_self($self,$owner,$prop,@arsg);
320 if(my $mh = $owner->modification_handler) {
321 @@ -89,8 +89,8 @@ sub item {
323 ref eq 'ARRAY' or return exit die return $_;
325 - require CSS'DOM'Value'Primitive;
326 - return $_ = new CSS'DOM'Value'Primitive
327 + require CSS::DOM::Value::Primitive;
328 + return $_ = new CSS::DOM::Value::Primitive
330 (owner => property => @$self{<o p>})[0,2,1,3],
332 diff --git a/lib/CSS/DOM/Value/Primitive.pm b/lib/CSS/DOM/Value/Primitive.pm
333 index 2ce0e9d..2046ff4 100644
334 --- a/lib/CSS/DOM/Value/Primitive.pm
335 +++ b/lib/CSS/DOM/Value/Primitive.pm
336 @@ -17,7 +17,7 @@ use Exporter 5.57 'import';
339 return 1 if $_[1] eq 'CSS::DOM::Value';
340 - goto &UNIVERSAL'DOES if defined &UNIVERSAL'DOES;
341 + goto &UNIVERSAL::DOES if defined &UNIVERSAL::DOES;
344 use constant 1.03 our $_const = { # Don’t conflict with the superclass!
345 @@ -203,8 +203,8 @@ sub cssText {
349 - require CSS'DOM'Exception,
350 - die new CSS'DOM'Exception
351 + require CSS::DOM::Exception,
352 + die new CSS::DOM::Exception
353 NO_MODIFICATION_ALLOWED_ERR,
354 "Unowned value objects cannot be modified"
355 unless my $owner = $self->[ownr];
356 @@ -213,15 +213,15 @@ sub cssText {
358 if(my $format = $$self[form]) {
360 - require CSS'DOM'PropertyParser;
361 + require CSS::DOM::PropertyParser;
363 - $parser = new CSS'DOM'PropertyParser
364 + $parser = new CSS::DOM::PropertyParser
365 } _=>our $prop_spec = {};
367 our $prop_spec->{format} = $format;
368 if(my @args = match { our $parser } _=> shift) {
369 - require CSS'DOM'Value;
370 - CSS'DOM'Value'_apply_args_to_self(
371 + require CSS::DOM::Value;
372 + CSS::DOM::Value::_apply_args_to_self(
373 $self, $owner, $prop,
374 @args, format => $format,
376 @@ -231,8 +231,8 @@ sub cssText {
377 # This is never reached, at least not when CSS::DOM’s mod-
378 # ules call the constructor:
379 elsif(!defined $prop) {
380 - require CSS'DOM'Exception,
381 - die new CSS'DOM'Exception
382 + require CSS::DOM::Exception,
383 + die new CSS::DOM::Exception
384 NO_MODIFICATION_ALLOWED_ERR,
385 ref($self) . " objects that do not know to which "
386 ."property they belong cannot be modified"
387 @@ -263,8 +263,8 @@ sub cssText {
391 - require CSS'DOM'Value;
392 - CSS'DOM'Value'_load_if_necessary($arsg[1]);
393 + require CSS::DOM::Value;
394 + CSS::DOM::Value::_load_if_necessary($arsg[1]);
395 my $list = $arsg[1]->new(
398 @@ -284,8 +284,8 @@ sub cssText {
400 = $owner->property_parser->match($prop, $_[0])
402 - require CSS'DOM'Value;
403 - CSS'DOM'Value'_apply_args_to_self(
404 + require CSS::DOM::Value;
405 + CSS::DOM::Value::_apply_args_to_self(
406 $self, $owner, $prop, @arsg
409 @@ -341,10 +341,10 @@ sub cssValueType { CSS::DOM::Value::CSS_PRIMITIVE_VALUE }
410 sub primitiveType { shift->[type] }
413 - my ($self,$type,$val) = @'_;
414 + my ($self,$type,$val) = @_;
416 - require CSS'DOM'Exception,
417 - die new CSS'DOM'Exception INVALID_ACCESS_ERR, "Invalid value type"
418 + require CSS::DOM::Exception,
419 + die new CSS::DOM::Exception INVALID_ACCESS_ERR, "Invalid value type"
420 if $type == CSS_UNKNOWN || $type == CSS_COUNTER
421 || $type == CSS_RECT || $type == CSS_RGBCOLOR || $type == CSS_DIMENSION;
423 @@ -352,8 +352,8 @@ sub setFloatValue {
425 no warnings 'numeric';
426 $self->cssText(my $css = _serialise($type, $val));
427 - require CSS'DOM'Exception,
428 - die new CSS'DOM'Exception INVALID_ACCESS_ERR, "Invalid value: $css"
429 + require CSS::DOM::Exception,
430 + die new CSS::DOM::Exception INVALID_ACCESS_ERR, "Invalid value: $css"
431 if $self->cssText ne $css;
434 @@ -364,8 +364,8 @@ sub getFloatValue {
435 # There are more types that are numbers than are not, so we
437 my $type = $self->[type];
438 - require CSS'DOM'Exception,
439 - die new CSS'DOM'Exception INVALID_ACCESS_ERR, "Not a numeric value"
440 + require CSS::DOM::Exception,
441 + die new CSS::DOM::Exception INVALID_ACCESS_ERR, "Not a numeric value"
442 if $type == CSS_UNKNOWN || $type == CSS_STRING || $type == CSS_URI
443 || $type == CSS_IDENT || $type == CSS_ATTR || $type == CSS_COUNTER
444 || $type == CSS_RECT || $type == CSS_RGBCOLOR;
445 @@ -380,8 +380,8 @@ sub getStringValue {
448 my $type = $self->[type];
449 - require CSS'DOM'Exception,
450 - die new CSS'DOM'Exception INVALID_ACCESS_ERR, "Not a string value"
451 + require CSS::DOM::Exception,
452 + die new CSS::DOM::Exception INVALID_ACCESS_ERR, "Not a string value"
453 unless $type == CSS_STRING || $type == CSS_URI
454 || $type == CSS_IDENT || $type == CSS_ATTR;
456 diff --git a/t/CSS2Properties.t b/t/CSS2Properties.t
457 index 315321b..13fc438 100644
458 --- a/t/CSS2Properties.t
459 +++ b/t/CSS2Properties.t
461 use strict; use warnings;
463 BEGIN { ++$INC{'tests.pm'} }
464 -sub tests'VERSION { $tests += pop };
465 -sub tests'import { $tests += pop if @_ > 1 };
466 +sub tests::VERSION { $tests += pop };
467 +sub tests::import { $tests += pop if @_ > 1 };
469 plan tests => $tests;
471 diff --git a/t/CSSCharsetRule.t b/t/CSSCharsetRule.t
472 index 92a8e74..fc3dba5 100644
473 --- a/t/CSSCharsetRule.t
474 +++ b/t/CSSCharsetRule.t
476 use strict; use warnings;
478 BEGIN { ++$INC{'tests.pm'} }
479 -sub tests'VERSION { $tests += pop };
480 +sub tests::VERSION { $tests += pop };
482 plan tests => $tests;
484 @@ -13,7 +13,7 @@ use_ok 'CSS::DOM::Rule::Charset',;
488 - my $ss = CSS::DOM'parse(
489 + my $ss = CSS::DOM::parse(
493 diff --git a/t/CSSFontFaceRule.t b/t/CSSFontFaceRule.t
494 index 9f4879e..abd5b6c 100644
495 --- a/t/CSSFontFaceRule.t
496 +++ b/t/CSSFontFaceRule.t
498 use strict; use warnings;
500 BEGIN { ++$INC{'tests.pm'} }
501 -sub tests'VERSION { $tests += pop };
502 +sub tests::VERSION { $tests += pop };
504 plan tests => $tests;
506 @@ -13,7 +13,7 @@ use_ok 'CSS::DOM::Rule::FontFace',;
510 - my $ss = CSS::DOM'parse(
511 + my $ss = CSS::DOM::parse(
512 '@font-face { font-family: "foo";src:url(bar) }'
515 diff --git a/t/CSSImportRule.t b/t/CSSImportRule.t
516 index 6ec65ef..c8a6a51 100644
517 --- a/t/CSSImportRule.t
518 +++ b/t/CSSImportRule.t
520 use strict; use warnings;
522 BEGIN { ++$INC{'tests.pm'} }
523 -sub tests'VERSION { $tests += pop };
524 +sub tests::VERSION { $tests += pop };
526 plan tests => $tests;
528 @@ -15,7 +15,7 @@ use_ok 'CSS::DOM::Rule::Import';
532 - my $ss = CSS::DOM'parse(
533 + my $ss = CSS::DOM::parse(
534 '@import "foo.css" tv, screen'
537 @@ -95,7 +95,7 @@ use tests 5; # styleSheet
538 'foo.css' => '@import "bar.css"',
539 'bar.css' => 'a { color: blue }',
541 - is CSS'DOM'parse('@import "foo.css',url_fetcher=>sub{$urls{$_[0]}})
542 + is CSS::DOM::parse('@import "foo.css',url_fetcher=>sub{$urls{$_[0]}})
543 ->cssRules->[0]->styleSheet
544 ->cssRules->[0]->styleSheet
545 ->cssRules->[0]->style->color,
546 diff --git a/t/CSSMediaRule.t b/t/CSSMediaRule.t
547 index fffa7fb..9d01698 100644
548 --- a/t/CSSMediaRule.t
549 +++ b/t/CSSMediaRule.t
551 use strict; use warnings;
553 BEGIN { ++$INC{'tests.pm'} }
554 -sub tests'VERSION { $tests += pop };
555 +sub tests::VERSION { $tests += pop };
557 plan tests => $tests;
559 @@ -15,7 +15,7 @@ use_ok 'CSS::DOM::Rule::Media';
563 - my $ss = CSS::DOM'parse(
564 + my $ss = CSS::DOM::parse(
565 '@media print { body { background: none } }'
568 @@ -133,4 +133,4 @@ use tests 4; # deleteRule
569 cmp_ok $@, '==', CSS::DOM::Exception::INDEX_SIZE_ERR,
570 'error raised by deleteRule';
573 \ No newline at end of file
575 diff --git a/t/CSSPageRule.t b/t/CSSPageRule.t
576 index 108923e..764e1a1 100644
577 --- a/t/CSSPageRule.t
578 +++ b/t/CSSPageRule.t
580 use strict; use warnings;
582 BEGIN { ++$INC{'tests.pm'} }
583 -sub tests'VERSION { $tests += pop };
584 +sub tests::VERSION { $tests += pop };
586 plan tests => $tests;
588 @@ -14,7 +14,7 @@ use_ok 'CSS::DOM::Rule::Page',;
592 - my $ss = CSS::DOM'parse( '@page:first{ margin-top: 3in }')
593 + my $ss = CSS::DOM::parse( '@page:first{ margin-top: 3in }')
597 diff --git a/t/CSSPrimitiveValue.t b/t/CSSPrimitiveValue.t
598 index 5b30046..ad378f7 100644
599 --- a/t/CSSPrimitiveValue.t
600 +++ b/t/CSSPrimitiveValue.t
601 @@ -4,8 +4,8 @@ use strict; use warnings;
602 no warnings<utf8 parenthesis regexp once qw bareword syntax>;
604 BEGIN { ++$INC{'tests.pm'} }
605 -sub tests'VERSION { $tests += pop };
606 -sub tests'import { $tests += pop if @_ > 1 };
607 +sub tests::VERSION { $tests += pop };
608 +sub tests::import { $tests += pop if @_ > 1 };
610 plan tests => $tests;
612 @@ -441,9 +441,9 @@ for(CSS::DOM::Value::Primitive->new(
613 # ------------------------------------------
614 # Tests for setFloatValue and setStringValue
617 +use CSS::DOM::Style;
618 require CSS::DOM::PropertyParser;
619 -my $s = new CSS'DOM'Style
620 +my $s = new CSS::DOM::Style
621 property_parser => $CSS::DOM::PropertyParser::Default;
623 for my $meth ('setFloatValue' ,'setStringValue'){
624 diff --git a/t/CSSRule.t b/t/CSSRule.t
625 index b33007c..582eb04 100644
629 use strict; use warnings;
631 BEGIN { ++$INC{'tests.pm'} }
632 -sub tests'VERSION { $tests += pop };
633 +sub tests::VERSION { $tests += pop };
635 plan tests => $tests;
637 @@ -24,7 +24,7 @@ use tests 7; # constants
641 -my $ss = CSS::DOM'parse( 'a{text-decoration: none} p { margin: 0 }');
642 +my $ss = CSS::DOM::parse( 'a{text-decoration: none} p { margin: 0 }');
643 my $rule = cssRules $ss ->[0];
646 diff --git a/t/CSSRuleList.t b/t/CSSRuleList.t
647 index bc2bfaf..5cee6f6 100644
648 --- a/t/CSSRuleList.t
649 +++ b/t/CSSRuleList.t
651 use strict; use warnings;
653 BEGIN { ++$INC{'tests.pm'} }
654 -sub tests'VERSION { $tests += pop };
655 +sub tests::VERSION { $tests += pop };
657 plan tests => $tests;
659 diff --git a/t/CSSStyleDeclaration-setProperty.t b/t/CSSStyleDeclaration-setProperty.t
660 index cceb993..d0615b7 100644
661 --- a/t/CSSStyleDeclaration-setProperty.t
662 +++ b/t/CSSStyleDeclaration-setProperty.t
664 use strict; use warnings;
666 BEGIN { ++$INC{'tests.pm'} }
667 -sub tests'VERSION { $tests += pop };
668 +sub tests::VERSION { $tests += pop };
670 plan tests => $tests;
672 diff --git a/t/CSSStyleDeclaration.t b/t/CSSStyleDeclaration.t
673 index 57bfe98..7bcc370 100644
674 --- a/t/CSSStyleDeclaration.t
675 +++ b/t/CSSStyleDeclaration.t
677 use strict; use warnings; no warnings qw 'utf8 parenthesis regexp once qw';
679 BEGIN { ++$INC{'tests.pm'} }
680 -sub tests'VERSION { $tests += pop };
681 +sub tests::VERSION { $tests += pop };
683 plan tests => $tests;
685 @@ -26,7 +26,7 @@ use tests 3; # first make sure we can use it without loading CSS::DOM
689 -my $ss = CSS::DOM'parse ('a{text-decoration: none} p { margin: 0 }');
690 +my $ss = CSS::DOM::parse ('a{text-decoration: none} p { margin: 0 }');
691 my $rule = cssRules $ss ->[0];
692 my $decl = $rule->style;
694 @@ -105,7 +105,7 @@ like $decl->cssText, qr/color: blue !very\\ important/,
696 use tests 4; # length
698 - my $decl = new CSS'DOM'Style;
699 + my $decl = new CSS::DOM::Style;
700 is eval { $decl->length }, 0, # This used to die [RT #54810]
701 'length when no properties have been added'; # (fixed in 0.09).
702 $decl = CSS::DOM::Style::parse(
703 diff --git a/t/CSSStyleRule.t b/t/CSSStyleRule.t
704 index 024012b..fb550da 100644
705 --- a/t/CSSStyleRule.t
706 +++ b/t/CSSStyleRule.t
708 use strict; use warnings;
710 BEGIN { ++$INC{'tests.pm'} }
711 -sub tests'VERSION { $tests += pop };
712 +sub tests::VERSION { $tests += pop };
714 plan tests => $tests;
716 @@ -14,7 +14,7 @@ use_ok 'CSS::DOM::Rule::Style',;
720 - my $ss = CSS::DOM'parse('a{text-decoration: none} p { margin: 0 }')
721 + my $ss = CSS::DOM::parse('a{text-decoration: none} p { margin: 0 }')
725 diff --git a/t/CSSStyleSheet-insertRule.t b/t/CSSStyleSheet-insertRule.t
726 index 3302966..94b3ee7 100644
727 --- a/t/CSSStyleSheet-insertRule.t
728 +++ b/t/CSSStyleSheet-insertRule.t
730 use strict; use warnings;
732 BEGIN { ++$INC{'tests.pm'} }
733 -sub tests'VERSION { $tests += pop };
734 +sub tests::VERSION { $tests += pop };
736 plan tests => $tests;
738 @@ -19,4 +19,3 @@ ok eval{$ss->insertRule('a{ color: red }',0);1},
739 'insertRule on empty style sheet doesn\'t die';
740 # At one point during development, it did die because it was call-
741 # ing methods on CSS::DOM::RuleParser which hadn’t been loaded.
743 diff --git a/t/CSSStyleSheet.t b/t/CSSStyleSheet.t
744 index ab82e6a..40b3edf 100644
745 --- a/t/CSSStyleSheet.t
746 +++ b/t/CSSStyleSheet.t
748 use strict; use warnings;
750 BEGIN { ++$INC{'tests.pm'} }
751 -sub tests'VERSION { $tests += pop };
752 +sub tests::VERSION { $tests += pop };
754 plan tests => $tests;
756 @@ -30,7 +30,7 @@ use tests 3; # (_set_)ownerRule
758 use tests 2; # cssRules
760 - $ss = CSS::DOM'parse( 'a{text-decoration: none} p { margin: 0 }');
761 + $ss = CSS::DOM::parse( 'a{text-decoration: none} p { margin: 0 }');
762 is +()=$ss->cssRules, 2, 'cssRules in list context';
763 isa_ok my $rules = cssRules $ss, 'CSS::DOM::RuleList',
764 'cssRules in scalar context';
765 @@ -38,7 +38,7 @@ use tests 2; # cssRules
767 use tests 11; # insertRule
769 - $ss = CSS::DOM'parse ('a{text-decoration: none} p { margin: 0 }');
770 + $ss = CSS::DOM::parse ('a{text-decoration: none} p { margin: 0 }');
772 is $ss->insertRule('b { font-weight: bold }', 0), 0,
773 'retval of insertRule';
774 @@ -70,7 +70,7 @@ use tests 11; # insertRule
776 use tests 4; # deleteRule
778 - $ss = CSS::DOM'parse ('a{text-decoration: none} p { margin: 0 }
779 + $ss = CSS::DOM::parse ('a{text-decoration: none} p { margin: 0 }
781 is +()=$ss->deleteRule(1), 0, 'retval of deleteRule';
782 is_deeply [map $_->selectorText, $ss->cssRules], [qw/ a i /],
783 @@ -82,4 +82,4 @@ use tests 4; # deleteRule
784 cmp_ok $@, '==', CSS::DOM::Exception::INDEX_SIZE_ERR,
785 'error raised by deleteRule';
788 \ No newline at end of file
790 diff --git a/t/CSSValue-prim-cssText.t b/t/CSSValue-prim-cssText.t
791 index 09f657b..b19836a 100644
792 --- a/t/CSSValue-prim-cssText.t
793 +++ b/t/CSSValue-prim-cssText.t
795 use strict; use warnings; no warnings qw 'qw regexp once utf8 parenthesis';
797 BEGIN { ++$INC{'tests.pm'} }
798 -sub tests'VERSION { $tests += pop };
799 +sub tests::VERSION { $tests += pop };
801 plan tests => $tests;
803 diff --git a/t/CSSValue.t b/t/CSSValue.t
804 index 5fad855..f5a04d0 100644
808 use strict; use warnings; no warnings qw 'qw regexp once utf8 parenthesis';
810 BEGIN { ++$INC{'tests.pm'} }
811 -sub tests'VERSION { $tests += pop };
812 +sub tests::VERSION { $tests += pop };
814 plan tests => $tests;
816 @@ -38,7 +38,7 @@ isa_ok +CSS::DOM::Value->new(type => &CSS_CUSTOM, value => "top left"),
818 require CSS::DOM::Style;
819 require CSS::DOM::PropertyParser;
820 -my $s = new CSS'DOM'Style
821 +my $s = new CSS::DOM::Style
822 property_parser => my $spec = $CSS::DOM::PropertyParser::Default;
824 # The default parser has no properties with a simple string, attr or
825 diff --git a/t/CSSValueList.t b/t/CSSValueList.t
826 index 1805209..25c1bec 100644
827 --- a/t/CSSValueList.t
828 +++ b/t/CSSValueList.t
830 use strict; use warnings;
832 BEGIN { ++$INC{'tests.pm'} }
833 -sub tests'VERSION { $tests += pop };
834 +sub tests::VERSION { $tests += pop };
836 plan tests => $tests;
838 -use CSS'DOM'Constants ':primitive';
839 -use CSS'DOM'Value'List;
840 +use CSS::DOM::Constants ':primitive';
841 +use CSS::DOM::Value::List;
844 -ok +CSS'DOM'Value'List->DOES('CSS::DOM::Value'), 'DOES';
845 +ok +CSS::DOM::Value::List->DOES('CSS::DOM::Value'), 'DOES';
847 -my $v = new CSS'DOM'Value'List values => [
848 +my $v = new CSS::DOM::Value::List values => [
849 [ type => CSS_STRING, value => 'sphed' ],
850 [ type => CSS_STRING, value => 'flit' ],
852 diff --git a/t/MediaList.t b/t/MediaList.t
853 index 3092c62..0888d61 100644
857 use strict; use warnings;
859 BEGIN { ++$INC{'tests.pm'} }
860 -sub tests'VERSION { $tests += pop };
861 +sub tests::VERSION { $tests += pop };
863 plan tests => $tests;
865 diff --git a/t/RGBColor.t b/t/RGBColor.t
866 index 3758529..12d2938 100644
870 use strict; use warnings;
872 BEGIN { ++$INC{'tests.pm'} }
873 -sub tests'VERSION { $tests += pop };
874 +sub tests::VERSION { $tests += pop };
876 plan tests => $tests;
878 diff --git a/t/Rect.t b/t/Rect.t
879 index e7f83a4..ea8f046 100644
883 use strict; use warnings;
885 BEGIN { ++$INC{'tests.pm'} }
886 -sub tests'VERSION { $tests += pop };
887 +sub tests::VERSION { $tests += pop };
889 plan tests => $tests;
891 @@ -25,4 +25,4 @@ use tests 4;
892 is $v->left->cssText, '4cm', 'left';
895 -# ~~~ test for modifications of the cssText property
896 \ No newline at end of file
897 +# ~~~ test for modifications of the cssText property
898 diff --git a/t/StyleSheet.t b/t/StyleSheet.t
899 index a4469fb..e84e7d4 100644
903 use strict; use warnings;
905 BEGIN { ++$INC{'tests.pm'} }
906 -sub tests'VERSION { $tests += pop };
907 +sub tests::VERSION { $tests += pop };
909 plan tests => $tests;
911 @@ -55,7 +55,7 @@ use tests 1; # (set_)href
915 - sub foo'attr { return shift->{+shift} }
916 + sub foo::attr { return shift->{+shift} }
917 $ss->set_ownerNode(my $foo = bless {title => 'tilde'}, 'foo');
918 is $ss->title, 'tilde', 'title';
920 diff --git a/t/StyleSheetList.t b/t/StyleSheetList.t
921 index 8e8c7cf..745f894 100644
922 --- a/t/StyleSheetList.t
923 +++ b/t/StyleSheetList.t
925 use strict; use warnings;
927 BEGIN { ++$INC{'tests.pm'} }
928 -sub tests'VERSION { $tests += pop };
929 +sub tests::VERSION { $tests += pop };
931 plan tests => $tests;
933 diff --git a/t/charset.t b/t/charset.t
934 index eed053e..1666157 100644
938 use strict; use warnings; no warnings qw 'utf8 parenthesis';
940 BEGIN { ++$INC{'tests.pm'} }
941 -sub tests'VERSION { $tests += pop };
942 +sub tests::VERSION { $tests += pop };
944 plan tests => $tests;
946 diff --git a/t/css-dom-interface.t b/t/css-dom-interface.t
947 index 41bca29..76e5f2f 100644
948 --- a/t/css-dom-interface.t
949 +++ b/t/css-dom-interface.t
951 use strict; use warnings;
953 BEGIN { ++$INC{'tests.pm'} }
954 -sub tests'VERSION { $tests += pop };
955 +sub tests::VERSION { $tests += pop };
957 plan tests => $tests;
959 diff --git a/t/css-dom-style.t b/t/css-dom-style.t
960 index f852f6f..9a6582f 100644
961 --- a/t/css-dom-style.t
962 +++ b/t/css-dom-style.t
964 use strict; use warnings;
966 BEGIN { ++$INC{'tests.pm'} }
967 -sub tests'VERSION { $tests += pop };
968 +sub tests::VERSION { $tests += pop };
970 plan tests => $tests;
972 use tests 4; # modification_handler
973 require CSS::DOM::Style;
974 -my $style = CSS::DOM::Style'parse('margin-top: 2px');
975 +my $style = CSS::DOM::Style::parse('margin-top: 2px');
976 $style->modification_handler(sub { ++$}; ${{} .= shift});
977 $style->cssText('margin-bottom: 600%');
978 is $}, 1, 'cssText triggers mod hander';
979 @@ -25,4 +25,3 @@ is $}, 3, 'AUTOLOAD triggers the handler';
980 # ~~~ We also needs tests for modification_handler triggered by:
982 # • modifications to CSSValue objects and their sub-objects (RGBColor etc
984 diff --git a/t/css-dom-util.t b/t/css-dom-util.t
985 index 5dbef09..554cd1b 100644
986 --- a/t/css-dom-util.t
987 +++ b/t/css-dom-util.t
989 use strict; use warnings; no warnings qw 'utf8 parenthesis';
991 BEGIN { ++$INC{'tests.pm'} }
992 -sub tests'VERSION { $tests += pop };
993 +sub tests::VERSION { $tests += pop };
995 plan tests => $tests;
997 diff --git a/t/css-dom.t b/t/css-dom.t
998 index e36a046..d43d458 100644
1002 use strict; use warnings;
1004 BEGIN { ++$INC{'tests.pm'} }
1005 -sub tests'VERSION { $tests += pop };
1006 +sub tests::VERSION { $tests += pop };
1008 plan tests => $tests;
1010 @@ -28,7 +28,7 @@ use tests 1; # compute_style
1011 local $SIG{__WARN__} = sub { $w .= shift };
1012 require CSS::DOM::Style;
1014 - style => CSS'DOM'Style'parse('color:red'), tagName => 'p',
1015 + style => CSS::DOM::Style::parse('color:red'), tagName => 'p',
1017 CSS::DOM::compute_style(element => $elem);
1018 is $w, undef, 'no warnings for style belonging to element itself';
1019 diff --git a/t/parser-rules.t b/t/parser-rules.t
1020 index 16cb536..7387caf 100644
1021 --- a/t/parser-rules.t
1022 +++ b/t/parser-rules.t
1024 use strict; use warnings; no warnings qw 'utf8 parenthesis';
1026 BEGIN { ++$INC{'tests.pm'} }
1027 -sub tests'VERSION { $tests += pop };
1028 +sub tests::VERSION { $tests += pop };
1030 plan tests => $tests;
1032 @@ -35,7 +35,7 @@ use tests 2; # miscellaneous CSS::DOM::parse stuff
1034 use tests 7; # <!-- -->
1036 - my $sheet = CSS'DOM'parse '
1037 + my $sheet = CSS::DOM::parse '
1039 @at-rule {/*<!--*/ } <!--
1041 @@ -46,9 +46,9 @@ use tests 7; # <!-- -->
1042 '@at-rule {/*<!--*/ }' . "\n" .
1043 "{ style: rule }\n",
1045 - CSS'DOM'parse 'a { --> }';
1046 + CSS::DOM::parse 'a { --> }';
1047 ok $@, 'invalid -->';
1048 - CSS'DOM'parse 'a { <!-- }';
1049 + CSS::DOM::parse 'a { <!-- }';
1050 ok $@, 'invalid <!--';
1051 ok !eval{$sheet->insertRule('--> a { }');1},
1052 'invalid --> before statement';
1053 @@ -62,7 +62,7 @@ use tests 7; # <!-- -->
1055 use tests 5; # single statement parser
1057 - my $sheet = new CSS'DOM;
1058 + my $sheet = new CSS::DOM;
1059 $sheet->insertRule('phoo { bar : baz} ',0);
1060 isa_ok cssRules$sheet->[0], 'CSS::DOM::Rule::Style',
1061 'ruleset created by insertRule';
1062 @@ -79,36 +79,36 @@ use tests 5; # single statement parser
1064 use tests 9; # styledecl parser
1066 - my $style = CSS'DOM'Style'parse ' foo : bar ';
1067 + my $style = CSS::DOM::Style::parse ' foo : bar ';
1068 is $style->cssText, 'foo: bar', 'style parser';
1069 - CSS'DOM'Style'parse 'foo: bar}';
1070 + CSS::DOM::Style::parse 'foo: bar}';
1071 ok $@, 'style parser chokes on }';
1072 - is CSS'DOM'Style'parse ' ; ;;;;;foo : bar ;;;; ; ',->cssText,
1073 + is CSS::DOM::Style::parse ' ; ;;;;;foo : bar ;;;; ; ',->cssText,
1074 'foo: bar', 'style wit extra semicolons';
1075 - is CSS'DOM'Style'parse 'foo:bar',->cssText,
1076 + is CSS::DOM::Style::parse 'foo:bar',->cssText,
1077 'foo: bar', 'style with no space';
1078 - is CSS'DOM'Style'parse 'foo:bar;;;baz:bonk;;',->cssText,
1079 + is CSS::DOM::Style::parse 'foo:bar;;;baz:bonk;;',->cssText,
1080 'foo: bar; baz: bonk',
1081 'style with no space & extra semicolons';
1082 - is CSS'DOM'Style'parse 'foo:bar;;;!baz:bonk;;',->cssText,
1083 + is CSS::DOM::Style::parse 'foo:bar;;;!baz:bonk;;',->cssText,
1085 'style with delimiter+ident for property name';
1086 - is CSS'DOM'Style'parse '\70\41 dding:0;;;;;',->cssText,
1087 + is CSS::DOM::Style::parse '\70\41 dding:0;;;;;',->cssText,
1089 'style with escaped property name';
1091 - is CSS'DOM'Style'parse '\a\z\A\Z\)\a a :bar',
1092 + is CSS::DOM::Style::parse '\a\z\A\Z\)\a a :bar',
1093 ->getPropertyValue("\nz\nZ)\na"), 'bar',
1094 'style with both kinds of ident escapes';
1096 { package Phoo; use overload '""'=>sub{'foo:bar'}}
1097 - is CSS'DOM'Style'parse(bless [], 'Phoo')->cssText, 'foo: bar',
1098 + is CSS::DOM::Style::parse(bless [], 'Phoo')->cssText, 'foo: bar',
1099 '::Style::parse\'s force stringification';
1102 use tests 121; # @media
1104 - my $sheet = new CSS'DOM; my $rule;
1105 + my $sheet = new CSS::DOM; my $rule;
1107 $sheet->insertRule('@media print{a{color:blue}}',0);
1108 isa_ok $rule=pop@{$sheet->cssRules}, 'CSS::DOM::Rule::Media',
1109 @@ -464,7 +464,7 @@ use tests 121; # @media
1110 is $rule->cssText, "\@meDIa { }\n",
1111 'serialised empty unclosed fake @meDIa rule w/ws';
1113 - $sheet = CSS'DOM'parse '
1114 + $sheet = CSS::DOM::parse '
1115 @media print { a { color: blue } "stuff"}
1118 @@ -496,7 +496,7 @@ use tests 121; # @media
1120 use tests 1; # bracket closure
1122 - my $sheet = new CSS'DOM; my $rule;
1123 + my $sheet = new CSS::DOM; my $rule;
1125 $sheet->insertRule('@unknown {(rect([',0);
1126 is +($rule=pop@{$sheet->cssRules})->cssText,
1127 @@ -506,7 +506,7 @@ use tests 1; # bracket closure
1129 use tests 14; # @page
1131 - my $sheet = new CSS'DOM; my $rule;
1132 + my $sheet = new CSS::DOM; my $rule;
1134 $sheet->insertRule('@page{color:blue}',0);
1135 is +($rule=pop@{$sheet->cssRules})->type, PAGE_RULE,
1136 @@ -553,7 +553,7 @@ use tests 14; # @page
1138 use tests 6; # unrecognised at-rules
1140 - my $sheet = new CSS'DOM; my $rule;
1141 + my $sheet = new CSS::DOM; my $rule;
1143 $sheet->insertRule('@unknown \ / \ / :-P {...}',0);
1144 is +($rule=pop@{$sheet->cssRules})->type, UNKNOWN_RULE,
1145 @@ -579,7 +579,7 @@ use tests 6; # unrecognised at-rules
1147 use tests 6; # ruselet pasrer
1149 - my $sheet = new CSS'DOM; my $rule;
1150 + my $sheet = new CSS::DOM; my $rule;
1152 $sheet->insertRule('a{text-decoration:none;color:blue}',0);
1153 is +($rule=pop@{$sheet->cssRules})->type, STYLE_RULE,
1154 @@ -605,7 +605,7 @@ use tests 6; # ruselet pasrer
1156 use tests 1; # invaldi strings
1158 - my $sheet = CSS'DOM'parse q*
1159 + my $sheet = CSS::DOM::parse q*
1162 font-family: 'Courier New Times
1163 @@ -634,51 +634,51 @@ use tests 1; # invaldi strings
1165 use tests 10; # invalid closing brackets
1167 - is CSS'DOM'parse q" @eotetet ]" =>-> cssRules->length,0,
1168 + is CSS::DOM::parse q" @eotetet ]" =>-> cssRules->length,0,
1169 'invalid closing bracket in unknown rule';
1170 ok $@, '$@ is set by invalid closing bracket in unknown rule';
1171 - is CSS'DOM'parse q" @media { ]" =>-> cssRules->length, 0,
1172 + is CSS::DOM::parse q" @media { ]" =>-> cssRules->length, 0,
1173 'invalid closing bracket in media rule';
1174 ok $@, '$@ is set by invalid closing bracket in media rule';
1175 - is CSS'DOM'parse q" @page { ]" =>-> cssRules->length, 0,
1176 + is CSS::DOM::parse q" @page { ]" =>-> cssRules->length, 0,
1177 'invalid closing bracket in page rule';
1178 ok $@, '$@ is set by invalid closing bracket in page rule';
1179 - is CSS'DOM'parse q" page ( ]" =>-> cssRules->length, 0,
1180 + is CSS::DOM::parse q" page ( ]" =>-> cssRules->length, 0,
1181 'invalid closing bracket in selector';
1182 ok $@, '$@ is set by invalid closing bracket in selector';
1183 - is CSS'DOM'parse q" a { (}" =>-> cssRules->length, 0,
1184 + is CSS::DOM::parse q" a { (}" =>-> cssRules->length, 0,
1185 'invalid closing bracket in style declaration';
1186 ok $@, '$@ is set by invalid closing bracket in selector';
1189 use tests 14; # invalid [\@;]
1191 - is CSS'DOM'parse q" @eotetet @aa ]" =>-> cssRules->length,0,
1192 + is CSS::DOM::parse q" @eotetet @aa ]" =>-> cssRules->length,0,
1193 'invalid @ in unknown rule';
1194 ok $@, '$@ is set by invalid @ in unknown rule';
1195 - is CSS'DOM'parse q" @eotetet aa (;" =>-> cssRules->length,0,
1196 + is CSS::DOM::parse q" @eotetet aa (;" =>-> cssRules->length,0,
1197 'invalid ; in unknown rule';
1198 ok $@, '$@ is set by invalid ; in unknown rule';
1199 - is CSS'DOM'parse q" @media {(; { " =>-> cssRules->length,0,
1200 + is CSS::DOM::parse q" @media {(; { " =>-> cssRules->length,0,
1201 'invalid ; in media rule';
1202 ok $@, '$@ is set by invalid ; in media rule';
1203 - is CSS'DOM'parse q" @page { (;fooo" =>-> cssRules->length,0,
1204 + is CSS::DOM::parse q" @page { (;fooo" =>-> cssRules->length,0,
1205 'invalid ; in page rule';
1206 ok $@, '$@ is set by invalid ; in page rule';
1207 - is CSS'DOM'parse q" page @oo " =>-> cssRules->length,0,
1208 + is CSS::DOM::parse q" page @oo " =>-> cssRules->length,0,
1209 'invalid @ in selector';
1210 ok $@, '$@ is set by invalid @ in selector';
1211 - is CSS'DOM'parse q" page ;( " =>-> cssRules->length,0,
1212 + is CSS::DOM::parse q" page ;( " =>-> cssRules->length,0,
1213 'invalid ; in selector';
1214 ok $@, '$@ is set by invalid ; in selector';
1215 - is CSS'DOM'parse q" a { ( ;( " =>-> cssRules->length,0,
1216 + is CSS::DOM::parse q" a { ( ;( " =>-> cssRules->length,0,
1217 'invalid ; in style declaration';
1218 ok $@, '$@ is set by invalid ; in style declaration';
1221 use tests 14; # @import
1223 - my $sheet = new CSS'DOM; my $rule;
1224 + my $sheet = new CSS::DOM; my $rule;
1226 $sheet->insertRule('@import"foo.css"print,screen;',0);
1227 is +($rule=pop@{$sheet->cssRules})->type, IMPORT_RULE,
1228 @@ -722,7 +722,7 @@ use tests 14; # @import
1230 use tests 8; # @font-face
1232 - my $sheet = new CSS'DOM; my $rule;
1233 + my $sheet = new CSS::DOM; my $rule;
1235 $sheet->insertRule('@font-face{color:blue}',0);
1236 is +($rule=pop@{$sheet->cssRules})->type, FONT_FACE_RULE,
1237 @@ -751,7 +751,7 @@ use tests 8; # @font-face
1239 use tests 13; # @charset
1241 - my $sheet = new CSS'DOM; my $rule;
1242 + my $sheet = new CSS::DOM; my $rule;
1244 $sheet->insertRule('@charset "utf-8";',0);
1245 is +($rule=pop@{$sheet->cssRules})->type, CHARSET_RULE,
1246 @@ -799,4 +799,3 @@ use tests 13; # @charset
1247 is +($rule=pop@{$sheet->cssRules})->type, UNKNOWN_RULE,
1248 '@charset w/space b4 ; is an unknown rule';
1251 diff --git a/t/parser-tokens.t b/t/parser-tokens.t
1252 index 9c0fae3..d6a42b7 100644
1253 --- a/t/parser-tokens.t
1254 +++ b/t/parser-tokens.t
1256 use strict; use warnings; no warnings qw 'utf8 parenthesis';
1258 BEGIN { ++$INC{'tests.pm'} }
1259 -sub tests'VERSION { $tests += pop };
1260 +sub tests::VERSION { $tests += pop };
1262 plan tests => $tests;
1264 @@ -37,7 +37,7 @@ for('_', 'a'..'z', 'A'.."Z", map(chr,0x80..0x100) ,"\x{2003}","\x{3000}"){
1266 my $style = CSS::DOM::Style::parse("--a: 65");
1267 is $style->cssText, '', 'identifier can\'t begin with --';
1268 - $style = CSS'DOM'Style'parse"-0b:-0b";
1269 + $style = CSS::DOM::Style::parse"-0b:-0b";
1270 is $style->cssText, '', 'nor with -0';
1273 @@ -49,7 +49,7 @@ use tests 8; # strings
1276 qq/ \x{10ffff}f-_abcABC}}}}}}}}\xff\x{2003}\x{100}\t'"/;
1277 - my $rule = new CSS::DOM::Rule'Import;
1278 + my $rule = new CSS::DOM::Rule::Import;
1280 $rule->cssText('@import ' . "'$nasty_escaped_string'");
1281 is $rule->href, $expect, "'...'";
1282 @@ -80,7 +80,7 @@ use tests 8; # strings
1284 use tests 23; # urls
1286 - my $rule = new CSS'DOM'Rule::Import;
1287 + my $rule = new CSS::DOM::Rule::Import;
1289 $rule->cssText('@import url(!$#%&][\\\}|{*~foo/bar.gif)');
1290 is $rule->href, '!$#%&][\}|{*~foo/bar.gif', 'unquoted url';
1291 @@ -118,7 +118,7 @@ use tests 23; # urls
1292 is $rule->href, "\x{2000}\x{2000}\n 0 )\tz",
1293 'double-quoted url with escapes';
1295 - my $style = new CSS'DOM'Style;
1296 + my $style = new CSS::DOM::Style;
1298 $style->name('url(foo');
1299 is $style->name, 'url(foo)', 'unquoted, unterminated url';
1300 @@ -179,7 +179,7 @@ use tests 3; # spaces and comments
1301 "name:valu /*eeeee "
1303 is $style->name, 'valu', 'another ws /**/ test';
1304 - $style = CSS'DOM'Style'parse( "name: /*\n*/valu");
1305 + $style = CSS::DOM::Style::parse( "name: /*\n*/valu");
1306 is $style->name, 'valu', 'multiline comments';
1309 @@ -187,27 +187,27 @@ use tests 3; # spaces and comments
1311 use tests 6; # <!-- -->
1313 - my $sheet = CSS'DOM'parse ' <!--{ name: value }--> @media print{}';
1314 + my $sheet = CSS::DOM::parse ' <!--{ name: value }--> @media print{}';
1315 is join('',map cssText$_,cssRules$sheet),
1316 "{ name: value }\n\@media print {\n}\n",
1318 - is CSS'DOM'parse"{}{name: <!-- value; n:v}" =>->
1319 + is CSS::DOM::parse"{}{name: <!-- value; n:v}" =>->
1323 ok $@, '$@ after invalid <!--';
1324 - is CSS'DOM'parse"{}{name: --> value; n:v}" =>->
1325 + is CSS::DOM::parse"{}{name: --> value; n:v}" =>->
1329 ok $@, '$@ after invalid -->';
1330 - is CSS'DOM'Style'parse"name:'<!--value-->",->name,
1331 + is CSS::DOM::Style::parse"name:'<!--value-->",->name,
1332 "'<!--value-->'", '<!-- --> in a string';
1335 use tests 1; # miscellaneous tokens
1337 - my $sheet = CSS'DOM'parse '@foo ()[~=:,./+-]{[("\"';
1338 + my $sheet = CSS::DOM::parse '@foo ()[~=:,./+-]{[("\"';
1339 is $sheet->cssRules->[0]->cssText,
1340 '@foo ()[~=:,./+-]{[("\"")]}'. "\n",
1341 'miscellaneous tokens'
1342 diff --git a/t/property-parser.t b/t/property-parser.t
1343 index 6423b39..f785054 100644
1344 --- a/t/property-parser.t
1345 +++ b/t/property-parser.t
1347 use strict; use warnings; no warnings qw 'utf8 parenthesis regexp once qw';
1349 BEGIN { ++$INC{'tests.pm'} }
1350 -sub tests'VERSION { $tests += pop };
1351 +sub tests::VERSION { $tests += pop };
1353 plan tests => $tests;
1355 @@ -18,11 +18,11 @@ isa_ok my $parser = CSS::DOM::PropertyParser->new,
1357 use tests 4; # clone
1358 my $clone = (my $css21 = $CSS::DOM::PropertyParser::CSS21)->clone;
1359 -isn't $clone, $css21, 'clone at the first level';
1360 -isn't $clone->get_property('background-position'),
1361 +isnt $clone, $css21, 'clone at the first level';
1362 +isnt $clone->get_property('background-position'),
1363 $css21->get_property('background-position'),
1364 'clone clones individual property specs';
1367 $clone->get_property('border-color')->{properties}
1368 {'border-top-color'},
1369 $css21->get_property('border-color')->{properties}
1370 @@ -1314,17 +1314,17 @@ use tests 2; # parsing colours
1371 { # Tests for problems with colours in cygwin’s perl (broken in 0.08; fixed
1372 # in 0.09) and for bugs temporarily introduced while those problems were
1374 - my $p = new CSS'DOM'PropertyParser;
1375 + my $p = new CSS::DOM::PropertyParser;
1378 format => '<colour>+',
1381 - my $s = CSS'DOM'Style'parse(
1382 + my $s = CSS::DOM::Style::parse(
1383 "colours: rgb(0,0,0) rgb(1,1,1)",
1384 property_parser => $p
1386 - use CSS'DOM'Constants 'CSS_CUSTOM';
1387 + use CSS::DOM::Constants 'CSS_CUSTOM';
1388 is $s->getPropertyCSSValue('colours')->cssValueType, CSS_CUSTOM,
1389 'quantified <colour>s';
1391 @@ -1346,18 +1346,18 @@ use tests 1; # backtracking with list properties
1392 # local ${$whatever}[0] localises one element. But it actually
1393 # replaces the array temporarily with a new one, which cannot
1394 # work with references.
1395 - my $p = new CSS'DOM'PropertyParser;
1396 + my $p = new CSS::DOM::PropertyParser;
1399 format => '[(foo)|(foo),]+', # [(foo),?]+ does not trigger the bug
1403 - my $s = CSS'DOM'Style'parse(
1404 + my $s = CSS::DOM::Style::parse(
1406 property_parser => $p
1408 - use CSS'DOM'Constants 'CSS_VALUE_LIST';
1409 + use CSS::DOM::Constants 'CSS_VALUE_LIST';
1410 is_deeply [map cssText $_, @{$s->getPropertyCSSValue('foo')}],[('foo')x2],
1411 'backtracking does not preserve existing captures';