File Coverage

blib/lib/HTML/DOM/Comment.pm
Criterion Covered Total %
statement 16 17 94.1
branch 0 2 0.0
condition 2 6 33.3
subroutine 7 8 87.5
pod 3 5 60.0
total 28 38 73.6


line stmt bran cond sub pod time code
1             package HTML::DOM::Comment;
2              
3 25     25   14136 use warnings;
  25         27  
  25         661  
4 25     25   82 use strict;
  25         27  
  25         408  
5              
6 25     25   459 use HTML::DOM::Node 'COMMENT_NODE';
  25         30  
  25         4474  
7              
8             require HTML::DOM::CharacterData;
9              
10             our @ISA = 'HTML::DOM::CharacterData';
11             our $VERSION = '0.057';
12              
13             sub new { # $_[1] contains the text
14 15     15 0 72329 $_[0]->SUPER::new('~comment', text => $_[1]);
15             }
16              
17             # ---------------- NODE METHODS ---------- #
18              
19 5     5 1 526 sub nodeName { '#comment' }
20             *nodeType = \&COMMENT_NODE;
21              
22             # ---------------- OVERRIDDEN HTML::Element METHODS ---------- #
23              
24 4     4 1 25 sub starttag { sprintf "", shift->data }
25 0     0 1 0 sub endtag { '' }
26              
27             sub isa { # Lie to HTML::Element 4
28 9 0 33 9 0 182 caller eq 'HTML::Element' && VERSION HTML::Element >= 4
      33        
29             and $_[1] eq 'HTML::DOM::Element' and return 1;
30 9         13 goto &{;can{$_[0]}"SUPER::isa"};
  9         11  
  9         139  
31             }
32              
33             1
34             __END__