File Coverage

lib/HTML/Object/DOM/Element/Menu.pm
Criterion Covered Total %
statement 22 28 78.5
branch 0 4 0.0
condition n/a
subroutine 8 10 80.0
pod 2 2 100.0
total 32 44 72.7


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