1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
//
// DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl/nsIDOMDocument.idl
//


/// `interface nsIDOMDocument : nsIDOMNode`
///


// The actual type definition for the interface. This struct has methods
// declared on it which will call through its vtable. You never want to pass
// this type around by value, always pass it behind a reference.

#[repr(C)]
pub struct nsIDOMDocument {
    vtable: *const nsIDOMDocumentVTable,

    /// This field is a phantomdata to ensure that the VTable type and any
    /// struct containing it is not safe to send across threads, as XPCOM is
    /// generally not threadsafe.
    ///
    /// XPCOM interfaces in general are not safe to send across threads.
    __nosync: ::std::marker::PhantomData<::std::rc::Rc<u8>>,
}

// Implementing XpCom for an interface exposes its IID, which allows for easy
// use of the `.query_interface<T>` helper method. This also defines that
// method for nsIDOMDocument.
unsafe impl XpCom for nsIDOMDocument {
    const IID: nsIID = nsID(0xb15fa0f4, 0x97c1, 0x4388,
        [0xaf, 0x62, 0x2c, 0xef, 0xf7, 0xa8, 0x9b, 0xdf]);
}

// We need to implement the RefCounted trait so we can be used with `RefPtr`.
// This trait teaches `RefPtr` how to manage our memory.
unsafe impl RefCounted for nsIDOMDocument {
    #[inline]
    unsafe fn addref(&self) {
        self.AddRef();
    }
    #[inline]
    unsafe fn release(&self) {
        self.Release();
    }
}

// This trait is implemented on all types which can be coerced to from nsIDOMDocument.
// It is used in the implementation of `fn coerce<T>`. We hide it from the
// documentation, because it clutters it up a lot.
#[doc(hidden)]
pub trait nsIDOMDocumentCoerce {
    /// Cheaply cast a value of this type from a `nsIDOMDocument`.
    fn coerce_from(v: &nsIDOMDocument) -> &Self;
}

// The trivial implementation: We can obviously coerce ourselves to ourselves.
impl nsIDOMDocumentCoerce for nsIDOMDocument {
    #[inline]
    fn coerce_from(v: &nsIDOMDocument) -> &Self {
        v
    }
}

impl nsIDOMDocument {
    /// Cast this `nsIDOMDocument` to one of its base interfaces.
    #[inline]
    pub fn coerce<T: nsIDOMDocumentCoerce>(&self) -> &T {
        T::coerce_from(self)
    }
}

// Every interface struct type implements `Deref` to its base interface. This
// causes methods on the base interfaces to be directly avaliable on the
// object. For example, you can call `.AddRef` or `.QueryInterface` directly
// on any interface which inherits from `nsISupports`.
impl ::std::ops::Deref for nsIDOMDocument {
    type Target = nsIDOMNode;
    #[inline]
    fn deref(&self) -> &nsIDOMNode {
        unsafe {
            ::std::mem::transmute(self)
        }
    }
}

// Ensure we can use .coerce() to cast to our base types as well. Any type which
// our base interface can coerce from should be coercable from us as well.
impl<T: nsIDOMNodeCoerce> nsIDOMDocumentCoerce for T {
    #[inline]
    fn coerce_from(v: &nsIDOMDocument) -> &Self {
        T::coerce_from(v)
    }
}

// This struct represents the interface's VTable. A pointer to a statically
// allocated version of this struct is at the beginning of every nsIDOMDocument
// object. It contains one pointer field for each method in the interface. In
// the case where we can't generate a binding for a method, we include a void
// pointer.
#[doc(hidden)]
#[repr(C)]
pub struct nsIDOMDocumentVTable {
    /// We need to include the members from the base interface's vtable at the start
    /// of the VTable definition.
    pub __base: nsIDOMNodeVTable,

    /* readonly attribute nsIDOMDocumentType doctype; */
    pub GetDoctype: unsafe extern "system" fn (this: *const nsIDOMDocument, aDoctype: *mut *const nsIDOMDocumentType) -> nsresult,

    /* readonly attribute nsIDOMDOMImplementation implementation; */
    pub GetImplementation: unsafe extern "system" fn (this: *const nsIDOMDocument, aImplementation: *mut *const nsIDOMDOMImplementation) -> nsresult,

    /* readonly attribute nsIDOMElement documentElement; */
    pub GetDocumentElement: unsafe extern "system" fn (this: *const nsIDOMDocument, aDocumentElement: *mut *const nsIDOMElement) -> nsresult,

    /* nsIDOMElement createElement ([Null (Stringify)] in DOMString tagName) raises (DOMException); */
    pub CreateElement: unsafe extern "system" fn (this: *const nsIDOMDocument, tagName: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult,

    /* nsIDOMDocumentFragment createDocumentFragment (); */
    pub CreateDocumentFragment: unsafe extern "system" fn (this: *const nsIDOMDocument, _retval: *mut *const nsIDOMDocumentFragment) -> nsresult,

    /* nsIDOMText createTextNode (in DOMString data); */
    pub CreateTextNode: unsafe extern "system" fn (this: *const nsIDOMDocument, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMText) -> nsresult,

    /* nsIDOMComment createComment (in DOMString data); */
    pub CreateComment: unsafe extern "system" fn (this: *const nsIDOMDocument, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMComment) -> nsresult,

    /* nsIDOMCDATASection createCDATASection (in DOMString data) raises (DOMException); */
    pub CreateCDATASection: unsafe extern "system" fn (this: *const nsIDOMDocument, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMCDATASection) -> nsresult,

    /* nsIDOMProcessingInstruction createProcessingInstruction (in DOMString target, in DOMString data) raises (DOMException); */
    pub CreateProcessingInstruction: unsafe extern "system" fn (this: *const nsIDOMDocument, target: &::nsstring::nsAString, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMProcessingInstruction) -> nsresult,

    /* nsIDOMAttr createAttribute (in DOMString name) raises (DOMException); */
    pub CreateAttribute: unsafe extern "system" fn (this: *const nsIDOMDocument, name: &::nsstring::nsAString, _retval: *mut *const nsIDOMAttr) -> nsresult,

    /* nsIDOMNodeList getElementsByTagName (in DOMString tagname); */
    pub GetElementsByTagName: unsafe extern "system" fn (this: *const nsIDOMDocument, tagname: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult,

    /* nsIDOMElement createElementNS (in DOMString namespaceURI, [Null (Stringify)] in DOMString qualifiedName) raises (DOMException); */
    pub CreateElementNS: unsafe extern "system" fn (this: *const nsIDOMDocument, namespaceURI: &::nsstring::nsAString, qualifiedName: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult,

    /* nsIDOMAttr createAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException); */
    pub CreateAttributeNS: unsafe extern "system" fn (this: *const nsIDOMDocument, namespaceURI: &::nsstring::nsAString, qualifiedName: &::nsstring::nsAString, _retval: *mut *const nsIDOMAttr) -> nsresult,

    /* nsIDOMNodeList getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName); */
    pub GetElementsByTagNameNS: unsafe extern "system" fn (this: *const nsIDOMDocument, namespaceURI: &::nsstring::nsAString, localName: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult,

    /* nsIDOMElement getElementById (in DOMString elementId); */
    pub GetElementById: unsafe extern "system" fn (this: *const nsIDOMDocument, elementId: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult,

    /* readonly attribute DOMString inputEncoding; */
    pub GetInputEncoding: unsafe extern "system" fn (this: *const nsIDOMDocument, aInputEncoding: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString documentURI; */
    pub GetDocumentURI: unsafe extern "system" fn (this: *const nsIDOMDocument, aDocumentURI: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString URL; */
    pub GetURL: unsafe extern "system" fn (this: *const nsIDOMDocument, aURL: &mut ::nsstring::nsAString) -> nsresult,

    /* nsIDOMRange createRange (); */
    pub CreateRange: unsafe extern "system" fn (this: *const nsIDOMDocument, _retval: *mut *const nsIDOMRange) -> nsresult,

    /* [optional_argc] nsIDOMNodeIterator createNodeIterator (in nsIDOMNode root, [optional] in unsigned long whatToShow, [optional] in nsIDOMNodeFilter filter) raises (DOMException); */
    /// Unable to generate binding because `optional_argc is unsupported`
    pub CreateNodeIterator: *const ::libc::c_void,

    /* [optional_argc] nsIDOMTreeWalker createTreeWalker (in nsIDOMNode root, [optional] in unsigned long whatToShow, [optional] in nsIDOMNodeFilter filter) raises (DOMException); */
    /// Unable to generate binding because `optional_argc is unsupported`
    pub CreateTreeWalker: *const ::libc::c_void,

    /* nsIDOMEvent createEvent (in DOMString eventType) raises (DOMException); */
    pub CreateEvent: unsafe extern "system" fn (this: *const nsIDOMDocument, eventType: &::nsstring::nsAString, _retval: *mut *const nsIDOMEvent) -> nsresult,

    /* readonly attribute mozIDOMWindowProxy defaultView; */
    pub GetDefaultView: unsafe extern "system" fn (this: *const nsIDOMDocument, aDefaultView: *mut *const mozIDOMWindowProxy) -> nsresult,

    /* readonly attribute DOMString characterSet; */
    pub GetCharacterSet: unsafe extern "system" fn (this: *const nsIDOMDocument, aCharacterSet: &mut ::nsstring::nsAString) -> nsresult,

    /* attribute DOMString dir; */
    pub GetDir: unsafe extern "system" fn (this: *const nsIDOMDocument, aDir: &mut ::nsstring::nsAString) -> nsresult,

    /* attribute DOMString dir; */
    pub SetDir: unsafe extern "system" fn (this: *const nsIDOMDocument, aDir: &::nsstring::nsAString) -> nsresult,

    /* attribute DOMString title; */
    pub GetTitle: unsafe extern "system" fn (this: *const nsIDOMDocument, aTitle: &mut ::nsstring::nsAString) -> nsresult,

    /* attribute DOMString title; */
    pub SetTitle: unsafe extern "system" fn (this: *const nsIDOMDocument, aTitle: &::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString readyState; */
    pub GetReadyState: unsafe extern "system" fn (this: *const nsIDOMDocument, aReadyState: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString lastModified; */
    pub GetLastModified: unsafe extern "system" fn (this: *const nsIDOMDocument, aLastModified: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString referrer; */
    pub GetReferrer: unsafe extern "system" fn (this: *const nsIDOMDocument, aReferrer: &mut ::nsstring::nsAString) -> nsresult,

    /* boolean hasFocus (); */
    pub HasFocus: unsafe extern "system" fn (this: *const nsIDOMDocument, _retval: *mut bool) -> nsresult,

    /* readonly attribute nsIDOMElement activeElement; */
    pub GetActiveElement: unsafe extern "system" fn (this: *const nsIDOMDocument, aActiveElement: *mut *const nsIDOMElement) -> nsresult,

    /* nsIDOMNodeList getElementsByClassName (in DOMString classes); */
    pub GetElementsByClassName: unsafe extern "system" fn (this: *const nsIDOMDocument, classes: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult,

    /* readonly attribute nsIDOMStyleSheetList styleSheets; */
    pub GetStyleSheets: unsafe extern "system" fn (this: *const nsIDOMDocument, aStyleSheets: *mut *const nsIDOMStyleSheetList) -> nsresult,

    /* readonly attribute DOMString preferredStyleSheetSet; */
    pub GetPreferredStyleSheetSet: unsafe extern "system" fn (this: *const nsIDOMDocument, aPreferredStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult,

    /* [binaryname(MozSelectedStyleSheetSet)] attribute DOMString selectedStyleSheetSet; */
    pub GetMozSelectedStyleSheetSet: unsafe extern "system" fn (this: *const nsIDOMDocument, aSelectedStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult,

    /* [binaryname(MozSelectedStyleSheetSet)] attribute DOMString selectedStyleSheetSet; */
    pub SetMozSelectedStyleSheetSet: unsafe extern "system" fn (this: *const nsIDOMDocument, aSelectedStyleSheetSet: &::nsstring::nsAString) -> nsresult,

    /* readonly attribute DOMString lastStyleSheetSet; */
    pub GetLastStyleSheetSet: unsafe extern "system" fn (this: *const nsIDOMDocument, aLastStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute nsISupports styleSheetSets; */
    pub GetStyleSheetSets: unsafe extern "system" fn (this: *const nsIDOMDocument, aStyleSheetSets: *mut *const nsISupports) -> nsresult,

    /* [binaryname(MozEnableStyleSheetsForSet)] void enableStyleSheetsForSet (in DOMString name); */
    pub MozEnableStyleSheetsForSet: unsafe extern "system" fn (this: *const nsIDOMDocument, name: &::nsstring::nsAString) -> nsresult,

    /* nsIDOMElement elementFromPoint (in float x, in float y); */
    pub ElementFromPoint: unsafe extern "system" fn (this: *const nsIDOMDocument, x: libc::c_float, y: libc::c_float, _retval: *mut *const nsIDOMElement) -> nsresult,

    /* readonly attribute DOMString contentType; */
    pub GetContentType: unsafe extern "system" fn (this: *const nsIDOMDocument, aContentType: &mut ::nsstring::nsAString) -> nsresult,

    /* readonly attribute boolean mozSyntheticDocument; */
    pub GetMozSyntheticDocument: unsafe extern "system" fn (this: *const nsIDOMDocument, aMozSyntheticDocument: *mut bool) -> nsresult,

    /* readonly attribute nsIDOMElement currentScript; */
    pub GetCurrentScript: unsafe extern "system" fn (this: *const nsIDOMDocument, aCurrentScript: *mut *const nsIDOMElement) -> nsresult,

    /* void mozSetImageElement (in DOMString aImageElementId, in nsIDOMElement aImageElement); */
    pub MozSetImageElement: unsafe extern "system" fn (this: *const nsIDOMDocument, aImageElementId: &::nsstring::nsAString, aImageElement: *const nsIDOMElement) -> nsresult,

    /* nsISupports caretPositionFromPoint (in float x, in float y); */
    pub CaretPositionFromPoint: unsafe extern "system" fn (this: *const nsIDOMDocument, x: libc::c_float, y: libc::c_float, _retval: *mut *const nsISupports) -> nsresult,

    /* readonly attribute boolean hidden; */
    pub GetHidden: unsafe extern "system" fn (this: *const nsIDOMDocument, aHidden: *mut bool) -> nsresult,

    /* readonly attribute DOMString visibilityState; */
    pub GetVisibilityState: unsafe extern "system" fn (this: *const nsIDOMDocument, aVisibilityState: &mut ::nsstring::nsAString) -> nsresult,
}


// The implementations of the function wrappers which are exposed to rust code.
// Call these methods rather than manually calling through the VTable struct.
impl nsIDOMDocument {

    /// ```text
    /// /**
    ///  * The nsIDOMDocument interface represents the entire HTML or XML document.
    ///  * Conceptually, it is the root of the document tree, and provides the
    ///  * primary access to the document's data.
    ///  * Since elements, text nodes, comments, processing instructions, etc.
    ///  * cannot exist outside the context of a Document, the nsIDOMDocument
    ///  * interface also contains the factory methods needed to create these
    ///  * objects.
    ///  *
    ///  * For more information on this interface please see
    ///  * http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html
    ///  */
    /// ```
    ///

    /// `readonly attribute nsIDOMDocumentType doctype;`
    #[inline]
    pub unsafe fn GetDoctype(&self, aDoctype: *mut *const nsIDOMDocumentType) -> nsresult {
        ((*self.vtable).GetDoctype)(self, aDoctype)
    }



    /// `readonly attribute nsIDOMDOMImplementation implementation;`
    #[inline]
    pub unsafe fn GetImplementation(&self, aImplementation: *mut *const nsIDOMDOMImplementation) -> nsresult {
        ((*self.vtable).GetImplementation)(self, aImplementation)
    }



    /// `readonly attribute nsIDOMElement documentElement;`
    #[inline]
    pub unsafe fn GetDocumentElement(&self, aDocumentElement: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).GetDocumentElement)(self, aDocumentElement)
    }



    /// `nsIDOMElement createElement ([Null (Stringify)] in DOMString tagName) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateElement(&self, tagName: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).CreateElement)(self, tagName, _retval)
    }



    /// `nsIDOMDocumentFragment createDocumentFragment ();`
    #[inline]
    pub unsafe fn CreateDocumentFragment(&self, _retval: *mut *const nsIDOMDocumentFragment) -> nsresult {
        ((*self.vtable).CreateDocumentFragment)(self, _retval)
    }



    /// `nsIDOMText createTextNode (in DOMString data);`
    #[inline]
    pub unsafe fn CreateTextNode(&self, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMText) -> nsresult {
        ((*self.vtable).CreateTextNode)(self, data, _retval)
    }



    /// `nsIDOMComment createComment (in DOMString data);`
    #[inline]
    pub unsafe fn CreateComment(&self, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMComment) -> nsresult {
        ((*self.vtable).CreateComment)(self, data, _retval)
    }



    /// `nsIDOMCDATASection createCDATASection (in DOMString data) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateCDATASection(&self, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMCDATASection) -> nsresult {
        ((*self.vtable).CreateCDATASection)(self, data, _retval)
    }



    /// `nsIDOMProcessingInstruction createProcessingInstruction (in DOMString target, in DOMString data) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateProcessingInstruction(&self, target: &::nsstring::nsAString, data: &::nsstring::nsAString, _retval: *mut *const nsIDOMProcessingInstruction) -> nsresult {
        ((*self.vtable).CreateProcessingInstruction)(self, target, data, _retval)
    }



    /// `nsIDOMAttr createAttribute (in DOMString name) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateAttribute(&self, name: &::nsstring::nsAString, _retval: *mut *const nsIDOMAttr) -> nsresult {
        ((*self.vtable).CreateAttribute)(self, name, _retval)
    }



    /// `nsIDOMNodeList getElementsByTagName (in DOMString tagname);`
    #[inline]
    pub unsafe fn GetElementsByTagName(&self, tagname: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult {
        ((*self.vtable).GetElementsByTagName)(self, tagname, _retval)
    }



    /// `nsIDOMElement createElementNS (in DOMString namespaceURI, [Null (Stringify)] in DOMString qualifiedName) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateElementNS(&self, namespaceURI: &::nsstring::nsAString, qualifiedName: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).CreateElementNS)(self, namespaceURI, qualifiedName, _retval)
    }



    /// `nsIDOMAttr createAttributeNS (in DOMString namespaceURI, in DOMString qualifiedName) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateAttributeNS(&self, namespaceURI: &::nsstring::nsAString, qualifiedName: &::nsstring::nsAString, _retval: *mut *const nsIDOMAttr) -> nsresult {
        ((*self.vtable).CreateAttributeNS)(self, namespaceURI, qualifiedName, _retval)
    }



    /// `nsIDOMNodeList getElementsByTagNameNS (in DOMString namespaceURI, in DOMString localName);`
    #[inline]
    pub unsafe fn GetElementsByTagNameNS(&self, namespaceURI: &::nsstring::nsAString, localName: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult {
        ((*self.vtable).GetElementsByTagNameNS)(self, namespaceURI, localName, _retval)
    }



    /// `nsIDOMElement getElementById (in DOMString elementId);`
    #[inline]
    pub unsafe fn GetElementById(&self, elementId: &::nsstring::nsAString, _retval: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).GetElementById)(self, elementId, _retval)
    }



    /// `readonly attribute DOMString inputEncoding;`
    #[inline]
    pub unsafe fn GetInputEncoding(&self, aInputEncoding: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetInputEncoding)(self, aInputEncoding)
    }



    /// `readonly attribute DOMString documentURI;`
    #[inline]
    pub unsafe fn GetDocumentURI(&self, aDocumentURI: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetDocumentURI)(self, aDocumentURI)
    }



    /// `readonly attribute DOMString URL;`
    #[inline]
    pub unsafe fn GetURL(&self, aURL: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetURL)(self, aURL)
    }


    /// ```text
    /// /**
    ///    * Create a range
    ///    *
    ///    * @see http://html5.org/specs/dom-range.html#dom-document-createrange
    ///    */
    /// ```
    ///

    /// `nsIDOMRange createRange ();`
    #[inline]
    pub unsafe fn CreateRange(&self, _retval: *mut *const nsIDOMRange) -> nsresult {
        ((*self.vtable).CreateRange)(self, _retval)
    }



    /// `[optional_argc] nsIDOMNodeIterator createNodeIterator (in nsIDOMNode root, [optional] in unsigned long whatToShow, [optional] in nsIDOMNodeFilter filter) raises (DOMException);`
    const _CreateNodeIterator: () = ();


    /// `[optional_argc] nsIDOMTreeWalker createTreeWalker (in nsIDOMNode root, [optional] in unsigned long whatToShow, [optional] in nsIDOMNodeFilter filter) raises (DOMException);`
    const _CreateTreeWalker: () = ();


    /// `nsIDOMEvent createEvent (in DOMString eventType) raises (DOMException);`
    #[inline]
    pub unsafe fn CreateEvent(&self, eventType: &::nsstring::nsAString, _retval: *mut *const nsIDOMEvent) -> nsresult {
        ((*self.vtable).CreateEvent)(self, eventType, _retval)
    }


    /// ```text
    /// /**
    ///    * The window associated with this document.
    ///    *
    ///    * @see <http://www.whatwg.org/html/#dom-document-defaultview>
    ///    */
    /// ```
    ///

    /// `readonly attribute mozIDOMWindowProxy defaultView;`
    #[inline]
    pub unsafe fn GetDefaultView(&self, aDefaultView: *mut *const mozIDOMWindowProxy) -> nsresult {
        ((*self.vtable).GetDefaultView)(self, aDefaultView)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-characterset>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString characterSet;`
    #[inline]
    pub unsafe fn GetCharacterSet(&self, aCharacterSet: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetCharacterSet)(self, aCharacterSet)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-dir>
    ///    */
    /// ```
    ///

    /// `attribute DOMString dir;`
    #[inline]
    pub unsafe fn GetDir(&self, aDir: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetDir)(self, aDir)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-dir>
    ///    */
    /// ```
    ///

    /// `attribute DOMString dir;`
    #[inline]
    pub unsafe fn SetDir(&self, aDir: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetDir)(self, aDir)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#document.title>
    ///    */
    /// ```
    ///

    /// `attribute DOMString title;`
    #[inline]
    pub unsafe fn GetTitle(&self, aTitle: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetTitle)(self, aTitle)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#document.title>
    ///    */
    /// ```
    ///

    /// `attribute DOMString title;`
    #[inline]
    pub unsafe fn SetTitle(&self, aTitle: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetTitle)(self, aTitle)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-readystate>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString readyState;`
    #[inline]
    pub unsafe fn GetReadyState(&self, aReadyState: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetReadyState)(self, aReadyState)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-lastmodified>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString lastModified;`
    #[inline]
    pub unsafe fn GetLastModified(&self, aLastModified: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetLastModified)(self, aLastModified)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-referrer>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString referrer;`
    #[inline]
    pub unsafe fn GetReferrer(&self, aReferrer: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetReferrer)(self, aReferrer)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-hasfocus>
    ///    */
    /// ```
    ///

    /// `boolean hasFocus ();`
    #[inline]
    pub unsafe fn HasFocus(&self, _retval: *mut bool) -> nsresult {
        ((*self.vtable).HasFocus)(self, _retval)
    }


    /// ```text
    /// /**
    ///    * @see <http://www.whatwg.org/html/#dom-document-activeelement>
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIDOMElement activeElement;`
    #[inline]
    pub unsafe fn GetActiveElement(&self, aActiveElement: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).GetActiveElement)(self, aActiveElement)
    }


    /// ```text
    /// /**
    ///    * Retrieve elements matching all classes listed in a
    ///    * space-separated string.
    ///    *
    ///    * @see <http://www.whatwg.org/html/#dom-document-getelementsbyclassname>
    ///    */
    /// ```
    ///

    /// `nsIDOMNodeList getElementsByClassName (in DOMString classes);`
    #[inline]
    pub unsafe fn GetElementsByClassName(&self, classes: &::nsstring::nsAString, _retval: *mut *const nsIDOMNodeList) -> nsresult {
        ((*self.vtable).GetElementsByClassName)(self, classes, _retval)
    }


    /// ```text
    /// /**
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-stylesheets>
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIDOMStyleSheetList styleSheets;`
    #[inline]
    pub unsafe fn GetStyleSheets(&self, aStyleSheets: *mut *const nsIDOMStyleSheetList) -> nsresult {
        ((*self.vtable).GetStyleSheets)(self, aStyleSheets)
    }


    /// ```text
    /// /**
    ///    * This attribute must return the preferred style sheet set as set by the
    ///    * author. It is determined from the order of style sheet declarations and
    ///    * the Default-Style HTTP headers, as eventually defined elsewhere in the Web
    ///    * Apps 1.0 specification. If there is no preferred style sheet set, this
    ///    * attribute must return the empty string. The case of this attribute must
    ///    * exactly match the case given by the author where the preferred style sheet
    ///    * is specified or implied. This attribute must never return null.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-preferredStyleSheetSet>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString preferredStyleSheetSet;`
    #[inline]
    pub unsafe fn GetPreferredStyleSheetSet(&self, aPreferredStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetPreferredStyleSheetSet)(self, aPreferredStyleSheetSet)
    }


    /// ```text
    /// /**
    ///    * This attribute indicates which style sheet set is in use. This attribute
    ///    * is live; changing the disabled attribute on style sheets directly will
    ///    * change the value of this attribute.
    ///    *
    ///    * If all the sheets that are enabled and have a title have the same title
    ///    * (by case-sensitive comparisons) then the value of this attribute must be
    ///    * exactly equal to the title of the first enabled style sheet with a title
    ///    * in the styleSheets list. Otherwise, if style sheets from different sets
    ///    * are enabled, then the return value must be null (there is no way to
        ///    * determine what the currently selected style sheet set is in those
        ///    * conditions). Otherwise, either all style sheets that have a title are
    ///    * disabled, or there are no alternate style sheets, and
    ///    * selectedStyleSheetSet must return the empty string.
    ///    *
    ///    * Setting this attribute to the null value must have no effect.
    ///    *
    ///    * Setting this attribute to a non-null value must call
    ///    * enableStyleSheetsForSet() with that value as the function's argument, and
    ///    * set lastStyleSheetSet to that value.
    ///    *
    ///    * From the DOM's perspective, all views have the same
    ///    * selectedStyleSheetSet. If a UA supports multiple views with different
    ///    * selected alternate style sheets, then this attribute (and the StyleSheet
        ///    * interface's disabled attribute) must return and set the value for the
    ///    * default view.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-selectedStyleSheetSet>
    ///    */
    /// ```
    ///

    /// `[binaryname(MozSelectedStyleSheetSet)] attribute DOMString selectedStyleSheetSet;`
    #[inline]
    pub unsafe fn GetMozSelectedStyleSheetSet(&self, aSelectedStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetMozSelectedStyleSheetSet)(self, aSelectedStyleSheetSet)
    }


    /// ```text
    /// /**
    ///    * This attribute indicates which style sheet set is in use. This attribute
    ///    * is live; changing the disabled attribute on style sheets directly will
    ///    * change the value of this attribute.
    ///    *
    ///    * If all the sheets that are enabled and have a title have the same title
    ///    * (by case-sensitive comparisons) then the value of this attribute must be
    ///    * exactly equal to the title of the first enabled style sheet with a title
    ///    * in the styleSheets list. Otherwise, if style sheets from different sets
    ///    * are enabled, then the return value must be null (there is no way to
        ///    * determine what the currently selected style sheet set is in those
        ///    * conditions). Otherwise, either all style sheets that have a title are
    ///    * disabled, or there are no alternate style sheets, and
    ///    * selectedStyleSheetSet must return the empty string.
    ///    *
    ///    * Setting this attribute to the null value must have no effect.
    ///    *
    ///    * Setting this attribute to a non-null value must call
    ///    * enableStyleSheetsForSet() with that value as the function's argument, and
    ///    * set lastStyleSheetSet to that value.
    ///    *
    ///    * From the DOM's perspective, all views have the same
    ///    * selectedStyleSheetSet. If a UA supports multiple views with different
    ///    * selected alternate style sheets, then this attribute (and the StyleSheet
        ///    * interface's disabled attribute) must return and set the value for the
    ///    * default view.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-selectedStyleSheetSet>
    ///    */
    /// ```
    ///

    /// `[binaryname(MozSelectedStyleSheetSet)] attribute DOMString selectedStyleSheetSet;`
    #[inline]
    pub unsafe fn SetMozSelectedStyleSheetSet(&self, aSelectedStyleSheetSet: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).SetMozSelectedStyleSheetSet)(self, aSelectedStyleSheetSet)
    }



    /// `readonly attribute DOMString lastStyleSheetSet;`
    #[inline]
    pub unsafe fn GetLastStyleSheetSet(&self, aLastStyleSheetSet: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetLastStyleSheetSet)(self, aLastStyleSheetSet)
    }


    /// ```text
    /// /**
    ///    * This must return the live list of the currently available style sheet
    ///    * sets. This list is constructed by enumerating all the style sheets for
    ///    * this document available to the implementation, in the order they are
    ///    * listed in the styleSheets attribute, adding the title of each style sheet
    ///    * with a title to the list, avoiding duplicates by dropping titles that
    ///    * match (case-sensitively) titles that have already been added to the
    ///    * list.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-styleSheetSets>
    ///    */
    /// ```
    ///

    /// `readonly attribute nsISupports styleSheetSets;`
    #[inline]
    pub unsafe fn GetStyleSheetSets(&self, aStyleSheetSets: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).GetStyleSheetSets)(self, aStyleSheetSets)
    }


    /// ```text
    /// /**
    ///    * Calling this method must change the disabled attribute on each StyleSheet
    ///    * object with a title attribute with a length greater than 0 in the
    ///    * styleSheets attribute, so that all those whose title matches the name
    ///    * argument are enabled, and all others are disabled. Title matches must be
    ///    * case-sensitive. Calling this method with the empty string disables all
    ///    * alternate and preferred style sheets (but does not change the state of
        ///    * persistent style sheets, that is those with no title attribute).
    ///    *
    ///    * Calling this method with a null value must have no effect.
    ///    *
    ///    * Style sheets that do not have a title are never affected by this
    ///    * method. This method does not change the values of the lastStyleSheetSet or
    ///    * preferredStyleSheetSet attributes.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom/#dom-document-enableStyleSheetsForSet>
    ///    */
    /// ```
    ///

    /// `[binaryname(MozEnableStyleSheetsForSet)] void enableStyleSheetsForSet (in DOMString name);`
    #[inline]
    pub unsafe fn MozEnableStyleSheetsForSet(&self, name: &::nsstring::nsAString) -> nsresult {
        ((*self.vtable).MozEnableStyleSheetsForSet)(self, name)
    }


    /// ```text
    /// /**
    ///    * Returns the element from the caller's document at the given point,
    ///    * relative to the upper-left-most point in the (possibly scrolled)
    ///    * window or frame.
    ///    *
    ///    * If the element at the given point belongs to another document (such as
        ///    * an iframe's subdocument), the element in the calling document's DOM
    ///    * (e.g. the iframe) is returned. If the element at the given point is
    ///    * anonymous or XBL generated content, such as a textbox's scrollbars, then
    ///    * the first non-anonymous parent element (that is, the textbox) is returned.
    ///    *
    ///    * This method returns null if either coordinate is negative, or if the
    ///    * specified point lies outside the visible bounds of the document.
    ///    *
    ///    * Callers from XUL documents should wait until the onload event has fired
    ///    * before calling this method.
    ///    *
    ///    * @see <http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompoint>
    ///    */
    /// ```
    ///

    /// `nsIDOMElement elementFromPoint (in float x, in float y);`
    #[inline]
    pub unsafe fn ElementFromPoint(&self, x: libc::c_float, y: libc::c_float, _retval: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).ElementFromPoint)(self, x, y, _retval)
    }


    /// ```text
    /// /**
    ///    * @see <https://developer.mozilla.org/en/DOM/document.contentType>
    ///    */
    /// ```
    ///

    /// `readonly attribute DOMString contentType;`
    #[inline]
    pub unsafe fn GetContentType(&self, aContentType: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetContentType)(self, aContentType)
    }


    /// ```text
    /// /**
    ///    * True if this document is synthetic : stand alone image, video, audio file,
    ///    * etc.
    ///    */
    /// ```
    ///

    /// `readonly attribute boolean mozSyntheticDocument;`
    #[inline]
    pub unsafe fn GetMozSyntheticDocument(&self, aMozSyntheticDocument: *mut bool) -> nsresult {
        ((*self.vtable).GetMozSyntheticDocument)(self, aMozSyntheticDocument)
    }


    /// ```text
    /// /**
    ///    * Returns the script element whose script is currently being processed.
    ///    *
    ///    * @see <https://developer.mozilla.org/en/DOM/document.currentScript>
    ///    */
    /// ```
    ///

    /// `readonly attribute nsIDOMElement currentScript;`
    #[inline]
    pub unsafe fn GetCurrentScript(&self, aCurrentScript: *mut *const nsIDOMElement) -> nsresult {
        ((*self.vtable).GetCurrentScript)(self, aCurrentScript)
    }


    /// ```text
    /// /**
    ///    * Use the given DOM element as the source image of target |-moz-element()|.
    ///    *
    ///    * This function introduces a new special ID (called "image element ID"),
    ///    * which is only used by |-moz-element()|, and associates it with the given
    ///    * DOM element.  Image elements ID's have the higher precedence than general
    ///    * HTML id's, so if |document.mozSetImageElement(<id>, <element>)| is called,
    ///    * |-moz-element(#<id>)| uses |<element>| as the source image even if there
    ///    * is another element with id attribute = |<id>|.  To unregister an image
    ///    * element ID |<id>|, call |document.mozSetImageElement(<id>, null)|.
    ///    *
    ///    * Example:
    ///    * <script>
    ///    *   canvas = document.createElement("canvas");
    ///    *   canvas.setAttribute("width", 100);
    ///    *   canvas.setAttribute("height", 100);
    ///    *   // draw to canvas
    ///    *   document.mozSetImageElement("canvasbg", canvas);
    ///    * </script>
    ///    * <div style="background-image: -moz-element(#canvasbg);"></div>
    ///    *
    ///    * @param aImageElementId an image element ID to associate with
    ///    * |aImageElement|
    ///    * @param aImageElement a DOM element to be used as the source image of
    ///    * |-moz-element(#aImageElementId)|. If this is null, the function will
    ///    * unregister the image element ID |aImageElementId|.
    ///    *
    ///    * @see <https://developer.mozilla.org/en/DOM/document.mozSetImageElement>
    ///    */
    /// ```
    ///

    /// `void mozSetImageElement (in DOMString aImageElementId, in nsIDOMElement aImageElement);`
    #[inline]
    pub unsafe fn MozSetImageElement(&self, aImageElementId: &::nsstring::nsAString, aImageElement: *const nsIDOMElement) -> nsresult {
        ((*self.vtable).MozSetImageElement)(self, aImageElementId, aImageElement)
    }


    /// ```text
    /// /**
    ///    * Retrieve the location of the caret position (DOM node and character
        ///    * offset within that node), given a point.
    ///    *
    ///    * @param x Horizontal point at which to determine the caret position, in
    ///    *          page coordinates.
    ///    * @param y Vertical point at which to determine the caret position, in
    ///    *          page coordinates.
    ///    */
    /// ```
    ///

    /// `nsISupports caretPositionFromPoint (in float x, in float y);`
    #[inline]
    pub unsafe fn CaretPositionFromPoint(&self, x: libc::c_float, y: libc::c_float, _retval: *mut *const nsISupports) -> nsresult {
        ((*self.vtable).CaretPositionFromPoint)(self, x, y, _retval)
    }


    /// ```text
    /// /**
    ///    * Visibility API implementation.
    ///    */
    /// ```
    ///

    /// `readonly attribute boolean hidden;`
    #[inline]
    pub unsafe fn GetHidden(&self, aHidden: *mut bool) -> nsresult {
        ((*self.vtable).GetHidden)(self, aHidden)
    }



    /// `readonly attribute DOMString visibilityState;`
    #[inline]
    pub unsafe fn GetVisibilityState(&self, aVisibilityState: &mut ::nsstring::nsAString) -> nsresult {
        ((*self.vtable).GetVisibilityState)(self, aVisibilityState)
    }


}