|
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 |
|
23 #include "JSHTMLDirectoryElement.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "HTMLDirectoryElement.h" |
|
28 |
|
29 using namespace KJS; |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 /* Hash table */ |
|
34 |
|
35 static const HashEntry JSHTMLDirectoryElementTableEntries[] = |
|
36 { |
|
37 { 0, 0, 0, 0, 0 }, |
|
38 { "compact", JSHTMLDirectoryElement::CompactAttrNum, DontDelete, 0, &JSHTMLDirectoryElementTableEntries[2] }, |
|
39 { "constructor", JSHTMLDirectoryElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
40 }; |
|
41 |
|
42 static const HashTable JSHTMLDirectoryElementTable = |
|
43 { |
|
44 2, 3, JSHTMLDirectoryElementTableEntries, 2 |
|
45 }; |
|
46 |
|
47 /* Hash table for constructor */ |
|
48 |
|
49 static const HashEntry JSHTMLDirectoryElementConstructorTableEntries[] = |
|
50 { |
|
51 { 0, 0, 0, 0, 0 } |
|
52 }; |
|
53 |
|
54 static const HashTable JSHTMLDirectoryElementConstructorTable = |
|
55 { |
|
56 2, 1, JSHTMLDirectoryElementConstructorTableEntries, 1 |
|
57 }; |
|
58 |
|
59 class JSHTMLDirectoryElementConstructor : public DOMObject { |
|
60 public: |
|
61 JSHTMLDirectoryElementConstructor(ExecState* exec) |
|
62 { |
|
63 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
64 putDirect(exec->propertyNames().prototype, JSHTMLDirectoryElementPrototype::self(exec), None); |
|
65 } |
|
66 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); |
|
67 JSValue* getValueProperty(ExecState*, int token) const; |
|
68 virtual const ClassInfo* classInfo() const { return &info; } |
|
69 static const ClassInfo info; |
|
70 |
|
71 virtual bool implementsHasInstance() const { return true; } |
|
72 }; |
|
73 |
|
74 const ClassInfo JSHTMLDirectoryElementConstructor::info = { "HTMLDirectoryElementConstructor", 0, &JSHTMLDirectoryElementConstructorTable, 0 }; |
|
75 |
|
76 bool JSHTMLDirectoryElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
77 { |
|
78 return getStaticValueSlot<JSHTMLDirectoryElementConstructor, DOMObject>(exec, &JSHTMLDirectoryElementConstructorTable, this, propertyName, slot); |
|
79 } |
|
80 |
|
81 JSValue* JSHTMLDirectoryElementConstructor::getValueProperty(ExecState*, int token) const |
|
82 { |
|
83 // The token is the numeric value of its associated constant |
|
84 return jsNumber(token); |
|
85 } |
|
86 |
|
87 /* Hash table for prototype */ |
|
88 |
|
89 static const HashEntry JSHTMLDirectoryElementPrototypeTableEntries[] = |
|
90 { |
|
91 { 0, 0, 0, 0, 0 } |
|
92 }; |
|
93 |
|
94 static const HashTable JSHTMLDirectoryElementPrototypeTable = |
|
95 { |
|
96 2, 1, JSHTMLDirectoryElementPrototypeTableEntries, 1 |
|
97 }; |
|
98 |
|
99 const ClassInfo JSHTMLDirectoryElementPrototype::info = { "HTMLDirectoryElementPrototype", 0, &JSHTMLDirectoryElementPrototypeTable, 0 }; |
|
100 |
|
101 JSObject* JSHTMLDirectoryElementPrototype::self(ExecState* exec) |
|
102 { |
|
103 return KJS::cacheGlobalObject<JSHTMLDirectoryElementPrototype>(exec, "[[JSHTMLDirectoryElement.prototype]]"); |
|
104 } |
|
105 |
|
106 const ClassInfo JSHTMLDirectoryElement::info = { "HTMLDirectoryElement", &JSHTMLElement::info, &JSHTMLDirectoryElementTable, 0 }; |
|
107 |
|
108 JSHTMLDirectoryElement::JSHTMLDirectoryElement(ExecState* exec, HTMLDirectoryElement* impl) |
|
109 : JSHTMLElement(exec, impl) |
|
110 { |
|
111 setPrototype(JSHTMLDirectoryElementPrototype::self(exec)); |
|
112 } |
|
113 |
|
114 bool JSHTMLDirectoryElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
115 { |
|
116 return getStaticValueSlot<JSHTMLDirectoryElement, JSHTMLElement>(exec, &JSHTMLDirectoryElementTable, this, propertyName, slot); |
|
117 } |
|
118 |
|
119 JSValue* JSHTMLDirectoryElement::getValueProperty(ExecState* exec, int token) const |
|
120 { |
|
121 switch (token) { |
|
122 case CompactAttrNum: { |
|
123 HTMLDirectoryElement* imp = static_cast<HTMLDirectoryElement*>(impl()); |
|
124 |
|
125 return jsBoolean(imp->compact()); |
|
126 } |
|
127 case ConstructorAttrNum: |
|
128 return getConstructor(exec); |
|
129 } |
|
130 return 0; |
|
131 } |
|
132 |
|
133 void JSHTMLDirectoryElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
134 { |
|
135 lookupPut<JSHTMLDirectoryElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLDirectoryElementTable, this); |
|
136 } |
|
137 |
|
138 void JSHTMLDirectoryElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
139 { |
|
140 switch (token) { |
|
141 case CompactAttrNum: { |
|
142 HTMLDirectoryElement* imp = static_cast<HTMLDirectoryElement*>(impl()); |
|
143 |
|
144 imp->setCompact(value->toBoolean(exec)); |
|
145 break; |
|
146 } |
|
147 } |
|
148 } |
|
149 |
|
150 JSValue* JSHTMLDirectoryElement::getConstructor(ExecState* exec) |
|
151 { |
|
152 return KJS::cacheGlobalObject<JSHTMLDirectoryElementConstructor>(exec, "[[HTMLDirectoryElement.constructor]]"); |
|
153 } |
|
154 |
|
155 } |