| 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 | ▶ | 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( :tablecol ); | ||||||||||||||||||||||||||
|
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 | 1 | ▶ | my $self = shift( @_ ); | ||||||||||||||||||||||||||
|
Subroutine
init: called CC=4 SCAR=15.2
Pod
documented
| |||||||||||||||||||||||||||||
| 32 | # Can either be col or colgroup | ||||||||||||||||||||||||||||
| 33 | 1 | ▶ | $self->{tag} = 'colgroup' if( !defined( $self->{tag} ) || !CORE::length( "$self->{tag}" ) ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
defined $self->{"tag"} and length qq[$self->{"tag"}]
MC/DC0%0/2
defined $self->{"tag"} and length qq[$self->{"tag"}]
defined $self->{"tag"}
length qq[$self->{"tag"}]
Truth table33%1/3
A and B
A= defined $self->{"tag"}B= length qq[$self->{"tag"}]
| |||||||||||||||||||||||||||||
| 34 | 1 | $self->{_init_strict_use_sub} = 1; | |||||||||||||||||||||||||||
| 35 | 1 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | 1 | return( $self ); | |||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | # Note: deprecated property align is inherited | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | # Note: deprecated property ch | ||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
ch: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | # Note: deprecated property chOff | ||||||||||||||||||||||||||||
| 45 | 0 | ▶ | sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
chOff: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | ▶ | sub choff : lvalue { return( shift->chOff( @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
choff: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||
| 49 | # Note: property span | ||||||||||||||||||||||||||||
| 50 | 0 | ▶ | sub span : lvalue { return( shift->_set_get_property( 'span', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
span: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | # Note: deprecated property vAlign | ||||||||||||||||||||||||||||
| 53 | 0 | ▶ | sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
vAlign: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||
| 55 | 0 | ▶ | sub valign : lvalue { return( shift->vAlign( @_ ) ); } | ||||||||||||||||||||||||||
|
Subroutine
valign: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | # Note: deprecated property width is inherited | ||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||
| 59 | 2 | 1; | |||||||||||||||||||||||||||
| 60 | # NOTE: POD | ||||||||||||||||||||||||||||
| 61 | __END__ | ||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||
| 63 | =encoding utf-8 | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | =head1 NAME | ||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||
| 67 | HTML::Object::DOM::Element::TableCol - HTML Object DOM TableCol Class | ||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||
| 69 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||
| 71 | use HTML::Object::DOM::Element::TableCol; | ||||||||||||||||||||||||||||
| 72 | my $col = HTML::Object::DOM::Element::TableCol->new || | ||||||||||||||||||||||||||||
| 73 | die( HTML::Object::DOM::Element::TableCol->error, "\n" ); | ||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||
| 75 | =head1 VERSION | ||||||||||||||||||||||||||||
| 76 | |||||||||||||||||||||||||||||
| 77 | v0.2.0 | ||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||
| 81 | 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. | ||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||
| 83 | 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. | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | <table> | ||||||||||||||||||||||||||||
| 86 | <colgroup span="4">Countries information</colgroup> | ||||||||||||||||||||||||||||
| 87 | <col> | ||||||||||||||||||||||||||||
| 88 | <col class="economic"> | ||||||||||||||||||||||||||||
| 89 | <col span="2" class="people"> | ||||||||||||||||||||||||||||
| 90 | </colgroup> | ||||||||||||||||||||||||||||
| 91 | <tr> | ||||||||||||||||||||||||||||
| 92 | <th>Countries</th> | ||||||||||||||||||||||||||||
| 93 | <th>Capitals</th> | ||||||||||||||||||||||||||||
| 94 | <th>Population</th> | ||||||||||||||||||||||||||||
| 95 | <th>Language</th> | ||||||||||||||||||||||||||||
| 96 | </tr> | ||||||||||||||||||||||||||||
| 97 | <tr> | ||||||||||||||||||||||||||||
| 98 | <td>Japan</td> | ||||||||||||||||||||||||||||
| 99 | <td>Tokyo</td> | ||||||||||||||||||||||||||||
| 100 | <td>126 million</td> | ||||||||||||||||||||||||||||
| 101 | <td>Japanese</td> | ||||||||||||||||||||||||||||
| 102 | </tr> | ||||||||||||||||||||||||||||
| 103 | <tr> | ||||||||||||||||||||||||||||
| 104 | <td>Taiwan</td> | ||||||||||||||||||||||||||||
| 105 | <td>Taipei</td> | ||||||||||||||||||||||||||||
| 106 | <td>23 million</td> | ||||||||||||||||||||||||||||
| 107 | <td>Traditional Chinese</td> | ||||||||||||||||||||||||||||
| 108 | </tr> | ||||||||||||||||||||||||||||
| 109 | </table> | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | =head1 INHERITANCE | ||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||
| 113 | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+ | ||||||||||||||||||||||||||||
| 114 | | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TableCol | | ||||||||||||||||||||||||||||
| 115 | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+ | ||||||||||||||||||||||||||||
| 116 | |||||||||||||||||||||||||||||
| 117 | =head1 PROPERTIES | ||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | Inherits properties from its parent L<HTML::Object::DOM::Element> | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | =head2 span | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | 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. | ||||||||||||||||||||||||||||
| 124 | |||||||||||||||||||||||||||||
| 125 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/span> | ||||||||||||||||||||||||||||
| 126 | |||||||||||||||||||||||||||||
| 127 | =head1 METHODS | ||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | Inherits methods from its parent L<HTML::Object::DOM::Element> | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | =head1 DEPRECATED PROPERTIES | ||||||||||||||||||||||||||||
| 132 | |||||||||||||||||||||||||||||
| 133 | =head2 align | ||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||
| 135 | Is a string that indicates the horizontal alignment of the cell data in the column. | ||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||
| 137 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/align> | ||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||
| 139 | =head2 ch | ||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||
| 141 | Is a string representing the alignment character for cell data. | ||||||||||||||||||||||||||||
| 142 | |||||||||||||||||||||||||||||
| 143 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/ch> | ||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||
| 145 | =head2 chOff | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | Is a string representing the offset for the alignment character. | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/chOff> | ||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||
| 151 | =head2 choff | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | Alias for L</chOff> | ||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||
| 155 | =head2 vAlign | ||||||||||||||||||||||||||||
| 156 | |||||||||||||||||||||||||||||
| 157 | Is a string that indicates the vertical alignment of the cell data in the column. | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/vAlign> | ||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||
| 161 | =head2 valign | ||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | Alias for L</vAlign> | ||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | =head2 width | ||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||
| 167 | Is a string representing the default column width. | ||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||
| 169 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLTableColElement/width> | ||||||||||||||||||||||||||||
| 170 | |||||||||||||||||||||||||||||
| 171 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||
| 173 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||||||||||||||||||||||||||||
| 174 | |||||||||||||||||||||||||||||
| 175 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||
| 177 | 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> | ||||||||||||||||||||||||||||
| 178 | |||||||||||||||||||||||||||||
| 179 | =head1 COPYRIGHT & LICENSE | ||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||
| 181 | Copyright(c) 2022 DEGUEST Pte. Ltd. | ||||||||||||||||||||||||||||
| 182 | |||||||||||||||||||||||||||||
| 183 | All rights reserved | ||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||
| 185 | This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||
| 187 | =cut | ||||||||||||||||||||||||||||