tizen beta release
[profile/ivi/webkit-efl.git] / DerivedSources / WebCore / JSCSSStyleRule.cpp
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 "JSCSSStyleRule.h"
23
24 #include "CSSMutableStyleDeclaration.h"
25 #include "CSSStyleDeclaration.h"
26 #include "CSSStyleRule.h"
27 #include "JSCSSStyleDeclaration.h"
28 #include "KURL.h"
29 #include <wtf/GetPtr.h>
30
31 using namespace JSC;
32
33 namespace WebCore {
34
35 ASSERT_CLASS_FITS_IN_CELL(JSCSSStyleRule);
36
37 /* Hash table */
38 #if ENABLE(JIT)
39 #define THUNK_GENERATOR(generator) , generator
40 #else
41 #define THUNK_GENERATOR(generator)
42 #endif
43 #if ENABLE(DFG_JIT)
44 #define INTRINSIC(intrinsic) , intrinsic
45 #else
46 #define INTRINSIC(intrinsic)
47 #endif
48
49 static const HashTableValue JSCSSStyleRuleTableValues[] =
50 {
51     { "selectorText", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleRuleSelectorText), (intptr_t)setJSCSSStyleRuleSelectorText THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
52     { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleRuleStyle), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
53     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleRuleConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
54     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
55 };
56
57 #undef THUNK_GENERATOR
58 static const HashTable JSCSSStyleRuleTable = { 8, 7, JSCSSStyleRuleTableValues, 0 };
59 /* Hash table for constructor */
60 #if ENABLE(JIT)
61 #define THUNK_GENERATOR(generator) , generator
62 #else
63 #define THUNK_GENERATOR(generator)
64 #endif
65 #if ENABLE(DFG_JIT)
66 #define INTRINSIC(intrinsic) , intrinsic
67 #else
68 #define INTRINSIC(intrinsic)
69 #endif
70
71 static const HashTableValue JSCSSStyleRuleConstructorTableValues[] =
72 {
73     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
74 };
75
76 #undef THUNK_GENERATOR
77 static const HashTable JSCSSStyleRuleConstructorTable = { 1, 0, JSCSSStyleRuleConstructorTableValues, 0 };
78 const ClassInfo JSCSSStyleRuleConstructor::s_info = { "CSSStyleRuleConstructor", &DOMConstructorObject::s_info, &JSCSSStyleRuleConstructorTable, 0, CREATE_METHOD_TABLE(JSCSSStyleRuleConstructor) };
79
80 JSCSSStyleRuleConstructor::JSCSSStyleRuleConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
81     : DOMConstructorObject(structure, globalObject)
82 {
83 }
84
85 void JSCSSStyleRuleConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
86 {
87     Base::finishCreation(exec->globalData());
88     ASSERT(inherits(&s_info));
89     putDirect(exec->globalData(), exec->propertyNames().prototype, JSCSSStyleRulePrototype::self(exec, globalObject), DontDelete | ReadOnly);
90 }
91
92 bool JSCSSStyleRuleConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
93 {
94     return getStaticValueSlot<JSCSSStyleRuleConstructor, JSDOMWrapper>(exec, &JSCSSStyleRuleConstructorTable, static_cast<JSCSSStyleRuleConstructor*>(cell), propertyName, slot);
95 }
96
97 bool JSCSSStyleRuleConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
98 {
99     return getStaticValueDescriptor<JSCSSStyleRuleConstructor, JSDOMWrapper>(exec, &JSCSSStyleRuleConstructorTable, static_cast<JSCSSStyleRuleConstructor*>(object), 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 #if ENABLE(DFG_JIT)
109 #define INTRINSIC(intrinsic) , intrinsic
110 #else
111 #define INTRINSIC(intrinsic)
112 #endif
113
114 static const HashTableValue JSCSSStyleRulePrototypeTableValues[] =
115 {
116     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
117 };
118
119 #undef THUNK_GENERATOR
120 static const HashTable JSCSSStyleRulePrototypeTable = { 1, 0, JSCSSStyleRulePrototypeTableValues, 0 };
121 const ClassInfo JSCSSStyleRulePrototype::s_info = { "CSSStyleRulePrototype", &JSC::JSNonFinalObject::s_info, &JSCSSStyleRulePrototypeTable, 0, CREATE_METHOD_TABLE(JSCSSStyleRulePrototype) };
122
123 JSObject* JSCSSStyleRulePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
124 {
125     return getDOMPrototype<JSCSSStyleRule>(exec, globalObject);
126 }
127
128 const ClassInfo JSCSSStyleRule::s_info = { "CSSStyleRule", &JSCSSRule::s_info, &JSCSSStyleRuleTable, 0 , CREATE_METHOD_TABLE(JSCSSStyleRule) };
129
130 JSCSSStyleRule::JSCSSStyleRule(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<CSSStyleRule> impl)
131     : JSCSSRule(structure, globalObject, impl)
132 {
133 }
134
135 void JSCSSStyleRule::finishCreation(JSGlobalData& globalData)
136 {
137     Base::finishCreation(globalData);
138     ASSERT(inherits(&s_info));
139 }
140
141 JSObject* JSCSSStyleRule::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
142 {
143     return JSCSSStyleRulePrototype::create(exec->globalData(), globalObject, JSCSSStyleRulePrototype::createStructure(exec->globalData(), globalObject, JSCSSRulePrototype::self(exec, globalObject)));
144 }
145
146 bool JSCSSStyleRule::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
147 {
148     JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(cell);
149     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
150     return getStaticValueSlot<JSCSSStyleRule, Base>(exec, &JSCSSStyleRuleTable, thisObject, propertyName, slot);
151 }
152
153 bool JSCSSStyleRule::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
154 {
155     JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(object);
156     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
157     return getStaticValueDescriptor<JSCSSStyleRule, Base>(exec, &JSCSSStyleRuleTable, thisObject, propertyName, descriptor);
158 }
159
160 JSValue jsCSSStyleRuleSelectorText(ExecState* exec, JSValue slotBase, const Identifier&)
161 {
162     JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(asObject(slotBase));
163     UNUSED_PARAM(exec);
164     CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
165     JSValue result = jsStringOrNull(exec, imp->selectorText());
166     return result;
167 }
168
169
170 JSValue jsCSSStyleRuleStyle(ExecState* exec, JSValue slotBase, const Identifier&)
171 {
172     JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(asObject(slotBase));
173     UNUSED_PARAM(exec);
174     CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
175     JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
176     return result;
177 }
178
179
180 JSValue jsCSSStyleRuleConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
181 {
182     JSCSSStyleRule* domObject = static_cast<JSCSSStyleRule*>(asObject(slotBase));
183     return JSCSSStyleRule::getConstructor(exec, domObject->globalObject());
184 }
185
186 void JSCSSStyleRule::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
187 {
188     JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(cell);
189     ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
190     lookupPut<JSCSSStyleRule, Base>(exec, propertyName, value, &JSCSSStyleRuleTable, thisObject, slot);
191 }
192
193 void setJSCSSStyleRuleSelectorText(ExecState* exec, JSObject* thisObject, JSValue value)
194 {
195     JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(thisObject);
196     CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
197     imp->setSelectorText(valueToStringWithNullCheck(exec, value));
198 }
199
200
201 JSValue JSCSSStyleRule::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
202 {
203     return getDOMConstructor<JSCSSStyleRuleConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
204 }
205
206
207 }