lib/HTML/Object/DOM/Element/Menu.pm

filter: Statementstmt 80.0% 24 / 30 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 8 / 10 Podpod 100% 2 / 2 totaltotal 73.9% 34 / 46 CC 3 SCAR 13.4
CC
3
Cov
71%
init
12.0
label
2.0
BEGIN
1.0
CRAP 3.8
« lib/HTML/Object/DOM/Element/Map.pm ↑ Summary lib/HTML/Object/DOM/Element/OptGroup.pm »
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Element/Menu.pm
3 ## Version v0.2.0
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2022/01/06
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::Menu;
15 BEGIN
16 {
17 1 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ use HTML::Object::DOM::Element::Shared qw( :menu );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 our $VERSION = 'v0.2.0';
24 };
25  
26 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=3 SCAR=24.8
Pod documented
32 0 $self->{_init_strict_use_sub} = 1;
33 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
34 0 ▶ $self->{tag} = 'menu' if( !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless length qq[$self->{"tag"}] 0 0 0
35 0 return( $self );
36 }
37  
38 # Note: property compact is inherited
39  
40 # Note: property label
41 0 ▶sub label : lvalue { return( shift->_set_get_property( 'label', @_ ) ); }
Subroutine label: not called CC=1 SCAR=6.9
Pod documented
42  
43 # Note: property type is inherited
44  
45 1 1;
46 # NOTE: POD
47 __END__
48  
49 =encoding utf-8
50  
51 =head1 NAME
52  
53 HTML::Object::DOM::Element::Menu - HTML Object DOM Menu Class
54  
55 =head1 SYNOPSIS
56  
57 use HTML::Object::DOM::Element::Menu;
58 my $menu = HTML::Object::DOM::Element::Menu->new ||
59 die( HTML::Object::DOM::Element::Menu->error, "\n" );
60  
61 =head1 VERSION
62  
63 v0.2.0
64  
65 =head1 DESCRIPTION
66  
67 Experimental: This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
68  
69 =head1 INHERITANCE
70  
71 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
72 | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Menu |
73 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
74  
75 =head1 PROPERTIES
76  
77 Inherits properties from its parent L<HTML::Object::DOM::Element>
78  
79 =head2 compact
80  
81 A Boolean value determining if the menu displays in a compact way.
82  
83 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement/compact>
84  
85 =head2 label
86  
87 A string associating the menu with a name,
88 displayed when the menu is used as a context menu.
89 This use of the <menu> element has never been implemented widely
90 and is now deprecated.
91  
92 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement/label>
93  
94 =head2 type
95  
96 Returns context if the menu is a context menu.
97 This use of the <menu> element has never been implemented widely
98 and is now deprecated.
99  
100 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement/type>
101  
102 =head1 METHODS
103  
104 Inherits methods from its parent L<HTML::Object::DOM::Element>
105  
106 =head1 AUTHOR
107  
108 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
109  
110 =head1 SEE ALSO
111  
112 L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMenuElement>, L<Mozilla documentation on menu element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/menu>
113  
114 =head1 COPYRIGHT & LICENSE
115  
116 Copyright(c) 2022 DEGUEST Pte. Ltd.
117  
118 All rights reserved
119  
120 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
121  
122 =cut
« lib/HTML/Object/DOM/Element/Map.pm ↑ Summary lib/HTML/Object/DOM/Element/OptGroup.pm »