| 1 | ##---------------------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||||||
| 2 | ## HTML Object - ~/lib/HTML/Object/DOM/Element/TableSection.pm | ||||||||||||||||||||||||||||||||||||||
| 3 | ## Version v0.2.0 | ||||||||||||||||||||||||||||||||||||||
| 4 | ## Copyright(c) 2021 DEGUEST Pte. Ltd. | ||||||||||||||||||||||||||||||||||||||
| 5 | ## Author: Jacques Deguest <jack@deguest.jp> | ||||||||||||||||||||||||||||||||||||||
| 6 | ## Created 2021/12/23 | ||||||||||||||||||||||||||||||||||||||
| 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::TableSection; | ||||||||||||||||||||||||||||||||||||||
| 15 | BEGIN | ||||||||||||||||||||||||||||||||||||||
| 16 | 2 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 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' ); | |||||||||||||||||||||||||||||||||||||
| 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( :tablesection ); | ||||||||||||||||||||||||||||||||||||
|
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 | 6 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
init: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 31 | 6 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 32 | # could also be tbody o tfoot | ||||||||||||||||||||||||||||||||||||||
| 33 | 6 | ▶ | $self->{tag} = 'thead' 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 | 6 | $self->{_init_strict_use_sub} = 1; | |||||||||||||||||||||||||||||||||||||
| 35 | 6 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 36 | 6 | $self->{_section_reset} = 1; | |||||||||||||||||||||||||||||||||||||
| 37 | my $callback = sub | ||||||||||||||||||||||||||||||||||||||
| 38 | 15 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||
| 39 | 15 | my $def = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 40 | # Our children were modified from outside our package. | ||||||||||||||||||||||||||||||||||||||
| 41 | # We need to check if it affects our rows and reset the cache accordingly | ||||||||||||||||||||||||||||||||||||||
| 42 | 15 | ▶ | unless( $def->{caller}->[0] eq ref( $self ) || | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$def->{"caller"}[0] eq ref $self or $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
MC/DC100%2/2
$def->{"caller"}[0] eq ref $self or $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
$def->{"caller"}[0] eq ref $self
$def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
Truth table100%3/3
A or B
A= $def->{"caller"}[0] eq ref $selfB= $def->{"caller"}[0] eq "HTML::Object::DOM::Element::Table"
| |||||||||||||||||||||||||||||||||||||||
| 43 | $def->{caller}->[0] eq 'HTML::Object::DOM::Element::Table' ) | ||||||||||||||||||||||||||||||||||||||
| 44 | { | ||||||||||||||||||||||||||||||||||||||
| 45 | 13 | $self->reset(1); | |||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||
| 47 | 15 | return(1); | |||||||||||||||||||||||||||||||||||||
| 48 | 6 | }; | |||||||||||||||||||||||||||||||||||||
| 49 | 6 | $self->children->callback( add => $callback ); | |||||||||||||||||||||||||||||||||||||
| 50 | 6 | $self->children->callback( remove => $callback ); | |||||||||||||||||||||||||||||||||||||
| 51 | 6 | return( $self ); | |||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||
| 54 | # Note: deprecated property align is inherited | ||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||
| 56 | # Note: deprecated property ch | ||||||||||||||||||||||||||||||||||||||
| 57 | 0 | ▶ | sub ch : lvalue { return( shift->_set_get_property( 'ch', @_ ) ); } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
ch: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||
| 59 | # Note: deprecated property chOff | ||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | sub chOff : lvalue { return( shift->_set_get_property( 'choff', @_ ) ); } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
chOff: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||
| 62 | sub deleteRow | ||||||||||||||||||||||||||||||||||||||
| 63 | 0 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
deleteRow: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 64 | 0 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 65 | 0 | my $pos = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/5
defined $pos and $self->_is_integer($pos)
$pos // ""
MC/DC0%0/2
defined $pos and $self->_is_integer($pos)
defined $pos
$self->_is_integer($pos)
MC/DC0%0/1
$pos // ""
$pos
Truth table0%0/3
A and B
A= defined $posB= $self->_is_integer($pos)
Truth table0%0/2
A
A= $pos
| |||||||||||||||||||||||||||||||||||||||
| 67 | message => "Value provided (" . overload::StrVal( $pos // '' ) . ") is not an integer.", | ||||||||||||||||||||||||||||||||||||||
| 68 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 69 | }) ) if( !defined( $pos ) || !$self->_is_integer( $pos ) ); | ||||||||||||||||||||||||||||||||||||||
| 70 | 0 | my $rows = $self->rows; | |||||||||||||||||||||||||||||||||||||
| 71 | 0 | my $size = $rows->size; | |||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 73 | message => "Value provided ($pos) is greater than the zero-based number of rows available (" . $rows->size . ").", | ||||||||||||||||||||||||||||||||||||||
| 74 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 75 | }) ) if( $pos > $size ); | ||||||||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pos < 0 and abs $pos > $size
MC/DC0%0/2
$pos < 0 and abs $pos > $size
$pos < 0
abs $pos > $size
Truth table0%0/3
A and B
A= $pos < 0B= abs $pos > $size
| |||||||||||||||||||||||||||||||||||||||
| 77 | message => "Value provided ($pos) is lower than the zero-based number of rows available (" . $rows->size . "). If you want to specify a negative index, it must be between -1 and -${size}", | ||||||||||||||||||||||||||||||||||||||
| 78 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 79 | }) ) if( $pos < 0 && abs( $pos ) > $size ); | ||||||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | $pos = ( $rows->length + $pos ) if( $pos < 0 ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 81 | 0 | my $elem = $rows->index( $pos ); | |||||||||||||||||||||||||||||||||||||
| 82 | 0 | my $children = $self->children; | |||||||||||||||||||||||||||||||||||||
| 83 | 0 | my $kid_pos = $children->pos( $elem ); | |||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 85 | message => "Unable to find the row element among this table children!", | ||||||||||||||||||||||||||||||||||||||
| 86 | class => 'HTML::Object::HierarchyRequestError', | ||||||||||||||||||||||||||||||||||||||
| 87 | }) ) if( !defined( $kid_pos ) ); | ||||||||||||||||||||||||||||||||||||||
| 88 | 0 | $children->splice( $kid_pos, 1 ); | |||||||||||||||||||||||||||||||||||||
| 89 | 0 | $elem->parent( undef ); | |||||||||||||||||||||||||||||||||||||
| 90 | 0 | $self->reset(1); | |||||||||||||||||||||||||||||||||||||
| 91 | 0 | return( $elem ); | |||||||||||||||||||||||||||||||||||||
| 92 | } | ||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||
| 94 | sub insertRow | ||||||||||||||||||||||||||||||||||||||
| 95 | 1 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
insertRow: called CC=13 SCAR=40.5
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 96 | 1 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 97 | 1 | my $pos = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 98 | 1 | my $rows = $self->rows; | |||||||||||||||||||||||||||||||||||||
| 99 | 1 | my $size = $rows->size; | |||||||||||||||||||||||||||||||||||||
| 100 | 1 | ▶ | if( defined( $pos ) ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 101 | { | ||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$pos // ""
MC/DC0%0/1
$pos // ""
$pos
Truth table0%0/2
A
A= $pos
| |||||||||||||||||||||||||||||||||||||||
| 103 | message => "Value provided (" . overload::StrVal( $pos // '' ) . ") is not an integer.", | ||||||||||||||||||||||||||||||||||||||
| 104 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 105 | }) ) if( !$self->_is_integer( $pos ) ); | ||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 107 | message => "Value provided ($pos) is greater than the zero-based number of rows available (" . $rows->size . ").", | ||||||||||||||||||||||||||||||||||||||
| 108 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 109 | }) ) if( $pos > $size ); | ||||||||||||||||||||||||||||||||||||||
| 110 | 0 | ▶ | return( $self->error({ | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pos < 0 and abs $pos > $size
MC/DC0%0/2
$pos < 0 and abs $pos > $size
$pos < 0
abs $pos > $size
Truth table0%0/3
A and B
A= $pos < 0B= abs $pos > $size
| |||||||||||||||||||||||||||||||||||||||
| 111 | message => "Value provided ($pos) is lower than the zero-based number of rows available (" . $rows->size . "). If you want to specify a negative index, it must be between -1 and -${size}", | ||||||||||||||||||||||||||||||||||||||
| 112 | class => 'HTML::Object::IndexSizeError', | ||||||||||||||||||||||||||||||||||||||
| 113 | }) ) if( $pos < 0 && abs( $pos ) > $size ); | ||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | $pos = ( $rows->length + $pos ) if( $pos < 0 ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||||||
| 116 | 1 | ▶ | $self->_load_class( 'HTML::Object::DOM::Element::TableRow' ) || return( $self->pass_error ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 117 | 1 | my $children = $self->children; | |||||||||||||||||||||||||||||||||||||
| 118 | 1 | ▶ | my $row = HTML::Object::DOM::Element::TableRow->new( @_ ) || | ||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
'HTML::Object::DOM::Element::TableRow'->new(@_) || (return $self->pass_error('HTML::Object::DOM::Element::TableRow'->error))
MC/DC0%0/1
'HTML::Object::DOM::Element::TableRow'->new(@_) || (return $self->pass_error('HTML::Object::DOM::Element::TableRow'->error))
'HTML::Object::DOM::Element::TableRow'->new(@_)
Truth table50%1/2
A
A= 'HTML::Object::DOM::Element::TableRow'->new(@_)
| |||||||||||||||||||||||||||||||||||||||
| 119 | return( $self->pass_error( HTML::Object::DOM::Element::TableRow->error ) ); | ||||||||||||||||||||||||||||||||||||||
| 120 | 1 | $row->close; | |||||||||||||||||||||||||||||||||||||
| 121 | # A position was provided | ||||||||||||||||||||||||||||||||||||||
| 122 | 1 | ▶ | if( defined( $pos ) ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 123 | { | ||||||||||||||||||||||||||||||||||||||
| 124 | # ..., but there are no rows yet | ||||||||||||||||||||||||||||||||||||||
| 125 | 0 | ▶ | if( $rows->is_empty ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 126 | { | ||||||||||||||||||||||||||||||||||||||
| 127 | 0 | $children->push( $row ); | |||||||||||||||||||||||||||||||||||||
| 128 | } | ||||||||||||||||||||||||||||||||||||||
| 129 | else | ||||||||||||||||||||||||||||||||||||||
| 130 | { | ||||||||||||||||||||||||||||||||||||||
| 131 | 0 | my $elem = $rows->index( $pos ); | |||||||||||||||||||||||||||||||||||||
| 132 | 0 | my $kid_pos = $children->pos( $elem ); | |||||||||||||||||||||||||||||||||||||
| 133 | 0 | ▶ | if( !defined( $kid_pos ) ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 134 | { | ||||||||||||||||||||||||||||||||||||||
| 135 | 0 | return( $self->error({ | |||||||||||||||||||||||||||||||||||||
| 136 | message => "Could not find a value at offset $pos (translated to $kid_pos among the table children) amazingly enough.", | ||||||||||||||||||||||||||||||||||||||
| 137 | class => 'HTML::Object::HierarchyRequestError', | ||||||||||||||||||||||||||||||||||||||
| 138 | }) ); | ||||||||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||||||
| 140 | 0 | $children->splice( $kid_pos, 0, $row ); | |||||||||||||||||||||||||||||||||||||
| 141 | } | ||||||||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||||||||
| 143 | # otherwise, there are already other rows directly under <table> and the new row is just added at the end of the table, even if there is a <tfoot> element. | ||||||||||||||||||||||||||||||||||||||
| 144 | else | ||||||||||||||||||||||||||||||||||||||
| 145 | { | ||||||||||||||||||||||||||||||||||||||
| 146 | 1 | $children->push( $row ); | |||||||||||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||||||||||||
| 148 | 1 | $row->parent( $self ); | |||||||||||||||||||||||||||||||||||||
| 149 | 1 | $self->reset(1); | |||||||||||||||||||||||||||||||||||||
| 150 | 1 | return( $row ); | |||||||||||||||||||||||||||||||||||||
| 151 | } | ||||||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||||||
| 153 | sub reset | ||||||||||||||||||||||||||||||||||||||
| 154 | 343 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
reset: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 155 | 343 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 156 | 343 | ▶ | if( scalar( @_ ) ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 157 | { | ||||||||||||||||||||||||||||||||||||||
| 158 | 63 | $self->_reset_section; | |||||||||||||||||||||||||||||||||||||
| 159 | 63 | return( $self->SUPER::reset( @_ ) ); | |||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||
| 161 | 280 | return( $self ); | |||||||||||||||||||||||||||||||||||||
| 162 | } | ||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||
| 164 | # Note: property rows read-only | ||||||||||||||||||||||||||||||||||||||
| 165 | sub rows | ||||||||||||||||||||||||||||||||||||||
| 166 | 153 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
rows: called CC=6 SCAR=18.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 167 | 153 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 168 | 153 | ▶ | return( $self->{_section_rows} ) if( $self->{_section_rows} && !$self->_is_section_reset ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->{"_section_rows"} and not $self->_is_section_reset
MC/DC100%2/2
$self->{"_section_rows"} and not $self->_is_section_reset
$self->{"_section_rows"}
not $self->_is_section_reset
Truth table100%3/3
A and not(B)
A= $self->{"_section_rows"}B= not $self->_is_section_reset
| |||||||||||||||||||||||||||||||||||||||
| 169 | 113 | ▶ | my $list = $self->children->grep(sub{ $self->_is_a( $_ => 'HTML::Object::DOM::Element::TableRow' ) }); | ||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 170 | 113 | ▶ | unless( $self->{_section_rows} ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 171 | { | ||||||||||||||||||||||||||||||||||||||
| 172 | 6 | ▶ | $self->_load_class( 'HTML::Object::DOM::Collection' ) || return( $self->pass_error ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 173 | 6 | ▶ | $self->{_section_rows} = HTML::Object::DOM::Collection->new || | ||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
'HTML::Object::DOM::Collection'->new || (return $self->pass_error('HTML::Object::DOM::Collection'->error))
MC/DC0%0/1
'HTML::Object::DOM::Collection'->new || (return $self->pass_error('HTML::Object::DOM::Collection'->error))
'HTML::Object::DOM::Collection'->new
Truth table50%1/2
A
A= 'HTML::Object::DOM::Collection'->new
| |||||||||||||||||||||||||||||||||||||||
| 174 | return( $self->pass_error( HTML::Object::DOM::Collection->error ) ); | ||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||
| 176 | 113 | $self->{_section_rows}->set( $list ); | |||||||||||||||||||||||||||||||||||||
| 177 | 113 | $self->_remove_section_reset; | |||||||||||||||||||||||||||||||||||||
| 178 | 113 | return( $self->{_section_rows} ); | |||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||
| 180 | |||||||||||||||||||||||||||||||||||||||
| 181 | # Note: deprecated property vAlign | ||||||||||||||||||||||||||||||||||||||
| 182 | 0 | ▶ | sub vAlign : lvalue { return( shift->_set_get_property( 'valign', @_ ) ); } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
vAlign: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||
| 183 | |||||||||||||||||||||||||||||||||||||||
| 184 | 147 | ▶ | sub _is_section_reset { return( CORE::length( shift->{_section_reset} ) ); } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_is_section_reset: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||
| 186 | 113 | ▶ | sub _remove_section_reset { return( CORE::delete( shift->{_section_reset} ) ); } | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_remove_section_reset: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||
| 187 | |||||||||||||||||||||||||||||||||||||||
| 188 | sub _reset_section | ||||||||||||||||||||||||||||||||||||||
| 189 | 113 | ▶ | { | ||||||||||||||||||||||||||||||||||||
|
Subroutine
_reset_section: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||||||||||||
| 190 | 113 | my $self = shift( @_ ); | |||||||||||||||||||||||||||||||||||||
| 191 | 113 | $self->{_section_reset}++; | |||||||||||||||||||||||||||||||||||||
| 192 | # Force cells object update | ||||||||||||||||||||||||||||||||||||||
| 193 | 113 | $self->rows; | |||||||||||||||||||||||||||||||||||||
| 194 | 113 | ▶ | if( my $parent = $self->parent ) | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 195 | { | ||||||||||||||||||||||||||||||||||||||
| 196 | 86 | ▶ | $parent->_reset_table( $self->{tag} ) if( $parent->can( '_reset_table' ) ); | ||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||
| 197 | } | ||||||||||||||||||||||||||||||||||||||
| 198 | 113 | return( $self ); | |||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||
| 201 | 2 | 1; | |||||||||||||||||||||||||||||||||||||
| 202 | # NOTE: POD | ||||||||||||||||||||||||||||||||||||||
| 203 | __END__ | ||||||||||||||||||||||||||||||||||||||