File Coverage

lib/HTML/Object/DOM/Element/Meter.pm
Criterion Covered Total %
statement 22 30 73.3
branch 0 4 0.0
condition n/a
subroutine 8 12 66.6
pod 4 4 100.0
total 34 50 68.0


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Element/Meter.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2022/01/10
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::Meter;
15             BEGIN
16             {
17 1     1   1002 use strict;
  1         8  
  1         39  
18 1     1   8 use warnings;
  1         1  
  1         27  
19 1     1   21 use parent qw( HTML::Object::DOM::Element );
  1         3  
  1         5  
20 1     1   73 use vars qw( $VERSION );
  1         17  
  1         54  
21 1     1   11 use HTML::Object::DOM::Element::Shared qw( :meter );
  1         3  
  1         132  
22 1     1   18 our $VERSION = 'v0.2.0';
23             };
24              
25 1     1   6 use strict;
  1         5  
  1         21  
26 1     1   5 use warnings;
  1         2  
  1         200  
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} = 'meter' if( !CORE::length( "$self->{tag}" ) );
34 0           return( $self );
35             }
36              
37             # Note: property high
38 0     0 1   sub high : lvalue { return( shift->_set_get_property( 'high', @_ ) ); }
39              
40             # Note: property labels read-only is inherited
41              
42             # Note: property low
43 0     0 1   sub low : lvalue { return( shift->_set_get_property( 'low', @_ ) ); }
44              
45             # Note: property max is inherited
46              
47             # Note: property min is inherited
48              
49             # Note: property optimum
50 0     0 1   sub optimum : lvalue { return( shift->_set_get_property( 'optimum', @_ ) ); }
51              
52             # Note: property value is inherited
53              
54             1;
55             # NOTE: POD
56             __END__
57              
58             =encoding utf-8
59              
60             =head1 NAME
61              
62             HTML::Object::DOM::Element::Meter - HTML Object DOM Meter Class
63              
64             =head1 SYNOPSIS
65              
66             use HTML::Object::DOM::Element::Meter;
67             my $meter = HTML::Object::DOM::Element::Meter->new ||
68             die( HTML::Object::DOM::Element::Meter->error, "\n" );
69              
70             =head1 VERSION
71              
72             v0.2.0
73              
74             =head1 DESCRIPTION
75              
76             The HTML <meter> elements expose the HTMLMeterElement interface, which provides special properties and methods (beyond the L<HTML::Object::DOM::Element> object interface they also have available to them by inheritance) for manipulating the layout and presentation of <meter> elements.
77              
78             =head1 INHERITANCE
79              
80             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
81             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Meter |
82             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
83              
84             =head1 PROPERTIES
85              
86             Inherits properties from its parent L<HTML::Object::DOM::Element>
87              
88             =head2 high
89              
90             A double representing the value of the high boundary, reflecting the high attribute.
91              
92             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/high>
93              
94             =head2 labels
95              
96             Read-only.
97              
98             A C<NodeList> of <label> elements that are associated with the element.
99              
100             Example:
101              
102             my $labelElements = meter->labels;
103              
104             <label id="label1" for="test">Label 1</label>
105             <meter id="test" min="0" max="100" value="70">70</meter>
106             <label id="label2" for="test">Label 2</label>
107              
108             Another example:
109              
110             window->addEventListener( DOMContentLoaded => sub
111             {
112             my $meter = $doc->getElementById( 'test' );
113             for( my $i = 0; $i < $meter->labels->length; $i++ )
114             {
115             say( $meter->labels->[$i]->textContent ); # "Label 1" and "Label 2"
116             }
117             });
118              
119             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/labels>
120              
121             =head2 low
122              
123             A double representing the value of the low boundary, reflecting the lowattribute.
124              
125             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/low>
126              
127             =head2 max
128              
129             A double representing the maximum value, reflecting the max attribute.
130              
131             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/max>
132              
133             =head2 min
134              
135             A double representing the minimum value, reflecting the min attribute.
136              
137             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/min>
138              
139             =head2 optimum
140              
141             A double representing the optimum, reflecting the optimum attribute.
142              
143             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/optimum>
144              
145             =head2 value
146              
147             A double representing the currrent value, reflecting the value attribute.
148              
149             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement/value>
150              
151             =head1 METHODS
152              
153             Inherits methods from its parent L<HTML::Object::DOM::Element>
154              
155             =head1 AUTHOR
156              
157             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
158              
159             =head1 SEE ALSO
160              
161             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMeterElement>, L<Mozilla documentation on meter element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meter>
162              
163             =head1 COPYRIGHT & LICENSE
164              
165             Copyright(c) 2022 DEGUEST Pte. Ltd.
166              
167             All rights reserved
168              
169             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
170              
171             =cut