2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
22 #include "JSCSSStyleRule.h"
24 #include "CSSMutableStyleDeclaration.h"
25 #include "CSSStyleDeclaration.h"
26 #include "CSSStyleRule.h"
27 #include "JSCSSStyleDeclaration.h"
29 #include <wtf/GetPtr.h>
35 ASSERT_CLASS_FITS_IN_CELL(JSCSSStyleRule);
39 #define THUNK_GENERATOR(generator) , generator
41 #define THUNK_GENERATOR(generator)
44 #define INTRINSIC(intrinsic) , intrinsic
46 #define INTRINSIC(intrinsic)
49 static const HashTableValue JSCSSStyleRuleTableValues[] =
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) }
57 #undef THUNK_GENERATOR
58 static const HashTable JSCSSStyleRuleTable = { 8, 7, JSCSSStyleRuleTableValues, 0 };
59 /* Hash table for constructor */
61 #define THUNK_GENERATOR(generator) , generator
63 #define THUNK_GENERATOR(generator)
66 #define INTRINSIC(intrinsic) , intrinsic
68 #define INTRINSIC(intrinsic)
71 static const HashTableValue JSCSSStyleRuleConstructorTableValues[] =
73 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
80 JSCSSStyleRuleConstructor::JSCSSStyleRuleConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
81 : DOMConstructorObject(structure, globalObject)
85 void JSCSSStyleRuleConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
87 Base::finishCreation(exec->globalData());
88 ASSERT(inherits(&s_info));
89 putDirect(exec->globalData(), exec->propertyNames().prototype, JSCSSStyleRulePrototype::self(exec, globalObject), DontDelete | ReadOnly);
92 bool JSCSSStyleRuleConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
94 return getStaticValueSlot<JSCSSStyleRuleConstructor, JSDOMWrapper>(exec, &JSCSSStyleRuleConstructorTable, static_cast<JSCSSStyleRuleConstructor*>(cell), propertyName, slot);
97 bool JSCSSStyleRuleConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
99 return getStaticValueDescriptor<JSCSSStyleRuleConstructor, JSDOMWrapper>(exec, &JSCSSStyleRuleConstructorTable, static_cast<JSCSSStyleRuleConstructor*>(object), propertyName, descriptor);
102 /* Hash table for prototype */
104 #define THUNK_GENERATOR(generator) , generator
106 #define THUNK_GENERATOR(generator)
109 #define INTRINSIC(intrinsic) , intrinsic
111 #define INTRINSIC(intrinsic)
114 static const HashTableValue JSCSSStyleRulePrototypeTableValues[] =
116 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
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) };
123 JSObject* JSCSSStyleRulePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
125 return getDOMPrototype<JSCSSStyleRule>(exec, globalObject);
128 const ClassInfo JSCSSStyleRule::s_info = { "CSSStyleRule", &JSCSSRule::s_info, &JSCSSStyleRuleTable, 0 , CREATE_METHOD_TABLE(JSCSSStyleRule) };
130 JSCSSStyleRule::JSCSSStyleRule(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<CSSStyleRule> impl)
131 : JSCSSRule(structure, globalObject, impl)
135 void JSCSSStyleRule::finishCreation(JSGlobalData& globalData)
137 Base::finishCreation(globalData);
138 ASSERT(inherits(&s_info));
141 JSObject* JSCSSStyleRule::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
143 return JSCSSStyleRulePrototype::create(exec->globalData(), globalObject, JSCSSStyleRulePrototype::createStructure(exec->globalData(), globalObject, JSCSSRulePrototype::self(exec, globalObject)));
146 bool JSCSSStyleRule::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
148 JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(cell);
149 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
150 return getStaticValueSlot<JSCSSStyleRule, Base>(exec, &JSCSSStyleRuleTable, thisObject, propertyName, slot);
153 bool JSCSSStyleRule::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
155 JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(object);
156 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
157 return getStaticValueDescriptor<JSCSSStyleRule, Base>(exec, &JSCSSStyleRuleTable, thisObject, propertyName, descriptor);
160 JSValue jsCSSStyleRuleSelectorText(ExecState* exec, JSValue slotBase, const Identifier&)
162 JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(asObject(slotBase));
164 CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
165 JSValue result = jsStringOrNull(exec, imp->selectorText());
170 JSValue jsCSSStyleRuleStyle(ExecState* exec, JSValue slotBase, const Identifier&)
172 JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(asObject(slotBase));
174 CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
175 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style()));
180 JSValue jsCSSStyleRuleConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
182 JSCSSStyleRule* domObject = static_cast<JSCSSStyleRule*>(asObject(slotBase));
183 return JSCSSStyleRule::getConstructor(exec, domObject->globalObject());
186 void JSCSSStyleRule::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
188 JSCSSStyleRule* thisObject = jsCast<JSCSSStyleRule*>(cell);
189 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
190 lookupPut<JSCSSStyleRule, Base>(exec, propertyName, value, &JSCSSStyleRuleTable, thisObject, slot);
193 void setJSCSSStyleRuleSelectorText(ExecState* exec, JSObject* thisObject, JSValue value)
195 JSCSSStyleRule* castedThis = static_cast<JSCSSStyleRule*>(thisObject);
196 CSSStyleRule* imp = static_cast<CSSStyleRule*>(castedThis->impl());
197 imp->setSelectorText(valueToStringWithNullCheck(exec, value));
201 JSValue JSCSSStyleRule::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
203 return getDOMConstructor<JSCSSStyleRuleConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));