| 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 | 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( :menu ); | ||
| 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->{_init_strict_use_sub} = 1; | ||
| 33 | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||
| 34 | $self->{tag} = 'menu' if( !CORE::length( "$self->{tag}" ) ); | ||
| 35 | return( $self ); | ||
| 36 | } | ||
| 37 | |||
| 38 | # Note: property compact is inherited | ||
| 39 | |||
| 40 | # Note: property label | ||
| 41 | sub label : lvalue { return( shift->_set_get_property( 'label', @_ ) ); } | ||
| 42 | |||
| 43 | # Note: property type is inherited | ||
| 44 | |||
| 45 | 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 |