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