lib/HTML/Object/DOM/Element/TableCaption.pm

filter: Statementstmt 100% 29 / 29 Branchbran 75.0% 3 / 4 Conditioncond 66.6% 2 / 3 MC/DCmcdc 50.0% 1 / 2 Subroutinesub 100% 9 / 9 Podpod 100% 1 / 1 totaltotal 93.7% 45 / 48 CC 4 SCAR 7.1
CC
4
Cov
94%
init
4.1
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« lib/HTML/Object/DOM/VTTRegion.pm ↑ Summary blib/lib/HTML/Object/DOM/Element/HTML.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableCaption.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/01/06
7 ## Modified 2022/09/18
8 ## All rights reserved
9 ##
10 ##
11 ## This program is free software; you can redistribute it and/or modify it
12 ## under the same terms as Perl itself.
13 ##----------------------------------------------------------------------------
14 package HTML::Object::DOM::Element::TableCaption;
15 BEGIN
16 {
17 2 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 2 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 2 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 2 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 2 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 2 ▶ use HTML::Object::DOM::Element::Shared qw( :tablecaption );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 2 our $VERSION = 'v0.2.0';
24 };
25  
26 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 2 ▶ my $self = shift( @_ );
Subroutine init: called CC=4 SCAR=14.0
Pod documented
32 2 $self->{_init_strict_use_sub} = 1;
33 2 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 2 2
34 2 ▶ $self->{tag} = 'caption' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{"tag"} and length qq[$self->{"tag"}] 1 1 2
Condition66%2/3
defined $self->{"tag"} and length qq[$self->{"tag"}]
!ll&&!rl&&r
011
MC/DC50%1/2
defined $self->{"tag"} and length qq[$self->{"tag"}]
defined $self->{"tag"} length qq[$self->{"tag"}]
Truth table66%2/3
A and B
A= defined $self->{"tag"}B= length qq[$self->{"tag"}]
ABresult
0X0
100
111
35 2 return( $self );
36 }
37  
38 # Note: deprecated property align is inherited
39  
40 2 1;
41 # NOTE: POD
42 __END__
43  
44 =encoding utf-8
45  
46 =head1 NAME
47  
48 HTML::Object::DOM::Element::TableCaption - HTML Object DOM TableCaption Class
49  
50 =head1 SYNOPSIS
51  
52 use HTML::Object::DOM::Element::TableCaption;
53 my $caption = HTML::Object::DOM::Element::TableCaption->new ||
54 die( HTML::Object::DOM::Element::TableCaption->error, "\n" );
55  
56 =head1 VERSION
57  
58 v0.2.0
59  
60 =head1 DESCRIPTION
61  
62 This interface special properties (beyond the regular L<HTML::Object::DOM::Element> interface it also has available to it by inheritance) for manipulating table C<caption> elements.
63  
64 =head1 INHERITANCE
65  
66 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------------+
67 | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TableCaption |
68 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------------+
69  
70 =head1 PROPERTIES
71  
72 Inherits properties from its parent L<HTML::Object::DOM::Element>
73  
74 =head1 METHODS
75  
76 Inherits methods from its parent L<HTML::Object::DOM::Element>
77  
78 =head1 EXAMPLE
79  
80 <table>
81 <caption>Example Caption</caption>
82 <tr>
83 <th>Login</th>
84 <th>Email</th>
85 </tr>
86 <tr>
87 <td>user1</td>
88 <td>user1@sample.com</td>
89 </tr>
90 <tr>
91 <td>user2</td>
92 <td>user2@sample.com</td>
93 </tr>
94 </table>
95  
96 =head1 DEPRECATED PROPERTIES
97  
98 =head2 align
99  
100 Is a string which represents an enumerated attribute indicating alignment of the caption with respect to the table. It may have one of the following values:
101  
102 =over 4
103  
104 =item left
105  
106 The caption is displayed to the left of the table.
107  
108 =item top
109  
110 The caption is displayed above the table.
111  
112 =item right
113  
114 The caption is displayed to the right of the table.
115  
116 =item bottom
117  
118 The caption is displayed below the table.
119  
120 =back
121  
122 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCaptionElement/align>
123  
124 =head1 AUTHOR
125  
126 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
127  
128 =head1 SEE ALSO
129  
130 L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableCaptionElement>, L<Mozilla documentation on tablecaption element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tablecaption>, L<Specifications|https://html.spec.whatwg.org/multipage/tables.html#htmltablecaptionelement>
131  
132 =head1 COPYRIGHT & LICENSE
133  
134 Copyright(c) 2022 DEGUEST Pte. Ltd.
135  
136 All rights reserved
137  
138 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
139  
140 =cut
« lib/HTML/Object/DOM/VTTRegion.pm ↑ Summary blib/lib/HTML/Object/DOM/Element/HTML.pm »