| 1 | package HTML::DOM::Implementation; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 29 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 29 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 29 | our $VERSION = '0.057'; | |||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 29 | our $it = bless do{\my$x}; | |||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 29 | my %features = ( | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | html => { '1.0' => 1, '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 12 | core => { '1.0' => 1, '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 13 | events => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | uievents => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 15 | mouseevents => { '2.0' => 1}, | ||||||||||||||||||||||||||||||||||||||||||||||
| 16 | mutationevents => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | htmlevents => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | views => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | # stylesheets => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 20 | # css => { '2.0' => 1 }, | ||||||||||||||||||||||||||||||||||||||||||||||
| 21 | ); | ||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | sub hasFeature { | ||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 24 | ▶ | my($feature,$v) = (lc $_[1], $_[2]); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
hasFeature: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | exists $features{$feature} | ||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 24 | ▶ | ? !defined $v || exists $features{$feature}{$v} | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition83%5/6
not defined $v or exists $features{$feature}{$v}
$feature =~ /^(?:stylesheets|css2?)\z/ and require CSS::DOM, "CSS::DOM"->hasFeature(@_[1 .. $#_])
MC/DC100%2/2
not defined $v or exists $features{$feature}{$v}
not defined $v
exists $features{$feature}{$v}
MC/DC50%1/2
$feature =~ /^(?:stylesheets|css2?)\z/ and require CSS::DOM, "CSS::DOM"->hasFeature(@_[1 .. $#_])
$feature =~ /^(?:stylesheets|css2?)\z/
require CSS::DOM, "CSS::DOM"->hasFeature(@_[1 .. $#_])
Truth table100%3/3
not(A) or B
A= not defined $vB= exists $features{$feature}{$v}
Truth table66%2/3
A and B
A= $feature =~ /^(?:stylesheets|css2?)\z/B= require CSS::DOM, "CSS::DOM"->hasFeature(@_[1 .. $#_])
| |||||||||||||||||||||||||||||||||||||||||||||||
| 27 | : $feature =~ /^(?:stylesheets|css2?)\z/ | ||||||||||||||||||||||||||||||||||||||||||||||
| 28 | && (require CSS::DOM, CSS::DOM->hasFeature(@_[1..$#_])); | ||||||||||||||||||||||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||||||||||||||||||||
| 31 | # ~~~ documentation, please! | ||||||||||||||||||||||||||||||||||||||||||||||
| 32 | # ~~~ not until I actually decide this should be here. | ||||||||||||||||||||||||||||||||||||||||||||||
| 33 | sub add_feature { # feature, version | ||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | ▶ | $features{$_[1]}{$_[2]}++; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
add_feature: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 29 | 1 | |||||||||||||||||||||||||||||||||||||||||||||
| 38 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||