blib/lib/HTML/Object/DOM/Element/IFrame.pm untested

filter: Statementstmt 0.0% 0 / 55 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 4 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 15 totaltotal 0.0% 0 / 103 CC 4 SCAR 12.4
CC
4
Cov
0%
init
12.0
sandbox
6.0
BEGIN
2.0
CRAP 3.5
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/IFrame.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::IFrame;
15 BEGIN
16 {
17 use strict;
18 use warnings;
19 warnings::register_categories( 'HTML::Object' );
20 use parent qw( HTML::Object::DOM::Element );
21 use vars qw( $VERSION );
22 use HTML::Object::DOM::Element::Shared qw( :iframe );
23 our $VERSION = 'v0.2.0';
24 };
25  
26 use strict;
27 use warnings;
28  
29 sub init
30 {
31 my $self = shift( @_ );
32 $self->{allowfullscreen} = 0;
33 $self->{_init_strict_use_sub} = 1;
34 $self->SUPER::init( @_ ) || return( $self->pass_error );
35 $self->{tag} = 'iframe' if( !CORE::length( "$self->{tag}" ) );
36 $self->_set_get_internal_attribute_callback( sandbox => sub
37 {
38 my( $this, $val ) = @_;
39 my $list;
40 return if( !( $list = $this->{_sanbox_list} ) );
41 # $list->debug( $self->debug );
42 $list->update( $val );
43 });
44 return( $self );
45 }
46  
47 # Note: property attribute align inherited
48  
49 # Note: property attribute
50 sub allow : lvalue { return( shift->_set_get_property( 'allow', @_ ) ); }
51  
52 # Note: property
53 sub allowfullscreen : lvalue { return( shift->_set_get_boolean( 'allowfullscreen', @_ ) ); }
54  
55 # TODO: property; fetch remote content and return a HTML::Object::DOM::Document object
56 sub contentDocument { return; }
57  
58 # Note: property does nothing
59 sub contentWindow : lvalue { return( shift->_set_get_object_lvalue( 'contentwindow', 'HTML::Object::DOM::WindowProxy', @_ ) ); }
60  
61 # Note: property
62 sub csp : lvalue { return( shift->_set_get_property( 'csp', @_ ) ); }
63  
64 # Note: property
65 sub featurePolicy { return; }
66  
67 # Note: property
68 sub frameBorder : lvalue { return( shift->_set_get_property( 'frameborder', @_ ) ); }
69  
70 # Note: property height inherited
71  
72 # Note: property
73 sub longDesc : lvalue { return( shift->_set_get_property( 'longdesc', @_ ) ); }
74  
75 # Note: property
76 sub marginHeight : lvalue { return( shift->_set_get_property( 'marginheight', @_ ) ); }
77  
78 # Note: property
79 sub marginWidth : lvalue { return( shift->_set_get_property( 'marginwidth', @_ ) ); }
80  
81 # Note: property name inherited
82  
83 # Note: property referrerPolicy inherited
84  
85 # Note: property read-only
86 sub sandbox
87 {
88 my $self = shift( @_ );
89 unless( $self->{_sanbox_list} )
90 {
91 my $sandbox = $self->attr( 'sandbox' );
92 require HTML::Object::TokenList;
93 $self->{_sanbox_list} = HTML::Object::TokenList->new( $sandbox, element => $self, attribute => 'sandbox', debug => $self->debug ) ||
94 return( $self->pass_error( HTML::Object::TokenList->error ) );
95 }
96 return( $self->{_sanbox_list} );
97 }
98  
99 # Note: property
100 sub scrolling : lvalue { return( shift->_set_get_property( 'scrolling', @_ ) ); }
101  
102 # Note: property src inherited
103  
104 # Note: property
105 sub srcdoc : lvalue { return( shift->_set_get_property( 'srcdoc', @_ ) ); }
106  
107 # Note: property width inherited
108  
109 1;
110 # NOTE: POD
111 __END__