lib/HTML/Object/DOM/Element/Marquee.pm

filter: Statementstmt 55.8% 24 / 43 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 34.7% 8 / 23 Podpod 100% 15 / 15 totaltotal 55.2% 47 / 85 CC 3 SCAR 10.6
CC
3
Cov
51%
init
12.0
behavior
2.0
bgColor
2.0
CRAP 2.9
« blib/lib/HTML/Object/DOM/Element/Span.pm ↑ Summary blib/lib/HTML/Object/XPath/NodeSet.pm »
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 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶ warnings::register_categories( 'HTML::Object' );
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶ use parent qw( HTML::Object::DOM::Element );
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
22 1 ▶ use HTML::Object::DOM::Element::Shared qw( :marquee );
Subroutine BEGIN: called CC=1 SCAR=0.0
23 1 our $VERSION = 'v0.2.0';
24 };
25  
26 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
27 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 sub init
30 {
31 0 ▶ my $self = shift( @_ );
Subroutine init: not called CC=3 SCAR=24.8
Pod documented
32 0 $self->{_init_strict_use_sub} = 1;
33 0 ▶ $self->SUPER::init( @_ ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->SUPER::init(@_) or return $self->pass_error 0 0 0
34 0 ▶ $self->{tag} = 'marquee' if( !CORE::length( "$self->{tag}" ) );
Branch: 1 branch
BranchTrueFalseTotal
unless length qq[$self->{"tag"}] 0 0 0
35 0 return( $self );
36 }
37  
38 # Note: property behavior
39 0 ▶sub behavior : lvalue { return( shift->_set_get_property( 'behavior', @_ ) ); }
Subroutine behavior: not called CC=1 SCAR=6.9
Pod documented
40  
41 # Note: property bgColor
42 0 ▶sub bgColor : lvalue { return( shift->_set_get_property( 'bgcolor', @_ ) ); }
Subroutine bgColor: not called CC=1 SCAR=6.9
Pod documented
43  
44 # Note: property direction
45 0 ▶sub direction : lvalue { return( shift->_set_get_property( 'direction', @_ ) ); }
Subroutine direction: not called CC=1 SCAR=6.9
Pod documented
46  
47 # Note: property height is inherited
48  
49 # Note: property hspace
50 0 ▶sub hspace : lvalue { return( shift->_set_get_property( 'hspace', @_ ) ); }
Subroutine hspace: not called CC=1 SCAR=6.9
Pod documented
51  
52 # Note: property loop
53 0 ▶sub loop : lvalue { return( shift->_set_get_property( 'loop', @_ ) ); }
Subroutine loop: not called CC=1 SCAR=6.9
Pod documented
54  
55 0 ▶sub onbounce : lvalue { return( shift->on( 'bounce', @_ ) ); }
Subroutine onbounce: not called CC=1 SCAR=6.9
Pod documented
56  
57 0 ▶sub onfinish : lvalue { return( shift->on( 'finish', @_ ) ); }
Subroutine onfinish: not called CC=1 SCAR=6.9
Pod documented
58  
59 0 ▶sub onstart : lvalue { return( shift->on( 'start', @_ ) ); }
Subroutine onstart: not called CC=1 SCAR=6.9
Pod documented
60  
61 # Note: property scrollAmount
62 0 ▶sub scrollAmount : lvalue { return( shift->_set_get_property( 'scrollamount', @_ ) ); }
Subroutine scrollAmount: not called CC=1 SCAR=6.9
Pod documented
63  
64 # Note: property scrollDelay
65 0 ▶sub scrollDelay : lvalue { return( shift->_set_get_property( 'scrolldelay', @_ ) ); }
Subroutine scrollDelay: not called CC=1 SCAR=6.9
Pod documented
66  
67 0 ▶sub start { return; }
Subroutine start: not called CC=1 SCAR=6.9
Pod documented
68  
69 0 ▶sub stop { return; }
Subroutine stop: not called CC=1 SCAR=6.9
Pod documented
70  
71 # Note: property trueSpeed
72 0 ▶sub trueSpeed : lvalue { return( shift->_set_get_property({ attribute => 'truespeed', is_boolean => 1 }, @_ ) ); }
Subroutine trueSpeed: not called CC=1 SCAR=6.9
Pod documented
73  
74 # Note: property vspace
75 0 ▶sub vspace : lvalue { return( shift->_set_get_property( 'vspace', @_ ) ); }
Subroutine vspace: not called CC=1 SCAR=6.9
Pod documented
76  
77 # Note: property width is inherited
78  
79 1 1;
80 # NOTE: POD
81 __END__
82  
83 =encoding utf-8
84  
85 =head1 NAME
86  
87 HTML::Object::DOM::Element::Marquee - HTML Object DOM Marquee Class
88  
89 =head1 SYNOPSIS
90  
91 use HTML::Object::DOM::Element::Marquee;
92 my $marquee = HTML::Object::DOM::Element::Marquee->new ||
93 die( HTML::Object::DOM::Element::Marquee->error, "\n" );
94  
95 =head1 VERSION
96  
97 v0.2.0
98  
99 =head1 DESCRIPTION
100  
101 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.
102  
103 =head1 INHERITANCE
104  
105 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-------------------------------------+
106 | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Marquee |
107 +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-------------------------------------+
108  
109 =head1 PROPERTIES
110  
111 Inherits properties from its parent L<HTML::Object::DOM::Element>
112  
113 =head2 behavior
114  
115 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>.
116  
117 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/behavior>
118  
119 =head2 bgColor
120  
121 This is the HTML attribute that reflects the background color through color name or hexadecimal value.
122  
123 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/bgColor>
124  
125 =head2 direction
126  
127 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>.
128  
129 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/direction>
130  
131 =head2 height
132  
133 This is the HTML attribute that reflects the height in pixels or percentage value.
134  
135 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/height>
136  
137 =head2 hspace
138  
139 This is the HTML attribute that reflects the horizontal margin.
140  
141 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/hspace>
142  
143 =head2 loop
144  
145 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.
146  
147 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/loop>
148  
149 =head2 scrollAmount
150  
151 This is the HTML attribute that reflects the amount of scrolling at each interval in pixels. The default value is C<6>.
152  
153 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/scrollAmount>
154  
155 =head2 scrollDelay
156  
157 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.
158  
159 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/scrollDelay>
160  
161 =head2 trueSpeed
162  
163 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.
164  
165 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/trueSpeed>
166  
167 =head2 vspace
168  
169 This is the HTML attribute that reflects the vertical margin.
170  
171 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/vspace>
172  
173 =head2 width
174  
175 This is the HTML attribute that reflects the width in pixels or percentage value.
176  
177 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/width>
178  
179 =head1 METHODS
180  
181 Inherits methods from its parent L<HTML::Object::DOM::Element>
182  
183 =head2 start
184  
185 Under perl, this does nothing and always returns C<undef> obviously.
186  
187 Under JavaScript, this starts scrolling of the marquee.
188  
189 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/start>
190  
191 =head2 stop
192  
193 Under perl, this does nothing and always returns C<undef> obviously.
194  
195 Under JavaScript, this stops scrolling of the marquee.
196  
197 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/stop>
198  
199 =head1 EVENT HANDLERS
200  
201 None of the following events are fired automatically under perl, obviously, but you can trigger them yourself.
202  
203 =head2 onbounce
204  
205 Fires when the marquee has reached the end of its scroll position. It can only fire when the behavior attribute is set to alternate.
206  
207 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onbounce>
208  
209 =head2 onfinish
210  
211 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.
212  
213 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onfinish>
214  
215 =head2 onstart
216  
217 Fires when the marquee starts scrolling.
218  
219 See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLMarqueeElement/onstart>
220  
221 =head1 AUTHOR
222  
223 Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
224  
225 =head1 SEE ALSO
226  
227 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>
228  
229 =head1 COPYRIGHT & LICENSE
230  
231 Copyright(c) 2022 DEGUEST Pte. Ltd.
232  
233 All rights reserved
234  
235 This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
236  
237 =cut
« blib/lib/HTML/Object/DOM/Element/Span.pm ↑ Summary blib/lib/HTML/Object/XPath/NodeSet.pm »