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
|
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use dom::bindings::codegen::HTMLElementBinding;
use dom::bindings::utils::{DOMString, ErrorResult, Fallible};
use dom::bindings::utils::{CacheableWrapper, BindingObject, WrapperCache};
use dom::element::{Element, ElementTypeId};
use dom::node::{AbstractNode, ScriptView};
use js::jsapi::{JSObject, JSContext, JSVal};
use js::JSVAL_NULL;
pub struct HTMLElement {
element: Element
}
impl HTMLElement {
pub fn new(type_id: ElementTypeId, tag_name: ~str) -> HTMLElement {
HTMLElement {
element: Element::new(type_id, tag_name)
}
}
}
impl HTMLElement {
pub fn Title(&self) -> DOMString {
None
}
pub fn SetTitle(&mut self, _title: &DOMString) {
}
pub fn Lang(&self) -> DOMString {
None
}
pub fn SetLang(&mut self, _lang: &DOMString) {
}
pub fn Dir(&self) -> DOMString {
None
}
pub fn SetDir(&mut self, _dir: &DOMString) -> ErrorResult {
Ok(())
}
pub fn GetItemValue(&self, _cx: *JSContext) -> Fallible<JSVal> {
Ok(JSVAL_NULL)
}
pub fn SetItemValue(&mut self, _cx: *JSContext, _val: JSVal) -> ErrorResult {
Ok(())
}
pub fn Hidden(&self) -> bool {
false
}
pub fn SetHidden(&mut self, _hidden: bool) -> ErrorResult {
Ok(())
}
pub fn Click(&self) {
}
pub fn TabIndex(&self) -> i32 {
0
}
pub fn SetTabIndex(&mut self, _index: i32) -> ErrorResult {
Ok(())
}
pub fn Focus(&self) -> ErrorResult {
Ok(())
}
pub fn Blur(&self) -> ErrorResult {
Ok(())
}
pub fn AccessKey(&self) -> DOMString {
None
}
pub fn SetAccessKey(&self, _key: &DOMString) -> ErrorResult {
Ok(())
}
pub fn AccessKeyLabel(&self) -> DOMString {
None
}
pub fn Draggable(&self) -> bool {
false
}
pub fn SetDraggable(&mut self, _draggable: bool) -> ErrorResult {
Ok(())
}
pub fn ContentEditable(&self) -> DOMString {
None
}
pub fn SetContentEditable(&mut self, _val: &DOMString) -> ErrorResult {
Ok(())
}
pub fn IsContentEditable(&self) -> bool {
false
}
pub fn Spellcheck(&self) -> bool {
false
}
pub fn SetSpellcheck(&self, _val: bool) -> ErrorResult {
Ok(())
}
pub fn ClassName(&self) -> DOMString {
None
}
pub fn SetClassName(&self, _class: &DOMString) {
}
pub fn GetOffsetParent(&self) -> Option<AbstractNode<ScriptView>> {
None
}
pub fn OffsetTop(&self) -> i32 {
0
}
pub fn OffsetLeft(&self) -> i32 {
0
}
pub fn OffsetWidth(&self) -> i32 {
0
}
pub fn OffsetHeight(&self) -> i32 {
0
}
}
impl CacheableWrapper for HTMLElement {
fn get_wrappercache(&mut self) -> &mut WrapperCache {
self.element.get_wrappercache()
}
fn wrap_object_shared(@mut self, cx: *JSContext, scope: *JSObject) -> *JSObject {
let mut unused = false;
HTMLElementBinding::Wrap(cx, scope, self, &mut unused)
}
}
impl BindingObject for HTMLElement {
fn GetParentObject(&self, cx: *JSContext) -> Option<@mut CacheableWrapper> {
self.element.GetParentObject(cx)
}
}
|