|
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 "JSHTMLFrameSetElement.h" |
|
24 |
|
25 #include <wtf/GetPtr.h> |
|
26 |
|
27 #include "AtomicString.h" |
|
28 #include "HTMLFrameSetElement.h" |
|
29 #include "PlatformString.h" |
|
30 |
|
31 using namespace KJS; |
|
32 |
|
33 namespace WebCore { |
|
34 |
|
35 /* Hash table */ |
|
36 |
|
37 static const HashEntry JSHTMLFrameSetElementTableEntries[] = |
|
38 { |
|
39 { "cols", JSHTMLFrameSetElement::ColsAttrNum, DontDelete, 0, &JSHTMLFrameSetElementTableEntries[3] }, |
|
40 { "rows", JSHTMLFrameSetElement::RowsAttrNum, DontDelete, 0, 0 }, |
|
41 { 0, 0, 0, 0, 0 }, |
|
42 { "constructor", JSHTMLFrameSetElement::ConstructorAttrNum, DontDelete|DontEnum|ReadOnly, 0, 0 } |
|
43 }; |
|
44 |
|
45 static const HashTable JSHTMLFrameSetElementTable = |
|
46 { |
|
47 2, 4, JSHTMLFrameSetElementTableEntries, 3 |
|
48 }; |
|
49 |
|
50 /* Hash table for constructor */ |
|
51 |
|
52 static const HashEntry JSHTMLFrameSetElementConstructorTableEntries[] = |
|
53 { |
|
54 { 0, 0, 0, 0, 0 } |
|
55 }; |
|
56 |
|
57 static const HashTable JSHTMLFrameSetElementConstructorTable = |
|
58 { |
|
59 2, 1, JSHTMLFrameSetElementConstructorTableEntries, 1 |
|
60 }; |
|
61 |
|
62 class JSHTMLFrameSetElementConstructor : public DOMObject { |
|
63 public: |
|
64 JSHTMLFrameSetElementConstructor(ExecState* exec) |
|
65 { |
|
66 setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype()); |
|
67 putDirect(exec->propertyNames().prototype, JSHTMLFrameSetElementPrototype::self(exec), None); |
|
68 } |
|
69 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); |
|
70 JSValue* getValueProperty(ExecState*, int token) const; |
|
71 virtual const ClassInfo* classInfo() const { return &info; } |
|
72 static const ClassInfo info; |
|
73 |
|
74 virtual bool implementsHasInstance() const { return true; } |
|
75 }; |
|
76 |
|
77 const ClassInfo JSHTMLFrameSetElementConstructor::info = { "HTMLFrameSetElementConstructor", 0, &JSHTMLFrameSetElementConstructorTable, 0 }; |
|
78 |
|
79 bool JSHTMLFrameSetElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
80 { |
|
81 return getStaticValueSlot<JSHTMLFrameSetElementConstructor, DOMObject>(exec, &JSHTMLFrameSetElementConstructorTable, this, propertyName, slot); |
|
82 } |
|
83 |
|
84 JSValue* JSHTMLFrameSetElementConstructor::getValueProperty(ExecState*, int token) const |
|
85 { |
|
86 // The token is the numeric value of its associated constant |
|
87 return jsNumber(token); |
|
88 } |
|
89 |
|
90 /* Hash table for prototype */ |
|
91 |
|
92 static const HashEntry JSHTMLFrameSetElementPrototypeTableEntries[] = |
|
93 { |
|
94 { 0, 0, 0, 0, 0 } |
|
95 }; |
|
96 |
|
97 static const HashTable JSHTMLFrameSetElementPrototypeTable = |
|
98 { |
|
99 2, 1, JSHTMLFrameSetElementPrototypeTableEntries, 1 |
|
100 }; |
|
101 |
|
102 const ClassInfo JSHTMLFrameSetElementPrototype::info = { "HTMLFrameSetElementPrototype", 0, &JSHTMLFrameSetElementPrototypeTable, 0 }; |
|
103 |
|
104 JSObject* JSHTMLFrameSetElementPrototype::self(ExecState* exec) |
|
105 { |
|
106 return KJS::cacheGlobalObject<JSHTMLFrameSetElementPrototype>(exec, "[[JSHTMLFrameSetElement.prototype]]"); |
|
107 } |
|
108 |
|
109 const ClassInfo JSHTMLFrameSetElement::info = { "HTMLFrameSetElement", &JSHTMLElement::info, &JSHTMLFrameSetElementTable, 0 }; |
|
110 |
|
111 JSHTMLFrameSetElement::JSHTMLFrameSetElement(ExecState* exec, HTMLFrameSetElement* impl) |
|
112 : JSHTMLElement(exec, impl) |
|
113 { |
|
114 setPrototype(JSHTMLFrameSetElementPrototype::self(exec)); |
|
115 } |
|
116 |
|
117 bool JSHTMLFrameSetElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) |
|
118 { |
|
119 if (canGetItemsForName(exec, static_cast<HTMLFrameSetElement*>(impl()), propertyName)) { |
|
120 slot.setCustom(this, nameGetter); |
|
121 return true; |
|
122 } |
|
123 return getStaticValueSlot<JSHTMLFrameSetElement, JSHTMLElement>(exec, &JSHTMLFrameSetElementTable, this, propertyName, slot); |
|
124 } |
|
125 |
|
126 JSValue* JSHTMLFrameSetElement::getValueProperty(ExecState* exec, int token) const |
|
127 { |
|
128 switch (token) { |
|
129 case ColsAttrNum: { |
|
130 HTMLFrameSetElement* imp = static_cast<HTMLFrameSetElement*>(impl()); |
|
131 |
|
132 return jsString(imp->cols()); |
|
133 } |
|
134 case RowsAttrNum: { |
|
135 HTMLFrameSetElement* imp = static_cast<HTMLFrameSetElement*>(impl()); |
|
136 |
|
137 return jsString(imp->rows()); |
|
138 } |
|
139 case ConstructorAttrNum: |
|
140 return getConstructor(exec); |
|
141 } |
|
142 return 0; |
|
143 } |
|
144 |
|
145 void JSHTMLFrameSetElement::put(ExecState* exec, const Identifier& propertyName, JSValue* value, int attr) |
|
146 { |
|
147 lookupPut<JSHTMLFrameSetElement, JSHTMLElement>(exec, propertyName, value, attr, &JSHTMLFrameSetElementTable, this); |
|
148 } |
|
149 |
|
150 void JSHTMLFrameSetElement::putValueProperty(ExecState* exec, int token, JSValue* value, int /*attr*/) |
|
151 { |
|
152 switch (token) { |
|
153 case ColsAttrNum: { |
|
154 HTMLFrameSetElement* imp = static_cast<HTMLFrameSetElement*>(impl()); |
|
155 |
|
156 imp->setCols(valueToStringWithNullCheck(exec, value)); |
|
157 break; |
|
158 } |
|
159 case RowsAttrNum: { |
|
160 HTMLFrameSetElement* imp = static_cast<HTMLFrameSetElement*>(impl()); |
|
161 |
|
162 imp->setRows(valueToStringWithNullCheck(exec, value)); |
|
163 break; |
|
164 } |
|
165 } |
|
166 } |
|
167 |
|
168 JSValue* JSHTMLFrameSetElement::getConstructor(ExecState* exec) |
|
169 { |
|
170 return KJS::cacheGlobalObject<JSHTMLFrameSetElementConstructor>(exec, "[[HTMLFrameSetElement.constructor]]"); |
|
171 } |
|
172 |
|
173 } |