File Coverage

lib/HTML/Object/DOM/Element/Marquee.pm
Criterion Covered Total %
statement 22 41 53.6
branch 0 4 0.0
condition n/a
subroutine 8 23 34.7
pod 15 15 100.0
total 45 83 54.2


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Element/Marquee.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::Marquee;
15             BEGIN
16             {
17 1     1   1052 use strict;
  1         2  
  1         30  
18 1     1   10 use warnings;
  1         3  
  1         31  
19 1     1   5 use parent qw( HTML::Object::DOM::Element );
  1         1  
  1         13  
20 1     1   70 use vars qw( $VERSION );
  1         2  
  1         38  
21 1     1   6 use HTML::Object::DOM::Element::Shared qw( :marquee );
  1         5  
  1         98  
22 1     1   29 our $VERSION = 'v0.2.0';
23             };
24              
25 1     1   5 use strict;
  1         2  
  1         18  
26 1     1   4 use warnings;
  1         2  
  1         364  
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} = 'marquee' if( !CORE::length( "$self->{tag}" ) );
34 0           return( $self );
35             }
36              
37             # Note: property behavior
38 0     0 1   sub behavior : lvalue { return( shift->_set_get_property( 'behavior', @_ ) ); }
39              
40             # Note: property bgColor
41 0     0 1   sub bgColor : lvalue { return( shift->_set_get_property( 'bgcolor', @_ ) ); }
42              
43             # Note: property direction
44 0     0 1   sub direction : lvalue { return( shift->_set_get_property( 'direction', @_ ) ); }
45              
46             # Note: property height is inherited
47              
48             # Note: property hspace
49 0     0 1   sub hspace : lvalue { return( shift->_set_get_property( 'hspace', @_ ) ); }
50              
51             # Note: property loop
52 0     0 1   sub loop : lvalue { return( shift->_set_get_property( 'loop', @_ ) ); }
53              
54 0     0 1   sub onbounce : lvalue { return( shift->on( 'bounce', @_ ) ); }
55              
56 0     0 1   sub onfinish : lvalue { return( shift->on( 'finish', @_ ) ); }
57              
58 0     0 1   sub onstart : lvalue { return( shift->on( 'start', @_ ) ); }
59              
60             # Note: property scrollAmount
61 0     0 1   sub scrollAmount : lvalue { return( shift->_set_get_property( 'scrollamount', @_ ) ); }
62              
63             # Note: property scrollDelay
64 0     0 1   sub scrollDelay : lvalue { return( shift->_set_get_property( 'scrolldelay', @_ ) ); }
65              
66 0     0 1   sub start { return; }
67              
68 0     0 1   sub stop { return; }
69              
70             # Note: property trueSpeed
71 0     0 1   sub trueSpeed : lvalue { return( shift->_set_get_property({ attribute => 'truespeed', is_boolean => 1 }, @_ ) ); }
72              
73             # Note: property vspace
74 0     0 1   sub vspace : lvalue { return( shift->_set_get_property( 'vspace', @_ ) ); }
75              
76             # Note: property width is inherited
77              
78             1;
79             # NOTE: POD
80             __END__
81              
82             =encoding utf-8
83              
84             =head1 NAME
85              
86             HTML::Object::DOM::Element::Marquee - HTML Object DOM Marquee Class
87              
88             =head1 SYNOPSIS
89              
90             use HTML::Object::DOM::Element::Marquee;
91             my $marquee = HTML::Object::DOM::Element::Marquee->new ||
92             die( HTML::Object::DOM::Element::Marquee->error, "\n" );
93              
94             =head1 VERSION
95              
96             v0.2.0
97              
98             =head1 DESCRIPTION
99              
100             Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
101              
102             =head1 INHERITANCE
103              
104             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-------------------------------------+
105             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Marquee |
106             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-------------------------------------+
107              
108             =head1 PROPERTIES
109              
110             Inherits properties from its parent L<HTML::Object::DOM::Element>
111              
112             =head2 behavior
113              
114             This is the HTML attribute that reflects how the text is scrolled within the marquee. Possible values are C<scroll>, C<slide> and C<alternate>. If no value is specified, the default value is C<scroll>.
115              
116             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/behavior>
117              
118             =head2 bgColor
119              
120             This is the HTML attribute that reflects the background color through color name or hexadecimal value.
121              
122             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/bgColor>
123              
124             =head2 direction
125              
126             This is the HTML attribute that reflects the direction of the scrolling within the marquee. Possible values are C<left>, C<right>, C<up> and C<down>. If no value is specified, the default value is C<left>.
127              
128             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/direction>
129              
130             =head2 height
131              
132             This is the HTML attribute that reflects the height in pixels or percentage value.
133              
134             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/height>
135              
136             =head2 hspace
137              
138             This is the HTML attribute that reflects the horizontal margin.
139              
140             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/hspace>
141              
142             =head2 loop
143              
144             This is the HTML attribute that reflects the number of times the marquee will scroll. If no value is specified, the default value is C<undef> (C<−1> under JavaScript), which means the marquee will scroll continuously.
145              
146             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/loop>
147              
148             =head2 scrollAmount
149              
150             This is the HTML attribute that reflects the amount of scrolling at each interval in pixels. The default value is C<6>.
151              
152             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/scrollAmount>
153              
154             =head2 scrollDelay
155              
156             Sets the interval between each scroll movement in milliseconds. The default value is 85. Note that any value smaller than 60 is ignored and the value 60 is used instead, unless trueSpeed is true.
157              
158             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/scrollDelay>
159              
160             =head2 trueSpeed
161              
162             This is the HTML attribute that reflects whether to ignore scrollDelay small value. By default, scrollDelay values lower than 60 are ignored. If trueSpeed is true, then those values are not ignored.
163              
164             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/trueSpeed>
165              
166             =head2 vspace
167              
168             This is the HTML attribute that reflects the vertical margin.
169              
170             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/vspace>
171              
172             =head2 width
173              
174             This is the HTML attribute that reflects the width in pixels or percentage value.
175              
176             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/width>
177              
178             =head1 METHODS
179              
180             Inherits methods from its parent L<HTML::Object::DOM::Element>
181              
182             =head2 start
183              
184             Under perl, this does nothing and always returns C<undef> obviously.
185              
186             Under JavaScript, this starts scrolling of the marquee.
187              
188             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/start>
189              
190             =head2 stop
191              
192             Under perl, this does nothing and always returns C<undef> obviously.
193              
194             Under JavaScript, this stops scrolling of the marquee.
195              
196             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/stop>
197              
198             =head1 EVENT HANDLERS
199              
200             None of the following events are fired automatically under perl, obviously, but you can trigger them yourself.
201              
202             =head2 onbounce
203              
204             Fires when the marquee has reached the end of its scroll position. It can only fire when the behavior attribute is set to alternate.
205              
206             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onbounce>
207              
208             =head2 onfinish
209              
210             Fires when the marquee has finished the amount of scrolling that is set by the loop attribute. It can only fire when the loop attribute is set to some number that is greater than 0.
211              
212             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onfinish>
213              
214             =head2 onstart
215              
216             Fires when the marquee starts scrolling.
217              
218             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onstart>
219              
220             =head1 AUTHOR
221              
222             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
223              
224             =head1 SEE ALSO
225              
226             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement>, L<Mozilla documentation on marquee element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/marquee>
227              
228             =head1 COPYRIGHT & LICENSE
229              
230             Copyright(c) 2022 DEGUEST Pte. Ltd.
231              
232             All rights reserved
233              
234             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
235              
236             =cut