|
1 /* |
|
2 This file is part of the WebKit open source project. |
|
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
|
4 |
|
5 This library is free software; you can redistribute it and/or |
|
6 modify it under the terms of the GNU Library General Public |
|
7 License as published by the Free Software Foundation; either |
|
8 version 2 of the License, or (at your option) any later version. |
|
9 |
|
10 This library 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. See the GNU |
|
13 Library General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU Library General Public License |
|
16 along with this library; see the file COPYING.LIB. If not, write to |
|
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
18 Boston, MA 02110-1301, USA. |
|
19 */ |
|
20 |
|
21 #include "config.h" |
|
22 #include "JSProcessingInstruction.h" |
|
23 |
|
24 #include "JSStyleSheet.h" |
|
25 #include "KURL.h" |
|
26 #include "ProcessingInstruction.h" |
|
27 #include "StyleSheet.h" |
|
28 #include <wtf/GetPtr.h> |
|
29 |
|
30 using namespace JSC; |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 ASSERT_CLASS_FITS_IN_CELL(JSProcessingInstruction); |
|
35 |
|
36 /* Hash table */ |
|
37 #if ENABLE(JIT) |
|
38 #define THUNK_GENERATOR(generator) , generator |
|
39 #else |
|
40 #define THUNK_GENERATOR(generator) |
|
41 #endif |
|
42 |
|
43 static const HashTableValue JSProcessingInstructionTableValues[5] = |
|
44 { |
|
45 { "target", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProcessingInstructionTarget), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
46 { "data", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProcessingInstructionData), (intptr_t)setJSProcessingInstructionData THUNK_GENERATOR(0) }, |
|
47 { "sheet", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProcessingInstructionSheet), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
48 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProcessingInstructionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, |
|
49 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
50 }; |
|
51 |
|
52 #undef THUNK_GENERATOR |
|
53 static JSC_CONST_HASHTABLE HashTable JSProcessingInstructionTable = { 8, 7, JSProcessingInstructionTableValues, 0 }; |
|
54 /* Hash table for constructor */ |
|
55 #if ENABLE(JIT) |
|
56 #define THUNK_GENERATOR(generator) , generator |
|
57 #else |
|
58 #define THUNK_GENERATOR(generator) |
|
59 #endif |
|
60 |
|
61 static const HashTableValue JSProcessingInstructionConstructorTableValues[1] = |
|
62 { |
|
63 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
64 }; |
|
65 |
|
66 #undef THUNK_GENERATOR |
|
67 static JSC_CONST_HASHTABLE HashTable JSProcessingInstructionConstructorTable = { 1, 0, JSProcessingInstructionConstructorTableValues, 0 }; |
|
68 class JSProcessingInstructionConstructor : public DOMConstructorObject { |
|
69 public: |
|
70 JSProcessingInstructionConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
71 |
|
72 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
73 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
74 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
75 static const JSC::ClassInfo s_info; |
|
76 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
77 { |
|
78 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
79 } |
|
80 protected: |
|
81 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
82 }; |
|
83 |
|
84 const ClassInfo JSProcessingInstructionConstructor::s_info = { "ProcessingInstructionConstructor", 0, &JSProcessingInstructionConstructorTable, 0 }; |
|
85 |
|
86 JSProcessingInstructionConstructor::JSProcessingInstructionConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) |
|
87 : DOMConstructorObject(JSProcessingInstructionConstructor::createStructure(globalObject->objectPrototype()), globalObject) |
|
88 { |
|
89 putDirect(exec->propertyNames().prototype, JSProcessingInstructionPrototype::self(exec, globalObject), DontDelete | ReadOnly); |
|
90 } |
|
91 |
|
92 bool JSProcessingInstructionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
93 { |
|
94 return getStaticValueSlot<JSProcessingInstructionConstructor, DOMObject>(exec, &JSProcessingInstructionConstructorTable, this, propertyName, slot); |
|
95 } |
|
96 |
|
97 bool JSProcessingInstructionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
98 { |
|
99 return getStaticValueDescriptor<JSProcessingInstructionConstructor, DOMObject>(exec, &JSProcessingInstructionConstructorTable, this, propertyName, descriptor); |
|
100 } |
|
101 |
|
102 /* Hash table for prototype */ |
|
103 #if ENABLE(JIT) |
|
104 #define THUNK_GENERATOR(generator) , generator |
|
105 #else |
|
106 #define THUNK_GENERATOR(generator) |
|
107 #endif |
|
108 |
|
109 static const HashTableValue JSProcessingInstructionPrototypeTableValues[1] = |
|
110 { |
|
111 { 0, 0, 0, 0 THUNK_GENERATOR(0) } |
|
112 }; |
|
113 |
|
114 #undef THUNK_GENERATOR |
|
115 static JSC_CONST_HASHTABLE HashTable JSProcessingInstructionPrototypeTable = { 1, 0, JSProcessingInstructionPrototypeTableValues, 0 }; |
|
116 const ClassInfo JSProcessingInstructionPrototype::s_info = { "ProcessingInstructionPrototype", 0, &JSProcessingInstructionPrototypeTable, 0 }; |
|
117 |
|
118 JSObject* JSProcessingInstructionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) |
|
119 { |
|
120 return getDOMPrototype<JSProcessingInstruction>(exec, globalObject); |
|
121 } |
|
122 |
|
123 const ClassInfo JSProcessingInstruction::s_info = { "ProcessingInstruction", &JSNode::s_info, &JSProcessingInstructionTable, 0 }; |
|
124 |
|
125 JSProcessingInstruction::JSProcessingInstruction(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ProcessingInstruction> impl) |
|
126 : JSNode(structure, globalObject, impl) |
|
127 { |
|
128 } |
|
129 |
|
130 JSObject* JSProcessingInstruction::createPrototype(ExecState* exec, JSGlobalObject* globalObject) |
|
131 { |
|
132 return new (exec) JSProcessingInstructionPrototype(globalObject, JSProcessingInstructionPrototype::createStructure(JSNodePrototype::self(exec, globalObject))); |
|
133 } |
|
134 |
|
135 bool JSProcessingInstruction::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
136 { |
|
137 return getStaticValueSlot<JSProcessingInstruction, Base>(exec, &JSProcessingInstructionTable, this, propertyName, slot); |
|
138 } |
|
139 |
|
140 bool JSProcessingInstruction::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) |
|
141 { |
|
142 return getStaticValueDescriptor<JSProcessingInstruction, Base>(exec, &JSProcessingInstructionTable, this, propertyName, descriptor); |
|
143 } |
|
144 |
|
145 JSValue jsProcessingInstructionTarget(ExecState* exec, JSValue slotBase, const Identifier&) |
|
146 { |
|
147 JSProcessingInstruction* castedThis = static_cast<JSProcessingInstruction*>(asObject(slotBase)); |
|
148 UNUSED_PARAM(exec); |
|
149 ProcessingInstruction* imp = static_cast<ProcessingInstruction*>(castedThis->impl()); |
|
150 JSValue result = jsStringOrNull(exec, imp->target()); |
|
151 return result; |
|
152 } |
|
153 |
|
154 JSValue jsProcessingInstructionData(ExecState* exec, JSValue slotBase, const Identifier&) |
|
155 { |
|
156 JSProcessingInstruction* castedThis = static_cast<JSProcessingInstruction*>(asObject(slotBase)); |
|
157 UNUSED_PARAM(exec); |
|
158 ProcessingInstruction* imp = static_cast<ProcessingInstruction*>(castedThis->impl()); |
|
159 JSValue result = jsStringOrNull(exec, imp->data()); |
|
160 return result; |
|
161 } |
|
162 |
|
163 JSValue jsProcessingInstructionSheet(ExecState* exec, JSValue slotBase, const Identifier&) |
|
164 { |
|
165 JSProcessingInstruction* castedThis = static_cast<JSProcessingInstruction*>(asObject(slotBase)); |
|
166 UNUSED_PARAM(exec); |
|
167 ProcessingInstruction* imp = static_cast<ProcessingInstruction*>(castedThis->impl()); |
|
168 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->sheet())); |
|
169 return result; |
|
170 } |
|
171 |
|
172 JSValue jsProcessingInstructionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) |
|
173 { |
|
174 JSProcessingInstruction* domObject = static_cast<JSProcessingInstruction*>(asObject(slotBase)); |
|
175 return JSProcessingInstruction::getConstructor(exec, domObject->globalObject()); |
|
176 } |
|
177 void JSProcessingInstruction::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) |
|
178 { |
|
179 lookupPut<JSProcessingInstruction, Base>(exec, propertyName, value, &JSProcessingInstructionTable, this, slot); |
|
180 } |
|
181 |
|
182 void setJSProcessingInstructionData(ExecState* exec, JSObject* thisObject, JSValue value) |
|
183 { |
|
184 JSProcessingInstruction* castedThis = static_cast<JSProcessingInstruction*>(thisObject); |
|
185 ProcessingInstruction* imp = static_cast<ProcessingInstruction*>(castedThis->impl()); |
|
186 ExceptionCode ec = 0; |
|
187 imp->setData(valueToStringWithNullCheck(exec, value), ec); |
|
188 setDOMException(exec, ec); |
|
189 } |
|
190 |
|
191 JSValue JSProcessingInstruction::getConstructor(ExecState* exec, JSGlobalObject* globalObject) |
|
192 { |
|
193 return getDOMConstructor<JSProcessingInstructionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); |
|
194 } |
|
195 |
|
196 |
|
197 } |