File Coverage

lib/HTML/Object/DOM/Element/OList.pm
Criterion Covered Total %
statement 27 29 93.1
branch 2 4 50.0
condition n/a
subroutine 9 11 81.8
pod 3 3 100.0
total 41 47 87.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Element/OList.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::OList;
15             BEGIN
16             {
17 2     2   2227 use strict;
  2         17  
  2         89  
18 2     2   15 use warnings;
  2         15  
  2         99  
19 2     2   25 use parent qw( HTML::Object::DOM::Element );
  2         4  
  2         25  
20 2     2   209 use vars qw( $VERSION );
  2         20  
  2         151  
21 2     2   23 use HTML::Object::DOM::Element::Shared qw( :ol );
  2         11  
  2         399  
22 2     2   77 our $VERSION = 'v0.2.0';
23             };
24              
25 2     2   38 use strict;
  2         11  
  2         75  
26 2     2   15 use warnings;
  2         8  
  2         476  
27              
28             sub init
29             {
30 1     1 1 113 my $self = shift( @_ );
31 1         268 $self->{_init_strict_use_sub} = 1;
32 1 50       41 $self->SUPER::init( @_ ) || return( $self->pass_error );
33 1 50       16 $self->{tag} = 'ol' if( !CORE::length( "$self->{tag}" ) );
34 1         25 return( $self );
35             }
36              
37             # Note: property compact is inherited
38              
39             # Note: property reversed
40 0     0 1   sub reversed : lvalue { return( shift->_set_get_property({ attribute => 'reversed', is_boolean => 1 }, @_ ) ); }
41              
42             # Note: property start
43 0     0 1   sub start : lvalue { return( shift->_set_get_property( 'start', @_ ) ); }
44              
45             # Note: property type is inherited
46              
47             1;
48             # NOTE: POD
49             __END__
50              
51             =encoding utf-8
52              
53             =head1 NAME
54              
55             HTML::Object::DOM::Element::OList - HTML Object DOM OL List Class
56              
57             =head1 SYNOPSIS
58              
59             use HTML::Object::DOM::Element::OList;
60             my $ol = HTML::Object::DOM::Element::OList->new ||
61             die( HTML::Object::DOM::Element::OList->error, "\n" );
62              
63             =head1 VERSION
64              
65             v0.2.0
66              
67             =head1 DESCRIPTION
68              
69             This interface provides special properties (beyond those defined on the regular L<HTML::Object::Element> interface it also has available to it by inheritance) for manipulating ordered list elements.
70              
71             =head1 INHERITANCE
72              
73             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
74             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::OList |
75             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
76              
77             =head1 PROPERTIES
78              
79             Inherits properties from its parent L<HTML::Object::DOM::Element>
80              
81             =head2 compact
82              
83             Is a boolean value indicating that spacing between list items should be reduced. This property reflects the C<compact> attribute only, it does not consider the line-height CSS property used for that behavior in modern pages.
84              
85             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement/compact>
86              
87             =head2 reversed
88              
89             Is a boolean value reflecting the C<reversed> and defining if the numbering is descending, that is its value is true, or ascending (false).
90              
91             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement/reversed>
92              
93             =head2 start
94              
95             Is a long value reflecting the start and defining the value of the first number of the first element of the list and reflects the C<start> attribute.
96              
97             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement/start>
98              
99             =head2 type
100              
101             Is a string value reflecting the C<type> and defining the kind of marker to be used to display. It can have the following values:
102              
103             =over 4
104              
105             =item * '1' meaning that decimal numbers are used: 1, 2, 3, 4, 5, …
106              
107             =item * 'a' meaning that the lowercase latin alphabet is used:  a, b, c, d, e, …
108              
109             =item * 'A' meaning that the uppercase latin alphabet is used: A, B, C, D, E, …
110              
111             =item * 'i' meaning that the lowercase latin numerals are used: i, ii, iii, iv, v, …
112              
113             =item * 'I' meaning that the uppercase latin numerals are used: I, II, III, IV, V, …
114              
115             =back
116              
117             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement/type>
118              
119             =head1 METHODS
120              
121             Inherits methods from its parent L<HTML::Object::DOM::Element>
122              
123             =head1 AUTHOR
124              
125             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
126              
127             =head1 SEE ALSO
128              
129             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLOListElement>, L<Mozilla documentation on ol element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ol>
130              
131             =head1 COPYRIGHT & LICENSE
132              
133             Copyright(c) 2021 DEGUEST Pte. Ltd.
134              
135             All rights reserved
136              
137             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
138              
139             =cut