@live-codes/pascal-wasm 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/LICENSE +501 -0
  2. package/README.md +278 -0
  3. package/THIRD-PARTY-NOTICES.md +48 -0
  4. package/assets/pas2js.wasm +0 -0
  5. package/assets/rtl/Rtl.BrowserLoadHelper.pas +179 -0
  6. package/assets/rtl/browserconsole.pas +190 -0
  7. package/assets/rtl/classes.pas +11371 -0
  8. package/assets/rtl/js.pas +2211 -0
  9. package/assets/rtl/manifest.json +19 -0
  10. package/assets/rtl/math.pas +903 -0
  11. package/assets/rtl/p2jsres.pp +334 -0
  12. package/assets/rtl/rtl.js +1563 -0
  13. package/assets/rtl/rtlconsts.pas +97 -0
  14. package/assets/rtl/simplelinkedlist.pas +152 -0
  15. package/assets/rtl/system.pas +1166 -0
  16. package/assets/rtl/sysutils.pas +8959 -0
  17. package/assets/rtl/types.pas +2296 -0
  18. package/assets/rtl/typinfo.pas +1680 -0
  19. package/assets/rtl/web.pas +3586 -0
  20. package/assets/rtl/weborworker.pas +2101 -0
  21. package/dist/pascal-wasm.iife.min.js +6 -0
  22. package/dist/pascal-wasm.iife.min.js.map +7 -0
  23. package/package.json +54 -0
  24. package/src/assets.js +119 -0
  25. package/src/compiler.js +142 -0
  26. package/src/config.js +24 -0
  27. package/src/iife.js +27 -0
  28. package/src/index.js +130 -0
  29. package/src/vendor/browser_wasi_shim/debug.js +1 -0
  30. package/src/vendor/browser_wasi_shim/fd.js +1 -0
  31. package/src/vendor/browser_wasi_shim/fs_mem.js +1 -0
  32. package/src/vendor/browser_wasi_shim/fs_opfs.js +1 -0
  33. package/src/vendor/browser_wasi_shim/index.js +1 -0
  34. package/src/vendor/browser_wasi_shim/strace.js +1 -0
  35. package/src/vendor/browser_wasi_shim/wasi.js +1 -0
  36. package/src/vendor/browser_wasi_shim/wasi_defs.js +1 -0
  37. package/types/index.d.ts +89 -0
@@ -0,0 +1,3586 @@
1
+ {
2
+ This file is part of the Pas2JS run time library.
3
+ Copyright (c) 2017-2020 by the Pas2JS development team.
4
+
5
+ Browser Window & DOM API definitions
6
+
7
+ See the file COPYING.FPC, included in this distribution,
8
+ for details about the copyright.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
+
14
+ **********************************************************************}
15
+
16
+ {$IFNDEF FPC_DOTTEDUNITS}
17
+ unit Web;
18
+ {$ENDIF}
19
+ {$mode objfpc}
20
+ {$modeswitch externalclass}
21
+
22
+ interface
23
+
24
+ Uses
25
+ {$IFDEF FPC_DOTTEDUNITS}
26
+ System.Types, JSApi.JS, BrowserApi.WebOrWorker;
27
+ {$ELSE FPC_DOTTEDUNITS}
28
+ Types, JS, weborworker;
29
+ {$ENDIF FPC_DOTTEDUNITS}
30
+
31
+ Type
32
+ // Forward definitions
33
+ TJSHTMLElement = Class;
34
+ TJSWindow = class;
35
+ TJSDOMTokenList = class;
36
+ TJSXPathResult = CLass;
37
+ TJSNodeList = class;
38
+ TJSDocument = class;
39
+ TJSElement = class;
40
+ TJSCSSStyleSheet = Class;
41
+ TJSNodeFilter = Class;
42
+ TJSShadowRoot = class;
43
+ TJSAnimation = class;
44
+ TJSAnimationTimeline = class;
45
+
46
+ TJSMouseEvent = Class;
47
+ TJSWheelEvent = Class;
48
+ TJSKeyBoardEvent = class;
49
+ TJSPointerEvent = Class;
50
+ TJSUIEvent = class;
51
+ TJSTouchEvent = Class;
52
+
53
+ TJSShowOpenFilePickerOptions = class;
54
+ TJSShowSaveFilePickerOptions = class;
55
+ TJSHTMLResizeObserver = class;
56
+
57
+ {$IFDEF FPC_DOTTEDUNITS}
58
+ TJSServiceWorker = BrowserApi.WebOrWorker.TJSServiceWorker;
59
+ TJSServiceWorkerRegistration = BrowserApi.WebOrWorker.TJSServiceWorkerRegistration;
60
+ TJSMessageEvent = BrowserApi.WebOrWorker.TJSMessageEvent;
61
+ TJSEvent = BrowserApi.WebOrWorker.TJSEvent;
62
+ TJSBlob = BrowserApi.WebOrWorker.TJSBlob;
63
+ TJSEventTarget = BrowserApi.WebOrWorker.TJSEventTarget;
64
+ TJSEventInit = BrowserApi.WebOrWorker.TJSEventInit;
65
+ TJSConsole = BrowserApi.WebOrWorker.TJSConsole;
66
+ KeyType = BrowserApi.WebOrWorker.TJSCryptoKeyType;
67
+ KeyUsage = BrowserApi.WebOrWorker.TJSCryptoKeyUsage;
68
+ NamedCurve = BrowserApi.WebOrWorker.TJSCryptoNamedCurve;
69
+ BigInteger = BrowserApi.WebOrWorker.TJSCryptoBigInteger;
70
+ KeyFormat = BrowserApi.WebOrWorker.TJSCryptoKeyFormat;
71
+ Algorithm = BrowserApi.WebOrWorker.TJSCryptoAlgorithm;
72
+ AesCbcParams = BrowserApi.WebOrWorker.TJSCryptoAesCbcParams;
73
+ AesCtrParams = BrowserApi.WebOrWorker.TJSCryptoAesCtrParams;
74
+ AesGcmParams = BrowserApi.WebOrWorker.TJSCryptoAesGcmParams;
75
+ HmacImportParams = BrowserApi.WebOrWorker.TJSCryptoHmacImportParams;
76
+ Pbkdf2Params = BrowserApi.WebOrWorker.TJSCryptoPbkdf2Params;
77
+ RsaHashedImportParams = BrowserApi.WebOrWorker.TJSCryptoRsaHashedImportParams;
78
+ AesKeyGenParams = BrowserApi.WebOrWorker.TJSCryptoAesKeyGenParams;
79
+ HmacKeyGenParams = BrowserApi.WebOrWorker.TJSCryptoHmacKeyGenParams;
80
+ RsaHashedKeyGenParams = BrowserApi.WebOrWorker.TJSCryptoRsaHashedKeyGenParams;
81
+ RsaOaepParams = BrowserApi.WebOrWorker.TJSCryptoRsaOaepParams;
82
+ RsaPssParams = BrowserApi.WebOrWorker.TJSCryptoRsaPssParams;
83
+ DhKeyGenParams = BrowserApi.WebOrWorker.TJSCryptoDhKeyGenParams;
84
+ EcKeyGenParams = BrowserApi.WebOrWorker.TJSCryptoEcKeyGenParams;
85
+ AesDerivedKeyParams = BrowserApi.WebOrWorker.TJSCryptoAesDerivedKeyParams;
86
+ HmacDerivedKeyParams = BrowserApi.WebOrWorker.TJSCryptoHmacDerivedKeyParams;
87
+ EcdhKeyDeriveParams = BrowserApi.WebOrWorker.TJSCryptoEcdhKeyDeriveParams;
88
+ DhKeyDeriveParams = BrowserApi.WebOrWorker.TJSCryptoDhKeyDeriveParams;
89
+ DhImportKeyParams = BrowserApi.WebOrWorker.TJSCryptoDhImportKeyParams;
90
+ EcdsaParams = BrowserApi.WebOrWorker.TJSCryptoEcdsaParams;
91
+ EcKeyImportParams = BrowserApi.WebOrWorker.TJSCryptoEcKeyImportParams;
92
+ CryptoKeyPair = BrowserApi.WebOrWorker.TJSCryptoKeyPair;
93
+ HkdfParams = BrowserApi.WebOrWorker.TJSCryptoHkdfParams;
94
+ RsaOtherPrimesInfo = BrowserApi.WebOrWorker.TJSCryptoRsaOtherPrimesInfo;
95
+ TRsaOtherPrimesInfoDynArray = BrowserApi.WebOrWorker.TJSCryptoRsaOtherPrimesInfoDynArray;
96
+ TKeyUsageDynArray = BrowserApi.WebOrWorker.TJSCryptoKeyUsageDynArray;
97
+ TJSCryptoKey = BrowserApi.WebOrWorker.TJSCryptoKey;
98
+ TJSSubtleCrypto = BrowserApi.WebOrWorker.TJSSubtleCrypto;
99
+ TJSCrypto = BrowserApi.WebOrWorker.TJSCrypto;
100
+ TJSIDBTransactionMode = BrowserApi.WebOrWorker.TJSIDBTransactionMode;
101
+ TJSIDBTransaction = BrowserApi.WebOrWorker.TJSIDBTransaction;
102
+ TJSIDBKeyRange = BrowserApi.WebOrWorker.TJSIDBKeyRange;
103
+ TJSIDBIndexParameters = BrowserApi.WebOrWorker.TJSIDBIndexParameters;
104
+ TJSIDBIndex = BrowserApi.WebOrWorker.TJSIDBIndex;
105
+ TJSIDBCursorDirection = BrowserApi.WebOrWorker.TJSIDBCursorDirection;
106
+ TJSIDBCursor = BrowserApi.WebOrWorker.TJSIDBCursor;
107
+ TJSIDBObjectStore = BrowserApi.WebOrWorker.TJSIDBObjectStore;
108
+ TJSIDBRequest = BrowserApi.WebOrWorker.TJSIDBRequest;
109
+ TJSIDBOpenDBRequest = BrowserApi.WebOrWorker.TJSIDBOpenDBRequest;
110
+ TJSCreateObjectStoreOptions = BrowserApi.WebOrWorker.TJSCreateObjectStoreOptions;
111
+ TIDBDatabase = BrowserApi.WebOrWorker.TIDBDatabase;
112
+ TJSIDBFactory = BrowserApi.WebOrWorker.TJSIDBFactory;
113
+ TJSWorker = BrowserApi.WebOrWorker.TJSWorker;
114
+ TJSExtendableEvent = BrowserApi.WebOrWorker.TJSExtendableEvent;
115
+ TJSClient = BrowserApi.WebOrWorker.TJSClient;
116
+ TJSExtendableMessageEvent = BrowserApi.WebOrWorker.TJSExtendableMessageEvent;
117
+ TJSURLSearchParams = BrowserApi.WebOrWorker.TJSURLSearchParams;
118
+ TJSURL = BrowserApi.WebOrWorker.TJSURL;
119
+ TJSURLDynArray = BrowserApi.WebOrWorker.TJSURLDynArray;
120
+ TJSTimerCallBack = BrowserApi.WebOrWorker.TJSTimerCallBack;
121
+ TJSReadableStream = BrowserApi.WebOrWorker.TJSReadableStream;
122
+ TJSWritableStream = BrowserApi.WebOrWorker.TJSWritableStream;
123
+ TJSBody = BrowserApi.WebOrWorker.TJSBody;
124
+ TJSResponse = BrowserApi.WebOrWorker.TJSResponse;
125
+ TJSCache = BrowserApi.WebOrWorker.TJSCache;
126
+ TJSCacheStorage = BrowserApi.WebOrWorker.TJSCacheStorage;
127
+ TJSPermissions = BrowserApi.WebOrWorker.TJSPermissions;
128
+ TJSRequest = BrowserApi.WebOrWorker.TJSRequest;
129
+ TJSPerformance = BrowserApi.WebOrWorker.TJSPerformance;
130
+ TCanvasCoordType = BrowserApi.WebOrWorker.TCanvasCoordType;
131
+ TJSCanvasGradient = BrowserApi.WebOrWorker.TJSCanvasGradient;
132
+ TJSCanvasPattern = BrowserApi.WebOrWorker.TJSCanvasPattern;
133
+ TJSPath2D = BrowserApi.WebOrWorker.TJSPath2D;
134
+ TJSImageBitmap = BrowserApi.WebOrWorker.TJSImageBitmap;
135
+ TJSOffscreenCanvasRenderingContext2D = BrowserApi.WebOrWorker.TJSOffscreenCanvasRenderingContext2D;
136
+ TJSHTMLOffscreenCanvasElement = BrowserApi.WebOrWorker.TJSHTMLOffscreenCanvas;
137
+ TJSHTMLOffscreenCanvas = BrowserApi.WebOrWorker.TJSHTMLOffscreenCanvas;
138
+ TJSBlobInit = BrowserApi.WebOrWorker.TJSBlobInit;
139
+ TJSImageBitmapOptions = BrowserApi.WebOrWorker.TJSImageBitmapOptions;
140
+ TJSDOMException = BrowserApi.WebOrWorker.TJSDOMException;
141
+ TJSFileReader = BrowserApi.WebOrWorker.TJSFileReader;
142
+ TJSFontFaceDescriptors = BrowserApi.WebOrWorker.TJSFontFaceDescriptors;
143
+ TJSFontFace = BrowserApi.WebOrWorker.TJSFontFace;
144
+ TJSFontFaceSet = BrowserApi.WebOrWorker.TJSFontFaceSet;
145
+ TJSHTMLFile = BrowserApi.WebOrWorker.TJSFile;
146
+ {$ELSE}
147
+ TJSServiceWorker = weborworker.TJSServiceWorker;
148
+ TJSServiceWorkerRegistration = weborworker.TJSServiceWorkerRegistration;
149
+ TJSMessageEvent = weborworker.TJSMessageEvent;
150
+ TJSEvent = weborworker.TJSEvent;
151
+ TJSBlob = weborworker.TJSBlob;
152
+ TJSFile = weborworker.TJSFIle;
153
+ TJSEventTarget = weborworker.TJSEventTarget;
154
+ TJSEventInit = weborworker.TJSEventInit;
155
+ TJSConsole = weborworker.TJSConsole;
156
+ KeyType = weborworker.TJSCryptoKeyType;
157
+ KeyUsage = weborworker.TJSCryptoKeyUsage;
158
+ NamedCurve = weborworker.TJSCryptoNamedCurve;
159
+ BigInteger = weborworker.TJSCryptoBigInteger;
160
+ KeyFormat = weborworker.TJSCryptoKeyFormat;
161
+ Algorithm = weborworker.TJSCryptoAlgorithm;
162
+ AesCbcParams = weborworker.TJSCryptoAesCbcParams;
163
+ AesCtrParams = weborworker.TJSCryptoAesCtrParams;
164
+ AesGcmParams = weborworker.TJSCryptoAesGcmParams;
165
+ HmacImportParams = weborworker.TJSCryptoHmacImportParams;
166
+ Pbkdf2Params = weborworker.TJSCryptoPbkdf2Params;
167
+ RsaHashedImportParams = weborworker.TJSCryptoRsaHashedImportParams;
168
+ AesKeyGenParams = weborworker.TJSCryptoAesKeyGenParams;
169
+ HmacKeyGenParams = weborworker.TJSCryptoHmacKeyGenParams;
170
+ RsaHashedKeyGenParams = weborworker.TJSCryptoRsaHashedKeyGenParams;
171
+ RsaOaepParams = weborworker.TJSCryptoRsaOaepParams;
172
+ RsaPssParams = weborworker.TJSCryptoRsaPssParams;
173
+ DhKeyGenParams = weborworker.TJSCryptoDhKeyGenParams;
174
+ EcKeyGenParams = weborworker.TJSCryptoEcKeyGenParams;
175
+ AesDerivedKeyParams = weborworker.TJSCryptoAesDerivedKeyParams;
176
+ HmacDerivedKeyParams = weborworker.TJSCryptoHmacDerivedKeyParams;
177
+ EcdhKeyDeriveParams = weborworker.TJSCryptoEcdhKeyDeriveParams;
178
+ DhKeyDeriveParams = weborworker.TJSCryptoDhKeyDeriveParams;
179
+ DhImportKeyParams = weborworker.TJSCryptoDhImportKeyParams;
180
+ EcdsaParams = weborworker.TJSCryptoEcdsaParams;
181
+ EcKeyImportParams = weborworker.TJSCryptoEcKeyImportParams;
182
+ CryptoKeyPair = weborworker.TJSCryptoKeyPair;
183
+ HkdfParams = weborworker.TJSCryptoHkdfParams;
184
+ RsaOtherPrimesInfo = weborworker.TJSCryptoRsaOtherPrimesInfo;
185
+ TRsaOtherPrimesInfoDynArray = weborworker.TJSCryptoRsaOtherPrimesInfoDynArray;
186
+ TKeyUsageDynArray = weborworker.TJSCryptoKeyUsageDynArray;
187
+ TJSCryptoKey = weborworker.TJSCryptoKey;
188
+ TJSSubtleCrypto = weborworker.TJSSubtleCrypto;
189
+ TJSCrypto = weborworker.TJSCrypto;
190
+ TJSIDBTransactionMode = weborworker.TJSIDBTransactionMode;
191
+ TJSIDBTransaction = weborworker.TJSIDBTransaction;
192
+ TJSIDBKeyRange = weborworker.TJSIDBKeyRange;
193
+ TJSIDBIndexParameters = weborworker.TJSIDBIndexParameters;
194
+ TJSIDBIndex = weborworker.TJSIDBIndex;
195
+ TJSIDBCursorDirection = weborworker.TJSIDBCursorDirection;
196
+ TJSIDBCursor = weborworker.TJSIDBCursor;
197
+ TJSIDBObjectStore = weborworker.TJSIDBObjectStore;
198
+ TJSIDBRequest = weborworker.TJSIDBRequest;
199
+ TJSIDBOpenDBRequest = weborworker.TJSIDBOpenDBRequest;
200
+ TJSCreateObjectStoreOptions = weborworker.TJSCreateObjectStoreOptions;
201
+ TIDBDatabase = weborworker.TIDBDatabase;
202
+ TJSIDBFactory = weborworker.TJSIDBFactory;
203
+ TJSWorker = weborworker.TJSWorker;
204
+ TJSExtendableEvent = weborworker.TJSExtendableEvent;
205
+ TJSClient = weborworker.TJSClient;
206
+ TJSExtendableMessageEvent = weborworker.TJSExtendableMessageEvent;
207
+ TJSURLSearchParams = weborworker.TJSURLSearchParams;
208
+ TJSURL = weborworker.TJSURL;
209
+ TJSURLDynArray = weborworker.TJSURLDynArray;
210
+ TJSTimerCallBack = weborworker.TJSTimerCallBack;
211
+ TJSReadableStream = weborworker.TJSReadableStream;
212
+ TJSWritableStream = weborworker.TJSWritableStream;
213
+ TJSBody = weborworker.TJSBody;
214
+ TJSResponse = weborworker.TJSResponse;
215
+ TJSCache = weborworker.TJSCache;
216
+ TJSCacheStorage = weborworker.TJSCacheStorage;
217
+ TJSRequest = webOrworker.TJSRequest;
218
+ TJSAbortController = webOrworker.TJSAbortController;
219
+ TJSPerformance = WebOrWorker.TJSPerformance;
220
+ TCanvasCoordType = weborworker.TCanvasCoordType;
221
+ TJSCanvasGradient = weborworker.TJSCanvasGradient;
222
+ TJSCanvasPattern = weborworker.TJSCanvasPattern;
223
+ TJSPath2D = weborworker.TJSPath2D;
224
+ TJSImageBitmap = weborworker.TJSImageBitmap;
225
+ TJSOffscreenCanvasRenderingContext2D = weborworker.TJSOffscreenCanvasRenderingContext2D;
226
+ TJSHTMLOffscreenCanvasElement = weborworker.TJSHTMLOffscreenCanvas;
227
+ TJSHTMLOffscreenCanvas = weborworker.TJSHTMLOffscreenCanvas;
228
+ TJSBlobInit = weborworker.TJSBlobInit;
229
+ TJSImageBitmapOptions = weborworker.TJSImageBitmapOptions;
230
+ TJSDOMException = weborworker.TJSDOMException;
231
+ TJSFileReader = weborworker.TJSFileReader;
232
+ TJSFontFaceDescriptors = WebOrWorker.TJSFontFaceDescriptors;
233
+ TJSFontFace = WebOrWorker.TJSFontFace;
234
+ TJSFontFaceSet = WebOrWorker.TJSFontFaceSet;
235
+ TJSHTMLFile = WebOrWorker.TJSFile;
236
+ {$ENDIF}
237
+ TJSMessagePortArray = TJSMessagePortDynArray;
238
+ TEventListenerEvent = TJSEvent;
239
+ TJSEventHandler = reference to function(Event: TEventListenerEvent): boolean; safecall;
240
+ TJSRawEventHandler = reference to Procedure(Event: TJSEvent); safecall;
241
+
242
+
243
+ TJSNode = class external name 'Node' (TJSEventTarget)
244
+ Private
245
+ FBaseURI : String; external name 'baseURI';
246
+ FChildNodes: TJSNodeList; external name 'childNodes';
247
+ FFirstChild : TJSNode; external name 'firstChild';
248
+ FNextSibling : TJSNode; external name 'nextSibling';
249
+ FNodeName : String; external name 'nodeName';
250
+ FNodeType : NativeInt; external name 'nodeType';
251
+ FOwnerDocument : TJSDocument; external name 'ownerDocument';
252
+ FParentElement : TJSElement; external name 'parentElement';
253
+ FParentNode : TJSNode; external name 'parentNode';
254
+ FPreviousSibling : TJSNode; external name 'previousSibling';
255
+ Public
256
+ Const
257
+ ELEMENT_NODE =1;
258
+ ATTRIBUTE_NODE = 2;
259
+ TEXT_NODE =3;
260
+ CDATA_SECTION_NODE = 4;
261
+ PROCESSING_INSTRUCTION_NODE = 7;
262
+ COMMENT_NODE =8;
263
+ DOCUMENT_NODE =9;
264
+ DOCUMENT_TYPE_NODE = 10;
265
+ DOCUMENT_FRAGMENT_NODE = 11;
266
+
267
+ DOCUMENT_POSITION_DISCONNECTED = 1;
268
+ DOCUMENT_POSITION_PRECEDING = 2;
269
+ DOCUMENT_POSITION_FOLLOWING = 4;
270
+ DOCUMENT_POSITION_CONTAINS = 8;
271
+ DOCUMENT_POSITION_CONTAINED_BY = 16;
272
+ DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC = 32;
273
+ Public
274
+ nodeValue: string;
275
+ innerText : string;
276
+ textContent : string;
277
+ function appendChild(aChild : TJSNode) : TJSNode;
278
+ function cloneNode(deep: boolean): TJSNode;
279
+ function compareDocumentPosition(aNode : TJSNode) : NativeInt;
280
+ function contains(aNode : TJSNode) : boolean;
281
+ function hasChildNodes : boolean;
282
+ function insertBefore(newNode, referenceNode : TJSNode) : TJSNode;
283
+ function isDefaultNameSpace(aNameSpaceURI : String) : Boolean;
284
+ function isEqualNode(aNode : TJSNode) : boolean;
285
+ function isSameNode(aNode : TJSNode) : boolean;
286
+ function lookupNamespaceURI(aPrefix : string) : string;
287
+ function lookupPrefix(aPrefix : string) : string;
288
+ procedure normalize;
289
+ function removeChild(aChild: TJSNode) : TJSNode;
290
+ function replaceChild(aNewChild, aOldChild : TJSNode) : TJSNode;
291
+ property baseURI : string read FBaseURI;
292
+ property childNodes : TJSNodeList read FChildNodes;
293
+ property firstChild : TJSNode Read FFirstChild;
294
+ property nextSibling : TJSNode Read FNextSibling;
295
+ property nodeName : String Read FNodeName;
296
+ property nodeType : NativeInt Read FNodeType;
297
+ property ownerDocument : TJSDocument read FOwnerDocument;
298
+ property parentElement : TJSElement read FParentElement;
299
+ property parentNode : TJSNode read FParentNode;
300
+ property previousSibling : TJSNode Read FPreviousSibling;
301
+ end;
302
+
303
+
304
+ TJSNodeListCallBack = reference to procedure (currentValue : TJSNode; currentIndex: NativeInt; list : TJSNodeList);
305
+ TJSNodeListEvent = TJSNodeListCallBack;
306
+
307
+ TJSNodeList = class external name 'NodeList' (TJSObject)
308
+ Private
309
+ FLength : NativeInt; external name 'length';
310
+ Public
311
+ procedure forEach(const aCallBack : TJSNodeListCallBack);
312
+ function item(aIndex : NativeInt) : TJSNode;
313
+ Property length : NativeInt Read FLength;
314
+ Property Nodes [aIndex : NativeInt] : TJSNode Read item; default;
315
+ end;
316
+
317
+ TJSAttr = class external name 'Attr' (TJSNode)
318
+ Private
319
+ fLocalName : String; external name 'localName';
320
+ fNameSpaceURI : String external name 'namespaceURI';
321
+ fPrefix : string; external name 'prefix';
322
+ fName : string; external name 'name';
323
+ fSpecified : Boolean; external name 'specified';
324
+ public
325
+ value : JSValue;
326
+ property localName : String Read fLocalName;
327
+ property namespaceURI : string Read fNameSpaceURI;
328
+ property prefix : string read fPrefix;
329
+ property name : string Read fName;
330
+ property specified : boolean Read fSpecified; // Useless, always true
331
+ end;
332
+
333
+
334
+ TJSNamedNodeMap = class external name 'NamedNodeMap' (TJSObject)
335
+ private
336
+ FLength : NativeInt; external name 'length';
337
+ Public
338
+ function getNamedItem(aName : string) : TJSAttr;
339
+ function setNamedItem(aAttr : TJSAttr) : TJSAttr;
340
+ function removeNamedItem(aName : string) : TJSAttr;
341
+ function item(aIndex : NativeInt) : TJSAttr;
342
+ function getNamedItemNS(aNamespaceURI, aLocalName : string) : TJSAttr;
343
+ function setNamedItemNS(aAttr : TJSAttr) : TJSAttr;
344
+ function removeNamedItem(aNamespaceURI, aLocalName : string) : TJSAttr;
345
+ Property Attrs[aIndex : String] : TJSattr Read getNamedItem; default;
346
+ // Property Attrs[aIndex : NativeInt] : TJSattr Read item; default; // ToDo: JS supports default property overloads
347
+ Property length : NativeInt Read FLength;
348
+ end;
349
+
350
+ TJSHTMLCollection = class external name 'HTMLCollection' (TJSObject)
351
+ Private
352
+ FLength : NativeInt; external name 'length';
353
+ public
354
+ Function item(aIndex : Integer) : TJSNode;
355
+ Function namedItem(aName : string) : TJSNode;
356
+ property Items[aIndex : Integer] : TJSNode Read item; default;
357
+ property NamedItems[aName : String] : TJSNode Read namedItem;
358
+ Property length : NativeInt Read FLength;
359
+ end;
360
+
361
+ TJSDOMString = String;
362
+
363
+ TDOMTokenlistCallBack = Procedure (Current : JSValue; currentIndex : NativeInt; list : TJSDOMTokenList);
364
+
365
+ // Interface
366
+ TJSDOMTokenList = class external name 'DOMTokenList' (TJSObject)
367
+ Private
368
+ FLength : NativeInt; external name 'length';
369
+ public
370
+ Procedure add(aToken : TJSDOMString); varargs;
371
+ Procedure remove(aToken : TJSDOMString); varargs;
372
+ function item(aIndex : NativeInt) : String;
373
+ function contains(aToken : TJSDOMString) : Boolean;
374
+ Procedure replace(aOldToken, ANewToken : TJSDOMString);
375
+ function supports(aToken : TJSDOMString) : Boolean;
376
+ function toggle(aToken : TJSDOMString) : Boolean;
377
+ // entries,keys, values
378
+ procedure forEach(const callback: TDOMTokenlistCallBack);
379
+ property length : NativeInt read FLength;
380
+ end;
381
+
382
+ TJSDOMRect = class external name 'DOMRect' (TJSObject)
383
+ public
384
+ left,top,right,bottom,x,y,width,height : double;
385
+ {$IFDEF FIREFOX}
386
+ constructor New;
387
+ {$ENDIF}
388
+ end;
389
+
390
+ { TJSDOMRectReadOnly }
391
+
392
+ TJSDOMRectReadOnly = class external name 'DOMRect' (TJSObject)
393
+ private
394
+ fbottom: double; external name 'bottom';
395
+ fHeight: double; external name 'height';
396
+ fleft: double; external name 'left';
397
+ fright: double; external name 'right';
398
+ ftop: double; external name 'top';
399
+ fwidth: double; external name 'width';
400
+ fx: double; external name 'x';
401
+ fy: double;external name 'y';
402
+ public
403
+ // left,top,right,bottom,x,y,width,height : double;
404
+ {$IFDEF FIREFOX}
405
+ constructor New;
406
+ {$ENDIF}
407
+ Property left : double read fleft;
408
+ Property top : double read ftop;
409
+ Property right : double read fright;
410
+ Property bottom : double read fbottom;
411
+ Property x : double read fx;
412
+ Property y : double read fy;
413
+ Property width : double read fwidth;
414
+ Property height : double read fHeight;
415
+ end;
416
+
417
+ TJSClientRect = record
418
+ left,top,right,bottom : double;
419
+ {$IFDEF FIREFOX}
420
+ width, height: double;
421
+ {$ENDIF}
422
+ end;
423
+
424
+ TJSScrollOptions = class external name 'Object' (TJSObject)
425
+ top : Integer;
426
+ left : Integer;
427
+ behaviour : string;
428
+ end;
429
+
430
+ TJSClientRectArray = array of TJSClientRect;
431
+
432
+ TJSCheckVisibilityOptions = class external name 'Object' (TJSObject)
433
+ contentVisibilityAuto : Boolean;
434
+ opacityProperty : Boolean;
435
+ visibilityProperty : Boolean;
436
+ checkOpacity : Boolean;
437
+ checkVisibility : Boolean;
438
+ end;
439
+
440
+ TJSAttachShadowOptions = class external name 'Object' (TJSObject)
441
+ mode : string;
442
+ clonable : boolean;
443
+ delegatesFocus : boolean;
444
+ serializable : boolean;
445
+ slotAssignment : string;
446
+ end;
447
+
448
+ TJSAnimateOptions = class external name 'Object' (TJSObject)
449
+ id : string;
450
+ rangeEnd: JSValue;
451
+ rangeStart : JSValue;
452
+ timeline : TJSAnimationTimeline;
453
+
454
+ end;
455
+
456
+ TJSElement = class external name 'Element' (TJSNode)
457
+ Private
458
+ FAttributes : TJSNamedNodeMap; external name 'attributes';
459
+ FChildElementCount : NativeInt; external name 'childElementCount';
460
+ FChildren : TJSHTMLCollection; external name 'children';
461
+ FClassList : TJSDOMTokenList; external name 'classList';
462
+ FCLientHeight : NativeInt; external name 'clientHeight';
463
+ FCLientLeft : NativeInt; external name 'clientLeft';
464
+ FCLientTop : NativeInt; external name 'clientTop';
465
+ FCLientWidth : NativeInt; external name 'clientWidth';
466
+ FFirstElementChild : TJSElement; external name 'firstElementChild';
467
+ FLastElementChild : TJSElement; external name 'lastElementChild';
468
+ FLocalName : string; external name 'localName';
469
+ FNameSpaceURI : String; external name 'namespaceURI';
470
+ FNextElementSibling : TJSElement; external name 'nextElementSibling';
471
+ FPreviousElementSibling : TJSElement; external name 'previousElementSibling';
472
+ FPrefix : String; external name 'prefix';
473
+ FScrollHeight : NativeInt; external name 'scrollHeight';
474
+ {$IFDEF FIREFOX}
475
+ FScrollLeftMax : NativeInt; external name 'scrollLeftMax';
476
+ FScrollTopMax : NativeInt; external name 'scrollTopMax';
477
+ {$endif}
478
+ FScrollWidth : NativeInt; external name 'scrollWidth';
479
+ FTagName : string; external name 'tagName';
480
+ Public
481
+ name : string;
482
+ className : string;
483
+ id : string;
484
+ innerHTML : String;
485
+ outerHTML : string;
486
+ scrollLeft : NativeInt;
487
+ scrollTop : NativeInt;
488
+ function animate(keyframes : TJSArray; options : TJSAnimateOptions) : TJSAnimation;
489
+ procedure append(aText : String); overload;
490
+ procedure append(aNode : TJSElement); overload;
491
+ procedure append(aText : String; aNode : TJSElement); varargs; overload;
492
+ procedure append(aNode1,aNode2: TJSElement); varargs; overload;
493
+ function attachShadow : TJSShadowRoot;
494
+ function attachShadow(aOptions : TJSAttachShadowOptions) : TJSShadowRoot;
495
+ procedure before(aText : String); overload;
496
+ procedure before(aText : String; aNode : TJSElement); varargs; overload;
497
+ procedure before(aNode : TJSElement); overload;
498
+ procedure before(aNode1,aNode2 : TJSElement); overload; varargs;
499
+ function checkVisibility : boolean;
500
+ function checkVisibility(Options : TJSCheckVisibilityOptions) : Boolean;
501
+ function closest(aSelector : String) : TJSElement;
502
+ function getAttribute(aName : string) : string;
503
+ function getAttributeNode(aName : string) : TJSAttr;
504
+ function getAttributeNodeNS(aNameSpace, aName : string) : TJSAttr;
505
+ function getAttributeNS(aNameSpace, aName : string) : string;
506
+ function getBoundingClientRect : TJSDOMRect;
507
+ function getClientRects : TJSClientRectArray;
508
+ function getElementsByClassName(aClassName: string) : TJSHTMLCollection;
509
+ function getElementsByTagNameNS(aNameSpace, aTagName : String): TJSHTMLCollection;
510
+ function getElementsByTagName(aTagName : String): TJSHTMLCollection;
511
+ function hasAttribute(aName : String) : Boolean;
512
+ function hasAttributeNS(aNameSpace,aName : String) : Boolean;
513
+ function hasAttributes : Boolean;
514
+ function insertAdjacentElement(aPosition : string; aElement : TJSElement) : TJSElement;
515
+ procedure insertAdjacentHTML(aPosition,aHTML : string);
516
+ procedure insertAdjacentText(aPosition,aText : string);
517
+ function matches(aSelectorString : String) : Boolean;
518
+ function querySelector(aSelectors : String) : TJSElement;
519
+ function querySelectorAll(aSelectors : String) : TJSNodeList;
520
+ procedure remove; overload;
521
+ procedure releasePointerCapture(evID : JSValue);
522
+ procedure removeAttribute(aName: string);
523
+ procedure removeAttributeNS(aNameSpace,aName: string);
524
+ function removeAttributeNode(aAttr : TJSAttr) : TJSAttr;
525
+ procedure replaceChildren; overload;
526
+ procedure replaceChildren(aNode : TJSNode); overload;
527
+ procedure replaceChildren(aNode1,aNode2 : TJSNode); overload;
528
+ procedure replaceChildren(aNode1,aNode2,aNode3 : TJSNode); overload; varargs;
529
+ procedure scroll(xCoord, yCoord: Integer); overload;
530
+ procedure scroll(options: TJSObject); overload;
531
+ procedure scroll(options: TJSScrollOptions); overload;
532
+ procedure scrollBy(xCoord, yCoord: Integer); overload;
533
+ procedure scrollBy(options: TJSObject); overload;
534
+ procedure scrollBy(options: TJSScrollOptions); overload;
535
+ procedure setAttribute(aName : string; AValue : String);
536
+ function setAttributeNode(aNode: TJSAttr) : TJSAttr;
537
+ function setAttributeNodeNS(aNode: TJSAttr) : TJSAttr;
538
+ procedure setAttributeNS(aNameSpace,aName : string; AValue : String);
539
+ procedure setCapture(retargetToElement : Boolean);
540
+ procedure setPointerCapture(pointerID : JSValue);
541
+ procedure requestFullScreen;
542
+ Property attributes : TJSNamedNodeMap read FAttributes;
543
+ Property childElementCount : NativeInt Read FChildElementCount;
544
+ Property children : TJSHTMLCollection Read FChildren;
545
+ Property classList : TJSDOMTokenList read FClassList;
546
+ property clientHeight : NativeInt read FClientHeight;
547
+ property clientLeft : NativeInt read FClientLeft;
548
+ property clientTop : NativeInt read FClientTop;
549
+ property clientWidth : NativeInt read FClientWidth;
550
+ property firstElementChild : TJSElement Read FFirstElementChild;
551
+ property lastElementChild : TJSElement Read FLastElementChild;
552
+ property localName : string Read FLocalName;
553
+ property namespaceURI : String read FNameSpaceURI;
554
+ property nextElementSibling : TJSElement Read FNextElementSibling;
555
+ property previousElementSibling : TJSElement Read FPreviousElementSibling;
556
+ property prefix : String read FPrefix;
557
+ property scrollHeight : NativeInt Read FScrollHeight;
558
+ {$IFDEF FIREFOX}
559
+ property scrollLeftMax : NativeInt Read FScrollLeftMax;
560
+ property scrollTopMax : NativeInt Read FScrollTopMax;
561
+ {$ENDIF}
562
+ property scrollWidth : NativeInt Read FScrollWidth;
563
+ property tagName : String read FTagName;
564
+ Property Attrs[aName : string] : String read getAttribute write setAttribute; default;
565
+ end;
566
+
567
+ TJSElementCreationOptions = record
568
+ named : string;
569
+ end;
570
+
571
+ TJSDocumentType = class external name 'DocumentType' (TJSNode)
572
+ private
573
+ FName : String; external name 'name';
574
+ FPublicID : String; external name 'publicId';
575
+ FSystemID : String; external name 'systemId';
576
+ public
577
+ property name : String read FName;
578
+ property publicId : String Read FPublicID;
579
+ property systemId : String read FSystemID;
580
+ end;
581
+
582
+ TJSDOMImplementation = class external name 'DocumentImplementation' (TJSObject)
583
+ Public
584
+ function createDocument(aNamespaceURI, aQualifiedNameStr : String; aDocumentType : TJSDocumentType) : TJSDocument;
585
+ function createDocumentType(aQualifiedNameStr,aPublicId,aSystemId : String) : TJSDocumentType;
586
+ function createHTMLDocument(aTitle : String) : TJSDocument;
587
+ end;
588
+
589
+ TJSLocation = class external name 'Location' (TJSObject)
590
+ Private
591
+ FOrigin : string; external name 'origin';
592
+ Public
593
+ hash : string;
594
+ host : string;
595
+ hostname : string;
596
+ href : string;
597
+ password : string;
598
+ pathname : string;
599
+ port : string;
600
+ protocol : string;
601
+ search : string;
602
+ username : string;
603
+ procedure assign(aURL : String); overload;
604
+ procedure reload(aForce : Boolean);
605
+ procedure replace(aURL : String);
606
+ property origin : string read FOrigin;
607
+ end;
608
+
609
+ TJSCSSStyleDeclaration = class; // forward
610
+
611
+ TJSStyleSheet = class external name 'StyleSheet' (TJSEventTarget)
612
+ Private
613
+ FHRef : String; external name 'href';
614
+ FOwnerNode : TJSNode; external name 'ownerNode';
615
+ FParentStyleSheet : TJSStyleSheet; external name 'parentStyleSheet';
616
+ FTitle : String; external name 'title';
617
+ FType : String; external name 'type';
618
+ Public
619
+ disabled : String;
620
+ Property href : String read FHRef;
621
+ property ownerNode : TJSNode Read FOwnerNode;
622
+ property parentStyleSheet : TJSStyleSheet read FParentStyleSheet;
623
+ property title : string Read FTitle;
624
+ property _type : String read FType;
625
+ end;
626
+
627
+ TJSCSSRule = class external name 'CSSRule' (TJSObject)
628
+ Private
629
+ FCSSText : String; external name 'cssText';
630
+ FParentStyleSheet : TJSCSSStyleSheet; external name 'parentStyleSheet';
631
+ FparentRule : TJSCSSRule; external name 'parentRule';
632
+ Public
633
+ property cssText : String Read FCSSText;
634
+ property parentRule : TJSCSSRule read FparentRule;
635
+ property parentStyleSheet : TJSCSSStyleSheet Read FParentStyleSheet;
636
+ end;
637
+
638
+ TJSCSSStyleRule = class external name 'CSSStyleRule' (TJSCSSRule)
639
+ private
640
+ FStyle: TJSCSSStyleDeclaration; external name 'style';
641
+ public
642
+ selectorText: String;
643
+ property style: TJSCSSStyleDeclaration read FStyle;
644
+ end;
645
+
646
+ TJSCSSRuleList = Class external name 'CSSRuleList' (TJSObject)
647
+ Private
648
+ FLength : NativeInt; external name 'length';
649
+ Public
650
+ function item(index : NativeInt) : TJSCSSRule;
651
+ property length : NativeInt Read FLength;
652
+ Property items[aIndex : NativeInt] : TJSCSSRule read item; default;
653
+ end;
654
+
655
+
656
+ TJSCSSStyleSheet = class external name 'CSSStyleSheet' (TJSStyleSheet)
657
+ Private
658
+ FCSSRules : TJSCSSRuleList; external name 'cssRules';
659
+ Public
660
+ procedure deleteRule(aIndex : NativeInt);
661
+ function insertRule(aRule : String; aIndex : NativeInt) : NativeInt;
662
+ Property cssRules : TJSCSSRuleList read FCSSRules;
663
+ end;
664
+
665
+ TJSStyleSheetList = Class external name 'StyleSheetList' (TJSObject)
666
+ Private
667
+ FLength : NativeInt; external name 'length';
668
+ Public
669
+ function item(index : NativeInt) : TJSStyleSheet;
670
+ property length : NativeInt Read FLength;
671
+ Property items[aIndex : NativeInt] : TJSStyleSheet read item; default;
672
+ end;
673
+
674
+ { TJSDocumentFragment }
675
+
676
+ TJSDocumentFragment = Class external name 'DocumentFragment' (TJSNode)
677
+ private
678
+ FchildElementCount: Integer; external name 'childElementCount';
679
+ Fchildren: TJSHTMLCollection; external name 'children';
680
+ FfirstElementChild: TJSElement; external name 'firstElementChild';
681
+ FlastElementChild: TJSElement; external name 'lastElementChild';
682
+ public
683
+ constructor new;
684
+ function querySelector(aSelector : String) : TJSElement;
685
+ function querySelectorAll(aSelector : String) : TJSNodeList;
686
+ property childElementCount : Integer read FchildElementCount;
687
+ property children : TJSHTMLCollection read Fchildren;
688
+ property firstElementChild : TJSElement read FfirstElementChild;
689
+ property lastElementChild : TJSElement read FlastElementChild;
690
+ end;
691
+
692
+ TJSShadowRootMode = (open, closed);
693
+ TJSSlotAssignmentMode = (manual, named);
694
+
695
+ TJSShadowRoot = class external name 'ShadowRoot' (TJSDocumentFragment)
696
+ private
697
+ FactiveElement: TJSElement; external name 'activeElement';
698
+ FadoptedStyleSheets: TJSArray; external name 'adoptedStyleSheets';
699
+ Fclonable: Boolean; external name 'clonable';
700
+ FdelegatesFocus: Boolean; external name 'delegatesFocus';
701
+ FfullscreenElement: TJSElement; external name 'fullscreenElement';
702
+ Fhost: TJSElement; external name 'host';
703
+ FinnerHTML: String; external name 'innerHTML';
704
+ Fmode: TJSShadowRootMode; external name 'mode';
705
+ FpictureInPictureElement: TJSElement; external name 'pictureInPictureElement';
706
+ FpointerLockElement: TJSElement; external name 'pointerLockElement';
707
+ FslotAssignment: String; external name 'slotAssignment';
708
+ FstyleSheets: TJSStyleSheetList; external name 'styleSheets';
709
+ public
710
+ property activeElement: TJSElement read FactiveElement;
711
+ property adoptedStyleSheets: TJSArray read FadoptedStyleSheets;
712
+ property clonable: Boolean read Fclonable;
713
+ property delegatesFocus: Boolean read FdelegatesFocus;
714
+ property fullscreenElement: TJSElement read FfullscreenElement;
715
+ property host: TJSElement read Fhost;
716
+ property innerHTML: String read FinnerHTML;
717
+ property mode: TJSShadowRootMode read Fmode;
718
+ property pictureInPictureElement: TJSElement read FpictureInPictureElement;
719
+ property pointerLockElement: TJSElement read FpointerLockElement;
720
+ property slotAssignment: String read FslotAssignment;
721
+ property styleSheets: TJSStyleSheetList read FstyleSheets;
722
+ end;
723
+
724
+ { TJSEventHelper }
725
+
726
+ TJSEventHelper = class helper for TJSEvent
727
+ private
728
+ function GetCurrentTargetElement: TJSElement;
729
+ function GetCurrentTargetHTMLElement: TJSHTMLElement;
730
+ function GetTargetElement: TJSElement;
731
+ function GetTargetHTMLElement: TJSHTMLElement;
732
+ Public
733
+ property currentTargetElement : TJSElement Read GetCurrentTargetElement;
734
+ property currentTargetHTMLElement : TJSHTMLElement Read GetCurrentTargetHTMLElement;
735
+ property targetElement : TJSElement Read GetTargetElement;
736
+ property targetHTMLElement : TJSHTmlElement Read GetTargetHTMLElement;
737
+ end;
738
+
739
+
740
+ TJSXPathExpression = class external name 'XPathExpression' (TJSObject)
741
+ Public
742
+ function evaluate(contextNode : TJSNode; aType : NativeInt; aResult : TJSXPathResult) : TJSXPathResult;
743
+ function evaluateWithContext(contextNode : TJSNode; aPosition, aSize, aType : NativeInt; aResult : TJSXPathResult) : TJSXPathResult;
744
+ end;
745
+
746
+ TJSXPathNSResolver = class external name 'XPathNSResolver' (TJSObject)
747
+ Public
748
+ function lookupNamespaceURI(prefix : string) : string;
749
+ end;
750
+
751
+ { TJSCharacterData }
752
+
753
+ TJSCharacterData = class external name 'CharacterData' (TJSNode)
754
+ private
755
+ FLength: NativeInt; external name 'length';
756
+ FnextElementSibling: TJSElement; external name 'nextElementSibling';
757
+ FpreviousElementSibling: TJSElement; external name 'previousElementSibling';
758
+ public
759
+ data: JSValue;
760
+ property length : NativeInt read FLength;
761
+ property nextElementSibling : TJSElement read FnextElementSibling;
762
+ property previousElementSibling : TJSElement read FpreviousElementSibling;
763
+ end;
764
+
765
+
766
+ TJSProcessingInstruction = class external name 'ProcessingInstruction' (TJSCharacterData);
767
+
768
+ { TJSRange }
769
+
770
+ TJSRange = class external name 'Range' (TJSObject)
771
+ private
772
+ FCollapsed: boolean; external name 'collapsed';
773
+ FcommonAncestorContainer: TJSNode; external name 'commonAncestorContainer';
774
+ FendContainer: TJSNode; external name 'endContainer';
775
+ FEndOffset: NativeInt; external name 'endOffset';
776
+ FstartContainer: TJSNode; external name 'startContainer';
777
+ FstartOffset: NativeInt; external name 'startOffset';
778
+ Public
779
+ const
780
+ END_TO_END = 0;
781
+ END_TO_START = 1;
782
+ START_TO_END = 2;
783
+ START_TO_START = 3;
784
+ Public
785
+ constructor new;
786
+ function cloneContents : TJSDocumentFragment;
787
+ function cloneRange : TJSRange;
788
+ procedure collapse;
789
+ function compareBoundaryPoints(aHow : NativeInt) : NativeInt;
790
+ function createContextualFragment(aTagstring : String) : TJSDocumentFragment;
791
+ procedure deleteContents;
792
+ procedure detach;
793
+ function extractContents : TJSDocumentFragment;
794
+ procedure insertNode(aNode : TJSNode);
795
+ procedure selectNode(aNode : TJSNode);
796
+ procedure selectNodeContents(aNode : TJSNode);
797
+ procedure setEnd(aEndNode : TJSNode; aEndOffset : NativeInt);
798
+ procedure setEndAfter(aEndNode : TJSNode);
799
+ procedure setEndBefore(aEndNode : TJSNode);
800
+ procedure setStart(aStartNode : TJSNode; aStartOffset : NativeInt);
801
+ procedure setStartAfter(aStartNode : TJSNode);
802
+ procedure setStartBefore(aStartNode : TJSNode);
803
+ procedure surroundContents(aNode : TJSNode);
804
+ property collapsed : boolean read FCollapsed;
805
+ property commonAncestorContainer : TJSNode read FcommonAncestorContainer ;
806
+ property endContainer : TJSNode read FendContainer;
807
+ property endOffset : NativeInt Read FEndOffset;
808
+ property startContainer : TJSNode read FstartContainer;
809
+ property startOffset : NativeInt Read FstartOffset;
810
+ end;
811
+
812
+
813
+ { TJSTreeWalker }
814
+
815
+ TJSTreeWalker = class external name 'TreeWalker' (TJSObject)
816
+ private
817
+ FCurrentNode: TJSNode; external name 'currentNode';
818
+ FexpandEntityReference: Boolean; external name 'expandEntityReference';
819
+ FFilter: TJSNodeFilter; external name 'filter';
820
+ FRoot: TJSNode; external name 'root';
821
+ FWhatToShow: NativeInt; external name 'whatToShow';
822
+ Public
823
+ function firstChild : TJSNode;
824
+ function lastChild : TJSNode;
825
+ function nextNode : TJSNode;
826
+ function nextSibling : TJSNode;
827
+ function parentNode : TJSNode;
828
+ function previousNode : TJSNode;
829
+ function previousSibling : TJSNode;
830
+
831
+ property root : TJSNode read FRoot;
832
+ property whatToShow : NativeInt read FWhatToShow;
833
+ property filter : TJSNodeFilter Read FFilter;
834
+ property expandEntityReference : Boolean Read FexpandEntityReference;
835
+ property currentNode : TJSNode Read FCurrentNode;
836
+ end;
837
+
838
+ TJSNodeFilter = class external name 'NodeFilter' (TJSObject)
839
+ const
840
+ SHOW_ALL = -1;
841
+ SHOW_ATTRIBUTE = 2;
842
+ SHOW_CDATA_SECTION = 8;
843
+ SHOW_COMMENT = 128;
844
+ SHOW_DOCUMENT = 256;
845
+ SHOW_DOCUMENT_FRAGMENT = 1024;
846
+ SHOW_DOCUMENT_TYPE = 512;
847
+ SHOW_ELEMENT = 1;
848
+ SHOW_ENTITY = 32;
849
+ SHOW_ENTITY_REFERENCE = 16;
850
+ SHOW_NOTATION = 2048;
851
+ SHOW_PROCESSING_INSTRUCTION = 64;
852
+ SHOW_TEXT = 4;
853
+ function acceptNode (aNode : TJSNode) : NativeInt;
854
+ end;
855
+
856
+ TJSXPathResult = class external name 'XPathResult' (TJSObject)
857
+ private class var
858
+ FANY_TYPE : Integer; external name 'ANY_TYPE';
859
+ FNUMBER_TYPE : Integer; external name 'NUMBER_TYPE';
860
+ FSTRING_TYPE : Integer; external name 'STRING_TYPE';
861
+ FBOOLEAN_TYPE : Integer; external name 'BOOLEAN_TYPE';
862
+ FUNORDERED_NODE_ITERATOR_TYPE : Integer; external name 'UNORDERED_NODE_ITERATOR_TYPE';
863
+ FORDERED_NODE_ITERATOR_TYPE : Integer; external name 'ORDERED_NODE_ITERATOR_TYPE';
864
+ FUNORDERED_NODE_SNAPSHOT_TYPE : Integer; external name 'UNORDERED_NODE_SNAPSHOT_TYPE';
865
+ FORDERED_NODE_SNAPSHOT_TYPE : Integer; external name 'ORDERED_NODE_SNAPSHOT_TYPE';
866
+ FANY_UNORDERED_NODE_TYPE : Integer; external name 'ANY_UNORDERED_NODE_TYPE';
867
+ FFIRST_ORDERED_NODE_TYPE : Integer; external name 'FIRST_ORDERED_NODE_TYPE';
868
+ public
869
+ class property ANY_TYPE: Integer read FANY_TYPE;
870
+ class property NUMBER_TYPE: Integer read FNUMBER_TYPE;
871
+ class property STRING_TYPE: Integer read FSTRING_TYPE;
872
+ class property BOOLEAN_TYPE: Integer read FBOOLEAN_TYPE;
873
+ class property UNORDERED_NODE_ITERATOR_TYPE: Integer read FUNORDERED_NODE_ITERATOR_TYPE;
874
+ class property ORDERED_NODE_ITERATOR_TYPE: Integer read FORDERED_NODE_ITERATOR_TYPE;
875
+ class property UNORDERED_NODE_SNAPSHOT_TYPE: Integer read FUNORDERED_NODE_SNAPSHOT_TYPE;
876
+ class property ORDERED_NODE_SNAPSHOT_TYPE: Integer read FORDERED_NODE_SNAPSHOT_TYPE;
877
+ class property ANY_UNORDERED_NODE_TYPE: Integer read FANY_UNORDERED_NODE_TYPE;
878
+ class property FIRST_ORDERED_NODE_TYPE: Integer read FFIRST_ORDERED_NODE_TYPE;
879
+ private
880
+ FBooleanValue : Boolean; external name 'booleanValue';
881
+ FNumberValue : Double; external name 'numberValue';
882
+ FResultType : NativeInt; external name 'resultType';
883
+ FSingleNodeValue : TJSNode; external name 'singleNodeValue';
884
+ FSnaphotLength : NativeInt; external name 'snapshotLength';
885
+ FStringValue : String; external name 'stringValue';
886
+ public
887
+ Function iterateNext : TJSNode;
888
+ Function snapshotItem(Index: NativeInt) : TJSNode;
889
+ Property booleanValue : Boolean Read FBooleanValue;
890
+ Property numberValue : Double Read FNumberValue;
891
+ property resultType : NativeInt Read FResultType;
892
+ Property singleNodeValue : TJSNode Read FSingleNodeValue;
893
+ property snapshotLength : NativeInt read FSnaphotLength;
894
+ property stringValue : String Read FStringValue;
895
+ end;
896
+
897
+ TJSSelection = class external name 'Selection' (TJSObject)
898
+ Private
899
+ FanchorNode : TJSNode ; external name 'anchorNode';
900
+ FanchorOffset : NativeInt ; external name 'anchorOffset';
901
+ FfocusNode : TJSNode ; external name 'focusNode';
902
+ FfocusOffset : NativeInt ; external name 'focusOffset';
903
+ FisCollapsed : Boolean ; external name 'isCollapsed';
904
+ FrangeCount : NativeInt ; external name 'rangeCount';
905
+ Ftype : String ; external name 'type';
906
+ Public
907
+ function getRangeAt(aIndex : NativeInt) : TJSRange;
908
+ procedure collapse(aParentNode : TJSNode; Offset : NativeInt);
909
+ procedure extend(aParentNode : TJSNode; Offset : NativeInt);
910
+ procedure collapseToStart;
911
+ procedure collapseToEnd;
912
+ procedure selectAllChildren(aParentNode : TJSNode);
913
+ procedure addRange(aRange : TJSRange);
914
+ procedure removeRange(aRange : TJSRange);
915
+ procedure removeAllRanges;
916
+ procedure deleteFromDocument;
917
+ function containsNode(aNode : TJSNode; aPartlyContained : Boolean) : Boolean;
918
+ procedure setBaseAndExtent(aAnchorNode : TJSNode; aAnchorOffset : NativeInt; aFocusNode : TJSNode; aFocusOffset : NativeInt);
919
+ property anchorNode : TJSNode read FAnchorNode;
920
+ property anchorOffset : NativeInt read FAnchorOffset;
921
+ property focusNode : TJSNode read FFocusNode;
922
+ property focusOffset : NativeInt read FFocusOffset;
923
+ property isCollapsed : Boolean read FIsCollapsed;
924
+ property rangeCount : NativeInt read FRangeCount;
925
+ property _type : String Read FType;
926
+ end;
927
+ TJSNameSpaceMapperCallback = function (aNameSpace : string ) : String;
928
+
929
+ TJSHTMLFileList = Class;
930
+
931
+ { TJSDataTransferItem }
932
+
933
+ TJSDataTransferItemCallBack = reference to Procedure(aData : String); safecall;
934
+
935
+ TJSDataTransferItem = class external name 'DataTransferItem' (TJSObject)
936
+ private
937
+ FKind: String; external name 'kind';
938
+ FType: string; external name 'type';
939
+ Public
940
+ function getAsFile : TJSHTMLFile;
941
+ Procedure getAsString(aCallBack : TJSDataTransferItemCallBack);
942
+ property Kind : String read FKind;
943
+ property _Type : string read FType;
944
+ end;
945
+
946
+ TJSDataTransferItemList = class external name 'DataTransferItemList' (TJSObject)
947
+ private
948
+ FLength: NativeInt; external name 'length';
949
+ function getitem(aIndex : nativeInt) : TJSDataTransferItem ; external name '[]';
950
+ Public
951
+ Function add(aData : string; AType: string) : TJSDataTransferItem; overload;
952
+ Function add(aFile : TJSHTMLFile) : TJSDataTransferItem; overload;
953
+ Procedure clear;
954
+ procedure remove(aIndex : integer);
955
+ property length : NativeInt read FLength;
956
+ property Items[aIndex : NativeInt] : TJSDataTransferItem Read getitem; default;
957
+ end;
958
+
959
+ { TJSDataTransfer }
960
+
961
+ TJSDataTransfer = class external name 'DataTransfer' (TJSObject)
962
+ private
963
+ FFiles: TJSHTMLFileList; external name 'files';
964
+ FItems: TJSDataTransferItemList; external name 'items';
965
+ FTypes: TJSStringDynArray; external name 'types';
966
+ Public
967
+ dropEffect : string;
968
+ effectAllowed : string;
969
+ Procedure clearData; overload;
970
+ Procedure clearData(aFormat : string); overload;
971
+ function getData(aFormat : string) : String;
972
+ procedure setData(aFormat : String; aData : String);
973
+ procedure setDragImage(aImage: TJSElement; xOffset,yOffset : integer);
974
+ property files : TJSHTMLFileList Read FFiles;
975
+ property items : TJSDataTransferItemList read FItems;
976
+ property types : TJSStringDynArray read FTypes;
977
+ end;
978
+
979
+ { TJSDragEvent }
980
+
981
+ TJSDragEvent = class external name 'DragEvent' (TJSEvent)
982
+ Private
983
+ FDataTransfer: TJSDataTransfer; external name 'dataTransfer';
984
+ FrelatedTarget : TJSEventTarget external name 'relatedTarget';
985
+ FscreenX : NativeInt external name 'screenX';
986
+ FscreenY : NativeInt external name 'screenY';
987
+ FclientX : NativeInt external name 'clientX';
988
+ FclientY : NativeInt external name 'clientY';
989
+ Fbutton : NativeInt external name 'button';
990
+ Fbuttons : NativeInt external name 'buttons';
991
+ FctrlKey : Boolean external name 'ctrlKey';
992
+ FshiftKey : Boolean external name 'shiftKey';
993
+ FaltKey : Boolean external name 'altKey';
994
+ FmetaKey : Boolean external name 'metaKey';
995
+ Public
996
+ Property relatedTarget : TJSEventTarget Read FRelatedTarget;
997
+ Property screenX : NativeInt Read FScreenX;
998
+ Property screenY : NativeInt Read FScreenY;
999
+ Property clientX : NativeInt Read FClientX;
1000
+ Property clientY : NativeInt Read FClientY;
1001
+ Property button : NativeInt Read FButton;
1002
+ Property buttons : NativeInt Read FButtons;
1003
+ Property ctrlKey : Boolean Read FctrlKey;
1004
+ Property shiftKey : Boolean Read FshiftKey;
1005
+ Property altKey : Boolean Read FaltKey;
1006
+ Property metaKey : Boolean Read FmetaKey;
1007
+ property dataTransfer : TJSDataTransfer Read FDataTransfer;
1008
+ end;
1009
+ TJSDragDropEventHandler = reference to function(aEvent: TJSDragEvent) : Boolean; safecall;
1010
+ THTMLClickEventHandler = reference to function(aEvent : TJSMouseEvent) : boolean; safecall;
1011
+
1012
+ TJSClipBoardEvent = Class external name 'ClipboardEvent' (TJSEvent)
1013
+ Private
1014
+ FClipboardData: TJSDataTransfer external name 'clipboardData';
1015
+ Public
1016
+ Property ClipBoardData : TJSDataTransfer Read FClipBoardData;
1017
+ end;
1018
+
1019
+ { Various events }
1020
+
1021
+ TJSFocusEvent = Class external name 'FocusEvent' (TJSEvent)
1022
+ private
1023
+ FrelatedTarget : TJSElement external name 'relatedTarget';
1024
+ public
1025
+ property relatedTarget : TJSElement Read FrelatedTarget;
1026
+ end;
1027
+
1028
+ TJSAnimationEvent = Class external name 'AnimationEvent' (TJSEvent);
1029
+ TJSLoadEvent = Class external name 'LoadEvent' (TJSEvent);
1030
+
1031
+ TJSErrorEvent = class external name 'ErrorEvent' (TJSEvent)
1032
+ Private
1033
+ Fmessage : String external name 'message';
1034
+ Ffilename : string external name 'filename';
1035
+ Flineno : integer external name 'lineno';
1036
+ Fcolno : integer external name 'colno';
1037
+ Ferror : TJSObject external name 'error';
1038
+ Public
1039
+ Property message : String read FMessage;
1040
+ property filename : string Read FFileName;
1041
+ property lineno : integer read FLineNo;
1042
+ Property colno : integer read FColNo;
1043
+ Property error : TJSObject read FError;
1044
+ end;
1045
+
1046
+ TJSPageTransitionEvent = class external name 'PageTransitionEvent' (TJSEvent)
1047
+ end;
1048
+
1049
+ TJSHashChangeEvent = class external name 'HashChangeEvent' (TJSEvent)
1050
+ Private
1051
+ FnewURL : String external name 'newURL';
1052
+ FoldURL : String external name 'oldURL';
1053
+ public
1054
+ property newURL : String Read FNewURL;
1055
+ property oldURL : String Read FOldURL;
1056
+ end;
1057
+
1058
+ TJSPopStateEvent = class external name 'PopStateEvent' (TJSEvent)
1059
+ Private
1060
+ FState : JSValue; external name 'state';
1061
+ Public
1062
+ property state : JSValue read FState;
1063
+ end;
1064
+
1065
+ TJSStorageEvent = class external name 'StorageEvent' (TJSEvent)
1066
+ private
1067
+ Fkey : String external name 'key';
1068
+ FoldValue : String external name 'oldValue';
1069
+ FnewValue : String external name 'newValue';
1070
+ Furl : String external name 'url';
1071
+ FstorageArea : String external name 'storageArea';
1072
+ public
1073
+ Property key : String Read FKey;
1074
+ Property oldValue : String Read FOldValue;
1075
+ Property newValue : String Read FNewValue;
1076
+ Property url : String Read FURL;
1077
+ Property storageArea : String Read FstorageArea;
1078
+ end;
1079
+
1080
+ { TJSProgressEvent }
1081
+
1082
+ TJSProgressEvent = class external name 'ProgressEvent' (TJSEvent)
1083
+ Private
1084
+ FlengthComputable : Boolean external name 'lengthComputable';
1085
+ Floaded : NativeUINT external name 'loaded';
1086
+ FTotal : NativeUINT external name 'total';
1087
+ Public
1088
+ property lengthComputable : Boolean Read FlengthComputable;
1089
+ property loaded : NativeUINT Read FLoaded;
1090
+ property Total : NativeUINT Read FTotal;
1091
+ end;
1092
+
1093
+ TJSCloseEvent = class external name 'CloseEvent' (TJSEvent)
1094
+ private
1095
+ fcode: Word; external name 'code';
1096
+ freason: TJSDOMString; external name 'reason';
1097
+ fwasClean: Boolean; external name 'wasClean';
1098
+ public
1099
+ property code: Word read fcode;
1100
+ property reason: TJSDOMString read freason;
1101
+ property wasClean: Boolean read fwasClean;
1102
+ end;
1103
+
1104
+ TJSPageTransitionEventHandler = reference to function(aEvent : TJsPageTransitionEvent) : boolean; safecall;
1105
+ TJSHashChangeEventhandler = reference to function(aEvent : TJSHashChangeEvent) : boolean; safecall;
1106
+ TJSMouseWheelEventHandler = reference to function(aEvent : TJSWheelEvent) : boolean; safecall;
1107
+ TJSMouseEventHandler = reference to function(aEvent : TJSMouseEvent) : boolean; safecall;
1108
+ THTMLAnimationEventHandler = reference to function(aEvent : TJSAnimationEvent) : boolean; safecall;
1109
+ TJSErrorEventHandler = reference to function(aEvent : TJSErrorEvent) : boolean; safecall;
1110
+ TJSFocusEventHandler = reference to function(aEvent : TJSFocusEvent) : boolean; safecall;
1111
+ TJSKeyEventhandler = reference to function (aEvent : TJSKeyBoardEvent) : boolean; safecall;
1112
+ TJSLoadEventhandler = reference to function (aEvent : TJSLoadEvent) : boolean; safecall;
1113
+ TJSPointerEventHandler = reference to function(aEvent : TJSPointerEvent) : boolean; safecall;
1114
+ TJSUIEventHandler = reference to function(aEvent : TJSUIEvent) : Boolean; safecall;
1115
+ TJSPopStateEventHandler = reference to function(aEvent : TJSPopStateEvent) : Boolean; safecall;
1116
+ TJSStorageEventHandler = reference to function(aEvent : TJSStorageEvent) : Boolean; safecall;
1117
+ TJSProgressEventhandler = reference to function(aEvent : TJSProgressEvent) : Boolean; safecall;
1118
+ TJSTouchEventHandler = reference to function(aEvent : TJSTouchEvent) : boolean; safecall;
1119
+
1120
+ TJSDocument = class external name 'Document' (TJSNode)
1121
+ Private
1122
+ fActiveElement : TJSElement; external name 'activeElement';
1123
+ FCharacterSet: String; external name 'characterSet';
1124
+ FChildElementCount: NativeInt; external name 'childElementCount';
1125
+ FCompatMode: String; external name 'compatMode';
1126
+ FCurrentScript: TJSElement; external name 'currentScript';
1127
+ FDefaultView: TJSWindow; external name 'defaultView';
1128
+ FDocType: TJSDocumentType; external name 'docrype';
1129
+ FDocumentElement: TJSElement; external name 'documentElement';
1130
+ FDocumentURI: String; external name 'documentURI';
1131
+ FEmbeds: TJSHTMLCollection; external name 'embeds';
1132
+ FFirstElementChild : TJSElement; external name 'firstElementChild';
1133
+ FForms: TJSHTMLCollection; external name 'forms';
1134
+ FFullScreenElement: TJSElement; external name 'fullscreenElement';
1135
+ FFullscreenEnabled: Boolean; external name 'fullscreenEnabled';
1136
+ FHead: TJSElement; external name 'head';
1137
+ FHidden: Boolean; external name 'hidden';
1138
+ FImages: TJSHTMLCollection; external name 'images';
1139
+ FImplementation: TJSDOMImplementation; external name 'implementation';
1140
+ FLastElementChild : TJSElement; external name 'lastElementChild';
1141
+ FLastModified: String; external name 'lastModified';
1142
+ FLastStyleSheetSet: String; external name 'lastStyleSheetSet';
1143
+ FLinks: TJSHTMLCollection; external name 'links';
1144
+ FLocation: TJSLocation; external name 'location';
1145
+ FLocationString: String; external name 'location';
1146
+ FPlugins: TJSHTMLCollection; external name 'plugins';
1147
+ FPointerLockElement: TJSElement; external name 'pointerLockElement';
1148
+ FPreferredStyleSheetSet: String; external name 'preferredStyleSheetSet';
1149
+ FReadyState: String; external name 'readyState';
1150
+ FReferrer: String; external name 'referrer';
1151
+ FScripts: TJSHTMLCollection; external name 'scripts';
1152
+ FStyleSheets: TJSStyleSheetList; external name 'styleSheets';
1153
+ FStyleSheetSets: TJSValueDynArray; external name 'styleSheetSets';
1154
+ FURL: String; external name 'URL';
1155
+ FVisibilityState: string; external name 'visibilityState';
1156
+ Public
1157
+ function adoptNode(aExternalNode : TJSNode) : TJSNode;
1158
+ procedure close;
1159
+ function createAttribute(aName : string) : TJSAttr;
1160
+ function createCDATASection(S : String) : TJSNode;
1161
+ function createComment(S : String) : TJSNode;
1162
+ function createDocumentFragment : TJSDocumentFragment;
1163
+ function createElement(tagName : string) : TJSElement; overload;
1164
+ function createElement(tagName : string; const options : TJSElementCreationOptions) : TJSElement; overload;
1165
+ function createElementNS(aNameSpace,tagName : string) : TJSElement; overload;
1166
+ function createElementNS(aNameSpace,tagName : string; const options : TJSElementCreationOptions) : TJSElement; overload;
1167
+ function createEvent(aType : string) : TJSEvent;
1168
+ function createExpression(xPathText : String; aNameSpaceMapper: TJSNameSpaceMapperCallback) : TJSXPathExpression;
1169
+ function createNSResolver(aNode : TJSNode) : TJSXPathNSResolver;
1170
+ function createProcessingInstruction(target, data : String) : TJSProcessingInstruction;
1171
+ function createRange : TJSRange;
1172
+ function createTextNode(S : String) : TJSNode;
1173
+ function createTreeWalker(root : TJSNode; whatToShow : NativeInt; filter : TJSNodeFilter) : TJSTreeWalker;
1174
+ function elementFromPoint(x,y : integer) : TJSElement;
1175
+ procedure enableStyleSheetsForSet(aSet : String);
1176
+ function evaluate(xpathExpression : String; ContextNode : TJSNode; NameSpaceResolver : TJSNamespaceMapperCallBack; resultType : NativeInt; aResult : TJSXPathResult) : TJSXPathResult;
1177
+ function execCommand(aCommandName : String; aShowDefaultUI : Boolean; AValueArgument : String) : boolean; overload;
1178
+ function execCommand(aCommandName : String; aShowDefaultUI : Boolean) : boolean; overload;
1179
+ Procedure exitFullScreen;
1180
+ function getElementById(aID : String) : TJSElement;
1181
+ function getHTMLElementById(aID : String) : TJSHTMLElement; external name 'getElementById';
1182
+ function getElementsByClassName(aNames : string) : TJSHTMLCollection;
1183
+ function getElementsByName(aName : String) : TJSNodeList;
1184
+ function getElementsByTagName(aName : String) : TJSHTMLCollection;
1185
+ function getElementsByTagNameNS(aNameSpace,aName : String) : TJSHTMLCollection;
1186
+ function getSelection : TJSSelection;
1187
+ function hasFocus : boolean;
1188
+ function importNode(aExternalNode : TJSNode; Deep: boolean) : TJSNode;
1189
+ function querySelector(aSelectors : String) : TJSElement;
1190
+ function querySelectorAll(aSelectors : String) : TJSNodeList;
1191
+ procedure open;
1192
+ procedure releaseCapture;
1193
+ procedure write(aLine : string);
1194
+ procedure writeln(aLine : String);
1195
+ Public
1196
+ body : TJSElement;
1197
+ cookie: TJSString;
1198
+ designMode : string;
1199
+ dir : string;
1200
+ domain : string;
1201
+ selectedStyleSheetSet : string;
1202
+ title : string;
1203
+ onabort : TJSEventHandler;
1204
+ onblur : TJSEventHandler;
1205
+ oncancel : TJSEventHandler;
1206
+ oncanplay : TJSEventHandler;
1207
+ oncanplaythrough : TJSEventHandler;
1208
+ onchange : TJSEventHandler;
1209
+ onclick: THTMLClickEventHandler;
1210
+ onclose : TJSEventHandler;
1211
+ oncontextmenu : TJSEventHandler;
1212
+ oncuechange : TJSEventHandler;
1213
+ ondblclick : THTMLClickEventHandler;
1214
+ ondrag : TJSDragDropEventHandler;
1215
+ ondragend : TJSDragDropEventHandler;
1216
+ ondragenter : TJSDragDropEventHandler;
1217
+ ondragexit : TJSDragDropEventHandler;
1218
+ ondragover : TJSDragDropEventHandler;
1219
+ ondragleave : TJSDragDropEventHandler;
1220
+ ondragstart: TJSDragDropEventHandler;
1221
+ ondrop : TJSDragDropEventHandler;
1222
+ ondurationchange : TJSEventHandler;
1223
+ onemptied : TJSEventHandler;
1224
+ onended : TJSEventHandler;
1225
+ onerror : TJSErrorEventHandler;
1226
+ onfocus : TJSFocusEventhandler;
1227
+ ongotpointercapture : TJSPointerEventHandler;
1228
+ oninput : TJSEventhandler;
1229
+ oninvalid : TJSEventhandler;
1230
+ onkeydown : TJSKeyEventhandler;
1231
+ onkeypress : TJSKeyEventhandler;
1232
+ onkeyup : TJSKeyEventhandler;
1233
+ onload : TJSEventhandler;
1234
+ onloadeddata : TJSEventhandler;
1235
+ onloadedmetadata : TJSEventhandler;
1236
+ onloadend : TJSProgressEventhandler;
1237
+ onloadstart : TJSProgressEventhandler;
1238
+ onlostpointercapture : TJSPointerEventHandler;
1239
+ onmessage : TJSEventHandler;
1240
+ onmousedown : TJSMouseEventHandler;
1241
+ onmouseenter : TJSMouseEventHandler;
1242
+ onmouseleave : TJSMouseEventHandler;
1243
+ onmousemove : TJSMouseEventHandler;
1244
+ onmouseout : TJSMouseEventHandler;
1245
+ onmouseover : TJSMouseEventHandler;
1246
+ onmouseup : TJSMouseEventHandler;
1247
+ onmousewheel : TJSMouseEventHandler;
1248
+ onpause : TJSEventHandler;
1249
+ onplay : TJSEventHandler;
1250
+ onplaying : TJSEventHandler;
1251
+ onpointercancel : TJSPointerEventHandler;
1252
+ onpointerdown : TJSPointerEventHandler;
1253
+ onpointerenter : TJSPointerEventHandler;
1254
+ onpointerleave : TJSPointerEventHandler;
1255
+ onpointermove : TJSPointerEventHandler;
1256
+ onpointerout : TJSPointerEventHandler;
1257
+ onpointerover : TJSPointerEventHandler;
1258
+ onpointerup : TJSPointerEventHandler;
1259
+ onpointerlockchange : TJSPointerEventHandler;
1260
+ onprogress : TJSProgressEventhandler;
1261
+ onreset : TJSUIEventHandler;
1262
+ onratechange : TJSEventHandler;
1263
+ onscroll : TJSUIEventHandler;
1264
+ onseekend : TJSEventHandler;
1265
+ onseeking : TJSEventHandler;
1266
+ onselect : TJSEventHandler;
1267
+ onselectionchange : TJSEventHandler;
1268
+ onsshow : TJSEventHandler;
1269
+ onsubmit : TJSEventHandler;
1270
+ onunload : TJSUIEventHandler;
1271
+ onwaiting : TJSEventHandler;
1272
+ touchstart : TJSTouchEventHandler;
1273
+ touchend : TJSTouchEventHandler;
1274
+ touchmove : TJSTouchEventHandler;
1275
+ touchcancel : TJSTouchEventHandler;
1276
+ Property activeElement : TJSElement Read FActiveElement;
1277
+ Property characterSet : String Read FCharacterSet;
1278
+ property childElementCount : NativeInt Read FChildElementCount;
1279
+ property compatMode : String Read FCompatMode;
1280
+ property currentScript : TJSElement Read FCurrentScript;
1281
+ property defaultView : TJSWindow Read FDefaultView;
1282
+ property doctype : TJSDocumentType read FDocType;
1283
+ property documentElement : TJSElement read FDocumentElement;
1284
+ property documentURI : String Read FDocumentURI;
1285
+ property embeds : TJSHTMLCollection Read FEmbeds;
1286
+ property firstElementChild : TJSElement Read FFirstElementChild;
1287
+ property lastElementChild : TJSElement Read FLastElementChild;
1288
+ property Forms : TJSHTMLCollection Read FForms;
1289
+ property fullscreenElement : TJSElement Read FFullScreenElement;
1290
+ property fullscreenEnabled : Boolean Read FFullscreenEnabled;
1291
+ property head : TJSElement read FHead;
1292
+ Property hidden : Boolean read FHidden;
1293
+ property images : TJSHTMLCollection Read FImages;
1294
+ property _implementation : TJSDOMImplementation Read FImplementation;
1295
+ property lastModified : String Read FLastModified;
1296
+ property lastStyleSheetSet : String read FLastStyleSheetSet;
1297
+ property links : TJSHTMLCollection Read FLinks;
1298
+ property location : TJSLocation read FLocation;
1299
+ Property LocationString : String Read FURL Write FLocationString; // On purpose
1300
+ property plugins : TJSHTMLCollection Read FPlugins;
1301
+ property pointerLockElement : TJSElement Read FPointerLockElement;
1302
+ property preferredStyleSheetSet : String Read FPreferredStyleSheetSet;
1303
+ Property readyState : String Read FReadyState;
1304
+ Property referrer : String Read FReferrer;
1305
+ property scripts : TJSHTMLCollection Read FScripts;
1306
+ property styleSheets : TJSStyleSheetList Read FStyleSheets;
1307
+ property styleSheetSets : TJSValueDynArray Read FStyleSheetSets; // No type documented ?
1308
+ Property URL : String Read FURL;
1309
+ property visibilityState : string read FVisibilityState;
1310
+ end;
1311
+
1312
+
1313
+ { TJSHistory }
1314
+
1315
+ TJSHistory = class external name 'History' (TJSObject)
1316
+ private
1317
+ FLength: NativeInt; external name 'length';
1318
+ {$IFDEF FIREFOX}
1319
+ FState : JSValue; external name 'state';
1320
+ {$ENDIF}
1321
+ Public
1322
+ procedure back;
1323
+ procedure forward;
1324
+ procedure go(aIndex : NativeInt);
1325
+ procedure go;
1326
+ procedure pushState(aState : jsValue; aTitle : String; AURL : String);
1327
+ procedure pushState(aState : jsValue; aTitle : String);
1328
+ procedure replaceState(aState : jsValue; aTitle : String; AURL : String);
1329
+ procedure replaceState(aState : jsValue; aTitle : String);
1330
+ procedure replaceState(aState : jsValue);
1331
+ {$IFDEF FIREFOX}
1332
+ property state : JSValue read FState;
1333
+ {$ENDIF}
1334
+ property length: NativeInt read FLength;
1335
+ end;
1336
+
1337
+
1338
+ { TJSStorage }
1339
+
1340
+ TJSStorage = class external name 'Storage' (TJSEventTarget)
1341
+ private
1342
+ FLength: NativeInt; external name 'length';
1343
+ public
1344
+ function key(aIndex : Integer) : String;
1345
+ function getItem(aKeyName : string) : string;
1346
+ procedure setItem(aKeyName : string; aValue : string);
1347
+ procedure removeItem(aKeyName : string);
1348
+ procedure clear;
1349
+ property Keys[AIndex : Integer] : String read key;
1350
+ property Items[aKeyName: String] : String read getItem write setItem; default;
1351
+ property length : NativeInt Read FLength;
1352
+ end;
1353
+
1354
+ // Fake object, used for objects whose visible can be checked
1355
+ TJSVisibleItem = class external name 'IVisible' (TJSObject)
1356
+ Private
1357
+ FVisible : boolean; external name 'visible';
1358
+ Public
1359
+ Property visible : boolean read FVisible;
1360
+ end;
1361
+
1362
+ TJSLocationBar = class external name 'LocationBar' (TJSVisibleItem);
1363
+ TJSMenuBar = class external name 'MenuBar' (TJSVisibleItem);
1364
+ TJSToolBar = class external name 'ToolBar' (TJSVisibleItem);
1365
+ TJSPersonalBar = class external name 'PersonalBar' (TJSVisibleItem);
1366
+ TJSScrollBars = class external name 'ScrollBars' (TJSVisibleItem);
1367
+
1368
+ TJSPositionError = record
1369
+ code : integer;
1370
+ message : string;
1371
+ end;
1372
+
1373
+ TJSPositionOptions = record
1374
+ enableHighAccuracy : boolean;
1375
+ timeout : integer;
1376
+ maximumAge : integer;
1377
+ end;
1378
+
1379
+ TJSCoordinates = record
1380
+ latitude : double;
1381
+ longitude : double;
1382
+ altitude : double;
1383
+ accuracy : double;
1384
+ altitudeAccuracy : double;
1385
+ heading : double;
1386
+ speed : double;
1387
+ end;
1388
+
1389
+ TJSPosition = record
1390
+ coords : TJSCoordinates;
1391
+ timestamp : String;
1392
+ end;
1393
+
1394
+ TJSGeoLocationCallback = procedure (aPosition : TJSPosition);
1395
+ TJSGeoLocationEvent = procedure (aPosition : TJSPosition) of object;
1396
+ TJSGeoLocationErrorCallback = procedure (aValue : TJSPositionError);
1397
+ TJSGeoLocationErrorEvent = procedure (aValue : TJSPositionError) of object;
1398
+
1399
+ TJSGeoLocation = class external name 'GeoLocation' (TJSObject)
1400
+ Public
1401
+ Procedure getCurrentPosition(ASuccess : TJSGeoLocationCallback); overload;
1402
+ Procedure getCurrentPosition(ASuccess : TJSGeoLocationCallback;aError : TJSGeoLocationErrorCallback); overload;
1403
+ Procedure getCurrentPosition(ASuccess : TJSGeoLocationCallback;aError : TJSGeoLocationErrorCallback; AOptions : TJSPositionOptions); overload;
1404
+ Function watchPosition(ASuccess : TJSGeoLocationCallback) : NativeInt; overload;
1405
+ Function watchPosition(ASuccess : TJSGeoLocationCallback;aError : TJSGeoLocationErrorCallback) : NativeInt; overload;
1406
+ Function watchPosition(ASuccess : TJSGeoLocationCallback;aError : TJSGeoLocationErrorCallback; AOptions : TJSPositionOptions) : NativeInt; overload;
1407
+ procedure clearWatch(AID : NativeInt);
1408
+ end;
1409
+
1410
+ TJSMediaStreamTrack = class external name 'MediaStreamTrack' (TJSEventTarget)
1411
+ private
1412
+ FcontentHint : String; external name 'contentHint';
1413
+ Fenabled : Boolean; external name 'enabled';
1414
+ Fkind : String; external name 'kind';
1415
+ Fid : String; external name 'id';
1416
+ Flabel : String; external name 'label';
1417
+ Fmuted : Boolean; external name 'muted';
1418
+ FreadyState : String; external name 'readyState';
1419
+ public
1420
+ property contentHint : String read FcontentHint write FcontentHint;
1421
+ property enabled : Boolean read Fenabled write Fenabled;
1422
+ property id : String read Fid;
1423
+ property kind : String read Fkind;
1424
+ property label_ : String read Flabel;
1425
+ property muted : Boolean read Fmuted;
1426
+ property readyState : String read FreadyState;
1427
+
1428
+ function applyConstraints(constraints : TJSObject) : TJSPromise;
1429
+ function clone : TJSMediaStreamTrack;
1430
+ function getCapabilities : TJSObject;
1431
+ function getConstraints : TJSObject;
1432
+ function getSettings : TJSObject;
1433
+ procedure stop;
1434
+ end;
1435
+ TJSMediaStreamTrackProc = reference to procedure (aMediaStreamTrack : TJSMediaStreamTrack);
1436
+
1437
+ TJSMediaStreamTracks = class external name 'Array' (TJSArray)
1438
+ procedure forEach(const aCallBack : TJSMediaStreamTrackProc); overload;
1439
+ end;
1440
+
1441
+ TJSMediaConstraints = class external name 'Object' (TJSObject)
1442
+ video : boolean;
1443
+ audio : boolean;
1444
+ end;
1445
+
1446
+ TJSMediaStream = class external name 'MediaStream' (TJSEventTarget)
1447
+ Public
1448
+ procedure addTrack(aTrack : TJSMediaStreamTrack);
1449
+ function clone : TJSMediaStream;
1450
+ function getTrackById(aID : String) : TJSMediaStreamTrack;
1451
+ function getVideoTracks : TJSMediaStreamTracks;
1452
+ function getAudioTracks : TJSMediaStreamTracks;
1453
+ function getTracks : TJSMediaStreamTracks;
1454
+ procedure removeTrack(aTrack : TJSMediaStreamTrack);
1455
+ end;
1456
+
1457
+ { TJSMediaDeviceInfo }
1458
+
1459
+ TJSMediaDeviceInfo = class external name 'MediaDeviceInfo' (TJSObject)
1460
+ private
1461
+ FDeviceID: string; external name 'deviceId';
1462
+ FGroupID: string; external name 'groupId';
1463
+ FKind: string; external name 'kind';
1464
+ FLabel: string; external name 'label';
1465
+ Public
1466
+ property deviceId : string read FDeviceID;
1467
+ property groupId : string read FGroupID;
1468
+ property kind : string read FKind;
1469
+ property label_ : string read FLabel;
1470
+ end;
1471
+
1472
+ TJSMediaDeviceInfoProc = reference to procedure (aMediaStreamTrack : TJSMediaStreamTrack);
1473
+
1474
+ { TJSMediaDeviceInfoArray }
1475
+
1476
+ TJSMediaDeviceInfoArray = class external name 'Array' (TJSArray)
1477
+ private
1478
+ function GetDevices(Index: NativeInt): TJSMediaDeviceInfo; external name '[]';
1479
+ procedure SetDevices(Index: NativeInt; const aValue: TJSMediaDeviceInfo); external name '[]';
1480
+ public
1481
+ procedure forEach(const aCallBack : TJSMediaDeviceInfoProc); overload;
1482
+ property Devices[Index: NativeInt]: TJSMediaDeviceInfo read GetDevices write SetDevices; default;
1483
+ end;
1484
+
1485
+ TJSMediaTrackSupportedConstraints = class external name 'MediaTrackSupportedConstraints' (TJSObject)
1486
+ autoGainControl : boolean;
1487
+ width : boolean;
1488
+ height : boolean;
1489
+ aspectRation : Boolean;
1490
+ frameRate : Boolean;
1491
+ resizeMode : boolean;
1492
+ volume : boolean;
1493
+ sampleRate : boolean;
1494
+ sampleSize : Boolean;
1495
+ echoCancellation : Boolean;
1496
+ latency : boolean;
1497
+ noiseSuppression : boolean;
1498
+ channelCount : boolean;
1499
+ deviceId : boolean;
1500
+ groupId : boolean;
1501
+ displaySurface : boolean;
1502
+ logicalSurface : boolean;
1503
+ end;
1504
+
1505
+ TJSMediaTrackSupportedConstraintsProc = reference to procedure(aConstraints :TJSMediaTrackSupportedConstraints);
1506
+
1507
+ TJSMediaTrackSupportedConstraintsArray = class external name 'Array' (TJSArray)
1508
+ private
1509
+ function GetConstraint(Index: NativeInt): TJSMediaTrackSupportedConstraints; external name '[]';
1510
+ procedure SetConstraint(Index: NativeInt; const aValue: TJSMediaTrackSupportedConstraints); external name '[]';
1511
+ public
1512
+ procedure forEach(const aCallBack : TJSMediaTrackSupportedConstraintsProc); overload;
1513
+ property Constraints[Index: NativeInt]: TJSMediaTrackSupportedConstraints read GetConstraint write SetConstraint; default;
1514
+ end;
1515
+
1516
+ TJSMediaDevices = class external name 'MediaDevices' (TJSEventTarget)
1517
+ function enumerateDevices : TJSMediaDeviceInfoArray; async;
1518
+ function getSupportedConstraints : TJSMediaTrackSupportedConstraintsArray;
1519
+ function getDisplayMedia: TJSPromise;
1520
+ function getDisplayMedia(options : TJSObject) : TJSPromise; overload;
1521
+ function getDisplayMedia(options : TJSMediaConstraints) : TJSPromise; overload;
1522
+ function getUserMedia(aConstraint : TJSOBject) : TJSPromise;
1523
+ function selectAudioOutput : TJSMediaDeviceInfo; async;
1524
+ end;
1525
+
1526
+
1527
+
1528
+ { TJSSharedWorker }
1529
+
1530
+ TJSSharedWorker = class external name 'SharedWorker' (TJSEventTarget)
1531
+ private
1532
+ FPort: TJSMessagePort; external name 'port';
1533
+ Public
1534
+ constructor new(aURL : String); overload;
1535
+ constructor new(aURL : String; aName : string); overload;
1536
+ property port : TJSMessagePort Read FPort;
1537
+ end;
1538
+
1539
+
1540
+ TJSServiceWorkerContainerOptions = record
1541
+ scope : string;
1542
+ end;
1543
+
1544
+ { TJSServiceWorkerContainer }
1545
+
1546
+ TJSServiceWorkerContainer = class external name 'ServiceWorkerContainer' (TJSObject)
1547
+ private
1548
+ FController: TJSServiceWorker; external name 'controller';
1549
+ FReady: TJSPromise; external name 'ready';
1550
+ Public
1551
+ function register(aURL : String) : TJSPromise; overload;
1552
+ function register(aURL : String; aOptions : TJSServiceWorkerContainerOptions) : TJSPromise; overload;
1553
+ function getRegistration(aURL : String) : TJSPromise; overload;
1554
+ function getRegistration : TJSPromise; overload;
1555
+ function getRegistrations : TJSPromise;
1556
+ property controller : TJSServiceWorker read FController;
1557
+ property ready : TJSPromise read FReady;
1558
+ end;
1559
+
1560
+ TJSClipboardItemOptions = Class external name 'Object' (TJSObject)
1561
+ presentationStyle : String;
1562
+ end;
1563
+
1564
+ TJSClipBoardItem = Class external name 'ClipboardItem' (TJSObject)
1565
+ constructor new(aData : TJSObject; aOptions : TJSOBject); overload;
1566
+ constructor new(aData : TJSObject; aOptions : TJSClipboardItemOptions); overload;
1567
+ constructor new(aData : TJSObject); overload;
1568
+ end;
1569
+
1570
+ TJSClipBoard = class external name 'Clipboard' (TJSEventTarget)
1571
+ Function read : TJSPromise;
1572
+ Function readText : TJSPromise;
1573
+ Function write(Data : Array of TJSClipBoardItem) : TJSPromise;
1574
+ Function writeText(aText : String) : TJSPromise;
1575
+ end;
1576
+
1577
+ { TJSNavigator }
1578
+
1579
+ TJSNavigator = class external name 'Navigator' (TJSObject)
1580
+ {$IFDEF FIREFOX}
1581
+ FbuildID : String ; external name 'buildID';
1582
+ FOSCPU : String ; external name 'oscpu';
1583
+ FproductSub : string; external name 'productSub';
1584
+ FVendor : string; external name 'vendor';
1585
+ {$ENDIF}
1586
+ private
1587
+ FCookieEnabled: Boolean; external name 'cookieEnabled';
1588
+ FGeoLocation: TJSGeoLocation; external name 'geolocation';
1589
+ FLanguage: String; external name 'language';
1590
+ FMaxTouchPoints: NativeInt; external name 'maxTouchPoints';
1591
+ FMediaDevices: TJSMediaDevices; external name 'mediaDevices';
1592
+ FOnline: boolean; external name 'onLine';
1593
+ FPlatform: string; external name 'platform';
1594
+ FServiceWorker: TJSServiceWorkerContainer; external name 'serviceWorker';
1595
+ FStorage: TJSStorageManager; external name 'storage';
1596
+ FUserAgent: string; external name 'userAgent';
1597
+ fClipBoard : TJSClipBoard; external name 'clipboard';
1598
+ FPermissions: TJSPermissions; external name 'permissions';
1599
+ public
1600
+ function getBattery : TJSPromise;
1601
+ function requestMediaKeySystemAccess(aKeySystem : String; supportedConfigurations : TJSValueDynArray) : TJSPromise;
1602
+ Procedure registerContentHandler(aMimeType,aURI,aTitle : string);
1603
+ Procedure registerProtocolHandler(aProtocol,aURI,aTitle : string);
1604
+ Procedure vibrate(aPattern : NativeInt);
1605
+ Procedure vibrate(aPattern : Array of NativeInt);
1606
+ {$IFDEF FIREFOX}
1607
+ property buildID : String read FBuildID;
1608
+ property oscpu : string read FOSCPU;
1609
+ property productSub: string read FproductSub;
1610
+ property vendor : string read Fvendor;
1611
+ {$ENDIF}
1612
+ property cookieEnabled : Boolean read FCookieEnabled;
1613
+ property geoLocation : TJSGeoLocation Read FGeoLocation;
1614
+ property language : String read FLanguage;
1615
+ property maxTouchPoints : NativeInt read FMaxTouchPoints;
1616
+ property mediaDevices : TJSMediaDevices read FMediaDevices;
1617
+ property onLine : boolean read FOnline;
1618
+ property platform : string read FPlatform;
1619
+ property userAgent : string read FUserAgent;
1620
+ property serviceWorker : TJSServiceWorkerContainer read FServiceWorker;
1621
+ property ClipBoard : TJSClipBoard Read FCLipboard;
1622
+ property permissions: TJSPermissions read FPermissions;
1623
+ property storage : TJSStorageManager Read FStorage;
1624
+ end;
1625
+
1626
+ { TJSTouchEvent }
1627
+ TTouchCoord = longint;
1628
+
1629
+ TJSTouch = class external name 'Touch' (TJSObject)
1630
+ private
1631
+ FClientX: TTouchCoord; external name 'clientX';
1632
+ FClientY: TTouchCoord; external name 'clientY';
1633
+ FIDentifier: longint; external name 'identifier';
1634
+ FPageX: TTouchCoord; external name 'pageX';
1635
+ FPageY: TTouchCoord; external name 'pageY';
1636
+ FScreenX: TTouchCoord; external name 'screenX';
1637
+ FScreenY: TTouchCoord; external name 'screenY';
1638
+ FTarget: TJSElement; external name 'target';
1639
+ Public
1640
+ Property identifier : longint read FIDentifier;
1641
+ Property ScreenX : TTouchCoord Read FScreenX;
1642
+ Property ScreenY : TTouchCoord Read FScreenY;
1643
+ Property ClientX : TTouchCoord Read FClientX;
1644
+ Property ClientY : TTouchCoord Read FClientY;
1645
+ Property PageX : TTouchCoord Read FPageX;
1646
+ Property PageY : TTouchCoord Read FPageY;
1647
+ Property Target : TJSElement Read FTarget;
1648
+ end;
1649
+
1650
+ { TJSTouchList }
1651
+
1652
+ TJSTouchList = class external name 'TouchList' (TJSObject)
1653
+ private
1654
+ FLength: NativeInt; external name 'length';
1655
+ Public
1656
+ function item (aIndex : Integer) : TJSTouch;
1657
+ property length : NativeInt Read FLength;
1658
+ Property Touches[AIndex : Integer] : TJSTouch Read item; default;
1659
+ end;
1660
+
1661
+
1662
+
1663
+ TJSScreen = class external name 'Screen' (TJSObject)
1664
+ private
1665
+ FavailHeight: Integer; external name 'availHeight';
1666
+ FavailWidth: Integer; external name 'availWidth';
1667
+ FcolorDepth: Integer; external name 'colorDepth';
1668
+ FPixelDepth: Integer; external name 'pixelDepth';
1669
+ Fheight: Integer; external name 'height';
1670
+ Fwidth: Integer; external name 'width';
1671
+ public
1672
+ { Properties declarations }
1673
+ property availHeight: Integer read FavailHeight;
1674
+ property availWidth: Integer read FavailWidth;
1675
+ property colorDepth: Integer read FcolorDepth;
1676
+ property pixelDepth: Integer read FPixelDepth;
1677
+ property height: Integer read Fheight;
1678
+ property width: Integer read Fwidth;
1679
+ end;
1680
+
1681
+
1682
+
1683
+
1684
+
1685
+ { TJSMediaQueryList }
1686
+
1687
+ TJSMediaQueryList = class external name 'MediaQueryList' (TJSEventTarget)
1688
+ private
1689
+ FMatches: Boolean; external name 'matches';
1690
+ FMedia: String; external name 'media';
1691
+ Public
1692
+ onchange : TJSRawEventHandler;
1693
+ Property matches : Boolean Read FMatches;
1694
+ Property media : String Read FMedia;
1695
+ end;
1696
+
1697
+
1698
+ TJSDOMHighResTimeStamp = Double;
1699
+ TFrameRequestCallback = reference to procedure (aTime: TJSDOMHighResTimeStamp);
1700
+
1701
+ TJSPostMessageOptions = class external name 'Object' (TJSObject)
1702
+ targetOrigin : string;
1703
+ transfer : TJSValueDynArray;
1704
+ end;
1705
+
1706
+ TJSIdleCallbackOptions = class
1707
+ public
1708
+ timeout: Cardinal;
1709
+ end;
1710
+
1711
+ TJSIdleDeadline = class external name 'IdleDeadline'
1712
+ private
1713
+ FDidTimeout: Boolean; external name 'didTimeout';
1714
+ public
1715
+ function timeRemaining: TJSDOMHighResTimeStamp;
1716
+
1717
+ property didTimeout: Boolean read FDidTimeout;
1718
+ end;
1719
+
1720
+
1721
+ TJSWindowArray = Array of TJSWindow;
1722
+ TIdleCallbackProc = reference to procedure(idleDeadline: TJSIdleDeadline);
1723
+
1724
+ { TJSWindow }
1725
+
1726
+ TJSWindow = class external name 'Window' (TWindowOrWorkerGlobalScope)
1727
+ Private
1728
+ FClosed: boolean; external name 'closed';
1729
+ FConsole : TJSConsole; external name 'console';
1730
+ FCrypto: TJSCrypto; external name 'crypto';
1731
+ FDevicePixelRatio: Double; external name 'devicePixelRatio';
1732
+ FDocument: TJSDocument; external name 'document';
1733
+ FFrameElement: TJSElement; external name 'frameElement';
1734
+ FFrames: TJSWindowArray; external name 'frames';
1735
+ FHistory: TJSHistory; external name 'history';
1736
+ FIndexedDB: TJSIDBFactory; external name 'indexedDB';
1737
+ FInnerheight: NativeInt; external name 'innerHeight';
1738
+ FInnerWidth: NativeInt; external name 'innerWidth';
1739
+ FLength: NativeInt; external name 'length';
1740
+ FLocalStorage: TJSStorage; external name 'localStorage';
1741
+ FLocation: TJSLocation; external name 'location';
1742
+ FLocationBar: TJSLocationBar; external name 'locationbar';
1743
+ FLocationString: string; external name 'location';
1744
+ FMenuBar: TJSMenuBar; external name 'menubar';
1745
+ FNavigator: TJSNavigator; external name 'navigator';
1746
+ FOpener: TJSWindow; external name 'opener';
1747
+ FOuterheight: NativeInt; external name 'outerHeight';
1748
+ FOuterWidth: NativeInt; external name 'outerWidth';
1749
+ FParent: TJSWindow; external name 'parent';
1750
+ FPerformance: TJSPerformance; external name 'performance';
1751
+ FPersonalBar: TJSPersonalBar; external name 'personalbar';
1752
+ FScreen: TJSScreen; external name 'screen';
1753
+ FScreenX: NativeInt; external name 'screenX';
1754
+ FScreenY: NativeInt; external name 'screenY';
1755
+ FScrollbar: TJSScrollBars; external name 'scrollbar';
1756
+ FScrollX: NativeInt; external name 'scrollX';
1757
+ FScrollY: NativeInt; external name 'scrollY';
1758
+ FSelf: TJSWindow; external name 'self';
1759
+ FSessionStorage: TJSStorage; external name 'sessionStorage';
1760
+ FToolBar: TJSToolBar; external name 'toolbar';
1761
+ FTop: TJSWindow; external name 'top';
1762
+ FURL: TJSURL; external name 'URL';
1763
+ Public
1764
+ fullSreen : Boolean;
1765
+ name : string;
1766
+ status : string;
1767
+ onabort : TJSEventHandler;
1768
+ onafterprint : TJSEventHandler;
1769
+ onbeforeprint : TJSEventHandler;
1770
+ onbeforeinstallprompt : TJSEventHandler;
1771
+ onbeforeunloadprompt : TJSEventHandler;
1772
+ onblur : TJSEventHandler;
1773
+ onchange : TJSEventHandler;
1774
+ onclick: THTMLClickEventHandler;
1775
+ onclose : TJSEventHandler;
1776
+ oncontextmenu : TJSEventHandler;
1777
+ ondblclick : THTMLClickEventHandler;
1778
+ onerror : TJSErrorEventHandler;
1779
+ onfocus : TJSFocusEventhandler;
1780
+ onhashchange : TJSHashChangeEventhandler;
1781
+ oninput : TJSEventhandler;
1782
+ onkeydown : TJSKeyEventhandler;
1783
+ onkeypress : TJSKeyEventhandler;
1784
+ onkeyup : TJSKeyEventhandler;
1785
+ onlanguagechange : TJSEventhandler;
1786
+ onload : TJSEventhandler;
1787
+ onloadend : TJSLoadEventhandler;
1788
+ onloadstart : TJSLoadEventhandler;
1789
+ onmessage : TJSEventHandler;
1790
+ onmousedown : TJSMouseEventHandler;
1791
+ onmouseenter : TJSMouseEventHandler;
1792
+ onmouseleave : TJSMouseEventHandler;
1793
+ onmousemove : TJSMouseEventHandler;
1794
+ onmouseout : TJSMouseEventHandler;
1795
+ onmouseover : TJSMouseEventHandler;
1796
+ onmouseup : TJSMouseEventHandler;
1797
+ onmousewheel : TJSMouseEventHandler;
1798
+ onoffline : TJSEventHandler;
1799
+ ononline : TJSEventHandler;
1800
+ onpagehide : TJSPageTransitionEventHandler;
1801
+ onpageshow : TJSPageTransitionEventHandler;
1802
+ onpaint : TJSEventHandler;
1803
+ onpointercancel : TJSPointerEventHandler;
1804
+ onpointerdown : TJSPointerEventHandler;
1805
+ onpointerenter : TJSPointerEventHandler;
1806
+ onpointerleave : TJSPointerEventHandler;
1807
+ onpointermove : TJSPointerEventHandler;
1808
+ onpointerout : TJSPointerEventHandler;
1809
+ onpointerover : TJSPointerEventHandler;
1810
+ onpointerup : TJSPointerEventHandler;
1811
+ onpointerlockchange : TJSPointerEventHandler;
1812
+ onprogress : TJSProgressEventhandler;
1813
+ onpopstate : TJSPopStateEventHandler;
1814
+ onreset : TJSUIEventHandler;
1815
+ onresize : TJSUIEventHandler;
1816
+ onscroll : TJSUIEventHandler;
1817
+ onselect : TJSEventHandler;
1818
+ onselectionchange : TJSEventHandler;
1819
+ onstorage : TJSStorageEventHandler;
1820
+ onsubmit : TJSEventHandler;
1821
+ onunload : TJSUIEventHandler;
1822
+ touchstart : TJSTouchEventHandler;
1823
+ touchend : TJSTouchEventHandler;
1824
+ touchmove : TJSTouchEventHandler;
1825
+ touchcancel : TJSTouchEventHandler;
1826
+ Procedure alert(Const Msg : String);
1827
+ procedure blur;
1828
+ procedure cancelAnimationFrame(aHandle: Integer);
1829
+ Procedure close;
1830
+ Function confirm(Const aMsg : String) : boolean;
1831
+ function fetch(resource: TJSObject; init: TJSObject): TJSPromise; overload; external name 'fetch';
1832
+ function fetch(resource: TJSObject): TJSPromise; overload; external name 'fetch';
1833
+ function asyncfetch(resource: String): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload; external name 'fetch';
1834
+ function asyncfetch(resource: TJSObject; init: TJSObject): TJSResponse; {$IFNDEF SkipAsync} async;{$ENDIF} overload; external name 'fetch';
1835
+ function asyncfetch(resource: TJSObject): TJSResponse; {$IFNDEF SkipAsync}async;{$ENDIF} overload;external name 'fetch';
1836
+ procedure focus;
1837
+ Function getComputedStyle(aElement : TJSElement) : TJSCSSStyleDeclaration; overload;
1838
+ Function getComputedStyle(aElement,aPseudoElement : TJSElement) : TJSCSSStyleDeclaration; overload;
1839
+ function getSelection : TJSSelection;
1840
+ function matchMedia(aQuery : String) : TJSMediaQueryList;
1841
+ procedure moveBy(x,y : NativeInt);
1842
+ procedure moveTo(x,y : NativeInt);
1843
+ function open : TJSWindow;
1844
+ function open(Const aURL : String) : TJSWindow; overload;
1845
+ function open(Const aURL,aTarget : String) : TJSWindow; overload;
1846
+ function open(Const aURL,aTarget : String; AOptions : TJSObject) : TJSWindow; overload;
1847
+ procedure postMessage(aMessage : JSValue);
1848
+ procedure postMessage(aMessage : JSValue; aOptions : TJSPostMessageOptions);
1849
+ procedure postMessage(aMessage : JSValue; aTransfer : TJSValueDynArray);
1850
+ procedure postMessage(aMessage : JSValue; aTarget : string);
1851
+ procedure postMessage(aMessage : JSValue; aTarget : string; aTransfer : TJSValueDynArray);
1852
+ procedure print;
1853
+ function prompt(const aMessage : String) : String; overload;
1854
+ function prompt(const aMessage,aDefault : String) : String; overload;
1855
+ function requestAnimationFrame(aCallback: TFrameRequestCallback): Integer;
1856
+ procedure resizeBy(aWidth,aHeight : NativeInt);
1857
+ procedure resizeTo(aWidth,aHeight : NativeInt);
1858
+ procedure scrollBy(x,y : NativeInt);
1859
+ procedure scrollTo(x,y : NativeInt);
1860
+ procedure stop;
1861
+ procedure cancelIdleCallback(handle: NativeInt);
1862
+ function requestIdleCallback(handler: TIdleCallbackProc): NativeInt; overload;
1863
+ function requestIdleCallback(handler: TIdleCallbackProc; options: TJSIdleCallbackOptions): NativeInt; overload;
1864
+ function showOpenFilePicker: TJSFileSystemFileHandleArray; async; overload;
1865
+ function showOpenFilePicker(options: TJSShowOpenFilePickerOptions): TJSFileSystemFileHandleArray; async; overload;
1866
+ function showSaveFilePicker: TJSFileSystemFileHandle; async; overload;
1867
+ function showSaveFilePicker(options: TJSShowSaveFilePickerOptions): TJSFileSystemFileHandle; async; overload;
1868
+ function FileSystemDirectoryHandle: TJSFileSystemDirectoryHandleArray; async;
1869
+
1870
+ { public properties }
1871
+ property console : TJSConsole Read FConsole;
1872
+ property closed : boolean read FClosed;
1873
+ property crypto : TJSCrypto Read FCrypto;
1874
+ property devicePixelRatio : Double read FDevicePixelRatio;
1875
+ property document : TJSDocument read FDocument;
1876
+ property frameElement : TJSElement Read FFrameElement;
1877
+ Property frames : TJSWindowArray read FFrames;
1878
+ Property history : TJSHistory read FHistory;
1879
+ Property indexedDB : TJSIDBFactory read FIndexedDB;
1880
+ Property innerHeight : NativeInt Read FInnerheight;
1881
+ Property innerWidth : NativeInt Read FInnerWidth;
1882
+ Property length : NativeInt Read FLength;
1883
+ Property localStorage : TJSStorage Read FLocalStorage;
1884
+ property location : TJSLocation Read FLocation;
1885
+ Property locationString : String read FLocationString write FLocationString;
1886
+ property locationbar : TJSLocationBar Read FLocationBar;
1887
+ property menubar : TJSMenuBar Read FMenuBar;
1888
+ property navigator : TJSNavigator Read FNavigator;
1889
+ property opener : TJSWindow read FOpener;
1890
+ Property outerHeight : NativeInt Read FOuterheight;
1891
+ Property outerWidth : NativeInt Read FOuterWidth;
1892
+ Property parent : TJSWindow Read FParent;
1893
+ Property Performance : TJSPerformance Read FPerformance;
1894
+ property personalbar : TJSPersonalBar Read FPersonalBar;
1895
+ property screen : TJSScreen read FScreen;
1896
+ property screenX : NativeInt read FScreenX;
1897
+ Property screenY : NativeInt read FScreenY;
1898
+ Property scrollbar : TJSScrollBars Read FScrollbar;
1899
+ property scrollX : NativeInt read FScrollX;
1900
+ Property scrollY : NativeInt read FScrollY;
1901
+ Property _Self : TJSWindow read FSelf;
1902
+ Property sessionStorage : TJSStorage Read FSessionStorage;
1903
+ property toolbar : TJSToolBar Read FToolBar;
1904
+ property top : TJSWindow Read FTop;
1905
+ property URL : TJSURL Read FURL;
1906
+ end;
1907
+
1908
+ { TJSCSSStyleDeclaration }
1909
+
1910
+ TJSCSSStyleDeclaration = class external name 'CSSStyleDeclaration' (TJSObject)
1911
+ private
1912
+ FLength: NativeInt; external name 'length';
1913
+ FParentRule: TJSCSSRule; external name 'parentRule';
1914
+ public
1915
+ cssText : string;
1916
+ function item(aIndex : Integer) : string;
1917
+ function removeProperty(const aProperty : String) : string;
1918
+ function getPropertyPriority(const aProperty : String) : string;
1919
+ function getPropertyValue(const aProperty : String) : string;
1920
+ procedure setProperty(const aProperty,aValue : String);overload;
1921
+ procedure setProperty(const aProperty,aValue,aPriority : string); overload;
1922
+ property length : NativeInt read FLength;
1923
+ property parentRule : TJSCSSRule read FParentRule;
1924
+ end;
1925
+
1926
+ TJSScrollIntoViewOptions = class external name 'Object' (TJSObject)
1927
+ behaviour : string;
1928
+ block : string;
1929
+ inline_ : string; external name 'inline';
1930
+ end;
1931
+
1932
+
1933
+ { TJSHTMLElement }
1934
+
1935
+ TJSDatasetMap = class external name 'Object' (TJSObject)
1936
+ Private
1937
+ function GetProps(Name: String): String; external name '[]';
1938
+ procedure SetProps(Name: String; const AValue: String); external name '[]';
1939
+ Public
1940
+ property Map[Name: String]: string read GetProps write SetProps; default;
1941
+ end;
1942
+
1943
+ TJSHTMLElement = class external name 'HTMLElement' (TJSElement)
1944
+ private
1945
+ FDataset: TJSDatasetMap ; external name 'dataset';
1946
+ FDatasetObj: TJSObject ; external name 'dataset';
1947
+ FIsContentEditable: Boolean ; external name 'isContentEditable';
1948
+ FOffsetHeight: Double; external name 'offsetHeight';
1949
+ FOffsetLeft: Double; external name 'offsetLeft';
1950
+ FOffsetParent: TJSElement; external name 'offsetParent';
1951
+ FOffsetTop: Double; external name 'offsetTop';
1952
+ FOffsetWidth: Double; external name 'offsetWidth';
1953
+ Public
1954
+ accessKey : string;
1955
+ contentEditable : string;
1956
+ dir : string;
1957
+ draggable : boolean;
1958
+ hidden : boolean;
1959
+ lang : string;
1960
+ spellcheck : boolean;
1961
+ style : TJSCSSStyleDeclaration;
1962
+ tabIndex : Integer;
1963
+ title: string;
1964
+ onabort : TJSEventHandler;
1965
+ onanimationcancel: THTMLAnimationEventHandler;
1966
+ onanimationend: THTMLAnimationEventHandler;
1967
+ onblur : TJSEventHandler;
1968
+ oncancel : TJSEventHandler;
1969
+ oncanplay : TJSEventHandler;
1970
+ oncanplaythrough : TJSEventHandler;
1971
+ onchange : TJSEventHandler;
1972
+ onclick: THTMLClickEventHandler;
1973
+ onclose : TJSEventHandler;
1974
+ oncontextmenu : TJSEventHandler;
1975
+ ondblclick : THTMLClickEventHandler;
1976
+ ondrag : TJSDragDropEventHandler;
1977
+ ondragend : TJSDragDropEventHandler;
1978
+ ondragenter : TJSDragDropEventHandler;
1979
+ ondragexit : TJSDragDropEventHandler;
1980
+ ondragover : TJSDragDropEventHandler;
1981
+ ondragleave : TJSDragDropEventHandler;
1982
+ ondragstart: TJSDragDropEventHandler;
1983
+ ondrop : TJSDragDropEventHandler;
1984
+ onerror : TJSErrorEventHandler;
1985
+ onfocus : TJSFocusEventhandler;
1986
+ ondurationchange : TJSEventHandler;
1987
+ onemptied : TJSEventHandler;
1988
+ onended : TJSEventHandler;
1989
+ ongotpointercapture : TJSPointerEventHandler;
1990
+ oninput : TJSEventhandler;
1991
+ oninvalid : TJSEventhandler;
1992
+ onkeydown : TJSKeyEventhandler;
1993
+ onkeypress : TJSKeyEventhandler;
1994
+ onkeyup : TJSKeyEventhandler;
1995
+ onload : TJSEventhandler;
1996
+ onloadeddata : TJSEventhandler;
1997
+ onloadedmetadata : TJSEventhandler;
1998
+ onloadend : TJSLoadEventhandler;
1999
+ onloadstart : TJSLoadEventhandler;
2000
+ onlostpointercapture : TJSPointerEventHandler;
2001
+ onmousedown : TJSMouseEventHandler;
2002
+ onmouseenter : TJSMouseEventHandler;
2003
+ onmouseleave : TJSMouseEventHandler;
2004
+ onmousemove : TJSMouseEventHandler;
2005
+ onmouseout : TJSMouseEventHandler;
2006
+ onmouseover : TJSMouseEventHandler;
2007
+ onmouseup : TJSMouseEventHandler;
2008
+ onmousewheel : TJSMouseEventHandler;
2009
+ onpause : TJSPointerEventHandler;
2010
+ onplay : TJSPointerEventHandler;
2011
+ onplaying : TJSPointerEventHandler;
2012
+ onpointercancel : TJSPointerEventHandler;
2013
+ onpointerdown : TJSPointerEventHandler;
2014
+ onpointerenter : TJSPointerEventHandler;
2015
+ onpointerleave : TJSPointerEventHandler;
2016
+ onpointermove : TJSPointerEventHandler;
2017
+ onpointerout : TJSPointerEventHandler;
2018
+ onpointerover : TJSPointerEventHandler;
2019
+ onpointerup : TJSPointerEventHandler;
2020
+ onpointerlockchange : TJSPointerEventHandler;
2021
+ onprogress : TJSProgressEventhandler;
2022
+ onseeked : TJSEventHandler;
2023
+ onseeking : TJSEventHandler;
2024
+ onreset : TJSUIEventHandler;
2025
+ onscroll : TJSUIEventHandler;
2026
+ onselect : TJSEventHandler;
2027
+ onselectstart : TJSEventHandler;
2028
+ onselectionchange : TJSEventHandler;
2029
+ onshow : TJSEventHandler;
2030
+ onstalled : TJSEventHandler;
2031
+ ontimeupdate : TJSEventHandler;
2032
+ ontouchstart: TJSTouchEventHandler;
2033
+ ontouchmove: TJSTouchEventHandler;
2034
+ ontouchcancel: TJSTouchEventHandler;
2035
+ ontouchend: TJSTouchEventHandler;
2036
+ ontransitioncancel : TJSEventHandler;
2037
+ ontransitionend : TJSEventHandler;
2038
+ onvolumechange : TJSEventHandler;
2039
+ onsubmit : TJSEventHandler;
2040
+ onwheel : TJSMouseWheelEventHandler;
2041
+ onwaiting : TJSEventHandler;
2042
+ touchstart : TJSTouchEventHandler;
2043
+ touchend : TJSTouchEventHandler;
2044
+ touchmove : TJSTouchEventHandler;
2045
+ touchcancel : TJSTouchEventHandler;
2046
+ Procedure blur;
2047
+ Procedure focus;
2048
+ Procedure click;
2049
+ procedure scrollIntoView; overload;
2050
+ procedure scrollIntoView(alignToTop : Boolean);
2051
+ procedure scrollIntoView(aObj : TJSObject);
2052
+ procedure scrollIntoView(Opts: TJSScrollIntoViewOptions);
2053
+ property dataset : TJSDatasetMap read FDataset;
2054
+ property datasetObj : TJSObject read FDatasetObj;
2055
+ property isContentEditable : Boolean read FIsContentEditable;
2056
+ property offsetHeight : Double Read FOffsetHeight;
2057
+ property offsetLeft : Double Read FOffsetLeft;
2058
+ property offsetTop : Double Read FOffsetTop;
2059
+ property offsetWidth : Double Read FOffsetWidth;
2060
+ property offsetParent : TJSElement Read FOffsetParent;
2061
+ end;
2062
+ TJSHTMLElementArray = Array of TJSHTMLElement;
2063
+
2064
+ TJSHTMLDivElement = class external name 'HTMLDivElement' (TJSHTMLElement)
2065
+ end;
2066
+
2067
+ TJSHTMLFormControlsCollection = class external name 'HTMLFormControlsCollection' (TJSHTMLCollection)
2068
+ Public
2069
+ function namedItem(S : String) : TJSElement; reintroduce; external name 'namedItem';
2070
+ property Items[S : String] : TJSElement read namedItem; default;
2071
+ end;
2072
+
2073
+ { TJSHTMLFormElement }
2074
+
2075
+ TJSHTMLFormElement = class external name 'HTMLFormElement' (TJSHTMLElement)
2076
+ private
2077
+ FElements: TJSHTMLFormControlsCollection; external name 'elements';
2078
+ FLength: NativeInt; external name 'length';
2079
+ Public
2080
+ Procedure reset;
2081
+ function reportValidity : Boolean;
2082
+ function checkValidity : Boolean;
2083
+ procedure requestSubmit;
2084
+ procedure requestSubmit(aElement : TJSHTMLElement);
2085
+ procedure submit;
2086
+ method : string;
2087
+ target : string;
2088
+ action : string;
2089
+ encoding : string;
2090
+ enctype : string;
2091
+ acceptCharset : string;
2092
+ autocomplete : string;
2093
+ noValidate : boolean;
2094
+ property elements : TJSHTMLFormControlsCollection read FElements;
2095
+ Property length : NativeInt Read FLength;
2096
+ end;
2097
+
2098
+ { TJSValidityState }
2099
+
2100
+ TJSValidityState = class external name 'ValidityState' (TJSObject)
2101
+ private
2102
+ FBadInput: Boolean; external name 'badInput';
2103
+ FCustomError: Boolean; external name 'customError';
2104
+ FPatternMismatch: Boolean; external name 'patternMisMatch';
2105
+ FRangeOverflow: Boolean; external name 'rangeOverflow';
2106
+ FRangeUnderflow: Boolean; external name 'rangeUnderflow';
2107
+ FStepMismatch: Boolean; external name 'stepMismatch';
2108
+ FTooLong: Boolean; external name 'tooLong';
2109
+ FTooShort: Boolean; external name 'tooShort';
2110
+ FTypeMismatch: Boolean; external name 'typeMisMatch';
2111
+ FValid: Boolean; external name 'valid';
2112
+ FValueMissing: Boolean; external name 'valueMissing';
2113
+ public
2114
+ property badInput : Boolean read FBadInput;
2115
+ property customError : Boolean read FCustomError;
2116
+ property patternMisMatch : Boolean read FPatternMismatch;
2117
+ property rangeOverflow : Boolean read FRangeOverflow;
2118
+ property rangeUnderflow : Boolean read FRangeUnderflow;
2119
+ property stepMismatch : Boolean read FStepMismatch;
2120
+ property tooLong : Boolean read FTooLong;
2121
+ property tooShort : Boolean read FTooShort;
2122
+ property typeMisMatch : Boolean read FTypeMismatch;
2123
+ property valid : Boolean Read FValid;
2124
+ property valueMissing : Boolean read FValueMissing;
2125
+ end;
2126
+
2127
+
2128
+ { TJSHTMLFileList }
2129
+
2130
+ TJSHTMLFileList = class external name 'FileList' (TJSEventTarget)
2131
+ private
2132
+ FLength: NativeInt; external name 'length';
2133
+ Public
2134
+ function item(aIndex : NativeInt) : TJSHTMLFile;
2135
+ property length : NativeInt read FLength;
2136
+ property Files[aIndex : NativeInt] : TJSHTMLFile Read item; default;
2137
+ end;
2138
+
2139
+ { TJSHTMLInputElement }
2140
+ // https://html.spec.whatwg.org/multipage/forms.html#the-input-element
2141
+
2142
+ TJSHTMLInputElement = class external name 'HTMLInputElement' (TJSHTMLElement)
2143
+ private
2144
+ FFiles: TJSHTMLFileList; external name 'files';
2145
+ FForm: TJSHTMLFormElement; external name 'form';
2146
+ FLabels: TJSNodeList; external name 'labels';
2147
+ FList: TJSHTMLElement; external name 'list';
2148
+ FValidationmMessage: string; external name 'validationMessage';
2149
+ FValidity: TJSValidityState; external name 'validity';
2150
+ FWillValidate: boolean; external name 'willValidate';
2151
+ Public
2152
+ procedure select;
2153
+ procedure setCustomValidity(aText : string);
2154
+ procedure stepUp; overload;
2155
+ procedure stepUp(n : Integer); overload;
2156
+ function checkValidity : Boolean;
2157
+ function reportValidity : Boolean;
2158
+ procedure setSelectionRange(selectionStart, selectionEnd: NativeInt) ; overload;
2159
+ procedure setSelectionRange(selectionStart, selectionEnd: NativeInt; Direction : string) ; overload;
2160
+ procedure setRangeText(aText : string; selectionStart, selectionEnd: NativeInt) ; overload;
2161
+ procedure setRangeText(aText : string; selectionStart, selectionEnd: NativeInt; Direction : string) ; overload;
2162
+ Public
2163
+ accept : string;
2164
+ allowDirs : boolean;
2165
+ align : string;
2166
+ alt : string;
2167
+ autofocus : boolean;
2168
+ autocapitalize : string;
2169
+ autocomplete : string;
2170
+ defaultValue : string;
2171
+ defaultChecked : string;
2172
+ checked : boolean;
2173
+ dirName : string;
2174
+ disabled : boolean;
2175
+ formAction : string;
2176
+ formEncType : string;
2177
+ formMethod : string;
2178
+ formNoValidate : Boolean;
2179
+ formTarget : string;
2180
+ height : string;
2181
+ indeterminate : boolean;
2182
+ inputMode : string;
2183
+ max : string;
2184
+ maxLength : NativeInt;
2185
+ min : string;
2186
+ minLength : NativeInt;
2187
+ multiple : boolean;
2188
+ pattern : string;
2189
+ placeholder : string;
2190
+ readOnly : boolean;
2191
+ required : boolean;
2192
+ size : NativeInt;
2193
+ src : string;
2194
+ step : string;
2195
+ _type : string; external name 'type';
2196
+ selectionStart : NativeInt;
2197
+ selectionEnd : NativeInt;
2198
+ selectionDirection : string;
2199
+ useMap : string;
2200
+ value : string;
2201
+ width : string;
2202
+ property files : TJSHTMLFileList Read FFiles;
2203
+ property form : TJSHTMLFormElement read FForm;
2204
+ property labels : TJSNodeList read FLabels;
2205
+ property list : TJSHTMLElement Read FList;
2206
+ property validationMessage : string read FValidationmMessage;
2207
+ property willValidate : boolean read FWillValidate;
2208
+ property validity : TJSValidityState read FValidity;
2209
+ end;
2210
+
2211
+ TJSDOMSettableTokenList = class external name 'DOMSettableTokenList' (TJSDOMTokenList)
2212
+ private
2213
+ fvalue: TJSDOMString; external name 'value';
2214
+ public
2215
+ property value: TJSDOMString read fvalue; // readonly
2216
+ end;
2217
+
2218
+ TJSHTMLOutputElement = class external name 'HTMLOutputElement' (TJSHTMLElement)
2219
+ private
2220
+ flabels: TJSNodeList; external name 'labels';
2221
+ fform: TJSHTMLFormElement; external name 'form';
2222
+ ftype: TJSDOMString; external name 'type';
2223
+ fdefaultValue: TJSDOMString; external name 'defaultValue';
2224
+ fvalue: TJSDOMString; external name 'value';
2225
+ fwillValidate: Boolean; external name 'willValidate';
2226
+ fvalidity: TJSValidityState; external name 'validity';
2227
+ fvalidationMessage: TJSDOMString; external name 'validationMessage';
2228
+ public
2229
+ htmlFor: TJSDOMSettableTokenList;
2230
+ function checkValidity: Boolean;
2231
+ function reportValidity: Boolean;
2232
+ procedure setCustomValidity(error: TJSDOMString);
2233
+ public
2234
+ property labels: TJSNodeList read flabels;
2235
+ property form: TJSHTMLFormElement read fform;
2236
+ property type_: TJSDOMString read ftype;
2237
+ property defaultValue: TJSDOMString read fdefaultValue;
2238
+ property value: TJSDOMString read fvalue write fvalue;
2239
+ property willValidate: Boolean read fwillValidate;
2240
+ property validity: TJSValidityState read fvalidity;
2241
+ property validationMessage: TJSDOMString read fvalidationMessage;
2242
+ end;
2243
+
2244
+ { TJSHTMLImageElement }
2245
+
2246
+ TJSHTMLImageElement = class external name 'Image' (TJSHTMLElement)
2247
+ Private
2248
+ FComplete: boolean; external name 'complete';
2249
+ FCurrentSrc: String; external name 'currentSrc';
2250
+ FNaturalHeight: NativeUInt; external name 'naturalHeight';
2251
+ FNaturalWidth: NativeUInt; external name 'naturalWidth';
2252
+ FX: NativeInt; external name 'x';
2253
+ FY: NativeInt; external name 'y';
2254
+ Public
2255
+ constructor New(x,y : Cardinal); overload;
2256
+ alt: String;
2257
+ crossOrigin: String;
2258
+ decoding: String;
2259
+ height: NativeUInt;
2260
+ isMap: boolean;
2261
+ referrerPolicy: String;
2262
+ src: String;
2263
+ sizes: String;
2264
+ srcset: String;
2265
+ useMap: String;
2266
+ width: NativeUInt;
2267
+ function decode : TJSPromise;
2268
+ property complete: boolean read FComplete;
2269
+ property currentSrc: String read FCurrentSrc;
2270
+ property naturalHeight: NativeUInt read FNaturalHeight;
2271
+ property naturalWidth: NativeUInt read FNaturalWidth;
2272
+ property x: NativeInt read FX;
2273
+ property y: NativeInt read FY;
2274
+ end;
2275
+
2276
+ TJSHTMLLinkElement = class external name 'HTMLLinkElement'(TJSHTMLElement)
2277
+ Private
2278
+ frelList: TJSDOMTokenList; external name 'relList';
2279
+ fsizes: TJSDOMSettableTokenList {TJSDOMTokenList}; external name 'sizes';
2280
+ Public
2281
+ href: string;
2282
+ crossOrigin: string;
2283
+ rel: string;
2284
+ as_: string; external name 'as';
2285
+ media: string;
2286
+ integrity: string;
2287
+ hreflang: string;
2288
+ type_: string external name 'type';
2289
+ imageSrcset: string;
2290
+ imageSizes: string;
2291
+ referrerPolicy: string;
2292
+ disabled: string;
2293
+ charset: string deprecated; // obsolete
2294
+ rev: string deprecated; // obsolete property
2295
+ target: string deprecated; // obsolete property
2296
+ Property relList: TJSDOMTokenList read frelList;
2297
+ Property sizes: TJSDOMSettableTokenList{TJSDOMTokenList} read fsizes;
2298
+ end;
2299
+
2300
+ { TJSHTMLAnchorElement }
2301
+
2302
+ TJSHTMLAnchorElement = class external name 'HTMLAnchorElement' (TJSHTMLElement)
2303
+ Private
2304
+ FOrigin: string;external name 'origin';
2305
+ frelList: TJSDOMTokenList; external name 'relList';
2306
+ Public
2307
+ href: string;
2308
+ download: string;
2309
+ hash: string;
2310
+ host: string;
2311
+ hostname: string;
2312
+ hreflang: string;
2313
+ media: string ;
2314
+ password: string;
2315
+ Protocol: string;
2316
+ referrerPolicy : string;
2317
+ rel: string ;
2318
+ rev: string deprecated; // obsolete property
2319
+ target: string ;
2320
+ text : string;
2321
+ type_ : string external name 'type';
2322
+ username : string;
2323
+ Property relList: TJSDOMTokenList read frelList;
2324
+ Property origin: string Read FOrigin;
2325
+ end;
2326
+
2327
+ { TJSHTMLMenuElement }
2328
+
2329
+ TJSHTMLMenuElement = class external name 'HTMLMenuElement' (TJSHTMLElement) // uhm... should it be declared? it is experimental at Mozilla docs...
2330
+ end;
2331
+
2332
+ { TJSHTMLButtonElement }
2333
+
2334
+ TJSHTMLButtonElement = class external name 'HTMLButtonElement' (TJSHTMLElement)
2335
+ private
2336
+ FForm: TJSHTMLFormElement; external name 'form';
2337
+ FLabels: TJSNodeList; external name 'labels';
2338
+ FValidationmMessage: String; external name 'validationMessage';
2339
+ FValidity: TJSValidityState; external name 'validity';
2340
+ FWillValidate: boolean; external name 'willValidate';
2341
+ Public
2342
+ autofocus : boolean;
2343
+ disabled : boolean;
2344
+ formAction : String;
2345
+ formEnctype : String;
2346
+ formMethod : String;
2347
+ formNoValidate : Boolean;
2348
+ formTarget : String;
2349
+ menu: TJSHTMLMenuElement;
2350
+ _type : String; external name 'type';
2351
+ value : string;
2352
+ Public
2353
+ property form : TJSHTMLFormElement Read FForm;
2354
+ property labels : TJSNodeList Read FLabels;
2355
+ property validationMessage : String Read FValidationmMessage;
2356
+ property validity : TJSValidityState Read FValidity;
2357
+ property willValidate : boolean read FWillValidate;
2358
+ end;
2359
+
2360
+ TJSHTMLLabelElement = class external name 'HTMLLabelElement' (TJSHTMLElement)
2361
+ Private
2362
+ FForm: TJSHTMLFormElement; external name 'form';
2363
+ FControl : TJSHTMLElement; external name 'control';
2364
+ Public
2365
+ For_ : String; external name 'htmlFor';
2366
+ property Control : TJSHTMLElement Read FControl;
2367
+ property Form : TJSHTMLFormElement read FForm;
2368
+ end;
2369
+
2370
+ { TJSHTMLTextAreaElement }
2371
+
2372
+ TJSHTMLTextAreaElement = class external name 'HTMLTextAreaElement' (TJSHTMLElement)
2373
+ private
2374
+ FForm: TJSHTMLFormElement; external name 'form';
2375
+ FTextLength: NativeInt; external name 'textKength';
2376
+ FType: String; external name 'type';
2377
+ FValidationMessage: String; external name 'validationMessage';
2378
+ FValidity: TJSValidityState; external name 'validity';
2379
+ FWillValidate: boolean; external name 'willValidate';
2380
+ Public
2381
+ defaultValue : string;
2382
+ value : string;
2383
+ rows : cardinal;
2384
+ cols : cardinal;
2385
+ autofocus : boolean;
2386
+ disabled : boolean;
2387
+ maxLength : nativeInt;
2388
+ placeholder: String;
2389
+ readOnly : Boolean;
2390
+ required : Boolean;
2391
+ selectionStart : Cardinal;
2392
+ selectionEnd : Cardinal;
2393
+ selectionDirection : String;
2394
+ wrap : string;
2395
+ Property Form : TJSHTMLFormElement Read FForm;
2396
+ Property Type_: String Read FType;
2397
+ Property textLength : NativeInt Read FTextLength;
2398
+ Property validity : TJSValidityState Read FValidity;
2399
+ property willValidate : boolean read FWillValidate;
2400
+ property validationMessage : String Read FValidationMessage;
2401
+ end;
2402
+
2403
+ { TJSHTMLEmbedElement }
2404
+
2405
+ TJSHTMLEmbedElement = class external name 'HTMLEmbedElement' (TJSHTMLElement)
2406
+ Public
2407
+ height: String;
2408
+ src: String;
2409
+ _type : String; external name 'type';
2410
+ width: String;
2411
+ end;
2412
+
2413
+ { TJSHTMLOptionElement }
2414
+
2415
+ TJSHTMLOptionElement = class external name 'Option' (TJSHTMLElement)
2416
+ private
2417
+ FForm: TJSHTMLFormElement; external name 'form';
2418
+ FIndex: NativeInt; external name 'index';
2419
+ Public
2420
+ Constructor New; overload;
2421
+ Constructor New(aText : String); overload;
2422
+ Constructor New(aText,aValue : String); overload;
2423
+ Constructor New(aText,aValue : String; aDefaultSelected : Boolean); overload;
2424
+ Constructor New(aText,aValue : String; aDefaultSelected,Selected : Boolean); overload;
2425
+ Public
2426
+ defaultSelected : boolean;
2427
+ disabled : boolean;
2428
+ _label : string ; external name 'label';
2429
+ selected : boolean;
2430
+ text : string;
2431
+ value : string;
2432
+ property index : NativeInt Read FIndex;
2433
+ property form : TJSHTMLFormElement Read FForm;
2434
+ end;
2435
+
2436
+ TJSHTMLOptGroupElement = class external name 'HTMLOptGroupElement' (TJSHTMLElement)
2437
+ end;
2438
+
2439
+ TJSHTMLOptionsCollection = class external name 'HTMLOptionsCollection' (TJSHTMLCollection)
2440
+ end;
2441
+
2442
+ { TJSHTMLSelectElement }
2443
+
2444
+ TJSHTMLSelectElement = Class external name 'HTMLSelectElement' (TJSHTMLElement)
2445
+ private
2446
+ FForm: TJSHTMLFormElement; external name 'form';
2447
+ FLabels: TJSNodeList; external name 'labels';
2448
+ FLength: NativeInt; external name 'length';
2449
+ FOptions: TJSHTMLOptionsCollection; external name 'options';
2450
+ FSelectedOptions: TJSHTMLCollection; external name 'selectedOptions';
2451
+ FType: String; external name 'type';
2452
+ FValidationMessage: string; external name 'validationMessage';
2453
+ FValidity: TJSValidityState; external name 'validity';
2454
+ fwillValidate: Boolean; external name 'willValidate';
2455
+ Public
2456
+ Procedure add(anItem : TJSHTMLOptionElement); overload;
2457
+ Procedure add(anItem, before : TJSHTMLOptionElement); overload;
2458
+ function item(aIndex : NativeInt): TJSHTMLOptionElement;
2459
+ function namedItem(aName : String): TJSHTMLOptionElement;
2460
+ procedure remove(aIndex : NativeInt); overload;
2461
+ procedure checkValidity;
2462
+ procedure setCustomValidity(aMessage : String);
2463
+ Public
2464
+ autofocus : Boolean;
2465
+ disabled : Boolean;
2466
+ multiple : boolean;
2467
+ required: boolean;
2468
+ selectedIndex : NativeInt;
2469
+ size : NativeInt;
2470
+ value : string;
2471
+ property length : NativeInt read FLength;
2472
+ Property options : TJSHTMLOptionsCollection read FOptions;
2473
+ Property selectedOptions : TJSHTMLCollection read FSelectedOptions;
2474
+ Property form : TJSHTMLFormElement read FForm;
2475
+ property labels : TJSNodeList Read FLabels;
2476
+ property _type : String Read FType;
2477
+ property validity : TJSValidityState Read FValidity;
2478
+ property validationMessage : string Read FValidationMessage;
2479
+ property willValidate : Boolean read fwillValidate;
2480
+ end;
2481
+
2482
+ { TJSHTMLTableElement }
2483
+
2484
+ TJSHTMLTableSectionElement = class;
2485
+ TJSHTMLTableRowElement = class;
2486
+
2487
+ TJSHTMLTableElement = Class external name 'HTMLTableElement'(TJSHTMLElement)
2488
+ private
2489
+ FAlign: String; external name 'align';
2490
+ FBGColor: String; external name 'bgColor';
2491
+ FBorder: String; external name 'border'; FCaption: TJSHTMLElement; external name 'caption';
2492
+ FCellPadding: String; external name 'cellPadding';
2493
+ FCellSpacing: String; external name 'cellSpacing';
2494
+ FFrame: String; external name 'frame';
2495
+ FRows: TJSHTMLCollection; external name 'rows';
2496
+ FRules: String; external name 'rules';
2497
+ FSummary: String; external name 'summary';
2498
+ FTBodies: TJSHTMLCollection; external name 'tBodies';
2499
+ FTfoot: TJSHTMLTableSectionElement; external name 'tfoot';
2500
+ FTHead: TJSHTMLTableSectionElement; external name 'tHead';
2501
+ FWidth: String; external name 'width';
2502
+ public
2503
+ { Methods }
2504
+ function createCaption: TJSHTMLElement;
2505
+ function createTFoot: TJSHTMLTableSectionElement;
2506
+ function createTHead: TJSHTMLTableSectionElement;
2507
+ procedure deleteCaption;
2508
+ procedure deleteRow(index: Integer);
2509
+ procedure deleteTFoot;
2510
+ procedure deleteTHead;
2511
+ function insertRow(index: Integer): TJSHTMLTableRowElement;
2512
+ { Properties }
2513
+ property align: String read FAlign write FAlign;
2514
+ property bgColor: String read FBGColor write FBGColor;
2515
+ property border: String read FBorder write FBorder;
2516
+ property caption: TJSHTMLElement read FCaption;
2517
+ property cellPadding: String read FCellPadding write FCellPadding;
2518
+ property cellSpacing: String read FCellSpacing write FCellSpacing;
2519
+ property frame: String read FFrame write FFrame;
2520
+ property rows: TJSHTMLCollection read FRows;
2521
+ property rules: String read FRules write FRules;
2522
+ property summary: String read FSummary write FSummary;
2523
+ property tBodies: TJSHTMLCollection read FTBodies;
2524
+ property tfoot: TJSHTMLTableSectionElement read FTfoot;
2525
+ property tHead: TJSHTMLTableSectionElement read FTHead;
2526
+ property width: String read FWidth write FWidth;
2527
+ end;
2528
+
2529
+ { TJSHTMLTableSectionElement }
2530
+
2531
+ TJSHTMLTableSectionElement = Class external name 'HTMLTableSectionElement' (TJSHTMLElement)
2532
+ private
2533
+ Falign: String; external name 'align';
2534
+ Frows: TJSHTMLCollection external name 'rows';
2535
+ Fch: String; external name 'ch';
2536
+ FchOff: String; external name 'chOff';
2537
+ FvAlign: String; external name 'vAlign';
2538
+ public
2539
+ { Methods }
2540
+ procedure deleteRow(index: Integer);
2541
+ function insertRow(index: Integer): TJSHTMLTableRowElement;
2542
+ { Properties }
2543
+ property align: String read Falign write Falign;
2544
+ property rows: TJSHTMLCollection read Frows;
2545
+ property ch: String read Fch write Fch;
2546
+ property chOff: String read FchOff write FchOff;
2547
+ property vAlign: String read FvAlign write FvAlign;
2548
+ end;
2549
+
2550
+ { TJSHTMLTableCellElement }
2551
+
2552
+ TJSHTMLTableCellElement = Class external name 'HTMLTableCellElement' (TJSHTMLElement)
2553
+ private
2554
+ Fabbr: String; external name 'abbr';
2555
+ Falign: String; external name 'align';
2556
+ Faxis: String; external name 'axis';
2557
+ FbgColor: String; external name 'bgColor';
2558
+ FcellIndex: Integer; external name 'cellIndex';
2559
+ Fch: String; external name 'ch';
2560
+ FchOff: String; external name 'chOff';
2561
+ FcolSpan: Integer; external name 'colSpan';
2562
+ Fheaders: String; external name 'headers';
2563
+ Fheight: String; external name 'height';
2564
+ FnoWrap: Boolean; external name 'noWrap';
2565
+ FrowSpan: Integer; external name 'rowSpan';
2566
+ Fscope: String; external name 'scope';
2567
+ FvAlign: String; external name 'vAlign';
2568
+ Fwidth: String; external name 'width';
2569
+ public
2570
+ { Properties }
2571
+ property abbr: String read Fabbr write Fabbr;
2572
+ property align: String read Falign write Falign;
2573
+ property axis: String read Faxis write Faxis;
2574
+ property bgColor: String read FbgColor write FbgColor;
2575
+ property cellIndex: Integer read FcellIndex;
2576
+ property ch: String read Fch write Fch;
2577
+ property chOff: String read FchOff write FchOff;
2578
+ property colSpan: Integer read FcolSpan write FcolSpan;
2579
+ property headers: String read Fheaders;
2580
+ property height: String read Fheight write Fheight;
2581
+ property noWrap: Boolean read FnoWrap write FnoWrap;
2582
+ property rowSpan: Integer read FrowSpan write FrowSpan;
2583
+ property scope: String read Fscope write Fscope;
2584
+ property vAlign: String read FvAlign write FvAlign;
2585
+ property width: String read Fwidth write Fwidth;
2586
+ end;
2587
+
2588
+ { TJSHTMLTableRowElement }
2589
+
2590
+ TJSHTMLTableRowElement = Class external name 'HTMLTableRowElement' (TJSHTMLElement)
2591
+ private
2592
+ Falign: String; external name 'align';
2593
+ FbgColor: String; external name 'bgColor';
2594
+ Fcells: TJSHTMLCollection; external name 'cells';
2595
+ Fch: String; external name 'ch';
2596
+ FchOff: String; external name 'chOff';
2597
+ FrowIndex: Integer; external name 'rowIndex';
2598
+ FsectionRowIndex: Integer; external name 'sectionRowIndex';
2599
+ FvAlign: String; external name 'vAlign';
2600
+ public
2601
+ { Methods }
2602
+ procedure deleteCell(index: Integer);
2603
+ function insertCell(index: Integer): TJSHTMLTableCellElement;
2604
+ { Properties }
2605
+ property align: String read Falign write Falign;
2606
+ property bgColor: String read FbgColor write FbgColor;
2607
+ property cells: TJSHTMLCollection read Fcells;
2608
+ property ch: String read Fch write Fch;
2609
+ property chOff: String read FchOff write FchOff;
2610
+ property rowIndex: Integer read FrowIndex;
2611
+ property sectionRowIndex: Integer read FsectionRowIndex;
2612
+ property vAlign: String read FvAlign write FvAlign;
2613
+ end;
2614
+
2615
+ { TJSHTMLTableDataCellElement }
2616
+
2617
+ TJSHTMLTableDataCellElement = Class external name 'HTMLTableDataCellElement' (TJSHTMLElement)
2618
+ private
2619
+ Fabbr: String; external name 'abbr';
2620
+ public
2621
+ { Properties }
2622
+ property abbr: String read Fabbr write Fabbr;
2623
+ end;
2624
+
2625
+
2626
+ TJSCanvasRenderingContext2D = Class;
2627
+
2628
+ THTMLCanvasToBlobCallback = Reference to function (aBlob : TJSBlob) : boolean; safecall;
2629
+
2630
+ TJSHTMLCanvasElement = Class external name 'HTMLCanvasElement' (TJSHTMLElement)
2631
+ Public
2632
+ height : integer;
2633
+ width : integer;
2634
+ Function getContext(contextType : string) : TJSObject;
2635
+ Function getContext(contextType : string; contextAttributes : TJSObject) : TJSObject;
2636
+ Function getContextAs2DContext(contextType : string; contextAttributes : TJSObject) : TJSCanvasRenderingContext2D; external name 'getContext';
2637
+ Function getContextAs2DContext(contextType : string) : TJSCanvasRenderingContext2D; external name 'getContext';
2638
+ Function getContextAsImageBitmapContext(contextType : string) : TJSImageBitmapCanvasRenderingContext; external name 'getContext'; reintroduce;
2639
+ Procedure toBlob (aCallBack : THTMLCanvasToBlobCallback; aMimeType : String); overload;
2640
+ Procedure toBlob (aCallBack : THTMLCanvasToBlobCallback; aMimeType : String; aQuality : Double); overload;
2641
+ Function toDataURL : String; overload;
2642
+ Function toDataURL(aMimeType : String) : String; overload;
2643
+ Function toDataURL(aMimeType : String; aQuality : Double) : String; overload;
2644
+
2645
+ end;
2646
+
2647
+
2648
+
2649
+ TJSHTMLProgressElement = class external name 'HTMLProgressElement' (TJSHTMLElement)
2650
+ private
2651
+ Fposition: Double; external name 'position';
2652
+ Flabels: TJSNodeList; external name 'labels';
2653
+ public
2654
+ max: Double;
2655
+ value: Double;
2656
+ property position: Double read Fposition;
2657
+ property labels: TJSNodeList read Flabels;
2658
+ end;
2659
+ Type
2660
+
2661
+
2662
+
2663
+
2664
+ TJSCanvasRenderingContext2D = class external name 'CanvasRenderingContext2D' (TJSBaseCanvasRenderingContext2D)
2665
+ private
2666
+ FCanvas: TJSHTMLCanvasElement; external name 'canvas';
2667
+ public
2668
+ procedure drawFocusIfNeeded(aElement : TJSElement); overload;
2669
+ procedure drawFocusIfNeeded(aPath : TJSPath2D; aElement : TJSElement); overload;
2670
+ property canvas : TJSHTMLCanvasElement Read FCanvas;
2671
+ end;
2672
+
2673
+
2674
+ { TJSHTMLIFrameElement }
2675
+
2676
+ TJSHTMLIFrameElement = Class external name 'HTMLIFrameElement' (TJSHTMLElement)
2677
+ private
2678
+ FAllowPaymentRequest: Boolean; external name 'allowPaymentRequest';
2679
+ FContentDocument: TJSDocument; external name 'contentDocument';
2680
+ FContentWindow: TJSWindow; external name 'contentWindow';
2681
+ FSandbox: string; external name 'sandbox';
2682
+ Public
2683
+ height : string;
2684
+ src : string;
2685
+ srcdoc : string;
2686
+ width : string;
2687
+ Property allowPaymentRequest : Boolean Read FAllowPaymentRequest;
2688
+ property contentWindow : TJSWindow Read FContentWindow;
2689
+ property contentDocument : TJSDocument Read FContentDocument;
2690
+ property sandbox : string read FSandbox;
2691
+ end;
2692
+
2693
+ TJSHTMLScriptElement = Class external name 'HTMLScriptElement' (TJSHTMLElement)
2694
+ Public
2695
+ type_ : String external name 'type';
2696
+ src : String;
2697
+ charset : string;
2698
+ integrity : string;
2699
+ async : boolean;
2700
+ defer : boolean;
2701
+ text : string;
2702
+ crossOrigin : string;
2703
+ referrerPolicy : string;
2704
+ noModule : boolean;
2705
+ end;
2706
+
2707
+
2708
+
2709
+
2710
+ TJSXMLHttpRequestEventTarget = class external name 'XMLHttpRequestEventTarget' (TJSEventTarget)
2711
+ public
2712
+ onabort: TJSProgressEventhandler;
2713
+ onerror: TJSProgressEventhandler;
2714
+ onload: TJSProgressEventhandler;
2715
+ onloadend: TJSProgressEventhandler;
2716
+ onloadstart: TJSProgressEventhandler;
2717
+ onprogress: TJSProgressEventhandler;
2718
+ ontimeout: TJSProgressEventhandler;
2719
+ end;
2720
+
2721
+ TJSXMLHttpRequestUpload = class external name 'XMLHttpRequestUpload' (TJSXMLHttpRequestEventTarget)
2722
+ end;
2723
+
2724
+ { TJSXMLHttpRequest }
2725
+ TJSOnReadyStateChangeHandler = reference to procedure; safecall;
2726
+
2727
+ TJSXMLHttpRequest = class external name 'XMLHttpRequest' (TJSXMLHttpRequestEventTarget)
2728
+ private
2729
+ FReadyState: NativeInt; external name 'readyState';
2730
+ FResponse: JSValue; external name 'response';
2731
+ FResponseText: string; external name 'responseText';
2732
+ FResponseType: string; external name 'responseType';
2733
+ FresponseURL: string; external name 'responseURL';
2734
+ FresponseXML: TJSDocument; external name 'responseXML';
2735
+ FUpload: TJSXMLHttpRequestUpload; external name 'upload';
2736
+ FStatus : integer; external name 'status';
2737
+ FStatusText : string; external name 'statusText';
2738
+ public
2739
+ const
2740
+ UNSENT = 0;
2741
+ OPENED = 1;
2742
+ HEADERS_RECEIVED = 2;
2743
+ LOADING = 3;
2744
+ DONE = 4;
2745
+ public
2746
+ timeout : LongWord;
2747
+ withCredentials : Boolean;
2748
+ onreadystatechange : TJSOnReadyStateChangeHandler;
2749
+ constructor new;
2750
+ procedure abort;
2751
+ function getResponseHeader(aName : string) : String;
2752
+ function getAllResponseHeaders : String;
2753
+ procedure open(aMethod,aURL : String); overload;
2754
+ procedure open(aMethod,aURL : String; Async : Boolean); overload;
2755
+ procedure open(aMethod,aURL : String; Async : Boolean; AUserame : String); overload;
2756
+ procedure open(aMethod,aURL : String; Async : Boolean; AUserame,APassword : String); overload;
2757
+ procedure overrideMimeType(aType : String);
2758
+ procedure send(aBody : jsValue);overload;
2759
+ procedure send;overload;
2760
+ procedure setRequestHeader(aName, AValue : string);
2761
+
2762
+ property readyState : NativeInt read FReadyState;
2763
+ property ResponseHeaders[aName : string] : string Read getResponseHeader;
2764
+ property responseXML : TJSDocument read FresponseXML;
2765
+ property responseURL : string read FresponseURL;
2766
+ property responseType : string read FResponseType Write FResponseType;
2767
+ property response : JSValue Read FResponse;
2768
+ property responseText : string read FResponseText;
2769
+ property Status : integer read FStatus;
2770
+ property StatusText : string read FStatusText;
2771
+ property upload : TJSXMLHttpRequestUpload read FUpload;
2772
+
2773
+ end;
2774
+
2775
+ { TJSUIEvent }
2776
+
2777
+ TJSUIEvent = class external name 'UIEvent' (TJSEvent)
2778
+ private
2779
+ FDetail: NativeInt; external name 'detail';
2780
+ FView: TJSWindow; external name 'view';
2781
+ Public
2782
+ property detail : NativeInt read FDetail;
2783
+ property view : TJSWindow read FView;
2784
+ end;
2785
+
2786
+ { TJSMouseEvent }
2787
+
2788
+ TJSMouseEvent = class external name 'MouseEvent' (TJSUIEvent)
2789
+ private
2790
+ FAltKey: Boolean; external name 'altKey';
2791
+ FBUtton: NativeInt; external name 'button';
2792
+ FBUttons: NativeInt; external name 'buttons';
2793
+ FClientX: Double; external name 'clientX';
2794
+ FClientY: Double; external name 'clientY';
2795
+ FCtrlKey: Boolean; external name 'ctrlKey';
2796
+ FMetaKey: Boolean; external name 'metaKey';
2797
+ FmovementX: Double; external name 'movementX';
2798
+ FmovementY: Double; external name 'movementY';
2799
+ FoffsetX: Double; external name 'offsetX';
2800
+ FoffsetY: Double; external name 'offsetY';
2801
+ FRegion: String; external name 'region';
2802
+ FRelatedTarget: TJSEventTarget; external name 'relatedTarget';
2803
+ FscreenX: Double; external name 'screenX';
2804
+ FscreenY: Double; external name 'screenY';
2805
+ FShiftKey: Boolean; external name 'shiftKey';
2806
+ Public
2807
+ function getModifierState(keyArg: String): boolean;
2808
+ Property altKey : Boolean read FAltKey;
2809
+ Property button: NativeInt read FBUtton;
2810
+ Property buttons: NativeInt read FBUttons;
2811
+ property clientX : Double read FClientX;
2812
+ property clientY : Double read FClientY;
2813
+ property ctrlKey : Boolean read FCtrlKey;
2814
+ property metaKey : Boolean read FMetaKey;
2815
+ property movementX : Double read FmovementX;
2816
+ property movementY : Double read FmovementY;
2817
+ property offsetX : Double read FoffsetX;
2818
+ property offsetY : Double read FoffsetY;
2819
+ {$IFDEF FIREFOX}
2820
+ property pageX : Double read FpageX;
2821
+ property pageY : Double read FpageY;
2822
+ {$ENDIF}
2823
+ property region : String read FRegion;
2824
+ property relatedTarget : TJSEventTarget read FRelatedTarget;
2825
+ property screenX : Double read FscreenX;
2826
+ property screenY : Double read FscreenY;
2827
+ property shiftKey : Boolean read FShiftKey;
2828
+ property x : Double read FClientX;
2829
+ property y : Double read FClientY;
2830
+ end;
2831
+
2832
+ { TJSWheelEvent }
2833
+ TJSWheelEventInit = record
2834
+ deltaX : Double;
2835
+ deltaY : Double;
2836
+ deltaZ : Double;
2837
+ deltaMode : NativeInt;
2838
+ end;
2839
+
2840
+ TJSWheelEvent = class external name 'WheelEvent' (TJSMouseEvent)
2841
+ private
2842
+ FDeltaMode: NativeInt; external name 'deltaMode';
2843
+ FDeltaX: Double; external name 'deltaX';
2844
+ FDeltaY: Double; external name 'deltaY';
2845
+ FDeltaZ: Double; external name 'deltaZ';
2846
+ Public
2847
+ constructor new(atype : String); overload;
2848
+ constructor new(atype : String; aInit : TJSWheelEventInit); overload;
2849
+ Property deltaX : Double Read FDeltaX;
2850
+ Property deltaY : Double Read FDeltaY;
2851
+ Property deltaZ : Double Read FDeltaZ;
2852
+ Property deltaMode : NativeInt Read FDeltaMode;
2853
+ end;
2854
+
2855
+ { TJSPointerEvent }
2856
+
2857
+ TJSPointerEvent = Class external name 'PointerEvent' (TJSMouseEvent)
2858
+ private
2859
+ faltitudeAngle : double; external name 'altitudeAngle';
2860
+ fazimuthAngle : double; external name 'azimuthAngle';
2861
+ fheight : integer; external name 'height';
2862
+ fisPrimary : boolean; external name 'isPrimary';
2863
+ fpersistentDeviceId : NativeInt; external name 'persistentDeviceId';
2864
+ fPointerID : NativeInt; external name 'pointerId';
2865
+ fPointerType : string; external name 'pointerType';
2866
+ fpressure : double; external name 'pressure';
2867
+ ftangentialpressure : double; external name 'tangentialPressure';
2868
+ fTiltX : double; external name 'tiltX';
2869
+ fTiltY : double; external name 'tiltY';
2870
+ fTwist : nativeint; external name 'twist';
2871
+ fWidth : nativeint; external name 'width';
2872
+ public
2873
+ property altitudeAngle : double read FaltitudeAngle;
2874
+ property azimuthAngle : double read FazimuthAngle;
2875
+ property height: integer read fheight;
2876
+ property isPrimary : boolean read FisPrimary;
2877
+ property persistentDeviceId : NativeInt read FpersistentDeviceId;
2878
+ property pointerId : NativeInt read FPointerID;
2879
+ property pointerType : string read FPointerType;
2880
+ property pressure : double read fpressure;
2881
+ property tangentialPressure : double read ftangentialpressure;
2882
+ property tiltX : double read FTiltX;
2883
+ property tiltY : double read FTiltY;
2884
+ property twist : nativeint read FTwist;
2885
+ property width : nativeint read FWidth;
2886
+
2887
+ end;
2888
+
2889
+ TJSTouchEvent = Class external name 'TouchEvent'(TJSUIEvent)
2890
+ private
2891
+ FAltKey: Boolean; external name 'altKey';
2892
+ FChangedTouches: TJSTouchList; external name 'changedTouches';
2893
+ FCtrlKey: Boolean; external name 'ctrlKey';
2894
+ FMetaKey: Boolean; external name 'metaKey';
2895
+ FShiftKey: Boolean; external name 'shiftKey';
2896
+ FTargetTouches: TJSTouchList; external name 'targetTouches';
2897
+ FTouches: TJSTouchList; external name 'touches';
2898
+ Public
2899
+ Property altKey : Boolean Read FAltKey;
2900
+ Property ctrlKey : Boolean Read FCtrlKey;
2901
+ Property metaKey : Boolean Read FMetaKey;
2902
+ Property shiftKey : Boolean Read FShiftKey;
2903
+ property changedTouches : TJSTouchList Read FChangedTouches;
2904
+ property touches : TJSTouchList Read FTouches;
2905
+ property targetTouches : TJSTouchList Read FTargetTouches;
2906
+ end;
2907
+
2908
+
2909
+ // Namespace for standard key names.
2910
+ // See list at https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
2911
+ TJSKeyNames = Class
2912
+ Const
2913
+ Alt = 'Alt';
2914
+ AltGraph = 'AltGraph';
2915
+ CapsLock = 'CapsLock';
2916
+ Control = 'Control';
2917
+ Fn = 'Fn';
2918
+ FnLock = 'FnLock';
2919
+ Hyper = 'Hyper';
2920
+ Meta = 'Meta';
2921
+ NumLock = 'NumLock';
2922
+ ScrollLock = 'ScrollLock';
2923
+ Shift = 'Shift';
2924
+ Super = 'Super';
2925
+ Symbol = 'Symbol';
2926
+ SymbolLock = 'SymbolLock';
2927
+ Enter = 'Enter';
2928
+ Tab = 'Tab';
2929
+ Space = 'Space';
2930
+ ArrowDown = 'ArrowDown';
2931
+ ArrowLeft = 'ArrowLeft';
2932
+ ArrowRight = 'ArrowRight';
2933
+ ArrowUp = 'ArrowUp';
2934
+ _End = 'End';
2935
+ Home = 'Home';
2936
+ PageDown = 'PageDown';
2937
+ PageUp = 'PageUp';
2938
+ BackSpace = 'Backspace';
2939
+ Clear = 'Clear';
2940
+ Copy = 'Copy';
2941
+ CrSel = 'CrSel';
2942
+ Cut = 'Cut';
2943
+ Delete = 'Delete';
2944
+ EraseEof = 'EraseEof';
2945
+ ExSel = 'ExSel';
2946
+ Insert = 'Insert';
2947
+ Paste = 'Paste';
2948
+ Redo = 'Redo';
2949
+ Undo = 'Undo';
2950
+ Accept = 'Accept';
2951
+ Again = 'Again';
2952
+ Attn = 'Attn';
2953
+ Cancel = 'Cancel';
2954
+ ContextMenu = 'Contextmenu';
2955
+ Escape = 'Escape';
2956
+ Execute = 'Execute';
2957
+ Find = 'Find';
2958
+ Finish = 'Finish';
2959
+ Help = 'Help';
2960
+ Pause = 'Pause';
2961
+ Play = 'Play';
2962
+ Props = 'Props';
2963
+ Select = 'Select';
2964
+ ZoomIn = 'ZoomIn';
2965
+ ZoomOut = 'ZoomOut';
2966
+ BrightnessDown = 'BrightnessDown';
2967
+ BrightnessUp = 'BrightnessUp';
2968
+ Eject = 'Eject';
2969
+ LogOff = 'LogOff';
2970
+ Power = 'Power';
2971
+ PowerOff = 'PowerOff';
2972
+ PrintScreen = 'PrintScreen';
2973
+ Hibernate = 'Hibernate';
2974
+ Standby = 'Standby';
2975
+ WakeUp = 'WakeUp';
2976
+ AllCandidates = 'AllCandidates';
2977
+ Alphanumeric = 'Alphanumeric';
2978
+ CodeInput = 'CodeInput';
2979
+ Compose = 'Compose';
2980
+ Convert = 'Convert';
2981
+ Dead = 'Dead';
2982
+ FinalMode = 'FinalMode';
2983
+ GroupFirst = 'GroupFirst';
2984
+ GroupLast = 'GroupLast';
2985
+ GroupNext = 'GroupNext';
2986
+ GroupPrevious = 'GroupPrevious';
2987
+ ModelChange = 'ModelChange';
2988
+ NextCandidate = 'NextCandidate';
2989
+ NonConvert = 'NonConvert';
2990
+ PreviousCandidate = 'PreviousCandidate';
2991
+ Process = 'Process';
2992
+ SingleCandidate = 'SingleCandidate';
2993
+ HangulMode = 'HangulMode';
2994
+ HanjaMode = 'HanjaMode';
2995
+ JunjaMode = 'JunjaMode';
2996
+ Eisu = 'Eisu';
2997
+ Hankaku = 'Hankaku';
2998
+ Hiranga = 'Hiranga';
2999
+ HirangaKatakana = 'HirangaKatakana';
3000
+ KanaMode = 'KanaMode';
3001
+ Katakana = 'Katakana';
3002
+ Romaji = 'Romaji';
3003
+ Zenkaku = 'Zenkaku';
3004
+ ZenkakuHanaku = 'ZenkakuHanaku';
3005
+ F1 = 'F1';
3006
+ F2 = 'F2';
3007
+ F3 = 'F3';
3008
+ F4 = 'F4';
3009
+ F5 = 'F5';
3010
+ F6 = 'F6';
3011
+ F7 = 'F7';
3012
+ F8 = 'F8';
3013
+ F9 = 'F9';
3014
+ F10 = 'F10';
3015
+ F11 = 'F11';
3016
+ F12 = 'F12';
3017
+ F13 = 'F13';
3018
+ F14 = 'F14';
3019
+ F15 = 'F15';
3020
+ F16 = 'F16';
3021
+ F17 = 'F17';
3022
+ F18 = 'F18';
3023
+ F19 = 'F19';
3024
+ F20 = 'F20';
3025
+ Soft1 = 'Soft1';
3026
+ Soft2 = 'Soft2';
3027
+ Soft3 = 'Soft3';
3028
+ Soft4 = 'Soft4';
3029
+ Decimal = 'Decimal';
3030
+ Key11 = 'Key11';
3031
+ Key12 = 'Key12';
3032
+ Multiply = 'Multiply';
3033
+ Add = 'Add';
3034
+ NumClear = 'Clear';
3035
+ Divide = 'Divide';
3036
+ Subtract = 'Subtract';
3037
+ Separator = 'Separator';
3038
+ AppSwitch = 'AppSwitch';
3039
+ Call = 'Call';
3040
+ Camera = 'Camera';
3041
+ CameraFocus = 'CameraFocus';
3042
+ EndCall = 'EndCall';
3043
+ GoBack = 'GoBack';
3044
+ GoHome = 'GoHome';
3045
+ HeadsetHook = 'HeadsetHook';
3046
+ LastNumberRedial = 'LastNumberRedial';
3047
+ Notification = 'Notification';
3048
+ MannerMode = 'MannerMode';
3049
+ VoiceDial = 'VoiceDial';
3050
+ // TODO : Multimedia keys
3051
+ // TODO : Audio control keys
3052
+ // TODO : TV control keys
3053
+ // TODO : Media controller keys
3054
+ // TODO : Speech recognition keys
3055
+ // TODO : Document keys
3056
+ // TODO : Application selector keys
3057
+ // TODO : Browser Control keys
3058
+ end;
3059
+
3060
+
3061
+ { TJSKeyboardEvent }
3062
+
3063
+ TJSKeyboardEvent = class external name 'KeyboardEvent' (TJSUIEvent)
3064
+ private
3065
+ FAltKey: Boolean; external name 'altKey';
3066
+ FCode: string; external name 'code';
3067
+ FCtrlKey: Boolean; external name 'ctrlKey';
3068
+ FIsComposing: Boolean; external name 'isComposing';
3069
+ FKey: String; external name 'key';
3070
+ FLocale: string; external name 'locale';
3071
+ FLocation: NativeInt; external name 'location';
3072
+ FMetaKey: Boolean; external name 'metaKey';
3073
+ FRepeat: Boolean; external name 'repeat';
3074
+ FShiftKey: Boolean; external name 'shiftKey';
3075
+ Public
3076
+ function getModifierState(aKey : string) : Boolean;
3077
+ property code : string read FCode;
3078
+ Property altKey : Boolean read FAltKey;
3079
+ property ctrlKey : Boolean read FCtrlKey;
3080
+ property isComposing : Boolean read FIsComposing;
3081
+ property Key : String read FKey;
3082
+ property locale : string read FLocale;
3083
+ property location : NativeInt read FLocation;
3084
+ property metaKey : Boolean read FMetaKey;
3085
+ property _repeat : Boolean read FRepeat;
3086
+ property shiftKey : Boolean read FShiftKey;
3087
+ end;
3088
+
3089
+ { TJSInputEvent }
3090
+
3091
+ TJSInputEvent = class external name 'InputEvent' (TJSUIEvent)
3092
+ private
3093
+ FData: string; external name 'data';
3094
+ FDataTransfer: TJSDataTransfer; external name 'dataTransfer';
3095
+ FInput: string; external name 'input';
3096
+ FIsComposing: boolean; external name 'isComposing';
3097
+ public
3098
+ property Data : string read FData;
3099
+ property DataTransfer : TJSDataTransfer read FDataTransfer;
3100
+ property InputType : string read FInput;
3101
+ property isComposing : boolean read FIsComposing;
3102
+ end;
3103
+
3104
+ { MutationObserver }
3105
+
3106
+ TJSMutationObserver = Class;
3107
+
3108
+ TJSMutationRecord = record
3109
+ type_ : string;
3110
+ target : TJSNode;
3111
+ addedNodes : TJSNodeList;
3112
+ removedNodes : TJSNodeList;
3113
+ previousSibling : TJSNode;
3114
+ nextSibling : TJSNode;
3115
+ attributeName : String;
3116
+ attributeNamespace : String;
3117
+ oldValue : String;
3118
+ end;
3119
+
3120
+ TJSMutationRecordArray = array of TJSMutationRecord;
3121
+ TJSMutationCallback = reference to procedure(mutations: TJSMutationRecordArray; observer: TJSMutationObserver); safecall;
3122
+
3123
+ TJSMutationObserverInit = record
3124
+ attributes: boolean;
3125
+ attributeOldValue: boolean;
3126
+ characterData: boolean;
3127
+ characterDataOldValue: boolean;
3128
+ childList: boolean;
3129
+ subTree: boolean;
3130
+ attributeFilter: TJSArray;
3131
+ end;
3132
+
3133
+ TJSMutationObserver = class external name 'MutationObserver' (TJSObject)
3134
+ public
3135
+ { constructor }
3136
+ constructor new(mutationCallback: TJSMutationCallback); overload;
3137
+ { public methods }
3138
+ procedure observe(target: TJSNode); overload;
3139
+ procedure observe(target: TJSNode; options: TJSMutationObserverInit); overload;
3140
+ procedure observe(target: TJSNode; options: TJSObject); overload;
3141
+ procedure disconnect;
3142
+ function takeRecords: TJSMutationRecordArray;
3143
+ end;
3144
+
3145
+
3146
+ { --------------------------------------------------------------------
3147
+ TJSWebSocket
3148
+ --------------------------------------------------------------------}
3149
+
3150
+ { TJSWebsocketCloseEvent }
3151
+
3152
+ TJSWebsocketCloseEvent = class external name 'CloseEvent' (TJSEvent)
3153
+ private
3154
+ FCode: Integer; external name 'code';
3155
+ FReason: String; external name 'reason';
3156
+ FWasClean: Boolean; external name 'wasClean';
3157
+ Public
3158
+ Property Code : Integer Read FCode;
3159
+ Property Reason : String Read FReason;
3160
+ Property WasClean : Boolean Read FWasClean;
3161
+ end;
3162
+
3163
+ TJSWebSocket = class external name 'WebSocket' (TJSEventTarget)
3164
+ Private
3165
+ Furl : String; external name 'url';
3166
+ FreadyState : Cardinal; external name 'readyState';
3167
+ FbufferedAmount : NativeInt; external name 'bufferedAmount';
3168
+ Fextensions : String; external name 'extensions';
3169
+ Fprotocol : String; external name 'protocol';
3170
+ Public
3171
+ Const
3172
+ CONNECTING = 0;
3173
+ OPEN = 1;
3174
+ CLOSING = 2;
3175
+ CLOSED = 3;
3176
+ Public
3177
+ onopen : TJSEventHandler;
3178
+ onerror : TJSEventHandler;
3179
+ onclose : TJSEventHandler;
3180
+ onmessage : TJSEventHandler;
3181
+ binaryType : String;
3182
+ constructor new(url : String); overload;
3183
+ constructor new(url : String; protocol: String); overload;
3184
+ constructor new(url : String; protocols: array of String); overload;
3185
+ Procedure close; overload;
3186
+ Procedure close(code : Cardinal); overload;
3187
+ Procedure close(code : Cardinal; reason : String); overload;
3188
+ Procedure send(data : String);
3189
+ Procedure send(data : TJSBlob);
3190
+ Procedure send(data : TJSArrayBuffer);
3191
+ Procedure send(data : TJSTypedArray);
3192
+ Property url : String Read Furl;
3193
+ Property readyState : Cardinal Read FreadyState;
3194
+ Property bufferedAmount : NativeInt Read FbufferedAmount;
3195
+ Property extensions : String Read Fextensions;
3196
+ Property protocol : String Read Fprotocol;
3197
+ end;
3198
+
3199
+ TJSHTMLAudioTrack = class external name 'AudioTrack' (TJSObject)
3200
+ end;
3201
+
3202
+ TJSHTMLAudioTrackList = class external name 'AudioTrackList' (TJSObject)
3203
+ FLength : Integer; external name 'length';
3204
+ function getitem(aIndex : nativeInt) : TJSHTMLAudioTrack ; external name '[]';
3205
+ Public
3206
+ onaddtrack : TJSEventHandler;
3207
+ onchange : TJSEventHandler;
3208
+ onremovetrack : TJSEventHandler;
3209
+ Property Length : Integer Read FLength;
3210
+ Property tracks [aIndex : NativeInt] : TJSHTMLAudioTrack read Getitem;
3211
+ end;
3212
+
3213
+ TJSHTMLVideoTrack = class external name 'VideoTrack' (TJSObject)
3214
+ end;
3215
+
3216
+ TJSHTMLVideoTrackList = class external name 'VideoTrackList' (TJSObject)
3217
+ FLength : Integer; external name 'length';
3218
+ function getitem(aIndex : nativeInt) : TJSHTMLVideoTrack ; external name '[]';
3219
+ Public
3220
+ onaddtrack : TJSEventHandler;
3221
+ onchange : TJSEventHandler;
3222
+ onremovetrack : TJSEventHandler;
3223
+ Property Length : Integer Read FLength;
3224
+ Property tracks [aIndex : NativeInt] : TJSHTMLVideoTrack read Getitem;
3225
+ end;
3226
+
3227
+ TJSHTMLTextTrack = class external name 'TextTrack' (TJSObject)
3228
+ end;
3229
+
3230
+ TJSHTMLTextTrackList = class external name 'TextTrackList' (TJSObject)
3231
+ FLength : Integer; external name 'length';
3232
+ function getitem(aIndex : nativeInt) : TJSHTMLTextTrack ; external name '[]';
3233
+ Public
3234
+ onaddtrack : TJSEventHandler;
3235
+ onchange : TJSEventHandler;
3236
+ onremovetrack : TJSEventHandler;
3237
+ Property Length : Integer Read FLength;
3238
+ Property tracks [aIndex : NativeInt] : TJSHTMLTextTrack read Getitem;
3239
+ end;
3240
+
3241
+
3242
+ { TJSHTMLMediaElement }
3243
+ TJSMEdiaError = class external name 'MediaError' (TJSObject)
3244
+ code : NativeInt;
3245
+ message : string;
3246
+ end;
3247
+
3248
+ TJSHTMLMediaStream = TJSMediaStream;
3249
+
3250
+ TJSHTMLMediaController = class external name 'MediaController' (TJSObject);
3251
+
3252
+ TJSHTMLMediaElement = Class external name 'HTMLMediaElement' (TJSHTMLElement)
3253
+ private
3254
+ FAudioTracks: TJSHTMLAudioTrackList; external name 'audioTracks';
3255
+ FVideoTracks: TJSHTMLVideoTrackList; external name 'videoTracks';
3256
+ FTextTracks: TJSHTMLTextTrackList; external name 'textTracks';
3257
+ FControlsList: TJSDOMTokenList; external name 'controlslist';
3258
+ FCurrentSrc: String; external name 'currentSrc';
3259
+ FDuration: Double; external name 'duration';
3260
+ FEnded: Boolean;external name 'ended';
3261
+ FError: TJSMEdiaError; external name 'error';
3262
+ FNetworkState: NativeInt; external name 'networkState';
3263
+ FPaused: boolean; external name 'paused';
3264
+ FReadyState: NativeInt; external name 'readyState';
3265
+ FSeeking: boolean; external name 'seeking';
3266
+ FSinkID: string; external name 'sinkId';
3267
+ Public
3268
+ autoplay : Boolean;
3269
+ buffered : Boolean;
3270
+ controls : Boolean;
3271
+ controller : TJSHTMLMediaController;
3272
+ crossOrigin : String;
3273
+ currentTime : Double;
3274
+ defaultMuted : boolean;
3275
+ defaultPlaybackRate : Double;
3276
+ disableRemotePlayback : Boolean;
3277
+ loop : boolean;
3278
+ mediaGroup : string;
3279
+ muted : boolean;
3280
+ preload : string;
3281
+ preservesPitch : boolean;
3282
+ src : string;
3283
+ srcObject : TJSHTMLMediaStream;
3284
+ volume : double;
3285
+ onencrypted : TJSEventHandler;
3286
+ onwaitingforkey : TJSEventHandler;
3287
+ function canPlayType(aType : String) : String;
3288
+ Function captureStream : TJSHTMLMediaStream;
3289
+ Procedure play;
3290
+ Procedure load;
3291
+ Procedure pause;
3292
+
3293
+ Property AudioTracks : TJSHTMLAudioTrackList Read FAudioTracks;
3294
+ Property Controlslist : TJSDOMTokenList Read FControlsList;
3295
+ Property CurrentSrc : String Read FCurrentSrc;
3296
+ Property Duration : Double read FDuration;
3297
+ Property Ended : Boolean read FEnded;
3298
+ Property Error : TJSMEdiaError read FError;
3299
+ property networkState : NativeInt read FNetworkState;
3300
+ property paused : boolean read FPaused;
3301
+ property readyState : NativeInt read FReadyState;
3302
+ property seeking : boolean read FSeeking;
3303
+ property sinkID : string read FSinkID;
3304
+ Property TextTracks : TJSHTMLTextTrackList Read FTextTracks;
3305
+ Property VideoTracks : TJSHTMLVideoTrackList Read FVideoTracks;
3306
+ end;
3307
+
3308
+ TJSHTMLAudioElement = Class external name 'HTMLAudioElement' (TJSHTMLMediaElement)
3309
+
3310
+ end;
3311
+
3312
+ TJSVideoFrameMetaData = class external name 'Object' (TJSObject)
3313
+ expectedDisplayTime : TJSDOMHighResTimeStamp;
3314
+ height : NativeInt;
3315
+ mediaTime : NativeInt;
3316
+ presentationTime : TJSDOMHighResTimeStamp;
3317
+ presentedFrames : NativeInt;
3318
+ processingDuration : NativeInt;
3319
+ width : NativeInt;
3320
+ // WebRTC only
3321
+ captureTime : TJSDOMHighResTimeStamp;
3322
+ receiveTime : TJSDOMHighResTimeStamp;
3323
+ rtpTimestamp : NativeInt;
3324
+ end;
3325
+
3326
+ { TJSHTMLVideoElement }
3327
+
3328
+ { TJSPictureInPictureWindow }
3329
+
3330
+ TJSPictureInPictureWindow = class external name 'PictureInPictureWindow' (TJSEventTarget)
3331
+ private
3332
+ FHeigth: NativeInt; external name 'height';
3333
+ FWidth: NativeInt; external name 'width';
3334
+ Public
3335
+ property height : NativeInt read FHeigth;
3336
+ property width : NativeInt read FWidth;
3337
+ end;
3338
+
3339
+ { TJSVideoPlaybackQuality }
3340
+
3341
+ TJSVideoPlaybackQuality = class external name 'VideoPlaybackQuality' (TJSObject)
3342
+ private
3343
+ FCreationTime: TJSDOMHighResTimeStamp; external name 'creationTime';
3344
+ FdroppedVideoFrames: NativeInt; external name 'droppedVideoFrames';
3345
+ FtotalVideoFrames: NativeInt; external name 'totalVideoFrames';
3346
+ Public
3347
+ property creationTime : TJSDOMHighResTimeStamp Read FCreationTime;
3348
+ property droppedVideoFrames : NativeInt Read FdroppedVideoFrames;
3349
+ property totalVideoFrames : NativeInt Read FtotalVideoFrames;
3350
+ end;
3351
+
3352
+ TRequestVideoFrameCallback = reference to procedure(aNow : TJSDOMHighResTimeStamp; metaData : TJSVideoFrameMetaData);
3353
+
3354
+ TJSHTMLVideoElement = Class external name 'HTMLVideoElement' (TJSHTMLMediaElement)
3355
+ private
3356
+ FvideoHeight: NativeInt; external name 'videoHeight';
3357
+ FvideoWidth: NativeInt; external name 'videoWidth';
3358
+ public
3359
+ disablePictureInPicture : boolean;
3360
+ height : NativeInt;
3361
+ width : NativeInt;
3362
+ poster : string;
3363
+ procedure cancelVideoFrameCallback(id : NativeInt);
3364
+ function getVideoPlaybackQuality : TJSVideoPlaybackQuality;
3365
+ function requestVideoFrameCallback(aCallback : TRequestVideoFrameCallback) : NativeInt;
3366
+ function requestPictureInPicture : TJSPictureInPictureWindow; async;
3367
+ property videoWidth : NativeInt read FvideoWidth;
3368
+ property videoHeight : NativeInt read FvideoHeight;
3369
+ end;
3370
+
3371
+ { TJSHTMLStyleElement }
3372
+
3373
+ TJSHTMLStyleElement = class external name 'HTMLStyleElement' (TJSHTMLElement)
3374
+ private
3375
+ FSheet: TJSStyleSheet; external name 'sheet';
3376
+ public
3377
+ media : string;
3378
+ type_ : string; external name 'style';
3379
+ disabled : boolean;
3380
+ property sheet : TJSStyleSheet read FSheet;
3381
+ end;
3382
+
3383
+
3384
+ TJSFormDataEntryValue = String;
3385
+ TJSFormDataEntryValueArray = Array of TJSFormDataEntryValue;
3386
+
3387
+ TJSFormData = Class external name 'FormData' (TJSObject)
3388
+ constructor new;
3389
+ constructor new(aForm : TJSHTMLElement);
3390
+ Procedure append(const aName,aValue : String);
3391
+ Procedure append(const aName : String; aBlob : TJSBlob);
3392
+ Procedure delete(const aName : String);
3393
+ Function entries : TJSFormDataEntryValueArray;
3394
+ Function get(const aName : String): TJSFormDataEntryValue;
3395
+ function has(const aName : String): Boolean;
3396
+ Function keys : TStringDynArray; reintroduce;
3397
+ Procedure set_(const aName,aValue : String); external name 'set';
3398
+ Procedure set_(const aName : String; aBlob : TJSBlob); external name 'set';
3399
+ Function getAll(const aName : String) : TJSFormDataEntryValueArray;
3400
+ Function values : TJSValueDynArray; reintroduce;
3401
+ Property Entry[const aIndex : String] : TJSFormDataEntryValue read Get;
3402
+ end;
3403
+
3404
+ TJSHTMLTemplateElement = class external name 'HTMLTemplateElement' (TJSHTMLElement)
3405
+ content : TJSHTMLElement;
3406
+ end;
3407
+
3408
+ TJSHTMLOrXMLDocument = Class external name 'Document' (TJSDocument)
3409
+ end;
3410
+
3411
+ TJSHTMLDocument = Class external name 'HTMLDocument' (TJSHTMLOrXMLDocument)
3412
+ end;
3413
+
3414
+ TJSXMLDocument = Class external name 'HTMLDocument' (TJSHTMLOrXMLDocument)
3415
+ end;
3416
+
3417
+ TDOMParser = Class external name 'DOMParser' (TJSObject)
3418
+ Public
3419
+ Function parseFromString (aString,aMimetype : String): TJSHTMLOrXMLDocument;
3420
+ end;
3421
+
3422
+
3423
+
3424
+ TJSShowOpenFilePickerTypeOptions = class external name 'Object' (TJSObject)
3425
+ public
3426
+ description: String;
3427
+ accept: TJSObject;
3428
+ end;
3429
+
3430
+ TJSShowOpenFilePickerOptions = class external name 'Object' (TJSObject)
3431
+ public
3432
+ multiple: Boolean;
3433
+ excludeAcceptAllOption: Boolean;
3434
+ types: array of TJSShowOpenFilePickerTypeOptions;
3435
+ end;
3436
+
3437
+ TJSShowSaveFilePickerOptionsAccept = class external name 'Object' (TJSObject)
3438
+ public
3439
+ description: String;
3440
+ accept: TStringDynArray;
3441
+ end;
3442
+
3443
+ TJSShowSaveFilePickerOptions = class external name 'Object' (TJSObject)
3444
+ public
3445
+ excludeAcceptAllOption: Boolean;
3446
+ accept: array of TJSShowSaveFilePickerOptionsAccept;
3447
+ end;
3448
+
3449
+ TJSXSLTProcessor = class external name 'XSLTProcessor' (TJSObject)
3450
+ Public
3451
+ procedure importStylesheet(aStyle: TJSNode);
3452
+ function transformToFragment(aSource: TJSNode; aOutput: TJSDocument): TJSDocumentFragment;
3453
+ function transformToDocument(aSource: TJSNode): TJSDocument;
3454
+ procedure setParameter(aNamespaceURI: String; aLocalName: String; aValue: String);
3455
+ function getParameter(aNamespaceURI: String; aLocalName: String): String;
3456
+ procedure removeParameter(aNamespaceURI: String; aLocalName: String);
3457
+ procedure clearParameters;
3458
+ procedure reset;
3459
+ end;
3460
+
3461
+ TJSXMLSerializer = class external name 'XMLSerializer' (TJSObject)
3462
+ public
3463
+ function serializeToString(aRoot: TJSNode): string;
3464
+ end;
3465
+
3466
+ { TJSSizeElement }
3467
+
3468
+ TJSSizeElement = class external name 'Object' (TJSObject)
3469
+ private
3470
+ Fblocksize: nativeint; external name 'blocksize';
3471
+ Finlinesize: nativeint; external name 'inlinesize';
3472
+ Public
3473
+ property blocksize : nativeint read Fblocksize;
3474
+ property inlinesize : nativeint read Finlinesize;
3475
+ end;
3476
+ TJSSizeElementArray = Array of TJSSizeElement;
3477
+
3478
+ { TJSHTMLResizeObserverEntry }
3479
+
3480
+ TJSHTMLResizeObserverEntry = class external name 'Object' (TJSObject)
3481
+ private
3482
+ FborderBoxSize: TJSSizeElementArray; external name 'borderBoxSize';
3483
+ FContentRect: TJSDOMRectReadOnly; external name 'contentRect';
3484
+ FcontentBoxSize: TJSSizeElementArray; external name 'contentBoxSize';
3485
+ FdevicePixelContentBoxSize: TJSSizeElementArray; external name 'devicePixelContentBoxSize';
3486
+ FTarget: TJSElement; external name 'target';
3487
+ Public
3488
+ Property borderBoxSize: TJSSizeElementArray Read FborderBoxSize;
3489
+ Property contentBoxSize: TJSSizeElementArray Read FcontentBoxSize;
3490
+ property contentRect : TJSDOMRectReadOnly Read FContentRect;
3491
+ Property devicePixelContentBoxSize: TJSSizeElementArray Read FdevicePixelContentBoxSize;
3492
+ Property Target : TJSElement Read FTarget;
3493
+ end;
3494
+
3495
+ TJSHTMLResizeObserverEntryArray = Array of TJSHTMLResizeObserverEntry;
3496
+ TJSHTMLResizeObserverCallback = reference to procedure (Entries : TJSHTMLResizeObserverEntryArray; aObserver : TJSHTMLResizeObserver);
3497
+
3498
+ TJSHTMLResizeObserverOptions = class external name 'Object' (TJSObject)
3499
+ box : string;
3500
+ end;
3501
+
3502
+ TJSHTMLResizeObserver = class external name 'ResizeObserver' (TJSObject)
3503
+ constructor new(aCallback : TJSHTMLResizeObserverCallback);
3504
+ procedure disconnect;
3505
+ procedure observe(aTarget : TJSElement);
3506
+ procedure observe(aTarget : TJSElement; aOptions :TJSHTMLResizeObserverOptions);
3507
+ procedure unobserve(aTarget : TJSElement);
3508
+ end;
3509
+
3510
+ TJSAnimationTimeline = class external name 'AnimationTimeline' (TJSObject)
3511
+ currentTime : nativeInt;
3512
+ end;
3513
+
3514
+ TJSAnimationTiming = class external name 'Object' (TJSObject)
3515
+ delay : NativeInt;
3516
+ direction : string;
3517
+ duration: NativeInt;
3518
+ durationString : string external name 'duration';
3519
+ easing : string;
3520
+ endDelay : NativeInt;
3521
+ fill : string;
3522
+ iterations : NativeInt;
3523
+ iterationStart : NativeInt;
3524
+ end;
3525
+
3526
+ TJSAnimationEffect = class external name 'AnimationEffect' (TJSObject)
3527
+ getTiming : TJSAnimationTiming;
3528
+ end;
3529
+
3530
+ TJSAnimation = class external name 'Animation' (TJSObject)
3531
+ currentTime : nativeInt;
3532
+ effect : TJSAnimationEffect;
3533
+ id : string;
3534
+ overallProgress : double;
3535
+ pending : boolean;
3536
+ playbackRate : integer;
3537
+ playState : string;
3538
+ ready : TJSPromise;
3539
+ replaceState : String;
3540
+ startTime : double;
3541
+ timeline : TJSAnimationTimeline;
3542
+ end;
3543
+
3544
+
3545
+ var
3546
+ document : TJSDocument; external name 'document';
3547
+ window : TJSWindow; external name 'window';
3548
+ console : TJSConsole; external name 'window.console';
3549
+ caches : TJSCacheStorage; external name 'caches';
3550
+ serviceWorker : TJSServiceWorker; external name 'window.navigator.serviceWorker';
3551
+
3552
+ Function HasServiceWorker : Boolean;
3553
+
3554
+ implementation
3555
+
3556
+ Function HasServiceWorker : Boolean;
3557
+ begin
3558
+ if jsvalue(window.navigator.serviceWorker) then
3559
+ exit(true)
3560
+ else
3561
+ exit(false);
3562
+ end;
3563
+
3564
+ { TJSEventHelper }
3565
+
3566
+ function TJSEventHelper.GetCurrentTargetElement: TJSElement;
3567
+ begin
3568
+ Result:=TJSElement(CurrentTarget);
3569
+ end;
3570
+
3571
+ function TJSEventHelper.GetCurrentTargetHTMLElement: TJSHTMLElement;
3572
+ begin
3573
+ Result:=TJSHTMLElement(CurrentTarget);
3574
+ end;
3575
+
3576
+ function TJSEventHelper.GetTargetElement: TJSElement;
3577
+ begin
3578
+ Result:=TJSElement(Target);
3579
+ end;
3580
+
3581
+ function TJSEventHelper.GetTargetHTMLElement: TJSHTMLElement;
3582
+ begin
3583
+ Result:=TJSHTMLElement(Target);
3584
+ end;
3585
+
3586
+ end.