| 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 | 32 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 18 | 32 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 19 | 32 | ▶ | warnings::register_categories( 'HTML::Object' ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 20 | 32 | ▶ | use parent qw( HTML::Object::EventTarget ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 21 | 32 | ▶ | use vars qw( @LVALUE_METHODS $VERSION ); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 22 | # perl -nE 'print if( s,^sub (\w+) : lvalue.*?$,$1, )' ./lib/HTML/Object/DOM/Window.pm | tr "\n" " " | ||||||||||||
| 23 | 32 | 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 | 32 | our $VERSION = 'v0.2.0_1'; | |||||||||||
| 25 | }; | ||||||||||||
| 26 | |||||||||||||
| 27 | 32 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 28 | 32 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 29 | |||||||||||||
| 30 | sub init | ||||||||||||
| 31 | { | ||||||||||||
| 32 | 91 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
init: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 33 | 91 | $self->{captureEvents} = 0; | |||||||||||
| 34 | 91 | $self->{fullscreen} = 0; | |||||||||||
| 35 | 91 | $self->{issecurecontext} = 1; | |||||||||||
| 36 | 91 | $self->{_init_strict_use_sub} = 1; | |||||||||||
| 37 | 91 | ▶ | $self->SUPER::init( @_ ) || return( $self->pass_error ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 38 | 91 | return( $self ); | |||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | 0 | ▶ | sub alert { shift; return( warn( @_ ) ); } | ||||||||||
|
Subroutine
alert: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 42 | |||||||||||||
| 43 | 0 | ▶ | sub blur { return; } | ||||||||||
|
Subroutine
blur: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 44 | |||||||||||||
| 45 | 0 | ▶ | sub cancelAnimationFrame { return; } | ||||||||||
|
Subroutine
cancelAnimationFrame: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 46 | |||||||||||||
| 47 | 0 | ▶ | sub cancelIdleCallback { return; } | ||||||||||
|
Subroutine
cancelIdleCallback: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 48 | |||||||||||||
| 49 | sub captureEvents | ||||||||||||
| 50 | { | ||||||||||||
| 51 | 0 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
captureEvents: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 52 | 0 | my $bit = shift( @_ ); | |||||||||||
| 53 | 0 | return( $self->{captured_events} |= $bit ); | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | 0 | ▶ | sub clearImmediate { return; } | ||||||||||
|
Subroutine
clearImmediate: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 57 | |||||||||||||
| 58 | # Note: property clientInformation read-only | ||||||||||||
| 59 | 0 | ▶ | sub clientInformation { return; } | ||||||||||
|
Subroutine
clientInformation: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 60 | |||||||||||||
| 61 | 0 | ▶ | sub close { return( shift->closed(1) ); } | ||||||||||
|
Subroutine
close: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 62 | |||||||||||||
| 63 | # Note: property closed read-only | ||||||||||||
| 64 | 0 | ▶ | sub closed : lvalue { return( shift->_set_get_boolean( 'closed', @_ ) ); } | ||||||||||
|
Subroutine
closed: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 65 | |||||||||||||
| 66 | 0 | ▶ | sub confirm { return; } | ||||||||||
|
Subroutine
confirm: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 67 | |||||||||||||
| 68 | # Note: property console read-only | ||||||||||||
| 69 | 0 | ▶ | sub console { return; } | ||||||||||
|
Subroutine
console: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 70 | |||||||||||||
| 71 | # Note: property crypto read-only | ||||||||||||
| 72 | 0 | ▶ | sub crypto { return; } | ||||||||||
|
Subroutine
crypto: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 73 | |||||||||||||
| 74 | # Note: property customElements read-only | ||||||||||||
| 75 | 0 | ▶ | sub customElements { return; } | ||||||||||
|
Subroutine
customElements: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 76 | |||||||||||||
| 77 | # Note: property devicePixelRatio read-only | ||||||||||||
| 78 | 0 | ▶ | sub devicePixelRatio { return; } | ||||||||||
|
Subroutine
devicePixelRatio: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 79 | |||||||||||||
| 80 | # Note: property document read-only | ||||||||||||
| 81 | 0 | ▶ | sub document : lvalue { return( shift->_set_get_object_lvalue( 'document', 'HTML::Object::DOM::Document', @_ ) ); } | ||||||||||
|
Subroutine
document: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 82 | |||||||||||||
| 83 | # Note: property DOMMatrix read-only | ||||||||||||
| 84 | 0 | ▶ | sub DOMMatrix { return; } | ||||||||||
|
Subroutine
DOMMatrix: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 85 | |||||||||||||
| 86 | # Note: property DOMMatrixReadOnly read-only | ||||||||||||
| 87 | 0 | ▶ | sub DOMMatrixReadOnly { return; } | ||||||||||
|
Subroutine
DOMMatrixReadOnly: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 88 | |||||||||||||
| 89 | # Note: property DOMPoint read-only | ||||||||||||
| 90 | 0 | ▶ | sub DOMPoint { return; } | ||||||||||
|
Subroutine
DOMPoint: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 91 | |||||||||||||
| 92 | # Note: property DOMPointReadOnly read-only | ||||||||||||
| 93 | 0 | ▶ | sub DOMPointReadOnly { return; } | ||||||||||
|
Subroutine
DOMPointReadOnly: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 94 | |||||||||||||
| 95 | # Note: property DOMQuad read-only | ||||||||||||
| 96 | 0 | ▶ | sub DOMQuad { return; } | ||||||||||
|
Subroutine
DOMQuad: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 97 | |||||||||||||
| 98 | # Note: property DOMRect read-only | ||||||||||||
| 99 | 0 | ▶ | sub DOMRect { return; } | ||||||||||
|
Subroutine
DOMRect: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 100 | |||||||||||||
| 101 | # Note: property DOMRectReadOnly read-only | ||||||||||||
| 102 | 0 | ▶ | sub DOMRectReadOnly { return; } | ||||||||||
|
Subroutine
DOMRectReadOnly: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 103 | |||||||||||||
| 104 | sub dump | ||||||||||||
| 105 | { | ||||||||||||
| 106 | 0 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
dump: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 107 | 0 | ▶ | $self->_load_class( 'Data::Dump' ) || return( $self->pass_error ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 108 | 0 | return( print( STDERR Data::Dump::dump( @_ ), "\n" ) ); | |||||||||||
| 109 | } | ||||||||||||
| 110 | |||||||||||||
| 111 | # Note: property event read-only | ||||||||||||
| 112 | 0 | ▶ | sub event : lvalue { return( shift->_set_get_object_lvalue( 'event', 'HTML::Object::Event', @_ ) ); } | ||||||||||
|
Subroutine
event: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 113 | |||||||||||||
| 114 | 0 | ▶ | sub find { return; } | ||||||||||
|
Subroutine
find: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 115 | |||||||||||||
| 116 | 0 | ▶ | sub focus { return; } | ||||||||||
|
Subroutine
focus: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 117 | |||||||||||||
| 118 | # Note: property frameElement read-only | ||||||||||||
| 119 | 0 | ▶ | sub frameElement { return; } | ||||||||||
|
Subroutine
frameElement: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 120 | |||||||||||||
| 121 | # Note: property frames read-only | ||||||||||||
| 122 | sub frames : lvalue | ||||||||||||
| 123 | { | ||||||||||||
| 124 | 0 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
frames: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 125 | 0 | my $results = $self->new_array; | |||||||||||
| 126 | 0 | ▶ | my $doc = $self->document || return( $results ); | ||||||||||
|
Condition0%0/2
$self->document || (return $results)
MC/DC0%0/1
$self->document || (return $results)
$self->document
Truth table0%0/2
A
A= $self->document
| |||||||||||||
| 127 | 0 | $results = $doc->look_down( _tag => 'iframes' ); | |||||||||||
| 128 | 0 | return( $results ); | |||||||||||
| 129 | } | ||||||||||||
| 130 | |||||||||||||
| 131 | # Note: property fullScreen | ||||||||||||
| 132 | 0 | ▶ | sub fullScreen : lvalue { return( shift->_set_get_boolean( 'fullscreen', @_ ) ); } | ||||||||||
|
Subroutine
fullScreen: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 133 | |||||||||||||
| 134 | 0 | ▶ | sub getComputedStyle { return; } | ||||||||||
|
Subroutine
getComputedStyle: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 135 | |||||||||||||
| 136 | 0 | ▶ | sub getDefaultComputedStyle { return; } | ||||||||||
|
Subroutine
getDefaultComputedStyle: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 137 | |||||||||||||
| 138 | 0 | ▶ | sub getSelection { return; } | ||||||||||
|
Subroutine
getSelection: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 139 | |||||||||||||
| 140 | # Note: property history read-only | ||||||||||||
| 141 | 0 | ▶ | sub history { return; } | ||||||||||
|
Subroutine
history: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 142 | |||||||||||||
| 143 | # Note: property innerHeight read-only | ||||||||||||
| 144 | 0 | ▶ | sub innerHeight : lvalue { return( shift->_set_get_number( 'innerheight', @_ ) ); } | ||||||||||
|
Subroutine
innerHeight: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 145 | |||||||||||||
| 146 | # Note: property innerWidth read-only | ||||||||||||
| 147 | 0 | ▶ | sub innerWidth : lvalue { return( shift->_set_get_number( 'innerwidth', @_ ) ); } | ||||||||||
|
Subroutine
innerWidth: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 148 | |||||||||||||
| 149 | # Note: property isSecureContext read-only | ||||||||||||
| 150 | 0 | ▶ | sub isSecureContext : lvalue { return( shift->_set_get_boolean( 'issecurecontext', @_ ) ); } | ||||||||||
|
Subroutine
isSecureContext: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 151 | |||||||||||||
| 152 | # Note: property length read-only | ||||||||||||
| 153 | 0 | ▶ | sub length { return( shift->frames->length ); } | ||||||||||
|
Subroutine
length: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 154 | |||||||||||||
| 155 | # Note: property localStorage read-only | ||||||||||||
| 156 | 0 | ▶ | sub localStorage { return; } | ||||||||||
|
Subroutine
localStorage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 157 | |||||||||||||
| 158 | # Note: property location | ||||||||||||
| 159 | 0 | ▶ | sub location : lvalue { return( shift->_set_get_uri( 'location', @_ ) ); } | ||||||||||
|
Subroutine
location: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 160 | |||||||||||||
| 161 | # Note: property locationbar read-only | ||||||||||||
| 162 | 0 | ▶ | sub locationbar { return; } | ||||||||||
|
Subroutine
locationbar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 163 | |||||||||||||
| 164 | 0 | ▶ | sub matchMedia { return; } | ||||||||||
|
Subroutine
matchMedia: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 165 | |||||||||||||
| 166 | # Note: property menubar read-only | ||||||||||||
| 167 | 0 | ▶ | sub menubar { return; } | ||||||||||
|
Subroutine
menubar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 168 | |||||||||||||
| 169 | # Note: property messageManager | ||||||||||||
| 170 | 0 | ▶ | sub messageManager { return; } | ||||||||||
|
Subroutine
messageManager: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 171 | |||||||||||||
| 172 | 0 | ▶ | sub moveBy { return; } | ||||||||||
|
Subroutine
moveBy: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 173 | |||||||||||||
| 174 | 0 | ▶ | sub moveTo { return; } | ||||||||||
|
Subroutine
moveTo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 175 | |||||||||||||
| 176 | # Note: property mozInnerScreenX read-only | ||||||||||||
| 177 | 0 | ▶ | sub mozInnerScreenX { return; } | ||||||||||
|
Subroutine
mozInnerScreenX: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 178 | |||||||||||||
| 179 | # Note: property mozInnerScreenY read-only | ||||||||||||
| 180 | 0 | ▶ | sub mozInnerScreenY { return; } | ||||||||||
|
Subroutine
mozInnerScreenY: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 181 | |||||||||||||
| 182 | # Note: property name | ||||||||||||
| 183 | 0 | ▶ | sub name : lvalue { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); } | ||||||||||
|
Subroutine
name: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 184 | |||||||||||||
| 185 | # Note: property navigator read-only | ||||||||||||
| 186 | 0 | ▶ | sub navigator { return; } | ||||||||||
|
Subroutine
navigator: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 187 | |||||||||||||
| 188 | 0 | ▶ | sub onappinstalled : lvalue { return( shift->on( 'appinstalled', @_ ) ); } | ||||||||||
|
Subroutine
onappinstalled: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 189 | |||||||||||||
| 190 | 0 | ▶ | sub onbeforeinstallprompt : lvalue { return( shift->on( 'beforeinstallprompt', @_ ) ); } | ||||||||||
|
Subroutine
onbeforeinstallprompt: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 191 | |||||||||||||
| 192 | 0 | ▶ | sub ondevicemotion : lvalue { return( shift->on( 'devicemotion', @_ ) ); } | ||||||||||
|
Subroutine
ondevicemotion: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 193 | |||||||||||||
| 194 | 0 | ▶ | sub ondeviceorientation : lvalue { return( shift->on( 'deviceorientation', @_ ) ); } | ||||||||||
|
Subroutine
ondeviceorientation: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 195 | |||||||||||||
| 196 | 0 | ▶ | sub ondeviceorientationabsolute : lvalue { return( shift->on( 'deviceorientationabsolute', @_ ) ); } | ||||||||||
|
Subroutine
ondeviceorientationabsolute: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 197 | |||||||||||||
| 198 | 0 | ▶ | sub ondeviceproximity : lvalue { return( shift->on( 'deviceproximity', @_ ) ); } | ||||||||||
|
Subroutine
ondeviceproximity: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 199 | |||||||||||||
| 200 | 0 | ▶ | sub onerror : lvalue { return( shift->on( 'error', @_ ) ); } | ||||||||||
|
Subroutine
onerror: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 201 | |||||||||||||
| 202 | 0 | ▶ | sub ongamepadconnected : lvalue { return( shift->on( 'gamepadconnected', @_ ) ); } | ||||||||||
|
Subroutine
ongamepadconnected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 203 | |||||||||||||
| 204 | 0 | ▶ | sub ongamepaddisconnected : lvalue { return( shift->on( 'gamepaddisconnected', @_ ) ); } | ||||||||||
|
Subroutine
ongamepaddisconnected: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 205 | |||||||||||||
| 206 | 0 | ▶ | sub onlanguagechange : lvalue { return( shift->on( 'languagechange', @_ ) ); } | ||||||||||
|
Subroutine
onlanguagechange: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 207 | |||||||||||||
| 208 | 0 | ▶ | sub onorientationchange : lvalue { return( shift->on( 'orientationchange', @_ ) ); } | ||||||||||
|
Subroutine
onorientationchange: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 209 | |||||||||||||
| 210 | 0 | ▶ | sub onrejectionhandled : lvalue { return( shift->on( 'rejectionhandled', @_ ) ); } | ||||||||||
|
Subroutine
onrejectionhandled: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 211 | |||||||||||||
| 212 | 0 | ▶ | sub onresize : lvalue { return( shift->on( 'resize', @_ ) ); } | ||||||||||
|
Subroutine
onresize: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 213 | |||||||||||||
| 214 | 0 | ▶ | sub onstorage : lvalue { return( shift->on( 'storage', @_ ) ); } | ||||||||||
|
Subroutine
onstorage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 215 | |||||||||||||
| 216 | 0 | ▶ | sub onuserproximity : lvalue { return( shift->on( 'userproximity', @_ ) ); } | ||||||||||
|
Subroutine
onuserproximity: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 217 | |||||||||||||
| 218 | 0 | ▶ | sub onvrdisplayactivate : lvalue { return( shift->on( 'vrdisplayactivate', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplayactivate: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 219 | |||||||||||||
| 220 | 0 | ▶ | sub onvrdisplayblur : lvalue { return( shift->on( 'vrdisplayblur', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplayblur: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 221 | |||||||||||||
| 222 | 0 | ▶ | sub onvrdisplayconnect : lvalue { return( shift->on( 'vrdisplayconnect', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplayconnect: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 223 | |||||||||||||
| 224 | 0 | ▶ | sub onvrdisplaydeactivate : lvalue { return( shift->on( 'vrdisplaydeactivate', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplaydeactivate: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 225 | |||||||||||||
| 226 | 0 | ▶ | sub onvrdisplaydisconnect : lvalue { return( shift->on( 'vrdisplaydisconnect', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplaydisconnect: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 227 | |||||||||||||
| 228 | 0 | ▶ | sub onvrdisplayfocus : lvalue { return( shift->on( 'vrdisplayfocus', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplayfocus: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 229 | |||||||||||||
| 230 | 0 | ▶ | sub onvrdisplaypresentchange : lvalue { return( shift->on( 'vrdisplaypresentchange', @_ ) ); } | ||||||||||
|
Subroutine
onvrdisplaypresentchange: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 231 | |||||||||||||
| 232 | 0 | ▶ | sub open { return( shift->new( @_ ) ); } | ||||||||||
|
Subroutine
open: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 233 | |||||||||||||
| 234 | # Note: property opener | ||||||||||||
| 235 | 0 | ▶ | sub opener { return; } | ||||||||||
|
Subroutine
opener: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 236 | |||||||||||||
| 237 | # Note: property outerHeight read-only | ||||||||||||
| 238 | 0 | ▶ | sub outerHeight : lvalue { return( shift->_set_get_number( 'outerheight', @_ ) ); } | ||||||||||
|
Subroutine
outerHeight: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 239 | |||||||||||||
| 240 | # Note: property outerWidth read-only | ||||||||||||
| 241 | 0 | ▶ | sub outerWidth : lvalue { return( shift->_set_get_number( 'outerwidth', @_ ) ); } | ||||||||||
|
Subroutine
outerWidth: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 242 | |||||||||||||
| 243 | # Note: property pageXOffset read-only | ||||||||||||
| 244 | 0 | ▶ | sub pageXOffset { return; } | ||||||||||
|
Subroutine
pageXOffset: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 245 | |||||||||||||
| 246 | # Note: property pageYOffset read-only | ||||||||||||
| 247 | 0 | ▶ | sub pageYOffset { return; } | ||||||||||
|
Subroutine
pageYOffset: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 248 | |||||||||||||
| 249 | # Note: property parent read-only | ||||||||||||
| 250 | sub parent : lvalue { return( shift->_set_get_object_lvalue({ | ||||||||||||
| 251 | 182 | ▶ | field => 'parent', | ||||||||||
|
Subroutine
parent: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 252 | weaken => 1, | ||||||||||||
| 253 | }, 'HTML::Object::DOM::Window', @_ ) ); } | ||||||||||||
| 254 | |||||||||||||
| 255 | # Note: property performance read-only | ||||||||||||
| 256 | 0 | ▶ | sub performance { return; } | ||||||||||
|
Subroutine
performance: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 257 | |||||||||||||
| 258 | # Note: property personalbar read-only | ||||||||||||
| 259 | 0 | ▶ | sub personalbar { return; } | ||||||||||
|
Subroutine
personalbar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 260 | |||||||||||||
| 261 | 0 | ▶ | sub postMessage { return; } | ||||||||||
|
Subroutine
postMessage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 262 | |||||||||||||
| 263 | 0 | ▶ | sub print { return; } | ||||||||||
|
Subroutine
print: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 264 | |||||||||||||
| 265 | 0 | ▶ | sub prompt { return; } | ||||||||||
|
Subroutine
prompt: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 266 | |||||||||||||
| 267 | sub releaseEvents | ||||||||||||
| 268 | { | ||||||||||||
| 269 | 0 | ▶ | my $self = shift( @_ ); | ||||||||||
|
Subroutine
releaseEvents: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 270 | 0 | my $bit = shift( @_ ); | |||||||||||
| 271 | 0 | $self->{captured_events} = ( $self->{captured_events} ^ $bit ); | |||||||||||
| 272 | 0 | return( $self->{captured_events} ); | |||||||||||
| 273 | } | ||||||||||||
| 274 | |||||||||||||
| 275 | 0 | ▶ | sub requestAnimationFrame { return; } | ||||||||||
|
Subroutine
requestAnimationFrame: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 276 | |||||||||||||
| 277 | 0 | ▶ | sub requestIdleCallback { return; } | ||||||||||
|
Subroutine
requestIdleCallback: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 278 | |||||||||||||
| 279 | 0 | ▶ | sub resizeBy { return; } | ||||||||||
|
Subroutine
resizeBy: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 280 | |||||||||||||
| 281 | 0 | ▶ | sub resizeTo { return; } | ||||||||||
|
Subroutine
resizeTo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 282 | |||||||||||||
| 283 | # Note: property screen read-only | ||||||||||||
| 284 | 90 | ▶ | sub screen : lvalue { return( shift->_set_get_object_lvalue( 'screen', 'HTML::Object::DOM::Screen', @_ ) ); } | ||||||||||
|
Subroutine
screen: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 285 | |||||||||||||
| 286 | # Note: property screenX read-only | ||||||||||||
| 287 | 0 | ▶ | sub screenX { return; } | ||||||||||
|
Subroutine
screenX: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 288 | |||||||||||||
| 289 | # Note: property screenY read-only | ||||||||||||
| 290 | 0 | ▶ | sub screenY { return; } | ||||||||||
|
Subroutine
screenY: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 291 | |||||||||||||
| 292 | 0 | ▶ | sub scroll { return; } | ||||||||||
|
Subroutine
scroll: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 293 | |||||||||||||
| 294 | 0 | ▶ | sub scrollBy { return; } | ||||||||||
|
Subroutine
scrollBy: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 295 | |||||||||||||
| 296 | 0 | ▶ | sub scrollByLines { return; } | ||||||||||
|
Subroutine
scrollByLines: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 297 | |||||||||||||
| 298 | 0 | ▶ | sub scrollByPages { return; } | ||||||||||
|
Subroutine
scrollByPages: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 299 | |||||||||||||
| 300 | # Note: property scrollMaxX read-only | ||||||||||||
| 301 | 0 | ▶ | sub scrollMaxX { return; } | ||||||||||
|
Subroutine
scrollMaxX: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 302 | |||||||||||||
| 303 | # Note: property scrollMaxY read-only | ||||||||||||
| 304 | 0 | ▶ | sub scrollMaxY { return; } | ||||||||||
|
Subroutine
scrollMaxY: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 305 | |||||||||||||
| 306 | 0 | ▶ | sub scrollTo { return; } | ||||||||||
|
Subroutine
scrollTo: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 307 | |||||||||||||
| 308 | # Note: property scrollX read-only | ||||||||||||
| 309 | 0 | ▶ | sub scrollX : lvalue { return( shift->_set_get_number( 'scrollx', @_ ) ); } | ||||||||||
|
Subroutine
scrollX: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 310 | |||||||||||||
| 311 | # Note: property scrollY read-only | ||||||||||||
| 312 | 0 | ▶ | sub scrollY : lvalue { return( shift->_set_get_number( 'scrolly', @_ ) ); } | ||||||||||
|
Subroutine
scrollY: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 313 | |||||||||||||
| 314 | # Note: property scrollbars read-only | ||||||||||||
| 315 | 0 | ▶ | sub scrollbars { return; } | ||||||||||
|
Subroutine
scrollbars: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 316 | |||||||||||||
| 317 | # Note: property self read-only | ||||||||||||
| 318 | 0 | ▶ | sub self : lvalue { return( shift( @_ ) ); } | ||||||||||
|
Subroutine
self: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 319 | |||||||||||||
| 320 | # Note: property sessionStorage | ||||||||||||
| 321 | 0 | ▶ | sub sessionStorage { return; } | ||||||||||
|
Subroutine
sessionStorage: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 322 | |||||||||||||
| 323 | 0 | ▶ | sub setImmediate { return; } | ||||||||||
|
Subroutine
setImmediate: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 324 | |||||||||||||
| 325 | 0 | ▶ | sub setResizable { return; } | ||||||||||
|
Subroutine
setResizable: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 326 | |||||||||||||
| 327 | 0 | ▶ | sub showDirectoryPicker { return; } | ||||||||||
|
Subroutine
showDirectoryPicker: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 328 | |||||||||||||
| 329 | 0 | ▶ | sub showOpenFilePicker { return; } | ||||||||||
|
Subroutine
showOpenFilePicker: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 330 | |||||||||||||
| 331 | 0 | ▶ | sub showSaveFilePicker { return; } | ||||||||||
|
Subroutine
showSaveFilePicker: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 332 | |||||||||||||
| 333 | # Note: property sidebar read-only | ||||||||||||
| 334 | 0 | ▶ | sub sidebar { return; } | ||||||||||
|
Subroutine
sidebar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 335 | |||||||||||||
| 336 | 0 | ▶ | sub sizeToContent { return; } | ||||||||||
|
Subroutine
sizeToContent: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 337 | |||||||||||||
| 338 | # Note: property speechSynthesis read-only | ||||||||||||
| 339 | 0 | ▶ | sub speechSynthesis { return; } | ||||||||||
|
Subroutine
speechSynthesis: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 340 | |||||||||||||
| 341 | # Note: property status | ||||||||||||
| 342 | 0 | ▶ | sub status : lvalue { return( shift->_set_get_scalar_as_object( 'status', @_ ) ); } | ||||||||||
|
Subroutine
status: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 343 | |||||||||||||
| 344 | # Note: property statusbar read-only | ||||||||||||
| 345 | 0 | ▶ | sub statusbar { return; } | ||||||||||
|
Subroutine
statusbar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 346 | |||||||||||||
| 347 | 0 | ▶ | sub stop { return; } | ||||||||||
|
Subroutine
stop: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 348 | |||||||||||||
| 349 | # Note: property toolbar read-only | ||||||||||||
| 350 | 0 | ▶ | sub toolbar { return; } | ||||||||||
|
Subroutine
toolbar: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 351 | |||||||||||||
| 352 | # Note: property top read-only | ||||||||||||
| 353 | 0 | ▶ | sub top : lvalue { return( shift->_set_get_object_lvalue( 'top', 'HTML::Object::DOM::Window', @_ ) ); } | ||||||||||
|
Subroutine
top: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 354 | |||||||||||||
| 355 | 0 | ▶ | sub updateCommands { return; } | ||||||||||
|
Subroutine
updateCommands: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 356 | |||||||||||||
| 357 | # Note: property visualViewport read-only | ||||||||||||
| 358 | 0 | ▶ | sub visualViewport : lvalue { return( shift->_set_get_number( 'visualviewport', @_ ) ); } | ||||||||||
|
Subroutine
visualViewport: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 359 | |||||||||||||
| 360 | # Note: property window read-only | ||||||||||||
| 361 | 0 | ▶ | sub window { return( shift( @_ ) ); } | ||||||||||
|
Subroutine
window: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 362 | |||||||||||||
| 363 | 0 | ▶ | sub is_property { return( scalar( grep( /^$_[1]$/i, @LVALUE_METHODS ) ) ); } | ||||||||||
|
Subroutine
is_property: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 364 | |||||||||||||
| 365 | 32 | 1; | |||||||||||
| 366 | # NOTE: POD | ||||||||||||
| 367 | __END__ | ||||||||||||
| 368 | |||||||||||||
| 369 | =encoding utf-8 | ||||||||||||
| 370 | |||||||||||||
| 371 | =head1 NAME | ||||||||||||
| 372 | |||||||||||||
| 373 | HTML::Object::DOM::Window - HTML Object DOM Window Class | ||||||||||||
| 374 | |||||||||||||
| 375 | =head1 SYNOPSIS | ||||||||||||
| 376 | |||||||||||||
| 377 | use HTML::Object::DOM::Window; | ||||||||||||
| 378 | my $window = HTML::Object::DOM::Window->new || | ||||||||||||
| 379 | die( HTML::Object::DOM::Window->error, "\n" ); | ||||||||||||
| 380 | |||||||||||||
| 381 | =head1 VERSION | ||||||||||||
| 382 | |||||||||||||
| 383 | v0.2.0_1 | ||||||||||||
| 384 | |||||||||||||
| 385 | =head1 DESCRIPTION | ||||||||||||
| 386 | |||||||||||||
| 387 | The Window interface represents a window containing a L<DOM document|HTML::Object::DOM::Document>; the L<document property|/document> points to the L<DOM document|HTML::Object::DOM::Document> loaded in that window. | ||||||||||||
| 388 | |||||||||||||
| 389 | A window for a given document can be obtained using the L<document->defaultView property|HTML::Object::DOM/defaultView. | ||||||||||||
| 390 | |||||||||||||
| 391 | =head1 INHERITANCE | ||||||||||||
| 392 | |||||||||||||
| 393 | +-----------------------+ +---------------------------+ +---------------------------+ | ||||||||||||
| 394 | | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Window | | ||||||||||||
| 395 | +-----------------------+ +---------------------------+ +---------------------------+ | ||||||||||||
| 396 | |||||||||||||
| 397 | =head1 PROPERTIES | ||||||||||||
| 398 | |||||||||||||
| 399 | Inherits properties from its parent L<HTML::Object::EventTarget> | ||||||||||||
| 400 | |||||||||||||
| 401 | =head2 DOMMatrix | ||||||||||||
| 402 | |||||||||||||
| 403 | This always returns C<undef> under perl. | ||||||||||||
| 404 | |||||||||||||
| 405 | Normally, under JavaScript, this returns a reference to a C<DOMMatrix> object, which represents 4x4 matrices, suitable for 2D and 3D operations. | ||||||||||||
| 406 | |||||||||||||
| 407 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrix> | ||||||||||||
| 408 | |||||||||||||
| 409 | =head2 DOMMatrixReadOnly | ||||||||||||
| 410 | |||||||||||||
| 411 | This always returns C<undef> under perl. | ||||||||||||
| 412 | |||||||||||||
| 413 | Normally, under JavaScript, this returns a reference to a C<DOMMatrixReadOnly> object, which represents 4x4 matrices, suitable for 2D and 3D operations. | ||||||||||||
| 414 | |||||||||||||
| 415 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrixReadOnly> | ||||||||||||
| 416 | |||||||||||||
| 417 | =head2 DOMPoint | ||||||||||||
| 418 | |||||||||||||
| 419 | This always returns C<undef> under perl. | ||||||||||||
| 420 | |||||||||||||
| 421 | Normally, under JavaScript, this returns a reference to a C<DOMPoint> object, which represents a 2D or 3D point in a coordinate system. | ||||||||||||
| 422 | |||||||||||||
| 423 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPoint> | ||||||||||||
| 424 | |||||||||||||
| 425 | =head2 DOMPointReadOnly | ||||||||||||
| 426 | |||||||||||||
| 427 | This always returns C<undef> under perl. | ||||||||||||
| 428 | |||||||||||||
| 429 | Normally, under JavaScript, this returns a reference to a C<DOMPointReadOnly> object, which represents a 2D or 3D point in a coordinate system. | ||||||||||||
| 430 | |||||||||||||
| 431 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPointReadOnly> | ||||||||||||
| 432 | |||||||||||||
| 433 | =head2 DOMQuad | ||||||||||||
| 434 | |||||||||||||
| 435 | This always returns C<undef> under perl. | ||||||||||||
| 436 | |||||||||||||
| 437 | Normally, under JavaScript, this returns a reference to a C<DOMQuad> object, which provides represents a quadrilaterial object, that is one having four corners and four sides. | ||||||||||||
| 438 | |||||||||||||
| 439 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMQuad> | ||||||||||||
| 440 | |||||||||||||
| 441 | =head2 DOMRect | ||||||||||||
| 442 | |||||||||||||
| 443 | This always returns C<undef> under perl. | ||||||||||||
| 444 | |||||||||||||
| 445 | Normally, under JavaScript, this returns a reference to a C<DOMRect> object, which represents a rectangle. | ||||||||||||
| 446 | |||||||||||||
| 447 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRect> | ||||||||||||
| 448 | |||||||||||||
| 449 | =head2 DOMRectReadOnly | ||||||||||||
| 450 | |||||||||||||
| 451 | This always returns C<undef> under perl. | ||||||||||||
| 452 | |||||||||||||
| 453 | Normally, under JavaScript, this returns a reference to a C<DOMRectReadOnly> object, which represents a rectangle. | ||||||||||||
| 454 | |||||||||||||
| 455 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRectReadOnly> | ||||||||||||
| 456 | |||||||||||||
| 457 | =head2 clientInformation | ||||||||||||
| 458 | |||||||||||||
| 459 | This always returns C<undef> under perl. | ||||||||||||
| 460 | |||||||||||||
| 461 | Normally, under JavaScript, this is an alias for Window.navigator. | ||||||||||||
| 462 | |||||||||||||
| 463 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator> | ||||||||||||
| 464 | |||||||||||||
| 465 | =head2 closed | ||||||||||||
| 466 | |||||||||||||
| 467 | This always returns C<undef> under perl. | ||||||||||||
| 468 | |||||||||||||
| 469 | Normally, under JavaScript, this property indicates whether the current window is closed or not. | ||||||||||||
| 470 | |||||||||||||
| 471 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/closed> | ||||||||||||
| 472 | |||||||||||||
| 473 | =head2 console | ||||||||||||
| 474 | |||||||||||||
| 475 | This always returns C<undef> under perl. | ||||||||||||
| 476 | |||||||||||||
| 477 | Normally, under JavaScript, this returns a reference to the console object which provides access to the browser's debugging console. | ||||||||||||
| 478 | |||||||||||||
| 479 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/console> | ||||||||||||
| 480 | |||||||||||||
| 481 | =head2 crypto | ||||||||||||
| 482 | |||||||||||||
| 483 | This always returns C<undef> under perl. | ||||||||||||
| 484 | |||||||||||||
| 485 | Normally, under JavaScript, this returns the browser crypto object. | ||||||||||||
| 486 | |||||||||||||
| 487 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/crypto_property> | ||||||||||||
| 488 | |||||||||||||
| 489 | =head2 customElements | ||||||||||||
| 490 | |||||||||||||
| 491 | This always returns C<undef> under perl. | ||||||||||||
| 492 | |||||||||||||
| 493 | Normally, under JavaScript, this returns a reference to the C<CustomElementRegistry> object, which can be used to register new custom elements and get information about previously registered custom elements. | ||||||||||||
| 494 | |||||||||||||
| 495 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements> | ||||||||||||
| 496 | |||||||||||||
| 497 | =head2 devicePixelRatio | ||||||||||||
| 498 | |||||||||||||
| 499 | This always returns C<undef> under perl. | ||||||||||||
| 500 | |||||||||||||
| 501 | Normally, under JavaScript, this returns the ratio between physical pixels and device independent pixels in the current display. | ||||||||||||
| 502 | |||||||||||||
| 503 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio> | ||||||||||||
| 504 | |||||||||||||
| 505 | =head2 document | ||||||||||||
| 506 | |||||||||||||
| 507 | Read-only. | ||||||||||||
| 508 | |||||||||||||
| 509 | Returns a reference to the L<document|HTML::Object::DOM::Document> that the window contains. | ||||||||||||
| 510 | |||||||||||||
| 511 | Example: | ||||||||||||
| 512 | |||||||||||||
| 513 | my $parser = HTML::Object::DOM->new; | ||||||||||||
| 514 | $parser->parse_data( $html ); | ||||||||||||
| 515 | say( $parser->window->document->title ); | ||||||||||||
| 516 | |||||||||||||
| 517 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/document> | ||||||||||||
| 518 | |||||||||||||
| 519 | =head2 event | ||||||||||||
| 520 | |||||||||||||
| 521 | Read-only. | ||||||||||||
| 522 | |||||||||||||
| 523 | Returns the current event, which is the event currently being handled by the C<JavaScript> code's context, or undefined if no event is currently being handled. The Event object passed directly to event handlers should be used instead whenever possible. | ||||||||||||
| 524 | |||||||||||||
| 525 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/event> | ||||||||||||
| 526 | |||||||||||||
| 527 | =head2 frameElement | ||||||||||||
| 528 | |||||||||||||
| 529 | This always returns C<undef> under perl. | ||||||||||||
| 530 | |||||||||||||
| 531 | Normally, under JavaScript, this returns the element in which the window is embedded, or C<undef> if the window is not embedded. | ||||||||||||
| 532 | |||||||||||||
| 533 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/frameElement> | ||||||||||||
| 534 | |||||||||||||
| 535 | =head2 frames | ||||||||||||
| 536 | |||||||||||||
| 537 | Read-only. | ||||||||||||
| 538 | |||||||||||||
| 539 | Returns an array of the subframes in the current window. | ||||||||||||
| 540 | |||||||||||||
| 541 | Example: | ||||||||||||
| 542 | |||||||||||||
| 543 | my $frameList = $parser->window->frames; | ||||||||||||
| 544 | |||||||||||||
| 545 | my $frames = $parser->window->frames; # or my $frames = $parser->window->parent->frames; | ||||||||||||
| 546 | for( my $i = 0; $i < $frames->length; $i++ ) | ||||||||||||
| 547 | { | ||||||||||||
| 548 | # do something with each subframe as $frames->[$i] | ||||||||||||
| 549 | $frames->[$i]->document->body->style->background = "red"; | ||||||||||||
| 550 | } | ||||||||||||
| 551 | |||||||||||||
| 552 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/frames> | ||||||||||||
| 553 | |||||||||||||
| 554 | =head2 fullScreen | ||||||||||||
| 555 | |||||||||||||
| 556 | This boolean value is set to false under perl, but you can change it. | ||||||||||||
| 557 | |||||||||||||
| 558 | Normally, under JavaScript, this property indicates whether the window is displayed in full screen or not. | ||||||||||||
| 559 | |||||||||||||
| 560 | Example: | ||||||||||||
| 561 | |||||||||||||
| 562 | if( $parser->window->fullScreen ) { | ||||||||||||
| 563 | # it's fullscreen! | ||||||||||||
| 564 | } | ||||||||||||
| 565 | else { | ||||||||||||
| 566 | # not fullscreen! | ||||||||||||
| 567 | } | ||||||||||||
| 568 | |||||||||||||
| 569 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/fullScreen> | ||||||||||||
| 570 | |||||||||||||
| 571 | =head2 history | ||||||||||||
| 572 | |||||||||||||
| 573 | This always returns C<undef> under perl. | ||||||||||||
| 574 | |||||||||||||
| 575 | Normally, under JavaScript, this returns a reference to the history object. | ||||||||||||
| 576 | |||||||||||||
| 577 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/history> | ||||||||||||
| 578 | |||||||||||||
| 579 | =head2 innerHeight | ||||||||||||
| 580 | |||||||||||||
| 581 | Normally this is read-only, but under perl you can set whatever number value you want. | ||||||||||||
| 582 | |||||||||||||
| 583 | Under JavaScript, this gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar. | ||||||||||||
| 584 | |||||||||||||
| 585 | Example: | ||||||||||||
| 586 | |||||||||||||
| 587 | my $intViewportHeight = $parser->window->innerHeight; | ||||||||||||
| 588 | |||||||||||||
| 589 | my $intFrameHeight = $parser->window->innerHeight; # or | ||||||||||||
| 590 | |||||||||||||
| 591 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight> | ||||||||||||
| 592 | |||||||||||||
| 593 | =head2 innerWidth | ||||||||||||
| 594 | |||||||||||||
| 595 | Normally this is read-only, but under perl you can set whatever number value you want. | ||||||||||||
| 596 | |||||||||||||
| 597 | Under JavaScript, this gets the width of the content area of the browser window including, if rendered, the vertical scrollbar. | ||||||||||||
| 598 | |||||||||||||
| 599 | Example: | ||||||||||||
| 600 | |||||||||||||
| 601 | my $intViewportWidth = $parser->window->innerWidth; | ||||||||||||
| 602 | |||||||||||||
| 603 | # This will return the width of the viewport | ||||||||||||
| 604 | my $intFrameWidth = $parser->window->innerWidth; | ||||||||||||
| 605 | |||||||||||||
| 606 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth> | ||||||||||||
| 607 | |||||||||||||
| 608 | =head2 is_property | ||||||||||||
| 609 | |||||||||||||
| 610 | Provided with a property name and this will return true if it is indeed a window property or false otherwise. | ||||||||||||
| 611 | |||||||||||||
| 612 | =head2 isSecureContext | ||||||||||||
| 613 | |||||||||||||
| 614 | This is not used under perl, but you can set whatever boolean value you want. By default this returns true. | ||||||||||||
| 615 | |||||||||||||
| 616 | Normally, under JavaScript, this indicates whether a context is capable of using features that require secure contexts. | ||||||||||||
| 617 | |||||||||||||
| 618 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/isSecureContext> | ||||||||||||
| 619 | |||||||||||||
| 620 | =head2 length | ||||||||||||
| 621 | |||||||||||||
| 622 | Read-only. | ||||||||||||
| 623 | |||||||||||||
| 624 | Returns the number of frames in the window. See also L</frames>. | ||||||||||||
| 625 | |||||||||||||
| 626 | Example: | ||||||||||||
| 627 | |||||||||||||
| 628 | if( $parser->window->length ) { | ||||||||||||
| 629 | # this is a document with subframes | ||||||||||||
| 630 | } | ||||||||||||
| 631 | |||||||||||||
| 632 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/length> | ||||||||||||
| 633 | |||||||||||||
| 634 | =head2 localStorage | ||||||||||||
| 635 | |||||||||||||
| 636 | This always returns C<undef> under perl. | ||||||||||||
| 637 | |||||||||||||
| 638 | Normally, under JavaScript, this returns a reference to the local storage object used to store data that may only be accessed by the origin that created it. | ||||||||||||
| 639 | |||||||||||||
| 640 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage> | ||||||||||||
| 641 | |||||||||||||
| 642 | =head2 location | ||||||||||||
| 643 | |||||||||||||
| 644 | By default, this returns C<undef>, but you can set it to whatever URI you want. If set, it will return a L<URI> object. | ||||||||||||
| 645 | |||||||||||||
| 646 | Gets/sets the location, or current URL, of the window object. | ||||||||||||
| 647 | |||||||||||||
| 648 | Example: | ||||||||||||
| 649 | |||||||||||||
| 650 | say( $parser->window->location ); # alerts "https://example.org/some/where" | ||||||||||||
| 651 | |||||||||||||
| 652 | $parser->window->location->assign( "https://example.org" ); # or | ||||||||||||
| 653 | $parser->window->location = "https://example.org"; | ||||||||||||
| 654 | |||||||||||||
| 655 | Another example: | ||||||||||||
| 656 | |||||||||||||
| 657 | $parser->window->location->reload(); | ||||||||||||
| 658 | |||||||||||||
| 659 | Another example: | ||||||||||||
| 660 | |||||||||||||
| 661 | sub reloadPageWithHash() { | ||||||||||||
| 662 | my $initialPage = $parser->window->location->pathname; | ||||||||||||
| 663 | $parser->window->location->replace('http://example.org/#' + $initialPage); | ||||||||||||
| 664 | } | ||||||||||||
| 665 | |||||||||||||
| 666 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/location> | ||||||||||||
| 667 | |||||||||||||
| 668 | =head2 locationbar | ||||||||||||
| 669 | |||||||||||||
| 670 | This always returns C<undef> under perl. | ||||||||||||
| 671 | |||||||||||||
| 672 | Normally, under JavaScript, this returns the locationbar object, whose visibility can be toggled in the window. | ||||||||||||
| 673 | |||||||||||||
| 674 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/locationbar> | ||||||||||||
| 675 | |||||||||||||
| 676 | =head2 menubar | ||||||||||||
| 677 | |||||||||||||
| 678 | This always returns C<undef> under perl. | ||||||||||||
| 679 | |||||||||||||
| 680 | Normally, under JavaScript, this returns the menubar object, whose visibility can be toggled in the window. | ||||||||||||
| 681 | |||||||||||||
| 682 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/menubar> | ||||||||||||
| 683 | |||||||||||||
| 684 | =head2 messageManager | ||||||||||||
| 685 | |||||||||||||
| 686 | This always returns C<undef> under perl. | ||||||||||||
| 687 | |||||||||||||
| 688 | Normally, under JavaScript, this returns the message manager object for this window. | ||||||||||||
| 689 | |||||||||||||
| 690 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/messageManager> | ||||||||||||
| 691 | |||||||||||||
| 692 | =head2 mozInnerScreenX | ||||||||||||
| 693 | |||||||||||||
| 694 | This always returns C<undef> under perl. | ||||||||||||
| 695 | |||||||||||||
| 696 | Normally, under JavaScript, this returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed. | ||||||||||||
| 697 | |||||||||||||
| 698 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenX> | ||||||||||||
| 699 | |||||||||||||
| 700 | =head2 mozInnerScreenY | ||||||||||||
| 701 | |||||||||||||
| 702 | This always returns C<undef> under perl. | ||||||||||||
| 703 | |||||||||||||
| 704 | Normally, under JavaScript, this returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed. | ||||||||||||
| 705 | |||||||||||||
| 706 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenY> | ||||||||||||
| 707 | |||||||||||||
| 708 | =head2 name | ||||||||||||
| 709 | |||||||||||||
| 710 | Gets/sets the name of the window. | ||||||||||||
| 711 | |||||||||||||
| 712 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/name> | ||||||||||||
| 713 | |||||||||||||
| 714 | =head2 navigator | ||||||||||||
| 715 | |||||||||||||
| 716 | This always returns C<undef> under perl. | ||||||||||||
| 717 | |||||||||||||
| 718 | Normally, under JavaScript, this returns a reference to the navigator object. | ||||||||||||
| 719 | |||||||||||||
| 720 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator> | ||||||||||||
| 721 | |||||||||||||
| 722 | =head2 onerror | ||||||||||||
| 723 | |||||||||||||
| 724 | Sets the event listener for when error occur on this window interface. | ||||||||||||
| 725 | |||||||||||||
| 726 | =head2 onlanguagechange | ||||||||||||
| 727 | |||||||||||||
| 728 | Sets the event listener for when the language is changed. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget> | ||||||||||||
| 729 | |||||||||||||
| 730 | =head2 onorientationchange | ||||||||||||
| 731 | |||||||||||||
| 732 | Sets the event listener for when there is a change of orientation. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget> | ||||||||||||
| 733 | |||||||||||||
| 734 | =head2 onresize | ||||||||||||
| 735 | |||||||||||||
| 736 | Sets the event listener for when the screen gets resized. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget> | ||||||||||||
| 737 | |||||||||||||
| 738 | =head2 onstorage | ||||||||||||
| 739 | |||||||||||||
| 740 | Sets the event listener for when the screen storage facility has been changed. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget> | ||||||||||||
| 741 | |||||||||||||
| 742 | =head2 opener | ||||||||||||
| 743 | |||||||||||||
| 744 | This always returns C<undef> under perl. | ||||||||||||
| 745 | |||||||||||||
| 746 | Normally, under JavaScript, this returns a reference to the window that opened this current window. | ||||||||||||
| 747 | |||||||||||||
| 748 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/opener> | ||||||||||||
| 749 | |||||||||||||
| 750 | =head2 outerHeight | ||||||||||||
| 751 | |||||||||||||
| 752 | Normally this is read-only, but under perl you can set whatever number value you want. | ||||||||||||
| 753 | |||||||||||||
| 754 | Under JavaScript, this gets the height of the outside of the browser window. | ||||||||||||
| 755 | |||||||||||||
| 756 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight> | ||||||||||||
| 757 | |||||||||||||
| 758 | =head2 outerWidth | ||||||||||||
| 759 | |||||||||||||
| 760 | Normally this is read-only, but under perl you can set whatever number value you want. | ||||||||||||
| 761 | |||||||||||||
| 762 | Under JavaScript, this gets the width of the outside of the browser window. | ||||||||||||
| 763 | |||||||||||||
| 764 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/outerWidth> | ||||||||||||
| 765 | |||||||||||||
| 766 | =head2 pageXOffset | ||||||||||||
| 767 | |||||||||||||
| 768 | This always returns C<undef> under perl. | ||||||||||||
| 769 | |||||||||||||
| 770 | Normally, under JavaScript, this is an alias for window.scrollX. | ||||||||||||
| 771 | |||||||||||||
| 772 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX> | ||||||||||||
| 773 | |||||||||||||
| 774 | =head2 pageYOffset | ||||||||||||
| 775 | |||||||||||||
| 776 | This always returns C<undef> under perl. | ||||||||||||
| 777 | |||||||||||||
| 778 | Normally, under JavaScript, this is an alias for window.scrollY | ||||||||||||
| 779 | |||||||||||||
| 780 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY> | ||||||||||||
| 781 | |||||||||||||
| 782 | =head2 parent | ||||||||||||
| 783 | |||||||||||||
| 784 | Read-only. | ||||||||||||
| 785 | |||||||||||||
| 786 | Returns a reference to the parent of the current window or subframe, if any. By default this returns C<undef>, but you can set it to a L<window object|HTML::Object::DOM::Window>. | ||||||||||||
| 787 | |||||||||||||
| 788 | Example: | ||||||||||||
| 789 | |||||||||||||
| 790 | my $parentWindow = $parser->window->parent; | ||||||||||||
| 791 | |||||||||||||
| 792 | if( $parser->window->parent != $parser->window->top) { | ||||||||||||
| 793 | # We're deeper than one down | ||||||||||||
| 794 | } | ||||||||||||
| 795 | |||||||||||||
| 796 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/parent> | ||||||||||||
| 797 | |||||||||||||
| 798 | =head2 performance | ||||||||||||
| 799 | |||||||||||||
| 800 | Read-only. | ||||||||||||
| 801 | |||||||||||||
| 802 | This always returns C<undef> under perl. | ||||||||||||
| 803 | |||||||||||||
| 804 | Normally, under JavaScript, this returns a C<Performance> object, which includes the timing and navigation attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples. | ||||||||||||
| 805 | |||||||||||||
| 806 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/performance_property> | ||||||||||||
| 807 | |||||||||||||
| 808 | =head2 personalbar | ||||||||||||
| 809 | |||||||||||||
| 810 | This always returns C<undef> under perl. | ||||||||||||
| 811 | |||||||||||||
| 812 | Normally, under JavaScript, this returns the personalbar object, whose visibility can be toggled in the window. | ||||||||||||
| 813 | |||||||||||||
| 814 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/personalbar> | ||||||||||||
| 815 | |||||||||||||
| 816 | =head2 screen | ||||||||||||
| 817 | |||||||||||||
| 818 | Read-only. | ||||||||||||
| 819 | |||||||||||||
| 820 | Returns a reference to the L<screen object|HTML::Object::DOM::Screen> associated with the window. | ||||||||||||
| 821 | |||||||||||||
| 822 | Example: | ||||||||||||
| 823 | |||||||||||||
| 824 | use HTML::Object::DOM qw( window screen ); | ||||||||||||
| 825 | if( screen->pixelDepth < 8 ) { | ||||||||||||
| 826 | # use low-color version of page | ||||||||||||
| 827 | } else { | ||||||||||||
| 828 | # use regular, colorful page | ||||||||||||
| 829 | } | ||||||||||||
| 830 | |||||||||||||
| 831 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screen> | ||||||||||||
| 832 | |||||||||||||
| 833 | =head2 screenX | ||||||||||||
| 834 | |||||||||||||
| 835 | This always returns C<undef> under perl. | ||||||||||||
| 836 | |||||||||||||
| 837 | Normally, under JavaScript, both properties return the horizontal distance from the left border of the user's browser viewport to the left side of the screen. | ||||||||||||
| 838 | |||||||||||||
| 839 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screenX> | ||||||||||||
| 840 | |||||||||||||
| 841 | =head2 screenY | ||||||||||||
| 842 | |||||||||||||
| 843 | This always returns C<undef> under perl. | ||||||||||||
| 844 | |||||||||||||
| 845 | Normally, under JavaScript, both properties return the vertical distance from the top border of the user's browser viewport to the top side of the screen. | ||||||||||||
| 846 | |||||||||||||
| 847 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY> | ||||||||||||
| 848 | |||||||||||||
| 849 | =head2 scrollMaxX | ||||||||||||
| 850 | |||||||||||||
| 851 | This always returns C<undef> under perl. | ||||||||||||
| 852 | |||||||||||||
| 853 | Normally, under JavaScript, this returns the maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width. | ||||||||||||
| 854 | |||||||||||||
| 855 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxX> | ||||||||||||
| 856 | |||||||||||||
| 857 | =head2 scrollMaxY | ||||||||||||
| 858 | |||||||||||||
| 859 | This always returns C<undef> under perl. | ||||||||||||
| 860 | |||||||||||||
| 861 | Normally, under JavaScript, this returns the maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height). | ||||||||||||
| 862 | |||||||||||||
| 863 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxY> | ||||||||||||
| 864 | |||||||||||||
| 865 | =head2 scrollX | ||||||||||||
| 866 | |||||||||||||
| 867 | Normally this is read-only, but under perl you can set whatever number value you want. BY default this is C<undef> | ||||||||||||
| 868 | |||||||||||||
| 869 | Under JavaScript, this returns the number of pixels that the document has already been scrolled horizontally. | ||||||||||||
| 870 | |||||||||||||
| 871 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX> | ||||||||||||
| 872 | |||||||||||||
| 873 | =head2 scrollY | ||||||||||||
| 874 | |||||||||||||
| 875 | Normally this is read-only, but under perl you can set whatever number value you want. BY default this is C<undef> | ||||||||||||
| 876 | |||||||||||||
| 877 | Under JavaScript, this returns the number of pixels that the document has already been scrolled vertically. | ||||||||||||
| 878 | |||||||||||||
| 879 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY> | ||||||||||||
| 880 | |||||||||||||
| 881 | =head2 scrollbars | ||||||||||||
| 882 | |||||||||||||
| 883 | This always returns C<undef> under perl. | ||||||||||||
| 884 | |||||||||||||
| 885 | Normally, under JavaScript, this returns the scrollbars object, whose visibility can be toggled in the window. | ||||||||||||
| 886 | |||||||||||||
| 887 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollbars> | ||||||||||||
| 888 | |||||||||||||
| 889 | =head2 self | ||||||||||||
| 890 | |||||||||||||
| 891 | Read-only. | ||||||||||||
| 892 | |||||||||||||
| 893 | Returns an object reference to the window object itself. | ||||||||||||
| 894 | |||||||||||||
| 895 | Example: | ||||||||||||
| 896 | |||||||||||||
| 897 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 898 | if( window->parent->frames->[0] != window->self ) | ||||||||||||
| 899 | { | ||||||||||||
| 900 | # this window is not the first frame in the list | ||||||||||||
| 901 | } | ||||||||||||
| 902 | |||||||||||||
| 903 | my $w1 = window; | ||||||||||||
| 904 | my $w2 = self; | ||||||||||||
| 905 | my $w3 = window->window; | ||||||||||||
| 906 | my $w4 = window->self; | ||||||||||||
| 907 | # $w1, $w2, $w3, $w4 all strictly equal, but only $w2 will sub in workers | ||||||||||||
| 908 | |||||||||||||
| 909 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/self> | ||||||||||||
| 910 | |||||||||||||
| 911 | =head2 sessionStorage | ||||||||||||
| 912 | |||||||||||||
| 913 | This always returns C<undef> under perl. | ||||||||||||
| 914 | |||||||||||||
| 915 | Normally, under JavaScript, this returns a reference to the session storage object used to store data that may only be accessed by the origin that created it. | ||||||||||||
| 916 | |||||||||||||
| 917 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage> | ||||||||||||
| 918 | |||||||||||||
| 919 | =head2 sidebar | ||||||||||||
| 920 | |||||||||||||
| 921 | This always returns C<undef> under perl. | ||||||||||||
| 922 | |||||||||||||
| 923 | Normally, under JavaScript, this returns a reference to the window object of the sidebar. | ||||||||||||
| 924 | |||||||||||||
| 925 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar> | ||||||||||||
| 926 | |||||||||||||
| 927 | =head2 speechSynthesis | ||||||||||||
| 928 | |||||||||||||
| 929 | This always returns C<undef> under perl. | ||||||||||||
| 930 | |||||||||||||
| 931 | Normally, under JavaScript, this returns a C<SpeechSynthesis> object, which is the entry point into using Web Speech API speech synthesis functionality. | ||||||||||||
| 932 | |||||||||||||
| 933 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/speechSynthesis> | ||||||||||||
| 934 | |||||||||||||
| 935 | =head2 status | ||||||||||||
| 936 | |||||||||||||
| 937 | Normally this is read-only, but under perl you can set whatever text value you want. It returns a L<scalar object|Module::Generic::Scalar>. | ||||||||||||
| 938 | |||||||||||||
| 939 | Under JavaScript, this gets/sets the text in the statusbar at the bottom of the browser. | ||||||||||||
| 940 | |||||||||||||
| 941 | Example: | ||||||||||||
| 942 | |||||||||||||
| 943 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 944 | window->status = $string; | ||||||||||||
| 945 | my $value = window->status; | ||||||||||||
| 946 | |||||||||||||
| 947 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/status> | ||||||||||||
| 948 | |||||||||||||
| 949 | =head2 statusbar | ||||||||||||
| 950 | |||||||||||||
| 951 | This always returns C<undef> under perl. | ||||||||||||
| 952 | |||||||||||||
| 953 | Normally, under JavaScript, this return the statusbar object, whose visibility can be toggled in the window. | ||||||||||||
| 954 | |||||||||||||
| 955 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/statusbar> | ||||||||||||
| 956 | |||||||||||||
| 957 | =head2 toolbar | ||||||||||||
| 958 | |||||||||||||
| 959 | This always returns C<undef> under perl. | ||||||||||||
| 960 | |||||||||||||
| 961 | Normally, under JavaScript, this return the toolbar object, whose visibility can be toggled in the window. | ||||||||||||
| 962 | |||||||||||||
| 963 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/toolbar> | ||||||||||||
| 964 | |||||||||||||
| 965 | =head2 top | ||||||||||||
| 966 | |||||||||||||
| 967 | Normally this is read-only, but under perl you can set whatever L<window object|HTML::Object::DOM::Window> you want. | ||||||||||||
| 968 | |||||||||||||
| 969 | Under JavaScript, this returns a reference to the topmost window in the window hierarchy. This property is read only. | ||||||||||||
| 970 | |||||||||||||
| 971 | Example: | ||||||||||||
| 972 | |||||||||||||
| 973 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 974 | my $topWindow = window->top; | ||||||||||||
| 975 | |||||||||||||
| 976 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/top> | ||||||||||||
| 977 | |||||||||||||
| 978 | =head2 visualViewport | ||||||||||||
| 979 | |||||||||||||
| 980 | Normally this is read-only, but under perl you can set whatever number value you want. | ||||||||||||
| 981 | |||||||||||||
| 982 | Under JavaScript, this a C<VisualViewport> object which represents the visual viewport for a given window. | ||||||||||||
| 983 | |||||||||||||
| 984 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/visualViewport> | ||||||||||||
| 985 | |||||||||||||
| 986 | =head2 window | ||||||||||||
| 987 | |||||||||||||
| 988 | Read-only. | ||||||||||||
| 989 | |||||||||||||
| 990 | Returns a reference to the current window. | ||||||||||||
| 991 | |||||||||||||
| 992 | Example: | ||||||||||||
| 993 | |||||||||||||
| 994 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 995 | window->window | ||||||||||||
| 996 | window->window->window | ||||||||||||
| 997 | window->window->window->window | ||||||||||||
| 998 | # ... | ||||||||||||
| 999 | |||||||||||||
| 1000 | my $global = {data: 0}; | ||||||||||||
| 1001 | say( $global == window->global ); # displays "true" | ||||||||||||
| 1002 | |||||||||||||
| 1003 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/window> | ||||||||||||
| 1004 | |||||||||||||
| 1005 | =head1 METHODS | ||||||||||||
| 1006 | |||||||||||||
| 1007 | Inherits methods from its parent L<HTML::Object::EventTarget> | ||||||||||||
| 1008 | |||||||||||||
| 1009 | =head2 alert | ||||||||||||
| 1010 | |||||||||||||
| 1011 | Under perl, this calls L<perlfunc/warn> passing it whatever arguments you provide. | ||||||||||||
| 1012 | |||||||||||||
| 1013 | Under JavaScript, this displays an alert dialog. | ||||||||||||
| 1014 | |||||||||||||
| 1015 | Example: | ||||||||||||
| 1016 | |||||||||||||
| 1017 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 1018 | my $parser = HTML::Object::DOM->new; | ||||||||||||
| 1019 | window->alert( $message ); | ||||||||||||
| 1020 | |||||||||||||
| 1021 | window->alert( "Hello world!" ); | ||||||||||||
| 1022 | $parser->window->alert( "Hello world!" ); | ||||||||||||
| 1023 | |||||||||||||
| 1024 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/alert> | ||||||||||||
| 1025 | |||||||||||||
| 1026 | =head2 blur | ||||||||||||
| 1027 | |||||||||||||
| 1028 | This always returns C<undef> under perl. | ||||||||||||
| 1029 | |||||||||||||
| 1030 | Normally, under JavaScript, this sets focus away from the window. | ||||||||||||
| 1031 | |||||||||||||
| 1032 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/blur> | ||||||||||||
| 1033 | |||||||||||||
| 1034 | =head2 cancelAnimationFrame | ||||||||||||
| 1035 | |||||||||||||
| 1036 | This always returns C<undef> under perl. | ||||||||||||
| 1037 | |||||||||||||
| 1038 | Normally, under JavaScript, this enables you to cancel a callback previously scheduled with Window.requestAnimationFrame. | ||||||||||||
| 1039 | |||||||||||||
| 1040 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame> | ||||||||||||
| 1041 | |||||||||||||
| 1042 | =head2 cancelIdleCallback | ||||||||||||
| 1043 | |||||||||||||
| 1044 | This always returns C<undef> under perl. | ||||||||||||
| 1045 | |||||||||||||
| 1046 | Normally, under JavaScript, this enables you to cancel a callback previously scheduled with Window.requestIdleCallback. | ||||||||||||
| 1047 | |||||||||||||
| 1048 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback> | ||||||||||||
| 1049 | |||||||||||||
| 1050 | =head2 captureEvents | ||||||||||||
| 1051 | |||||||||||||
| 1052 | Registers the window to capture all events of the specified type. | ||||||||||||
| 1053 | |||||||||||||
| 1054 | Example: | ||||||||||||
| 1055 | |||||||||||||
| 1056 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 1057 | use HTML::Object::Event qw( events ); | ||||||||||||
| 1058 | window->captureEvents( CLICK ); | ||||||||||||
| 1059 | window->onclick = \&page_click; | ||||||||||||
| 1060 | |||||||||||||
| 1061 | Note that you can pass a list of events to this method using the following syntax: | ||||||||||||
| 1062 | |||||||||||||
| 1063 | window.captureEvents( KEYPRESS | KEYDOWN | KEYUP ). | ||||||||||||
| 1064 | |||||||||||||
| 1065 | Although you can still use it, this method is deprecated in favour of L<EventTarget/addEventListener> | ||||||||||||
| 1066 | |||||||||||||
| 1067 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/captureEvents> | ||||||||||||
| 1068 | |||||||||||||
| 1069 | =head2 clearImmediate | ||||||||||||
| 1070 | |||||||||||||
| 1071 | This always returns C<undef> under perl. | ||||||||||||
| 1072 | |||||||||||||
| 1073 | Normally, under JavaScript, this cancels the repeated execution set using setImmediate. | ||||||||||||
| 1074 | |||||||||||||
| 1075 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/clearImmediate> | ||||||||||||
| 1076 | |||||||||||||
| 1077 | =head2 close | ||||||||||||
| 1078 | |||||||||||||
| 1079 | Under perl, this does nothing in particular, but under JavaScript, this closes the current window. | ||||||||||||
| 1080 | |||||||||||||
| 1081 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/close> | ||||||||||||
| 1082 | |||||||||||||
| 1083 | =head2 confirm | ||||||||||||
| 1084 | |||||||||||||
| 1085 | This always returns C<undef> under perl. | ||||||||||||
| 1086 | |||||||||||||
| 1087 | Normally, under JavaScript, this displays a dialog with a message that the user needs to respond to. | ||||||||||||
| 1088 | |||||||||||||
| 1089 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm> | ||||||||||||
| 1090 | |||||||||||||
| 1091 | =head2 dump | ||||||||||||
| 1092 | |||||||||||||
| 1093 | Under perl, this use L<Data::Dump/dump> to print out data provided to the C<STDERR>. | ||||||||||||
| 1094 | |||||||||||||
| 1095 | Under JavaScript, this writes a message to the console. | ||||||||||||
| 1096 | |||||||||||||
| 1097 | Example: | ||||||||||||
| 1098 | |||||||||||||
| 1099 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 1100 | window->dump( $message ); | ||||||||||||
| 1101 | |||||||||||||
| 1102 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/dump> | ||||||||||||
| 1103 | |||||||||||||
| 1104 | =head2 find | ||||||||||||
| 1105 | |||||||||||||
| 1106 | This always returns C<undef> under perl. | ||||||||||||
| 1107 | |||||||||||||
| 1108 | Normally, under JavaScript, this searches for a given string in a window. | ||||||||||||
| 1109 | |||||||||||||
| 1110 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/find> | ||||||||||||
| 1111 | |||||||||||||
| 1112 | =head2 focus | ||||||||||||
| 1113 | |||||||||||||
| 1114 | This always returns C<undef> under perl. | ||||||||||||
| 1115 | |||||||||||||
| 1116 | Normally, under JavaScript, this sets focus on the current window. | ||||||||||||
| 1117 | |||||||||||||
| 1118 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/focus> | ||||||||||||
| 1119 | |||||||||||||
| 1120 | =head2 getComputedStyle | ||||||||||||
| 1121 | |||||||||||||
| 1122 | This always returns C<undef> under perl. | ||||||||||||
| 1123 | |||||||||||||
| 1124 | Normally, under JavaScript, this gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element. | ||||||||||||
| 1125 | |||||||||||||
| 1126 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle> | ||||||||||||
| 1127 | |||||||||||||
| 1128 | =head2 getDefaultComputedStyle | ||||||||||||
| 1129 | |||||||||||||
| 1130 | This always returns C<undef> under perl. | ||||||||||||
| 1131 | |||||||||||||
| 1132 | Normally, under JavaScript, this gets default computed style for the specified element, ignoring author stylesheets. | ||||||||||||
| 1133 | |||||||||||||
| 1134 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/window/getDefaultComputedStyle> | ||||||||||||
| 1135 | |||||||||||||
| 1136 | =head2 getSelection | ||||||||||||
| 1137 | |||||||||||||
| 1138 | This always returns C<undef> under perl. | ||||||||||||
| 1139 | |||||||||||||
| 1140 | Normally, under JavaScript, this returns the selection object representing the selected item(s). | ||||||||||||
| 1141 | |||||||||||||
| 1142 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection> | ||||||||||||
| 1143 | |||||||||||||
| 1144 | =head2 matchMedia | ||||||||||||
| 1145 | |||||||||||||
| 1146 | This always returns C<undef> under perl. | ||||||||||||
| 1147 | |||||||||||||
| 1148 | Normally, under JavaScript, this returns a C<MediaQueryList> object representing the specified media query string. | ||||||||||||
| 1149 | |||||||||||||
| 1150 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia> | ||||||||||||
| 1151 | |||||||||||||
| 1152 | =head2 moveBy | ||||||||||||
| 1153 | |||||||||||||
| 1154 | This always returns C<undef> under perl. | ||||||||||||
| 1155 | |||||||||||||
| 1156 | Normally, under JavaScript, this moves the current window by a specified amount. | ||||||||||||
| 1157 | |||||||||||||
| 1158 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/moveBy> | ||||||||||||
| 1159 | |||||||||||||
| 1160 | =head2 moveTo | ||||||||||||
| 1161 | |||||||||||||
| 1162 | This always returns C<undef> under perl. | ||||||||||||
| 1163 | |||||||||||||
| 1164 | Normally, under JavaScript, this moves the window to the specified coordinates. | ||||||||||||
| 1165 | |||||||||||||
| 1166 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo> | ||||||||||||
| 1167 | |||||||||||||
| 1168 | =head2 open | ||||||||||||
| 1169 | |||||||||||||
| 1170 | Under perl, this merely returns a new L<window object>. | ||||||||||||
| 1171 | |||||||||||||
| 1172 | Under JavaScript, this opens a new window. | ||||||||||||
| 1173 | |||||||||||||
| 1174 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/open> | ||||||||||||
| 1175 | |||||||||||||
| 1176 | =head2 postMessage | ||||||||||||
| 1177 | |||||||||||||
| 1178 | This always returns C<undef> under perl. | ||||||||||||
| 1179 | |||||||||||||
| 1180 | Normally, under JavaScript, this provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first. | ||||||||||||
| 1181 | |||||||||||||
| 1182 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage> | ||||||||||||
| 1183 | |||||||||||||
| 1184 | =head2 print | ||||||||||||
| 1185 | |||||||||||||
| 1186 | This always returns C<undef> under perl. | ||||||||||||
| 1187 | |||||||||||||
| 1188 | Normally, under JavaScript, this opens the Print Dialog to print the current document. | ||||||||||||
| 1189 | |||||||||||||
| 1190 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/print> | ||||||||||||
| 1191 | |||||||||||||
| 1192 | =head2 prompt | ||||||||||||
| 1193 | |||||||||||||
| 1194 | This always returns C<undef> under perl. | ||||||||||||
| 1195 | |||||||||||||
| 1196 | Normally, under JavaScript, this returns the text entered by the user in a prompt dialog. | ||||||||||||
| 1197 | |||||||||||||
| 1198 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt> | ||||||||||||
| 1199 | |||||||||||||
| 1200 | =head2 releaseEvents | ||||||||||||
| 1201 | |||||||||||||
| 1202 | Releases the window from trapping events of a specific type. | ||||||||||||
| 1203 | |||||||||||||
| 1204 | Example: | ||||||||||||
| 1205 | |||||||||||||
| 1206 | use HTML::Object::DOM qw( window ); | ||||||||||||
| 1207 | window->releaseEvents( KEYPRESS ); | ||||||||||||
| 1208 | |||||||||||||
| 1209 | Note that you can pass a list of events to this method using the following syntax: | ||||||||||||
| 1210 | |||||||||||||
| 1211 | window->releaseEvents( KEYPRESS | KEYDOWN | KEYUP ); | ||||||||||||
| 1212 | |||||||||||||
| 1213 | =head2 requestAnimationFrame | ||||||||||||
| 1214 | |||||||||||||
| 1215 | This always returns C<undef> under perl. | ||||||||||||
| 1216 | |||||||||||||
| 1217 | Normally, under JavaScript, this tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame. | ||||||||||||
| 1218 | |||||||||||||
| 1219 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame> | ||||||||||||
| 1220 | |||||||||||||
| 1221 | =head2 requestIdleCallback | ||||||||||||
| 1222 | |||||||||||||
| 1223 | This always returns C<undef> under perl. | ||||||||||||
| 1224 | |||||||||||||
| 1225 | Normally, under JavaScript, this enables the scheduling of tasks during a browser's idle periods. | ||||||||||||
| 1226 | |||||||||||||
| 1227 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback> | ||||||||||||
| 1228 | |||||||||||||
| 1229 | =head2 resizeBy | ||||||||||||
| 1230 | |||||||||||||
| 1231 | This always returns C<undef> under perl. | ||||||||||||
| 1232 | |||||||||||||
| 1233 | Normally, under JavaScript, this resizes the current window by a certain amount. | ||||||||||||
| 1234 | |||||||||||||
| 1235 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeBy> | ||||||||||||
| 1236 | |||||||||||||
| 1237 | =head2 resizeTo | ||||||||||||
| 1238 | |||||||||||||
| 1239 | This always returns C<undef> under perl. | ||||||||||||
| 1240 | |||||||||||||
| 1241 | Normally, under JavaScript, this dynamically resizes window. | ||||||||||||
| 1242 | |||||||||||||
| 1243 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo> | ||||||||||||
| 1244 | |||||||||||||
| 1245 | =head2 scroll | ||||||||||||
| 1246 | |||||||||||||
| 1247 | This always returns C<undef> under perl. | ||||||||||||
| 1248 | |||||||||||||
| 1249 | Normally, under JavaScript, this scrolls the window to a particular place in the document. | ||||||||||||
| 1250 | |||||||||||||
| 1251 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll> | ||||||||||||
| 1252 | |||||||||||||
| 1253 | =head2 scrollBy | ||||||||||||
| 1254 | |||||||||||||
| 1255 | This always returns C<undef> under perl. | ||||||||||||
| 1256 | |||||||||||||
| 1257 | Normally, under JavaScript, this scrolls the document in the window by the given amount. | ||||||||||||
| 1258 | |||||||||||||
| 1259 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy> | ||||||||||||
| 1260 | |||||||||||||
| 1261 | =head2 scrollByLines | ||||||||||||
| 1262 | |||||||||||||
| 1263 | This always returns C<undef> under perl. | ||||||||||||
| 1264 | |||||||||||||
| 1265 | Normally, under JavaScript, this scrolls the document by the given number of lines. | ||||||||||||
| 1266 | |||||||||||||
| 1267 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByLines> | ||||||||||||
| 1268 | |||||||||||||
| 1269 | =head2 scrollByPages | ||||||||||||
| 1270 | |||||||||||||
| 1271 | This always returns C<undef> under perl. | ||||||||||||
| 1272 | |||||||||||||
| 1273 | Normally, under JavaScript, this scrolls the current document by the specified number of pages. | ||||||||||||
| 1274 | |||||||||||||
| 1275 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByPages> | ||||||||||||
| 1276 | |||||||||||||
| 1277 | =head2 scrollTo | ||||||||||||
| 1278 | |||||||||||||
| 1279 | This always returns C<undef> under perl. | ||||||||||||
| 1280 | |||||||||||||
| 1281 | Normally, under JavaScript, this scrolls to a particular set of coordinates in the document. | ||||||||||||
| 1282 | |||||||||||||
| 1283 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo> | ||||||||||||
| 1284 | |||||||||||||
| 1285 | =head2 setImmediate | ||||||||||||
| 1286 | |||||||||||||
| 1287 | This always returns C<undef> under perl. | ||||||||||||
| 1288 | |||||||||||||
| 1289 | Normally, under JavaScript, this executes a function after the browser has finished other heavy tasks | ||||||||||||
| 1290 | |||||||||||||
| 1291 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate> | ||||||||||||
| 1292 | |||||||||||||
| 1293 | =head2 setResizable | ||||||||||||
| 1294 | |||||||||||||
| 1295 | This always returns C<undef> under perl. | ||||||||||||
| 1296 | |||||||||||||
| 1297 | Normally, under JavaScript, this toggles a user's ability to resize a window. | ||||||||||||
| 1298 | |||||||||||||
| 1299 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/setResizable> | ||||||||||||
| 1300 | |||||||||||||
| 1301 | =head2 showDirectoryPicker | ||||||||||||
| 1302 | |||||||||||||
| 1303 | This always returns C<undef> under perl. | ||||||||||||
| 1304 | |||||||||||||
| 1305 | Normally, under JavaScript, this displays a directory picker which allows the user to select a directory. | ||||||||||||
| 1306 | |||||||||||||
| 1307 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker> | ||||||||||||
| 1308 | |||||||||||||
| 1309 | =head2 showOpenFilePicker | ||||||||||||
| 1310 | |||||||||||||
| 1311 | This always returns C<undef> under perl. | ||||||||||||
| 1312 | |||||||||||||
| 1313 | Normally, under JavaScript, this shows a file picker that allows a user to select a file or multiple files. | ||||||||||||
| 1314 | |||||||||||||
| 1315 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker> | ||||||||||||
| 1316 | |||||||||||||
| 1317 | =head2 showSaveFilePicker | ||||||||||||
| 1318 | |||||||||||||
| 1319 | This always returns C<undef> under perl. | ||||||||||||
| 1320 | |||||||||||||
| 1321 | Normally, under JavaScript, this shows a file picker that allows a user to save a file. | ||||||||||||
| 1322 | |||||||||||||
| 1323 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker> | ||||||||||||
| 1324 | |||||||||||||
| 1325 | =head2 sizeToContent | ||||||||||||
| 1326 | |||||||||||||
| 1327 | This always returns C<undef> under perl. | ||||||||||||
| 1328 | |||||||||||||
| 1329 | Normally, under JavaScript, this sizes the window according to its content. | ||||||||||||
| 1330 | |||||||||||||
| 1331 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sizeToContent> | ||||||||||||
| 1332 | |||||||||||||
| 1333 | =head2 stop | ||||||||||||
| 1334 | |||||||||||||
| 1335 | This always returns C<undef> under perl. | ||||||||||||
| 1336 | |||||||||||||
| 1337 | Normally, under JavaScript, this method stops window loading. | ||||||||||||
| 1338 | |||||||||||||
| 1339 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/stop> | ||||||||||||
| 1340 | |||||||||||||
| 1341 | =head2 updateCommands | ||||||||||||
| 1342 | |||||||||||||
| 1343 | This always returns C<undef> under perl. | ||||||||||||
| 1344 | |||||||||||||
| 1345 | Normally, under JavaScript, this updates the state of commands of the current chrome window (UI). | ||||||||||||
| 1346 | |||||||||||||
| 1347 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/updateCommands> | ||||||||||||
| 1348 | |||||||||||||
| 1349 | =head1 EVENTS | ||||||||||||
| 1350 | |||||||||||||
| 1351 | Event listeners for those events can also be found by prepending C<on> before the event type: | ||||||||||||
| 1352 | |||||||||||||
| 1353 | C<click> event listeners can be set also with C<onclick> method: | ||||||||||||
| 1354 | |||||||||||||
| 1355 | $e->onclick(sub{ # do something }); | ||||||||||||
| 1356 | # or as an lvalue method | ||||||||||||
| 1357 | $e->onclick = sub{ # do something }; | ||||||||||||
| 1358 | |||||||||||||
| 1359 | =head2 error | ||||||||||||
| 1360 | |||||||||||||
| 1361 | Under perl, this is fired when this window object encounters an error. | ||||||||||||
| 1362 | |||||||||||||
| 1363 | Under JavaScript, this is fired when a resource failed to load, or cannot be used. For example, if a script has an execution error or an image can't be found or is invalid. | ||||||||||||
| 1364 | Also available via the onerror property. | ||||||||||||
| 1365 | |||||||||||||
| 1366 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event> | ||||||||||||
| 1367 | |||||||||||||
| 1368 | =head1 UNSUPPORTED EVENTS | ||||||||||||
| 1369 | |||||||||||||
| 1370 | The following events are unsupported under perl, but you can still fire them by yourself using the L<HTML::Object::EventTarget/dispatchEvent> | ||||||||||||
| 1371 | |||||||||||||
| 1372 | =head2 devicemotion | ||||||||||||
| 1373 | |||||||||||||
| 1374 | Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available. | ||||||||||||
| 1375 | |||||||||||||
| 1376 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/devicemotion_event> | ||||||||||||
| 1377 | |||||||||||||
| 1378 | =head2 deviceorientation | ||||||||||||
| 1379 | |||||||||||||
| 1380 | Fired when fresh data is available from the magnetometer orientation sensor about the current orientation of the device as compared to the Earth coordinate frame. | ||||||||||||
| 1381 | |||||||||||||
| 1382 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event> | ||||||||||||
| 1383 | |||||||||||||
| 1384 | =head2 languagechange | ||||||||||||
| 1385 | |||||||||||||
| 1386 | Fired at the global scope object when the user's preferred language changes. | ||||||||||||
| 1387 | Also available via the onlanguagechange property. | ||||||||||||
| 1388 | |||||||||||||
| 1389 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/languagechange_event> | ||||||||||||
| 1390 | |||||||||||||
| 1391 | =head2 orientationchange | ||||||||||||
| 1392 | |||||||||||||
| 1393 | Fired when the orientation of the device has changed. | ||||||||||||
| 1394 | Also available via the onorientationchange property. | ||||||||||||
| 1395 | |||||||||||||
| 1396 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event> | ||||||||||||
| 1397 | |||||||||||||
| 1398 | =head2 resize | ||||||||||||
| 1399 | |||||||||||||
| 1400 | Fired when the window has been resized. | ||||||||||||
| 1401 | Also available via the onresize property. | ||||||||||||
| 1402 | |||||||||||||
| 1403 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event> | ||||||||||||
| 1404 | |||||||||||||
| 1405 | =head2 storage | ||||||||||||
| 1406 | |||||||||||||
| 1407 | Fired when a storage area (localStorage or sessionStorage) has been modified in the context of another document. | ||||||||||||
| 1408 | Also available via the onstorage property. | ||||||||||||
| 1409 | |||||||||||||
| 1410 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event> | ||||||||||||
| 1411 | |||||||||||||
| 1412 | =head1 UNSUPPORTED EVENT HANDLERS | ||||||||||||
| 1413 | |||||||||||||
| 1414 | Although those event handlers exist, their related events never get fired unless you fire them yourself. | ||||||||||||
| 1415 | |||||||||||||
| 1416 | =head2 onappinstalled | ||||||||||||
| 1417 | |||||||||||||
| 1418 | Called when the page is installed as a webapp. See appinstalled event. | ||||||||||||
| 1419 | |||||||||||||
| 1420 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onappinstalled> | ||||||||||||
| 1421 | |||||||||||||
| 1422 | =head2 onbeforeinstallprompt | ||||||||||||
| 1423 | |||||||||||||
| 1424 | An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile. | ||||||||||||
| 1425 | |||||||||||||
| 1426 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforeinstallprompt> | ||||||||||||
| 1427 | |||||||||||||
| 1428 | =head2 ondevicemotion | ||||||||||||
| 1429 | |||||||||||||
| 1430 | Called if accelerometer detects a change (For mobile devices) | ||||||||||||
| 1431 | |||||||||||||
| 1432 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondevicemotion> | ||||||||||||
| 1433 | |||||||||||||
| 1434 | =head2 ondeviceorientation | ||||||||||||
| 1435 | |||||||||||||
| 1436 | Called when the orientation is changed (For mobile devices) | ||||||||||||
| 1437 | |||||||||||||
| 1438 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientation> | ||||||||||||
| 1439 | |||||||||||||
| 1440 | =head2 ondeviceorientationabsolute | ||||||||||||
| 1441 | |||||||||||||
| 1442 | An event handler property for any device orientation changes. | ||||||||||||
| 1443 | |||||||||||||
| 1444 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientationabsolute> | ||||||||||||
| 1445 | |||||||||||||
| 1446 | =head2 ondeviceproximity | ||||||||||||
| 1447 | |||||||||||||
| 1448 | An event handler property for device proximity event (see C<DeviceProximityEvent>) | ||||||||||||
| 1449 | |||||||||||||
| 1450 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity> | ||||||||||||
| 1451 | |||||||||||||
| 1452 | =head2 ongamepadconnected | ||||||||||||
| 1453 | |||||||||||||
| 1454 | Represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires). | ||||||||||||
| 1455 | |||||||||||||
| 1456 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepadconnected> | ||||||||||||
| 1457 | |||||||||||||
| 1458 | =head2 ongamepaddisconnected | ||||||||||||
| 1459 | |||||||||||||
| 1460 | Represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires). | ||||||||||||
| 1461 | |||||||||||||
| 1462 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepaddisconnected> | ||||||||||||
| 1463 | |||||||||||||
| 1464 | =head2 onrejectionhandled | ||||||||||||
| 1465 | |||||||||||||
| 1466 | An event handler for handled Promise rejection events. | ||||||||||||
| 1467 | |||||||||||||
| 1468 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onrejectionhandled> | ||||||||||||
| 1469 | |||||||||||||
| 1470 | =head2 onuserproximity | ||||||||||||
| 1471 | |||||||||||||
| 1472 | An event handler property for user proximity events (see C<UserProximityEvent>). | ||||||||||||
| 1473 | |||||||||||||
| 1474 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onuserproximity> | ||||||||||||
| 1475 | |||||||||||||
| 1476 | =head2 onvrdisplayactivate | ||||||||||||
| 1477 | |||||||||||||
| 1478 | Represents an event handler that will run when a display is able to be presented to (when the vrdisplayactivate event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on. | ||||||||||||
| 1479 | |||||||||||||
| 1480 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayactivate> | ||||||||||||
| 1481 | |||||||||||||
| 1482 | =head2 onvrdisplayblur | ||||||||||||
| 1483 | |||||||||||||
| 1484 | Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the vrdisplayblur event fires) - for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience. | ||||||||||||
| 1485 | |||||||||||||
| 1486 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayblur> | ||||||||||||
| 1487 | |||||||||||||
| 1488 | =head2 onvrdisplayconnect | ||||||||||||
| 1489 | |||||||||||||
| 1490 | Represents an event handler that will run when a compatible VR device has been connected to the computer (when the vrdisplayconnected event fires). | ||||||||||||
| 1491 | |||||||||||||
| 1492 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayconnect> | ||||||||||||
| 1493 | |||||||||||||
| 1494 | =head2 onvrdisplaydeactivate | ||||||||||||
| 1495 | |||||||||||||
| 1496 | Represents an event handler that will run when a display can no longer be presented to (when the vrdisplaydeactivate event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity. | ||||||||||||
| 1497 | |||||||||||||
| 1498 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydeactivate> | ||||||||||||
| 1499 | |||||||||||||
| 1500 | =head2 onvrdisplaydisconnect | ||||||||||||
| 1501 | |||||||||||||
| 1502 | Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the vrdisplaydisconnected event fires). | ||||||||||||
| 1503 | |||||||||||||
| 1504 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydisconnect> | ||||||||||||
| 1505 | |||||||||||||
| 1506 | =head2 onvrdisplayfocus | ||||||||||||
| 1507 | |||||||||||||
| 1508 | Represents an event handler that will run when presentation to a display has resumed after being blurred (when the vrdisplayfocus event fires). | ||||||||||||
| 1509 | |||||||||||||
| 1510 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayfocus> | ||||||||||||
| 1511 | |||||||||||||
| 1512 | =head2 onvrdisplaypresentchange | ||||||||||||
| 1513 | |||||||||||||
| 1514 | represents an event handler that will run when the presenting state of a VR device changes - i.e. goes from presenting to not presenting, or vice versa (when the vrdisplaypresentchange event fires). | ||||||||||||
| 1515 | |||||||||||||
| 1516 | See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaypresentchange> | ||||||||||||
| 1517 | |||||||||||||
| 1518 | =head1 AUTHOR | ||||||||||||
| 1519 | |||||||||||||
| 1520 | Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> | ||||||||||||
| 1521 | |||||||||||||
| 1522 | =head1 SEE ALSO | ||||||||||||
| 1523 | |||||||||||||
| 1524 | L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window>, L<W3C specifications|https://html.spec.whatwg.org/multipage/window-object.html>, L<StackOverlow about WindowProxy|https://stackoverflow.com/questions/16092835/windowproxy-and-window-objects> | ||||||||||||
| 1525 | |||||||||||||
| 1526 | =head1 COPYRIGHT & LICENSE | ||||||||||||
| 1527 | |||||||||||||
| 1528 | Copyright(c) 2021 DEGUEST Pte. Ltd. | ||||||||||||
| 1529 | |||||||||||||
| 1530 | All rights reserved | ||||||||||||
| 1531 | |||||||||||||
| 1532 | This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. | ||||||||||||
| 1533 | |||||||||||||
| 1534 | =cut | ||||||||||||