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 "JSCSSStyleDeclaration.h"
25 #include "CSSStyleDeclaration.h"
27 #include "ExceptionCode.h"
28 #include "JSCSSRule.h"
29 #include "JSCSSStyleDeclarationCustom.h"
30 #include "JSDOMBinding.h"
32 #include "wtf/text/AtomicString.h"
33 #include <runtime/Error.h>
34 #include <runtime/JSString.h>
35 #include <runtime/PropertyNameArray.h>
36 #include <wtf/GetPtr.h>
42 ASSERT_CLASS_FITS_IN_CELL(JSCSSStyleDeclaration);
46 #define THUNK_GENERATOR(generator) , generator
48 #define THUNK_GENERATOR(generator)
51 #define INTRINSIC(intrinsic) , intrinsic
53 #define INTRINSIC(intrinsic)
56 static const HashTableValue JSCSSStyleDeclarationTableValues[] =
58 { "cssText", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleDeclarationCssText), (intptr_t)setJSCSSStyleDeclarationCssText THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
59 { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleDeclarationLength), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
60 { "parentRule", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleDeclarationParentRule), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
61 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSStyleDeclarationConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
62 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
65 #undef THUNK_GENERATOR
66 static const HashTable JSCSSStyleDeclarationTable = { 10, 7, JSCSSStyleDeclarationTableValues, 0 };
67 /* Hash table for constructor */
69 #define THUNK_GENERATOR(generator) , generator
71 #define THUNK_GENERATOR(generator)
74 #define INTRINSIC(intrinsic) , intrinsic
76 #define INTRINSIC(intrinsic)
79 static const HashTableValue JSCSSStyleDeclarationConstructorTableValues[] =
81 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
84 #undef THUNK_GENERATOR
85 static const HashTable JSCSSStyleDeclarationConstructorTable = { 1, 0, JSCSSStyleDeclarationConstructorTableValues, 0 };
86 const ClassInfo JSCSSStyleDeclarationConstructor::s_info = { "CSSStyleDeclarationConstructor", &DOMConstructorObject::s_info, &JSCSSStyleDeclarationConstructorTable, 0, CREATE_METHOD_TABLE(JSCSSStyleDeclarationConstructor) };
88 JSCSSStyleDeclarationConstructor::JSCSSStyleDeclarationConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
89 : DOMConstructorObject(structure, globalObject)
93 void JSCSSStyleDeclarationConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
95 Base::finishCreation(exec->globalData());
96 ASSERT(inherits(&s_info));
97 putDirect(exec->globalData(), exec->propertyNames().prototype, JSCSSStyleDeclarationPrototype::self(exec, globalObject), DontDelete | ReadOnly);
100 bool JSCSSStyleDeclarationConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
102 return getStaticValueSlot<JSCSSStyleDeclarationConstructor, JSDOMWrapper>(exec, &JSCSSStyleDeclarationConstructorTable, static_cast<JSCSSStyleDeclarationConstructor*>(cell), propertyName, slot);
105 bool JSCSSStyleDeclarationConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
107 return getStaticValueDescriptor<JSCSSStyleDeclarationConstructor, JSDOMWrapper>(exec, &JSCSSStyleDeclarationConstructorTable, static_cast<JSCSSStyleDeclarationConstructor*>(object), propertyName, descriptor);
110 /* Hash table for prototype */
112 #define THUNK_GENERATOR(generator) , generator
114 #define THUNK_GENERATOR(generator)
117 #define INTRINSIC(intrinsic) , intrinsic
119 #define INTRINSIC(intrinsic)
122 static const HashTableValue JSCSSStyleDeclarationPrototypeTableValues[] =
124 { "getPropertyValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionGetPropertyValue), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
125 { "getPropertyCSSValue", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionGetPropertyCSSValue), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
126 { "removeProperty", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionRemoveProperty), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
127 { "getPropertyPriority", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionGetPropertyPriority), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
128 { "setProperty", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionSetProperty), (intptr_t)3 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
129 { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
130 { "getPropertyShorthand", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionGetPropertyShorthand), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
131 { "isPropertyImplicit", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCSSStyleDeclarationPrototypeFunctionIsPropertyImplicit), (intptr_t)1 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
132 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
135 #undef THUNK_GENERATOR
136 static const HashTable JSCSSStyleDeclarationPrototypeTable = { 17, 15, JSCSSStyleDeclarationPrototypeTableValues, 0 };
137 const ClassInfo JSCSSStyleDeclarationPrototype::s_info = { "CSSStyleDeclarationPrototype", &JSC::JSNonFinalObject::s_info, &JSCSSStyleDeclarationPrototypeTable, 0, CREATE_METHOD_TABLE(JSCSSStyleDeclarationPrototype) };
139 JSObject* JSCSSStyleDeclarationPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
141 return getDOMPrototype<JSCSSStyleDeclaration>(exec, globalObject);
144 bool JSCSSStyleDeclarationPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
146 JSCSSStyleDeclarationPrototype* thisObject = jsCast<JSCSSStyleDeclarationPrototype*>(cell);
147 return getStaticFunctionSlot<JSObject>(exec, &JSCSSStyleDeclarationPrototypeTable, thisObject, propertyName, slot);
150 bool JSCSSStyleDeclarationPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
152 JSCSSStyleDeclarationPrototype* thisObject = jsCast<JSCSSStyleDeclarationPrototype*>(object);
153 return getStaticFunctionDescriptor<JSObject>(exec, &JSCSSStyleDeclarationPrototypeTable, thisObject, propertyName, descriptor);
156 const ClassInfo JSCSSStyleDeclaration::s_info = { "CSSStyleDeclaration", &JSDOMWrapper::s_info, &JSCSSStyleDeclarationTable, 0 , CREATE_METHOD_TABLE(JSCSSStyleDeclaration) };
158 JSCSSStyleDeclaration::JSCSSStyleDeclaration(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<CSSStyleDeclaration> impl)
159 : JSDOMWrapper(structure, globalObject)
160 , m_impl(impl.leakRef())
164 void JSCSSStyleDeclaration::finishCreation(JSGlobalData& globalData)
166 Base::finishCreation(globalData);
167 ASSERT(inherits(&s_info));
170 JSObject* JSCSSStyleDeclaration::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
172 return JSCSSStyleDeclarationPrototype::create(exec->globalData(), globalObject, JSCSSStyleDeclarationPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
175 bool JSCSSStyleDeclaration::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
177 JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(cell);
178 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
179 const HashEntry* entry = JSCSSStyleDeclarationTable.entry(exec, propertyName);
181 slot.setCustom(thisObject, entry->propertyGetter());
185 unsigned index = propertyName.toUInt32(ok);
187 slot.setCustomIndex(thisObject, index, indexGetter);
190 if (canGetItemsForName(exec, static_cast<CSSStyleDeclaration*>(thisObject->impl()), propertyName)) {
191 slot.setCustom(thisObject, thisObject->nameGetter);
194 return getStaticValueSlot<JSCSSStyleDeclaration, Base>(exec, &JSCSSStyleDeclarationTable, thisObject, propertyName, slot);
197 bool JSCSSStyleDeclaration::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
199 JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(object);
200 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
201 const HashEntry* entry = JSCSSStyleDeclarationTable.entry(exec, propertyName);
204 slot.setCustom(thisObject, entry->propertyGetter());
205 descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
209 unsigned index = propertyName.toUInt32(ok);
210 if (ok && index < static_cast<CSSStyleDeclaration*>(thisObject->impl())->length()) {
212 slot.setCustomIndex(thisObject, index, indexGetter);
213 descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly);
216 if (canGetItemsForName(exec, static_cast<CSSStyleDeclaration*>(thisObject->impl()), propertyName)) {
218 slot.setCustom(thisObject, nameGetter);
219 descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
222 return getStaticValueDescriptor<JSCSSStyleDeclaration, Base>(exec, &JSCSSStyleDeclarationTable, thisObject, propertyName, descriptor);
225 bool JSCSSStyleDeclaration::getOwnPropertySlotByIndex(JSCell* cell, ExecState* exec, unsigned propertyName, PropertySlot& slot)
227 JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(cell);
228 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
229 if (propertyName < static_cast<CSSStyleDeclaration*>(thisObject->impl())->length()) {
230 slot.setCustomIndex(thisObject, propertyName, thisObject->indexGetter);
233 return thisObject->methodTable()->getOwnPropertySlot(thisObject, exec, Identifier::from(exec, propertyName), slot);
236 JSValue jsCSSStyleDeclarationCssText(ExecState* exec, JSValue slotBase, const Identifier&)
238 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
240 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
241 JSValue result = jsStringOrNull(exec, imp->cssText());
246 JSValue jsCSSStyleDeclarationLength(ExecState* exec, JSValue slotBase, const Identifier&)
248 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
250 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
251 JSValue result = jsNumber(imp->length());
256 JSValue jsCSSStyleDeclarationParentRule(ExecState* exec, JSValue slotBase, const Identifier&)
258 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
260 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
261 JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->parentRule()));
266 JSValue jsCSSStyleDeclarationConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
268 JSCSSStyleDeclaration* domObject = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
269 return JSCSSStyleDeclaration::getConstructor(exec, domObject->globalObject());
272 void JSCSSStyleDeclaration::put(JSCell* cell, ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
274 JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(cell);
275 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
276 if (thisObject->putDelegate(exec, propertyName, value, slot))
278 lookupPut<JSCSSStyleDeclaration, Base>(exec, propertyName, value, &JSCSSStyleDeclarationTable, thisObject, slot);
281 void setJSCSSStyleDeclarationCssText(ExecState* exec, JSObject* thisObject, JSValue value)
283 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(thisObject);
284 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
285 ExceptionCode ec = 0;
286 imp->setCssText(valueToStringWithNullCheck(exec, value), ec);
287 setDOMException(exec, ec);
291 void JSCSSStyleDeclaration::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
293 JSCSSStyleDeclaration* thisObject = jsCast<JSCSSStyleDeclaration*>(object);
294 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
295 for (unsigned i = 0; i < static_cast<CSSStyleDeclaration*>(thisObject->impl())->length(); ++i)
296 propertyNames.add(Identifier::from(exec, i));
297 Base::getOwnPropertyNames(thisObject, exec, propertyNames, mode);
300 JSValue JSCSSStyleDeclaration::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
302 return getDOMConstructor<JSCSSStyleDeclarationConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
305 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionGetPropertyValue(ExecState* exec)
307 JSValue thisValue = exec->hostThisValue();
308 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
309 return throwVMTypeError(exec);
310 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
311 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
312 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
313 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
314 if (exec->hadException())
315 return JSValue::encode(jsUndefined());
317 JSC::JSValue result = jsStringOrNull(exec, imp->getPropertyValue(propertyName));
318 return JSValue::encode(result);
321 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionGetPropertyCSSValue(ExecState* exec)
323 JSValue thisValue = exec->hostThisValue();
324 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
325 return throwVMTypeError(exec);
326 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
327 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
328 return JSValue::encode(castedThis->getPropertyCSSValue(exec));
331 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionRemoveProperty(ExecState* exec)
333 JSValue thisValue = exec->hostThisValue();
334 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
335 return throwVMTypeError(exec);
336 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
337 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
338 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
339 ExceptionCode ec = 0;
340 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
341 if (exec->hadException())
342 return JSValue::encode(jsUndefined());
344 JSC::JSValue result = jsStringOrNull(exec, imp->removeProperty(propertyName, ec));
345 setDOMException(exec, ec);
346 return JSValue::encode(result);
349 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionGetPropertyPriority(ExecState* exec)
351 JSValue thisValue = exec->hostThisValue();
352 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
353 return throwVMTypeError(exec);
354 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
355 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
356 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
357 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
358 if (exec->hadException())
359 return JSValue::encode(jsUndefined());
361 JSC::JSValue result = jsStringOrNull(exec, imp->getPropertyPriority(propertyName));
362 return JSValue::encode(result);
365 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionSetProperty(ExecState* exec)
367 JSValue thisValue = exec->hostThisValue();
368 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
369 return throwVMTypeError(exec);
370 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
371 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
372 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
373 ExceptionCode ec = 0;
374 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
375 if (exec->hadException())
376 return JSValue::encode(jsUndefined());
377 const String& value(valueToStringWithNullCheck(exec, MAYBE_MISSING_PARAMETER(exec, 1, MissingIsUndefined)));
378 if (exec->hadException())
379 return JSValue::encode(jsUndefined());
380 const String& priority(ustringToString(MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 2, MissingIsUndefined).toString(exec)));
381 if (exec->hadException())
382 return JSValue::encode(jsUndefined());
383 imp->setProperty(propertyName, value, priority, ec);
384 setDOMException(exec, ec);
385 return JSValue::encode(jsUndefined());
388 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionItem(ExecState* exec)
390 JSValue thisValue = exec->hostThisValue();
391 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
392 return throwVMTypeError(exec);
393 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
394 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
395 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
396 unsigned index(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toUInt32(exec));
397 if (exec->hadException())
398 return JSValue::encode(jsUndefined());
400 JSC::JSValue result = jsString(exec, imp->item(index));
401 return JSValue::encode(result);
404 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionGetPropertyShorthand(ExecState* exec)
406 JSValue thisValue = exec->hostThisValue();
407 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
408 return throwVMTypeError(exec);
409 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
410 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
411 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
412 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
413 if (exec->hadException())
414 return JSValue::encode(jsUndefined());
416 JSC::JSValue result = jsStringOrNull(exec, imp->getPropertyShorthand(propertyName));
417 return JSValue::encode(result);
420 EncodedJSValue JSC_HOST_CALL jsCSSStyleDeclarationPrototypeFunctionIsPropertyImplicit(ExecState* exec)
422 JSValue thisValue = exec->hostThisValue();
423 if (!thisValue.inherits(&JSCSSStyleDeclaration::s_info))
424 return throwVMTypeError(exec);
425 JSCSSStyleDeclaration* castedThis = static_cast<JSCSSStyleDeclaration*>(asObject(thisValue));
426 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSCSSStyleDeclaration::s_info);
427 CSSStyleDeclaration* imp = static_cast<CSSStyleDeclaration*>(castedThis->impl());
428 const String& propertyName(ustringToString(MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).isEmpty() ? UString() : MAYBE_MISSING_PARAMETER(exec, 0, MissingIsUndefined).toString(exec)));
429 if (exec->hadException())
430 return JSValue::encode(jsUndefined());
432 JSC::JSValue result = jsBoolean(imp->isPropertyImplicit(propertyName));
433 return JSValue::encode(result);
437 JSValue JSCSSStyleDeclaration::indexGetter(ExecState* exec, JSValue slotBase, unsigned index)
439 JSCSSStyleDeclaration* thisObj = static_cast<JSCSSStyleDeclaration*>(asObject(slotBase));
440 ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info);
441 return jsStringOrNull(exec, thisObj->impl()->item(index));
444 static inline bool isObservable(JSCSSStyleDeclaration* jsCSSStyleDeclaration)
446 if (jsCSSStyleDeclaration->hasCustomProperties())
451 bool JSCSSStyleDeclarationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
453 JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());
454 if (!isObservable(jsCSSStyleDeclaration))
456 void* root = WebCore::root(jsCSSStyleDeclaration->impl());
457 return visitor.containsOpaqueRoot(root);
460 void JSCSSStyleDeclarationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
462 JSCSSStyleDeclaration* jsCSSStyleDeclaration = static_cast<JSCSSStyleDeclaration*>(handle.get().asCell());
463 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
464 uncacheWrapper(world, jsCSSStyleDeclaration->impl(), jsCSSStyleDeclaration);
465 jsCSSStyleDeclaration->releaseImpl();
468 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, CSSStyleDeclaration* impl)
470 return wrap<JSCSSStyleDeclaration>(exec, globalObject, impl);
473 CSSStyleDeclaration* toCSSStyleDeclaration(JSC::JSValue value)
475 return value.inherits(&JSCSSStyleDeclaration::s_info) ? static_cast<JSCSSStyleDeclaration*>(asObject(value))->impl() : 0;