File Coverage

lib/HTML/Object/DOM/Element/TableCol.pm
Criterion Covered Total %
statement 27 33 81.8
branch 2 4 50.0
condition 1 3 33.3
subroutine 9 15 60.0
pod 7 7 100.0
total 46 62 74.1


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableCol.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/01/08
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::TableCol;
15             BEGIN
16             {
17 2     2   1900 use strict;
  2         5  
  2         67  
18 2     2   10 use warnings;
  2         5  
  2         72  
19 2     2   12 use parent qw( HTML::Object::DOM::Element );
  2         5  
  2         13  
20 2     2   166 use vars qw( $VERSION );
  2         26  
  2         103  
21 2     2   12 use HTML::Object::DOM::Element::Shared qw( :tablecol );
  2         5  
  2         292  
22 2     2   57 our $VERSION = 'v0.2.0';
23             };
24              
25 2     2   14 use strict;
  2         3  
  2         53  
26 2     2   10 use warnings;
  2         9  
  2         620  
27              
28             sub init
29             {
30 1     1 1 81 my $self = shift( @_ );
31             # Can either be col or colgroup
32 1 50 33     164 $self->{tag} = 'colgroup' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) );
33 1         4 $self->{_init_strict_use_sub} = 1;
34 1 50       9 $self->SUPER::init( @_ ) || return( $self->pass_error );
35 1         5 return( $self );
36             }
37              
38             # Note: deprecated property align is inherited
39              
40             # Note: deprecated property ch
41 0     0 1   sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); }
42              
43             # Note: deprecated property chOff
44 0     0 1   sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); }
45              
46 0     0 1   sub choff : lvalue { return( shift->chOff( @_ ) ); }
47              
48             # Note: property span
49 0     0 1   sub span : lvalue { return( shift->_set_get_property( 'span', @_ ) ); }
50              
51             # Note: deprecated property vAlign
52 0     0 1   sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); }
53              
54 0     0 1   sub valign : lvalue { return( shift->vAlign( @_ ) ); }
55              
56             # Note: deprecated property width is inherited
57              
58             1;
59             # NOTE: POD
60             __END__
61              
62             =encoding utf-8
63              
64             =head1 NAME
65              
66             HTML::Object::DOM::Element::TableCol - HTML Object DOM TableCol Class
67              
68             =head1 SYNOPSIS
69              
70             use HTML::Object::DOM::Element::TableCol;
71             my $col = HTML::Object::DOM::Element::TableCol->new ||
72             die( HTML::Object::DOM::Element::TableCol->error, "\n" );
73              
74             =head1 VERSION
75              
76             v0.2.0
77              
78             =head1 DESCRIPTION
79              
80             This interface provides special properties (beyond the L<HTML::Object::DOM::Element> interface it also has available to it inheritance) for manipulating single or grouped table column elements using the C<colgroup> or C<col> HTML tag.
81              
82             The <colgroup> HTML element defines a group of columns within a table. The <col> HTML element defines a column within a table and is used for defining common semantics on all common cells. It is generally found within a <colgroup> element.
83              
84             <table>
85             <colgroup span="4">Countries information</colgroup>
86             <col>
87             <col class="economic">
88             <col span="2" class="people">
89             </colgroup>
90             <tr>
91             <th>Countries</th>
92             <th>Capitals</th>
93             <th>Population</th>
94             <th>Language</th>
95             </tr>
96             <tr>
97             <td>Japan</td>
98             <td>Tokyo</td>
99             <td>126 million</td>
100             <td>Japanese</td>
101             </tr>
102             <tr>
103             <td>Taiwan</td>
104             <td>Taipei</td>
105             <td>23 million</td>
106             <td>Traditional Chinese</td>
107             </tr>
108             </table>
109              
110             =head1 INHERITANCE
111              
112             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
113             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TableCol |
114             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
115              
116             =head1 PROPERTIES
117              
118             Inherits properties from its parent L<HTML::Object::DOM::Element>
119              
120             =head2 span
121              
122             Is an unsigned long that reflects the span HTML attribute, indicating the number of columns to apply this object's attributes to. Must be a positive integer.
123              
124             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/span>
125              
126             =head1 METHODS
127              
128             Inherits methods from its parent L<HTML::Object::DOM::Element>
129              
130             =head1 DEPRECATED PROPERTIES
131              
132             =head2 align
133              
134             Is a string that indicates the horizontal alignment of the cell data in the column.
135              
136             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/align>
137              
138             =head2 ch
139              
140             Is a string representing the alignment character for cell data.
141              
142             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/ch>
143              
144             =head2 chOff
145              
146             Is a string representing the offset for the alignment character.
147              
148             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/chOff>
149              
150             =head2 choff
151              
152             Alias for L</chOff>
153              
154             =head2 vAlign
155              
156             Is a string that indicates the vertical alignment of the cell data in the column.
157              
158             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/vAlign>
159              
160             =head2 valign
161              
162             Alias for L</vAlign>
163              
164             =head2 width
165              
166             Is a string representing the default column width.
167              
168             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/width>
169              
170             =head1 AUTHOR
171              
172             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
173              
174             =head1 SEE ALSO
175              
176             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement>, L<Mozilla documentation on tablecol element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/tablecol>
177              
178             =head1 COPYRIGHT & LICENSE
179              
180             Copyright(c) 2022 DEGUEST Pte. Ltd.
181              
182             All rights reserved
183              
184             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
185              
186             =cut