| 1 | ##---------------------------------------------------------------------------- | ||||||||||||
| 2 | ## HTML Object - ~/lib/HTML/Object/DOM/Element/Output.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::Output; | ||||||||||||
| 15 | BEGIN | ||||||||||||
| 16 | { | ||||||||||||
| 17 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 3 | ▶ | warnings::register_categories( 'HTML::Object' ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 3 | ▶ | use parent qw( HTML::Object::DOM::Element ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | 3 | ▶ | use vars qw( $VERSION ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | 3 | ▶ | use HTML::Object::DOM::Element::Shared qw( :output ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 23 | 3 | our $VERSION = 'v0.2.0'; | |||||||||||
| 24 | }; | ||||||||||||
| 25 | |||||||||||||
| 26 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 27 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | |||||||||||||
| 29 | sub init | ||||||||||||
| 30 | { | ||||||||||||
| 31 | 2 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
init: called CC=3 SCAR=13.3
Pod
documented
| |||||||||||||
| 32 | 2 | $self->{defaultvalue} = undef; | |||||||||||
| 33 | 2 | $self->{_init_strict_use_sub} = 1; | |||||||||||
| 34 | 2 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 35 | 2 | ▶ | $self->{tag} = 'output' if( !CORE::length( "$self->{tag}" ) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 36 | 2 | $self->{type} = 'output'; | |||||||||||
| 37 | $self->_set_get_internal_attribute_callback( 'for' => sub | ||||||||||||
| 38 | { | ||||||||||||
| 39 | 0 | ▶ | my( $this, $val ) = @_; | ||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||
| 40 | 0 | my $list; | |||||||||||
| 41 | 0 | ▶ | return if( !( $list = $this->{_for_list} ) ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 42 | # $list->debug( $self->debug ); | ||||||||||||
| 43 | 0 | $list->update( $val ); | |||||||||||
| 44 | 2 | }); | |||||||||||
| 45 | 2 | return( $self ); | |||||||||||
| 46 | } | ||||||||||||
| 47 | |||||||||||||
| 48 | # Note: method checkValidity inherited | ||||||||||||
| 49 | |||||||||||||
| 50 | # Note: property defaultValue | ||||||||||||
| 51 | 0 | ▶ | sub defaultValue : lvalue { return( shift->_set_get_property( 'defaultvalue', @_ ) ); } | ||||||||||
|
Subroutine
defaultValue: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 52 | |||||||||||||
| 53 | # Note: property form read-only inherited | ||||||||||||
| 54 | |||||||||||||
| 55 | # Note: property htmlFor read-only | ||||||||||||
| 56 | sub htmlFor | ||||||||||||
| 57 | { | ||||||||||||
| 58 | 0 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
htmlFor: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 59 | 0 | ▶ | unless( $self->{_for_list} ) | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 60 | { | ||||||||||||
| 61 | 0 | my $for = $self->attr( 'for' ); | |||||||||||
| 62 | 0 | require HTML::Object::TokenList; | |||||||||||
| 63 | 0 | ▶ | $self->{_for_list} = HTML::Object::TokenList->new( $for, element => $self, attribute => 'for', debug => $self->debug ) || | ||||||||||
|
Condition0%0/2
'HTML::Object::TokenList'->new($for, 'element', $self, 'attribute', 'for', 'debug', $self->debug) || (return $self->pass_error('HTML::Object::TokenList'->error))
MC/DC0%0/1
'HTML::Object::TokenList'->new($for, 'element', $self, 'attribute', 'for', 'debug', $self->debug) || (return $self->pass_error('HTML::Object::TokenList'->error))
'HTML::Object::TokenList'->new($for, 'element', $self, 'attribute', 'for', 'debug', $self->debug)
Truth table0%0/2
A
A= 'HTML::Object::TokenList'->new($for, 'element', $self, 'attribute', 'for', 'debug', $self->debug)
| |||||||||||||
| 64 | return( $self->pass_error( HTML::Object::TokenList->error ) ); | ||||||||||||
| 65 | } | ||||||||||||
| 66 | 0 | return( $self->{_for_list} ); | |||||||||||
| 67 | } | ||||||||||||
| 68 | |||||||||||||
| 69 | # Note: property labels read-only inherited | ||||||||||||
| 70 | |||||||||||||
| 71 | # Note: property name inherited | ||||||||||||
| 72 | |||||||||||||
| 73 | # Note: method reportValidity inherited | ||||||||||||
| 74 | |||||||||||||
| 75 | # Note: method setCustomValidity inherited | ||||||||||||
| 76 | |||||||||||||
| 77 | # Note: property type read-only inherited | ||||||||||||
| 78 | |||||||||||||
| 79 | # Note: property validationMessage read-only inherited | ||||||||||||
| 80 | |||||||||||||
| 81 | # Note: property validity read-only inherited | ||||||||||||
| 82 | |||||||||||||
| 83 | # Note: property value | ||||||||||||
| 84 | { | ||||||||||||
| 85 | 3 | ▶ | no warnings 'redefine'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 86 | 1 | ▶ | sub value : lvalue { return( shift->textContent( @_ ) ); } | ||||||||||
|
Subroutine
value: called CC=1 SCAR=0.0
| |||||||||||||
| 87 | } | ||||||||||||
| 88 | |||||||||||||
| 89 | # Note: property willValidate read-only inherited | ||||||||||||
| 90 | |||||||||||||
| 91 | 3 | 1; | |||||||||||
| 92 | # NOTE: POD | ||||||||||||
| 93 | __END__ | ||||||||||||