2
$Id: dom_html.pp,v 1.1 2002/12/11 21:06:07 sg Exp $
3
This file is part of the Free Component Library
5
Implementation of DOM HTML interfaces
7
Areca Systems GmbH / Sebastian Guenther, sg@freepascal.org
9
See the file COPYING.FPC, included in this distribution,
10
for details about the copyright.
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
**********************************************************************}
18
{ Please note that this is a very early version, most properties and methods
19
are not implemented yet. }
30
THTMLDocument = class;
31
THTMLFormElement = class;
32
THTMLTableCaptionElement = class;
33
THTMLTableSectionElement = class;
35
THTMLCollection = class
37
property Length: Cardinal; // !!!: ro
38
function Item(Index: Cardinal): TDOMNode;
39
function NamedItem(const Index: DOMString): TDOMNode;
42
THTMLOptionsCollection = class
44
property Length: Cardinal; // !!!: ro
45
function Item(Index: Cardinal): TDOMNode;
46
function NamedItem(const Index: DOMString): TDOMNode;
49
THTMLElement = class(TDOMElement)
51
function GetID: DOMString;
52
procedure SetID(const Value: DOMString);
53
function GetTitle: DOMString;
54
procedure SetTitle(const Value: DOMString);
55
function GetLang: DOMString;
56
procedure SetLang(const Value: DOMString);
57
function GetDir: DOMString;
58
procedure SetDir(const Value: DOMString);
59
function GetClassName: DOMString;
60
procedure SetClassName(const Value: DOMString);
62
constructor Create(AOwner: THTMLDocument; const ATagName: DOMString);
64
property ID: DOMString read GetID write SetID;
65
property Title: DOMString read GetTitle write SetTitle;
66
property Lang: DOMString read GetLang write SetLang;
67
property Dir: DOMString read GetDir write SetDir;
68
property ClassName: DOMString read GetClassName write SetClassName;
71
THTMLHtmlElement = class(THTMLElement)
73
function GetVersion: DOMString;
74
procedure SetVersion(const Value: DOMString);
76
property Version: DOMString read GetVersion write SetVersion;
79
THTMLHeadElement = class(THTMLElement)
81
function GetProfile: DOMString;
82
procedure SetProfile(const Value: DOMString);
84
property Profile: DOMString read GetProfile write SetProfile;
87
THTMLLinkElement = class(THTMLElement)
89
property Disabled: Boolean; // !!!: rw
90
property Charset: DOMString; // !!!: rw
91
property HRef: DOMString; // !!!: rw
92
property HRefLang: DOMString; // !!!: rw
93
property Media: DOMString; // !!!: rw
94
property Rel: DOMString; // !!!: rw
95
property Rev: DOMString; // !!!: rw
96
property Target: DOMString; // !!!: rw
97
property HTMLType: DOMString; // !!!: rw
100
THTMLTitleElement = class(THTMLElement)
102
property Text: DOMString; // !!!: rw
105
THTMLMetaElement = class(THTMLElement)
107
property Content: DOMString; // !!!: rw
108
property HTTPEqiv: DOMString; // !!!: rw
109
property Name: DOMString; // !!!: rw
110
property Scheme: DOMString; // !!!: rw
113
THTMLBaseElement = class(THTMLElement)
115
property HRef: DOMString; // !!!: rw
116
property Target: DOMString; // !!!: rw
119
THTMLIsIndexElement = class(THTMLElement)
121
property Form: THTMLFormElement; // !!!: ro
122
property Prompt: DOMString; // !!!: rw
125
THTMLStyleElement = class(THTMLElement)
127
property Disabled: Boolean; // !!!: rw
128
property Media: DOMString; // !!!: rw
129
property HTMLType: DOMString; // !!!: rw
132
THTMLBodyElement = class(THTMLElement)
134
property ALink: DOMString; // !!!: rw
135
property Background: DOMString; // !!!: rw
136
property BgColor: DOMString; // !!!: rw
137
property Link: DOMString; // !!!: rw
138
property Text: DOMString; // !!!: rw
139
property VLink: DOMString; // !!!: rw
142
THTMLFormElement = class(THTMLElement)
144
property Elements: THTMLCollection; // !!!: ro
145
property Length: Integer; // !!!: ro
146
property Name: DOMString; // !!!: rw
147
property AcceptCharset: DOMString; // !!!: rw
148
property Action: DOMString; // !!!: rw
149
property EncType: DOMString; // !!!: rw
150
property Method: DOMString; // !!!: rw
151
property Target: DOMString; // !!!: rw
152
procedure Submit; virtual; abstract;
153
procedure Reset; virtual; abstract;
156
THTMLSelectElement = class(THTMLElement)
158
property HTMLType: DOMString; // !!!: ro
159
property SelectedIndex: Integer; // !!!: rw
160
property Value: DOMString; // !!!: rw
161
property Length: Cardinal; // !!!: rw
162
property Form: THTMLFormElement; // !!!: ro
163
property Options: THTMLOptionsCollection; // !!!: ro
164
property Disabled: Boolean; // !!!: rw
165
property Multiple: Boolean; // !!!: rw
166
property Name: DOMString; // !!!: rw
167
property Size: Integer; // !!!: rw
168
property TabIndex: Integer; // !!!: rw
169
procedure Add(Element, Before: THTMLElement);
170
procedure Remove(Index: Integer);
171
procedure Blur; virtual; abstract;
172
procedure Focus; virtual; abstract;
175
THTMLOptGroupElement = class(THTMLElement)
177
property Disabled: Boolean; // !!!: rw
178
property GroupLabel: DOMString; // !!!: rw
181
THTMLOptionElement = class(THTMLElement)
183
property Form: THTMLFormElement; // !!!: ro
184
property DefaultSelected: Boolean; // !!!: rw
185
property Text: DOMString; // !!!: ro
186
property Index: Integer; // !!!: ro
187
property Disabled: Boolean; // !!!: rw
188
property OptionLabel: DOMString; // !!!: rw
189
property Selected: Boolean; // !!!: rw
190
property Value: DOMString; // !!!: rw
193
THTMLInputElement = class(THTMLElement)
195
property DefaultValue: DOMString; // !!!: rw
196
property DefaultChecked: Boolean; // !!!: rw
197
property Form: THTMLFormElement; // !!!: ro
198
property Accept: DOMString; // !!!: rw
199
property AccessKey: DOMString; // !!!: rw
200
property Align: DOMString; // !!!: rw
201
property Alt: DOMString; // !!!: rw
202
property Checked: Boolean; // !!!: rw
203
property Disabled: Boolean; // !!!: rw
204
property MaxLength: Integer; // !!!: rw
205
property Name: DOMString; // !!!: rw
206
property ReadOnly: Boolean; // !!!: rw
207
property Size: Cardinal; // !!!: rw
208
property Src: DOMString; // !!!: rw
209
property TabIndex: Integer; // !!!: rw
210
property HTMLType: DOMString; // !!!: rw
211
property UseMap: DOMString; // !!!: rw
212
property Value: DOMString; // !!!: rw
213
procedure Blur; virtual; abstract;
214
procedure Focus; virtual; abstract;
215
procedure Select; virtual; abstract;
216
procedure Click; virtual; abstract;
219
THTMLTextAreaElement = class(THTMLElement)
221
property DefaultValue: DOMString; // !!!: rw
222
property Form: THTMLFormElement; // !!!: ro
223
property AccessKey: DOMString; // !!!: rw
224
property Cols: Integer; // !!!: rw
225
property Disabled: Boolean; // !!!: rw
226
property Name: DOMString; // !!!: rw
227
property ReadOnly: Boolean; // !!!: rw
228
property Rows: Integer; // !!!: rw
229
property TabIndex: Integer; // !!!: rw
230
property HTMLType: DOMString; // !!!: rw
231
property Value: DOMString; // !!!: rw
232
procedure Blur; virtual; abstract;
233
procedure Focus; virtual; abstract;
234
procedure Select; virtual; abstract;
237
THTMLButtonElement = class(THTMLElement)
239
property Form: THTMLFormElement; // !!!: ro
240
property AccessKey: DOMString; // !!!: rw
241
property Disabled: Boolean; // !!!: rw
242
property Name: DOMString; // !!!: rw
243
property TabIndex: Integer; // !!!: rw
244
property HTMLType: DOMString; // !!!: rw
245
property Value: DOMString; // !!!: rw
248
THTMLLabelElement = class(THTMLElement)
250
property Form: THTMLFormElement; // !!!: ro
251
property AccessKey: DOMString; // !!!: rw
252
property HtmlFor: DOMString; // !!!: rw
255
THTMLFieldSetElement = class(THTMLElement)
257
property Form: THTMLFormElement; // !!!: ro
260
THTMLLegendElement = class(THTMLElement)
262
property Form: THTMLFormElement; // !!!: ro
263
property AccessKey: DOMString; // !!!: rw
264
property Align: DOMString; // !!!: rw
267
THTMLUListElement = class(THTMLElement)
269
property Compact: Boolean; // !!!: rw
270
property HTMLType: DOMString; // !!!: rw
273
THTMLOListElement = class(THTMLElement)
275
property Compact: Boolean; // !!!: rw
276
property Start: Integer; // !!!: rw
277
property HTMLType: DOMString; // !!!: rw
280
THTMLDListElement = class(THTMLElement)
282
property Compact: Boolean; // !!!: rw
285
THTMLDirectoryElement = class(THTMLElement)
287
property Compact: Boolean; // !!!: rw
290
THTMLMenuElement = class(THTMLElement)
292
property Compact: Boolean; // !!!: rw
295
THTMLLIElement = class(THTMLElement)
297
property HTMLType: DOMString; // !!!: rw
298
property Value: Integer; // !!!: rw
301
THTMLDivElement = class(THTMLElement)
303
property Align: DOMString; // !!!: rw
306
THTMLParagraphElement = class(THTMLElement)
308
property Align: DOMString; // !!!: rw
311
THTMLHeadingElement = class(THTMLElement)
313
property Align: DOMString; // !!!: rw
316
THTMLQuoteElement = class(THTMLElement)
318
property Cite: DOMString; // !!!: rw
321
THTMLPreElement = class(THTMLElement)
323
property Width: Integer; // !!!: rw
326
THTMLBREElement = class(THTMLElement)
328
property Clear: DOMString; // !!!: rw
331
THTMLBaseFontElement = class(THTMLElement)
333
property Color: DOMString; // !!!: rw
334
property Face: DOMString; // !!!: rw
335
property Size: Integer; // !!!: rw
338
THTMLFontElement = class(THTMLElement)
340
property Color: DOMString; // !!!: rw
341
property Face: DOMString; // !!!: rw
342
property Size: Integer; // !!!: rw
345
THTMLHRElement = class(THTMLElement)
347
property Align: DOMString; // !!!: rw
348
property NoShade: Boolean; // !!!: rw
349
property Size: DOMString; // !!!: rw
350
property Width: DOMString; // !!!: rw
353
THTMLModElement = class(THTMLElement)
355
property Cite: DOMString; // !!!: rw
356
property DateTime: DOMString; // !!!: rw
359
THTMLAnchorElement = class(THTMLElement)
361
property AccessKey: DOMString; // !!!: rw
362
property Charset: DOMString; // !!!: rw
363
property Coords: DOMString; // !!!: rw
364
property HRef: DOMString; // !!!: rw
365
property HRefLang: DOMString; // !!!: rw
366
property Name: DOMString; // !!!: rw
367
property Rel: DOMString; // !!!: rw
368
property Rev: DOMString; // !!!: rw
369
property Shape: DOMString; // !!!: rw
370
property TabIndex: Integer; // !!!: rw
371
property Target: DOMString; // !!!: rw
372
property HTMLType: DOMString; // !!!: rw
373
procedure Blur; virtual; abstract;
374
procedure Focus; virtual; abstract;
377
THTMLImageElement = class(THTMLElement)
379
property Name: DOMString; // !!!: rw
380
property Align: DOMString; // !!!: rw
381
property Alt: DOMString; // !!!: rw
382
property Border: DOMString; // !!!: rw
383
property Height: Integer; // !!!: rw
384
property HSpace: Integer; // !!!: rw
385
property IsMap: Boolean; // !!!: rw
386
property LongDesc: DOMString; // !!!: rw
387
property Src: Integer; // !!!: rw
388
property UseMap: DOMString; // !!!: rw
389
property VSpace: Integer; // !!!: rw
390
property Width: Integer; // !!!: rw
393
THTMLObjectElement = class(THTMLElement)
395
property Form: THTMLFormElement; // !!!: ro
396
property Code: DOMString; // !!!: rw
397
property Align: DOMString; // !!!: rw
398
property Archive: DOMString; // !!!: rw
399
property Border: DOMString; // !!!: rw
400
property CodeBase: DOMString; // !!!: rw
401
property CodeType: DOMString; // !!!: rw
402
property Data: DOMString; // !!!: rw
403
property Declare: Boolean; // !!!: rw
404
property Height: DOMString; // !!!: rw
405
property HSpace: Integer; // !!!: rw
406
property Name: DOMString; // !!!: rw
407
property StandBy: DOMString; // !!!: rw
408
property TabIndex: Integer; // !!!: rw
409
property HTMLType: DOMString; // !!!: rw
410
property UseMap: DOMString; // !!!: rw
411
property VSpace: Integer; // !!!: rw
412
property Width: Integer; // !!!: rw
413
property ContentDocument: TDOMDocument; // !!!: ro
416
THTMLParamElement = class(THTMLElement)
418
property Name: DOMString; // !!!: rw
419
property HTMLType: DOMString; // !!!: rw
420
property Value: DOMString; // !!!: rw
421
property ValueType: DOMString; // !!!: rw
424
THTMLAppletElement = class(THTMLElement)
426
property Align: DOMString; // !!!: rw
427
property Alt: DOMString; // !!!: rw
428
property Archive: DOMString; // !!!: rw
429
property Code: DOMString; // !!!: rw
430
property CodeBase: DOMString; // !!!: rw
431
property Height: DOMString; // !!!: rw
432
property HSpace: Integer; // !!!: rw
433
property Name: DOMString; // !!!: rw
434
property AppletObject: DOMString; // !!!: rw
435
property VSpace: Integer; // !!!: rw
436
property Width: Integer; // !!!: rw
439
THTMLMapElement = class(THTMLElement)
441
property Areas: THTMLCollection; // !!!: ro
442
property Name: DOMString; // !!!: rw
445
THTMLAreaElement = class(THTMLElement)
447
property AccessKey: DOMString; // !!!: rw
448
property Alt: DOMString; // !!!: rw
449
property Coords: DOMString; // !!!: rw
450
property HRef: DOMString; // !!!: rw
451
property NoHRef: Boolean; // !!!: rw
452
property Shape: DOMString; // !!!: rw
453
property TabIndex: Integer; // !!!: rw
454
property Target: DOMString; // !!!: rw
457
THTMLScriptElement = class(THTMLElement)
459
property Text: DOMString; // !!!: rw
460
property HtmlFor: DOMString; // !!!: rw
461
property Event: DOMString; // !!!: rw
462
property Charset: DOMString; // !!!: rw
463
property Defer: Boolean; // !!!: rw
464
property Src: DOMString; // !!!: rw
465
property HTMLType: DOMString; // !!!: rw
468
THTMLTableElement = class(THTMLElement)
470
property Caption: THTMLTableCaptionElement; // !!!: rw
471
property THead: THTMLTableSectionElement; // !!!: rw
472
property TFoot: THTMLTableSectionElement; // !!!: rw
473
property Rows: THTMLCollection; // !!!: ro
474
property TBodies: THTMLCollection; // !!!: ro
475
property Align: DOMString; // !!!: rw
476
property BgColor: DOMString; // !!!: rw
477
property Border: DOMString; // !!!: rw
478
property CellPadding: DOMString; // !!!: rw
479
property CellSpacing: DOMString; // !!!: rw
480
property Frame: DOMString; // !!!: rw
481
property Rules: DOMString; // !!!: rw
482
property Summary: DOMString; // !!!: rw
483
property Width: DOMString; // !!!: rw
484
function CreateTHead: THTMLElement;
485
procedure DeleteTHead;
486
function CreateTFoot: THTMLElement;
487
procedure DeleteTFoot;
488
function CreateCaption: THTMLElement;
489
procedure DeleteCaption;
490
function InsertRow(Index: Integer): THTMLElement;
491
procedure DeleteRow(Index: Integer);
494
THTMLTableCaptionElement = class(THTMLElement)
496
property Align: DOMString; // !!!: rw
499
THTMLTableColElement = class(THTMLElement)
501
property Align: DOMString; // !!!: rw
502
property Ch: DOMString; // !!!: rw
503
property ChOff: DOMString; // !!!: rw
504
property Span: Integer; // !!!: rw
505
property VAlign: DOMString; // !!!: rw
506
property Width: DOMString; // !!!: rw
509
THTMLTableSectionElement = class(THTMLElement)
511
property Align: DOMString; // !!!: rw
512
property Ch: DOMString; // !!!: rw
513
property ChOff: DOMString; // !!!: rw
514
property VAlign: DOMString; // !!!: rw
515
property Rows: THTMLCollection; // !!!: ro
516
function InsertRow(Index: Integer): THTMLElement;
517
procedure DeleteRow(Index: Integer);
520
THTMLTableRowElement = class(THTMLElement)
522
property RowIndex: Integer; // !!!: ro
523
property SectionRowIndex: Integer; // !!!: ro
524
property Cells: THTMLCollection; // !!!: ro
525
property Align: DOMString; // !!!: rw
526
property BgColor: DOMString; // !!!: rw
527
property Ch: DOMString; // !!!: rw
528
property ChOff: DOMString; // !!!: rw
529
property VAlign: DOMString; // !!!: rw
530
function InsertCell(Index: Integer): THTMLElement;
531
procedure DeleteCell(Index: Integer);
534
THTMLTableCellElement = class(THTMLElement)
536
property CellIndex: Integer; // !!!: ro
537
property Abbr: DOMString; // !!!: rw
538
property Align: DOMString; // !!!: rw
539
property Axis: DOMString; // !!!: rw
540
property BgColor: DOMString; // !!!: rw
541
property Ch: DOMString; // !!!: rw
542
property ChOff: DOMString; // !!!: rw
543
property ColSpan: Integer; // !!!: rw
544
property Headers: DOMString; // !!!: rw
545
property Height: DOMString; // !!!: rw
546
property NoWrap: Boolean; // !!!: rw
547
property RowSpan: Integer; // !!!: rw
548
property Scope: DOMString; // !!!: rw
549
property VAlign: DOMString; // !!!: rw
550
property Width: DOMString; // !!!: rw
553
THTMLFrameSetElement = class(THTMLElement)
555
property Cols: DOMString; // !!!: rw
556
property Rows: DOMString; // !!!: rw
559
THTMLFrameElement = class(THTMLElement)
561
property FrameBorder: DOMString; // !!!: rw
562
property LongDesc: DOMString; // !!!: rw
563
property MarginHeight: DOMString; // !!!: rw
564
property MarginWidth: DOMString; // !!!: rw
565
property Name: DOMString; // !!!: rw
566
property NoResize: Boolean; // !!!: rw
567
property Scrolling: DOMString; // !!!: rw
568
property Src: DOMString; // !!!: rw
569
property ContentDocument: TDOMDocument; // !!!: ro
572
THTMLIFrameElement = class(THTMLElement)
574
property Align: DOMString; // !!!: rw
575
property FrameBorder: DOMString; // !!!: rw
576
property Height: DOMString; // !!!: rw
577
property LongDesc: DOMString; // !!!: rw
578
property MarginHeight: DOMString; // !!!: rw
579
property MarginWidth: DOMString; // !!!: rw
580
property Name: DOMString; // !!!: rw
581
property Scrolling: DOMString; // !!!: rw
582
property Src: DOMString; // !!!: rw
583
property Width: DOMString; // !!!: rw
584
property ContentDocument: TDOMDocument; // !!!: ro
587
THTMLDocument = class(TXMLDocument)
589
function GetTitle: DOMString;
590
procedure SetTitle(const Value: DOMString);
592
property Title: DOMString read GetTitle write SetTitle;
593
property Referrer: DOMString; // !!!: ro
594
property Domain: DOMString; // !!!: ro
595
property URL: DOMString; // !!!: ro
596
property Body: THTMLElement; // !!!: rw
597
property Images: THTMLCollection; // !!!: ro
598
property Applets: THTMLCollection; // !!!: ro
599
property Links: THTMLCollection; // !!!: ro
600
property Forms: THTMLCollection; // !!!: ro
601
property Anchors: THTMLCollection; // !!!: ro
602
property Cookie: DOMString; // !!!: rw
604
procedure Open; virtual; abstract;
605
procedure Close; virtual; abstract;
606
procedure Write(const AText: DOMString);
607
procedure WriteLn(const AText: DOMString);
608
function GetElementsByName(const ElementName: DOMString): TDOMNodeList;
610
// Helper functions (not in DOM standard):
611
function CreateElement(const tagName: DOMString): THTMLElement;
612
function CreateSubElement: THTMLElement;
613
function CreateSupElement: THTMLElement;
614
function CreateSpanElement: THTMLElement;
615
function CreateBDOElement: THTMLElement;
616
function CreateTTElement: THTMLElement;
617
function CreateIElement: THTMLElement;
618
function CreateBElement: THTMLElement;
619
function CreateUElement: THTMLElement;
620
function CreateSElement: THTMLElement;
621
function CreateStrikeElement: THTMLElement;
622
function CreateBigElement: THTMLElement;
623
function CreateSmallElement: THTMLElement;
624
function CreateEmElement: THTMLElement;
625
function CreateStrongElement: THTMLElement;
626
function CreateDfnElement: THTMLElement;
627
function CreateCodeElement: THTMLElement;
628
function CreateSampElement: THTMLElement;
629
function CreateKbdElement: THTMLElement;
630
function CreateVarElement: THTMLElement;
631
function CreateCiteElement: THTMLElement;
632
function CreateAcronymElement: THTMLElement;
633
function CreateAbbrElement: THTMLElement;
634
function CreateDDElement: THTMLElement;
635
function CreateDTElement: THTMLElement;
636
function CreateNoFramesElement: THTMLElement;
637
function CreateNoScriptElement: THTMLElement;
638
function CreateAddressElement: THTMLElement;
639
function CreateCenterElement: THTMLElement;
640
function CreateHtmlElement: THTMLHtmlElement;
641
function CreateHeadElement: THTMLHeadElement;
642
function CreateLinkElement: THTMLLinkElement;
643
{ function CreateTitleElement: THTMLTitleElement;
644
function CreateMetaElement: THTMLMetaElement;
645
function CreateBaseElement: THTMLBaseElement;
646
function CreateIsIndexElement: THTMLIsIndexElement;
647
function CreateStyleElement: THTMLStyleElement;}
648
function CreateBodyElement: THTMLBodyElement;
649
{ function CreateFormElement: THTMLFormElement;
650
function CreateSelectElement: THTMLSelectElement;
651
function CreateOptGroupElement: THTMLOptGroupElement;
652
function CreateOptionElement: THTMLOptionElement;
653
function CreateInputElement: THTMLInputElement;
654
function CreateTextAreaElement: THTMLTextAreaElement;
655
function CreateButtonElement: THTMLButtonElement;
656
function CreateLabelElement: THTMLLabelElement;
657
function CreateFieldSetElement: THTMLFieldSetElement;
658
function CreateLegendElement: THTMLLegendElement;}
659
function CreateUListElement: THTMLUListElement;
660
function CreateOListElement: THTMLOListElement;
661
function CreateDListElement: THTMLDListElement;
662
{ function CreateDirectoryElement: THTMLDirectoryElement;
663
function CreateMenuElement: THTMLMenuElement;}
664
function CreateLIElement: THTMLLIElement;
665
{ function CreateDivElement: THTMLDivElement;}
666
function CreateParagraphElement: THTMLParagraphElement;
667
{ function CreateHeadingElement: THTMLHeadingElement;
668
function CreateQuoteElement: THTMLQuoteElement;
669
function CreatePreElement: THTMLPreElement;
670
function CreateBRElement: THTMLBreElement;
671
function CreateBaseFontElement: THTMLBaseFontElement;
672
function CreateFontElement: THTMFontLElement;
673
function CreateHRElement: THTMLHREElement;
674
function CreateModElement: THTMLModElement;
675
function CreateAnchorElement: THTMLAnchorElement;
676
function CreateImageElement: THTMLImageElement;
677
function CreateObjectElement: THTMLObjectElement;
678
function CreateParamElement: THTMLParamElement;
679
function CreateAppletElement: THTMLAppletElement;
680
function CreateMapElement: THTMLMapElement;
681
function CreateAreaElement: THTMLAreaElement;
682
function CreateScriptElement: THTMLScriptElement;
683
function CreateTableElement: THTMLTableElement;
684
function CreateTableCaptionElement: THTMLTableCaptionElement;
685
function CreateTableColElement: THTMLTableColElement;
686
function CreateTableSectionElement: THTMLTableSectionElement;
687
function CreateTableRowElement: THTMLTableRowElement;
688
function CreateTableCellElement: THTMLTableCellElement;
689
function CreateFrameSetElement: THTMLFrameSetElement;
690
function CreateFrameElement: THTMLFrameElement;
691
function CreateIFrameElement: THTMLIFrameElement;}
698
function THTMLCollection.Item(Index: Cardinal): TDOMNode;
703
function THTMLCollection.NamedItem(const Index: DOMString): TDOMNode;
709
function THTMLOptionsCollection.Item(Index: Cardinal): TDOMNode;
714
function THTMLOptionsCollection.NamedItem(const Index: DOMString): TDOMNode;
720
constructor THTMLElement.Create(AOwner: THTMLDocument; const ATagName: DOMString);
722
inherited Create(AOwner);
723
FNodeName := ATagName;
726
function THTMLElement.GetID: DOMString; begin Result := GetAttribute('id') end;
727
procedure THTMLElement.SetID(const Value: DOMString); begin SetAttribute('id', Value) end;
728
function THTMLElement.GetTitle: DOMString; begin Result := GetAttribute('title') end;
729
procedure THTMLElement.SetTitle(const Value: DOMString); begin SetAttribute('title', Value) end;
730
function THTMLElement.GetLang: DOMString; begin Result := GetAttribute('lang') end;
731
procedure THTMLElement.SetLang(const Value: DOMString); begin SetAttribute('lang', Value) end;
732
function THTMLElement.GetDir: DOMString; begin Result := GetAttribute('dir') end;
733
procedure THTMLElement.SetDir(const Value: DOMString); begin SetAttribute('dir', Value) end;
734
function THTMLElement.GetClassName: DOMString; begin Result := GetAttribute('class') end;
735
procedure THTMLElement.SetClassName(const Value: DOMString); begin SetAttribute('class', Value) end;
738
function THTMLHtmlElement.GetVersion: DOMString; begin Result := GetAttribute('version') end;
739
procedure THTMLHtmlElement.SetVersion(const Value: DOMString); begin SetAttribute('version', Value) end;
742
function THTMLHeadElement.GetProfile: DOMString; begin Result := GetAttribute('profile') end;
743
procedure THTMLHeadElement.SetProfile(const Value: DOMString); begin SetAttribute('profile', Value) end;
746
procedure THTMLSelectElement.Add(Element, Before: THTMLElement);
750
procedure THTMLSelectElement.Remove(Index: Integer);
755
function THTMLTableElement.CreateTHead: THTMLElement;
760
procedure THTMLTableElement.DeleteTHead;
764
function THTMLTableElement.CreateTFoot: THTMLElement;
769
procedure THTMLTableElement.DeleteTFoot;
773
function THTMLTableElement.CreateCaption: THTMLElement;
778
procedure THTMLTableElement.DeleteCaption;
782
function THTMLTableElement.InsertRow(Index: Integer): THTMLElement;
787
procedure THTMLTableElement.DeleteRow(Index: Integer);
792
function THTMLTableSectionElement.InsertRow(Index: Integer): THTMLElement;
797
procedure THTMLTableSectionElement.DeleteRow(Index: Integer);
802
function THTMLTableRowElement.InsertCell(Index: Integer): THTMLElement;
807
procedure THTMLTableRowElement.DeleteCell(Index: Integer);
812
function THTMLDocument.GetTitle: DOMString;
817
if not Assigned(DocumentElement) then
819
Node := DocumentElement.FirstChild;
820
while Assigned(Node) and (Node.NodeName <> 'head') do
821
Node := Node.NextSibling;
822
if not Assigned(Node) then
824
Node := Node.FirstChild;
825
while Assigned(Node) and (Node.NodeName <> 'title') do
826
Node := Node.NextSibling;
827
if not Assigned(Node) then
829
Node := Node.FirstChild;
830
if Assigned(Node) and (Node.NodeType = TEXT_NODE) then
831
Result := Node.NodeValue;
834
procedure THTMLDocument.SetTitle(const Value: DOMString);
837
TitleEl: TDOMElement;
839
if not Assigned(DocumentElement) then
840
AppendChild(CreateHtmlElement);
841
Node := DocumentElement.FirstChild;
842
while Assigned(Node) and (Node.NodeName <> 'head') do
843
Node := Node.NextSibling;
844
if not Assigned(Node) then
846
Node := CreateHeadElement;
847
DocumentElement.InsertBefore(Node, DocumentElement.FirstChild);
849
TitleEl := TDOMElement(Node.FirstChild);
850
while Assigned(TitleEl) and (TitleEl.NodeName <> 'title') do
851
TitleEl := TDOMElement(TitleEl.NextSibling);
852
if not Assigned(TitleEl) then
854
TitleEl := CreateElement('title');
855
Node.AppendChild(TitleEl);
857
while Assigned(TitleEl.FirstChild) do
858
TitleEl.RemoveChild(TitleEl.FirstChild);
859
TitleEl.AppendChild(CreateTextNode(Value));
862
procedure THTMLDocument.Write(const AText: DOMString);
866
procedure THTMLDocument.WriteLn(const AText: DOMString);
870
function THTMLDocument.GetElementsByName(const ElementName: DOMString): TDOMNodeList;
875
function THTMLDocument.CreateElement(const tagName: DOMString): THTMLElement;
877
Result := THTMLElement.Create(Self, tagName);
880
function THTMLDocument.CreateSubElement: THTMLElement; begin Result := CreateElement('sub') end;
881
function THTMLDocument.CreateSupElement: THTMLElement; begin Result := CreateElement('sup') end;
882
function THTMLDocument.CreateSpanElement: THTMLElement; begin Result := CreateElement('span') end;
883
function THTMLDocument.CreateBDOElement: THTMLElement; begin Result := CreateElement('bdo') end;
884
function THTMLDocument.CreateTTElement: THTMLElement; begin Result := CreateElement('tt') end;
885
function THTMLDocument.CreateIElement: THTMLElement; begin Result := CreateElement('i') end;
886
function THTMLDocument.CreateBElement: THTMLElement; begin Result := CreateElement('b') end;
887
function THTMLDocument.CreateUElement: THTMLElement; begin Result := CreateElement('u') end;
888
function THTMLDocument.CreateSElement: THTMLElement; begin Result := CreateElement('s') end;
889
function THTMLDocument.CreateStrikeElement: THTMLElement; begin Result := CreateElement('strike') end;
890
function THTMLDocument.CreateBigElement: THTMLElement; begin Result := CreateElement('big') end;
891
function THTMLDocument.CreateSmallElement: THTMLElement; begin Result := CreateElement('small') end;
892
function THTMLDocument.CreateEmElement: THTMLElement; begin Result := CreateElement('em') end;
893
function THTMLDocument.CreateStrongElement: THTMLElement; begin Result := CreateElement('strong') end;
894
function THTMLDocument.CreateDfnElement: THTMLElement; begin Result := CreateElement('dfn') end;
895
function THTMLDocument.CreateCodeElement: THTMLElement; begin Result := CreateElement('code') end;
896
function THTMLDocument.CreateSampElement: THTMLElement; begin Result := CreateElement('samp') end;
897
function THTMLDocument.CreateKbdElement: THTMLElement; begin Result := CreateElement('kbd') end;
898
function THTMLDocument.CreateVarElement: THTMLElement; begin Result := CreateElement('var') end;
899
function THTMLDocument.CreateCiteElement: THTMLElement; begin Result := CreateElement('cite') end;
900
function THTMLDocument.CreateAcronymElement: THTMLElement; begin Result := CreateElement('acronym') end;
901
function THTMLDocument.CreateAbbrElement: THTMLElement; begin Result := CreateElement('abbr') end;
902
function THTMLDocument.CreateDDElement: THTMLElement; begin Result := CreateElement('dd') end;
903
function THTMLDocument.CreateDTElement: THTMLElement; begin Result := CreateElement('dt') end;
904
function THTMLDocument.CreateNoFramesElement: THTMLElement; begin Result := CreateElement('noframes') end;
905
function THTMLDocument.CreateNoScriptElement: THTMLElement; begin Result := CreateElement('noscript') end;
906
function THTMLDocument.CreateAddressElement: THTMLElement; begin Result := CreateElement('address') end;
907
function THTMLDocument.CreateCenterElement: THTMLElement; begin Result := CreateElement('center') end;
908
function THTMLDocument.CreateHtmlElement: THTMLHtmlElement; begin Result := THTMLHtmlElement.Create(Self, 'html') end;
909
function THTMLDocument.CreateHeadElement: THTMLHeadElement; begin Result := THTMLHeadElement.Create(Self, 'head') end;
910
function THTMLDocument.CreateLinkElement: THTMLLinkElement; begin Result := THTMLLinkElement.Create(Self, 'a') end;
912
function THTMLDocument.CreateBodyElement: THTMLBodyElement; begin Result := THTMLBodyElement.Create(Self, 'body') end;
914
function THTMLDocument.CreateUListElement: THTMLUListElement; begin Result := THTMLUListElement.Create(Self, 'ul') end;
915
function THTMLDocument.CreateOListElement: THTMLOListElement; begin Result := THTMLOListElement.Create(Self, 'ol') end;
916
function THTMLDocument.CreateDListElement: THTMLDListElement; begin Result := THTMLDListElement.Create(Self, 'dl') end;
918
function THTMLDocument.CreateLIElement: THTMLLIElement; begin Result := THTMLLIElement.Create(Self, 'li') end;
920
function THTMLDocument.CreateParagraphElement: THTMLParagraphElement; begin Result := THTMLParagraphElement.Create(Self, 'p') end;
926
$Log: dom_html.pp,v $
927
Revision 1.1 2002/12/11 21:06:07 sg
929
* Replaced htmldoc unit with dom_html unit
930
* Added SAX parser framework and SAX HTML parser