blib/lib/HTML/Object/DOM/Window.pm untested

filter: Statementstmt 0.0% 0 / 162 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 128 Podpod 0.0% 0 / 122 totaltotal 0.0% 0 / 418 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
init
2.0
alert
2.0
CRAP 2.0
1 ##----------------------------------------------------------------------------
2 ## HTML Object - ~/lib/HTML/Object/DOM/Window.pm
3 ## Version v0.2.0_1
4 ## Copyright(c) 2022 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2021/12/31
7 ## Modified 2026/03/29
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::Window;
15 BEGIN
16 {
17 use strict;
18 use warnings;
19 warnings::register_categories( 'HTML::Object' );
20 use parent qw( HTML::Object::EventTarget );
21 use vars qw( @LVALUE_METHODS $VERSION );
22 # perl -nE 'print if( s,^sub (\w+) : lvalue.*?$,$1, )' ./lib/HTML/Object/DOM/Window.pm | tr "\n" " "
23 our @LVALUE_METHODS = qw( closed document event frames fullScreen innerHeight innerWidth isSecureContext location name onappinstalled onbeforeinstallprompt ondevicemotion ondeviceorientation ondeviceorientationabsolute ondeviceproximity onerror ongamepadconnected ongamepaddisconnected onlanguagechange onorientationchange onrejectionhandled onresize onstorage onuserproximity onvrdisplayactivate onvrdisplayblur onvrdisplayconnect onvrdisplaydeactivate onvrdisplaydisconnect onvrdisplayfocus onvrdisplaypresentchange outerHeight outerWidth parent screen scrollX scrollY self status top visualViewport );
24 our $VERSION = 'v0.2.0_1';
25 };
26  
27 use strict;
28 use warnings;
29  
30 sub init
31 {
32 my $self = shift( @_ );
33 $self->{captureEvents} = 0;
34 $self->{fullscreen} = 0;
35 $self->{issecurecontext} = 1;
36 $self->{_init_strict_use_sub} = 1;
37 $self->SUPER::init( @_ ) || return( $self->pass_error );
38 return( $self );
39 }
40  
41 sub alert { shift; return( warn( @_ ) ); }
42  
43 sub blur { return; }
44  
45 sub cancelAnimationFrame { return; }
46  
47 sub cancelIdleCallback { return; }
48  
49 sub captureEvents
50 {
51 my $self = shift( @_ );
52 my $bit = shift( @_ );
53 return( $self->{captured_events} |= $bit );
54 }
55  
56 sub clearImmediate { return; }
57  
58 # Note: property clientInformation read-only
59 sub clientInformation { return; }
60  
61 sub close { return( shift->closed(1) ); }
62  
63 # Note: property closed read-only
64 sub closed : lvalue { return( shift->_set_get_boolean( 'closed', @_ ) ); }
65  
66 sub confirm { return; }
67  
68 # Note: property console read-only
69 sub console { return; }
70  
71 # Note: property crypto read-only
72 sub crypto { return; }
73  
74 # Note: property customElements read-only
75 sub customElements { return; }
76  
77 # Note: property devicePixelRatio read-only
78 sub devicePixelRatio { return; }
79  
80 # Note: property document read-only
81 sub document : lvalue { return( shift->_set_get_object_lvalue( 'document', 'HTML::Object::DOM::Document', @_ ) ); }
82  
83 # Note: property DOMMatrix read-only
84 sub DOMMatrix { return; }
85  
86 # Note: property DOMMatrixReadOnly read-only
87 sub DOMMatrixReadOnly { return; }
88  
89 # Note: property DOMPoint read-only
90 sub DOMPoint { return; }
91  
92 # Note: property DOMPointReadOnly read-only
93 sub DOMPointReadOnly { return; }
94  
95 # Note: property DOMQuad read-only
96 sub DOMQuad { return; }
97  
98 # Note: property DOMRect read-only
99 sub DOMRect { return; }
100  
101 # Note: property DOMRectReadOnly read-only
102 sub DOMRectReadOnly { return; }
103  
104 sub dump
105 {
106 my $self = shift( @_ );
107 $self->_load_class( 'Data::Dump' ) || return( $self->pass_error );
108 return( print( STDERR Data::Dump::dump( @_ ), "\n" ) );
109 }
110  
111 # Note: property event read-only
112 sub event : lvalue { return( shift->_set_get_object_lvalue( 'event', 'HTML::Object::Event', @_ ) ); }
113  
114 sub find { return; }
115  
116 sub focus { return; }
117  
118 # Note: property frameElement read-only
119 sub frameElement { return; }
120  
121 # Note: property frames read-only
122 sub frames : lvalue
123 {
124 my $self = shift( @_ );
125 my $results = $self->new_array;
126 my $doc = $self->document || return( $results );
127 $results = $doc->look_down( _tag => 'iframes' );
128 return( $results );
129 }
130  
131 # Note: property fullScreen
132 sub fullScreen : lvalue { return( shift->_set_get_boolean( 'fullscreen', @_ ) ); }
133  
134 sub getComputedStyle { return; }
135  
136 sub getDefaultComputedStyle { return; }
137  
138 sub getSelection { return; }
139  
140 # Note: property history read-only
141 sub history { return; }
142  
143 # Note: property innerHeight read-only
144 sub innerHeight : lvalue { return( shift->_set_get_number( 'innerheight', @_ ) ); }
145  
146 # Note: property innerWidth read-only
147 sub innerWidth : lvalue { return( shift->_set_get_number( 'innerwidth', @_ ) ); }
148  
149 # Note: property isSecureContext read-only
150 sub isSecureContext : lvalue { return( shift->_set_get_boolean( 'issecurecontext', @_ ) ); }
151  
152 # Note: property length read-only
153 sub length { return( shift->frames->length ); }
154  
155 # Note: property localStorage read-only
156 sub localStorage { return; }
157  
158 # Note: property location
159 sub location : lvalue { return( shift->_set_get_uri( 'location', @_ ) ); }
160  
161 # Note: property locationbar read-only
162 sub locationbar { return; }
163  
164 sub matchMedia { return; }
165  
166 # Note: property menubar read-only
167 sub menubar { return; }
168  
169 # Note: property messageManager
170 sub messageManager { return; }
171  
172 sub moveBy { return; }
173  
174 sub moveTo { return; }
175  
176 # Note: property mozInnerScreenX read-only
177 sub mozInnerScreenX { return; }
178  
179 # Note: property mozInnerScreenY read-only
180 sub mozInnerScreenY { return; }
181  
182 # Note: property name
183 sub name : lvalue { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); }
184  
185 # Note: property navigator read-only
186 sub navigator { return; }
187  
188 sub onappinstalled : lvalue { return( shift->on( 'appinstalled', @_ ) ); }
189  
190 sub onbeforeinstallprompt : lvalue { return( shift->on( 'beforeinstallprompt', @_ ) ); }
191  
192 sub ondevicemotion : lvalue { return( shift->on( 'devicemotion', @_ ) ); }
193  
194 sub ondeviceorientation : lvalue { return( shift->on( 'deviceorientation', @_ ) ); }
195  
196 sub ondeviceorientationabsolute : lvalue { return( shift->on( 'deviceorientationabsolute', @_ ) ); }
197  
198 sub ondeviceproximity : lvalue { return( shift->on( 'deviceproximity', @_ ) ); }
199  
200 sub onerror : lvalue { return( shift->on( 'error', @_ ) ); }
201  
202 sub ongamepadconnected : lvalue { return( shift->on( 'gamepadconnected', @_ ) ); }
203  
204 sub ongamepaddisconnected : lvalue { return( shift->on( 'gamepaddisconnected', @_ ) ); }
205  
206 sub onlanguagechange : lvalue { return( shift->on( 'languagechange', @_ ) ); }
207  
208 sub onorientationchange : lvalue { return( shift->on( 'orientationchange', @_ ) ); }
209  
210 sub onrejectionhandled : lvalue { return( shift->on( 'rejectionhandled', @_ ) ); }
211  
212 sub onresize : lvalue { return( shift->on( 'resize', @_ ) ); }
213  
214 sub onstorage : lvalue { return( shift->on( 'storage', @_ ) ); }
215  
216 sub onuserproximity : lvalue { return( shift->on( 'userproximity', @_ ) ); }
217  
218 sub onvrdisplayactivate : lvalue { return( shift->on( 'vrdisplayactivate', @_ ) ); }
219  
220 sub onvrdisplayblur : lvalue { return( shift->on( 'vrdisplayblur', @_ ) ); }
221  
222 sub onvrdisplayconnect : lvalue { return( shift->on( 'vrdisplayconnect', @_ ) ); }
223  
224 sub onvrdisplaydeactivate : lvalue { return( shift->on( 'vrdisplaydeactivate', @_ ) ); }
225  
226 sub onvrdisplaydisconnect : lvalue { return( shift->on( 'vrdisplaydisconnect', @_ ) ); }
227  
228 sub onvrdisplayfocus : lvalue { return( shift->on( 'vrdisplayfocus', @_ ) ); }
229  
230 sub onvrdisplaypresentchange : lvalue { return( shift->on( 'vrdisplaypresentchange', @_ ) ); }
231  
232 sub open { return( shift->new( @_ ) ); }
233  
234 # Note: property opener
235 sub opener { return; }
236  
237 # Note: property outerHeight read-only
238 sub outerHeight : lvalue { return( shift->_set_get_number( 'outerheight', @_ ) ); }
239  
240 # Note: property outerWidth read-only
241 sub outerWidth : lvalue { return( shift->_set_get_number( 'outerwidth', @_ ) ); }
242  
243 # Note: property pageXOffset read-only
244 sub pageXOffset { return; }
245  
246 # Note: property pageYOffset read-only
247 sub pageYOffset { return; }
248  
249 # Note: property parent read-only
250 sub parent : lvalue { return( shift->_set_get_object_lvalue({
251 field => 'parent',
252 weaken => 1,
253 }, 'HTML::Object::DOM::Window', @_ ) ); }
254  
255 # Note: property performance read-only
256 sub performance { return; }
257  
258 # Note: property personalbar read-only
259 sub personalbar { return; }
260  
261 sub postMessage { return; }
262  
263 sub print { return; }
264  
265 sub prompt { return; }
266  
267 sub releaseEvents
268 {
269 my $self = shift( @_ );
270 my $bit = shift( @_ );
271 $self->{captured_events} = ( $self->{captured_events} ^ $bit );
272 return( $self->{captured_events} );
273 }
274  
275 sub requestAnimationFrame { return; }
276  
277 sub requestIdleCallback { return; }
278  
279 sub resizeBy { return; }
280  
281 sub resizeTo { return; }
282  
283 # Note: property screen read-only
284 sub screen : lvalue { return( shift->_set_get_object_lvalue( 'screen', 'HTML::Object::DOM::Screen', @_ ) ); }
285  
286 # Note: property screenX read-only
287 sub screenX { return; }
288  
289 # Note: property screenY read-only
290 sub screenY { return; }
291  
292 sub scroll { return; }
293  
294 sub scrollBy { return; }
295  
296 sub scrollByLines { return; }
297  
298 sub scrollByPages { return; }
299  
300 # Note: property scrollMaxX read-only
301 sub scrollMaxX { return; }
302  
303 # Note: property scrollMaxY read-only
304 sub scrollMaxY { return; }
305  
306 sub scrollTo { return; }
307  
308 # Note: property scrollX read-only
309 sub scrollX : lvalue { return( shift->_set_get_number( 'scrollx', @_ ) ); }
310  
311 # Note: property scrollY read-only
312 sub scrollY : lvalue { return( shift->_set_get_number( 'scrolly', @_ ) ); }
313  
314 # Note: property scrollbars read-only
315 sub scrollbars { return; }
316  
317 # Note: property self read-only
318 sub self : lvalue { return( shift( @_ ) ); }
319  
320 # Note: property sessionStorage
321 sub sessionStorage { return; }
322  
323 sub setImmediate { return; }
324  
325 sub setResizable { return; }
326  
327 sub showDirectoryPicker { return; }
328  
329 sub showOpenFilePicker { return; }
330  
331 sub showSaveFilePicker { return; }
332  
333 # Note: property sidebar read-only
334 sub sidebar { return; }
335  
336 sub sizeToContent { return; }
337  
338 # Note: property speechSynthesis read-only
339 sub speechSynthesis { return; }
340  
341 # Note: property status
342 sub status : lvalue { return( shift->_set_get_scalar_as_object( 'status', @_ ) ); }
343  
344 # Note: property statusbar read-only
345 sub statusbar { return; }
346  
347 sub stop { return; }
348  
349 # Note: property toolbar read-only
350 sub toolbar { return; }
351  
352 # Note: property top read-only
353 sub top : lvalue { return( shift->_set_get_object_lvalue( 'top', 'HTML::Object::DOM::Window', @_ ) ); }
354  
355 sub updateCommands { return; }
356  
357 # Note: property visualViewport read-only
358 sub visualViewport : lvalue { return( shift->_set_get_number( 'visualviewport', @_ ) ); }
359  
360 # Note: property window read-only
361 sub window { return( shift( @_ ) ); }
362  
363 sub is_property { return( scalar( grep( /^$_[1]$/i, @LVALUE_METHODS ) ) ); }
364  
365 1;
366 # NOTE: POD
367 __END__