namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSNodeIterator); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNodeIteratorTableValues[] = { { "root", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorRoot), (intptr_t)0 THUNK_GENERATOR(0) }, { "whatToShow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorWhatToShow), (intptr_t)0 THUNK_GENERATOR(0) }, { "filter", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorFilter), (intptr_t)0 THUNK_GENERATOR(0) }, { "expandEntityReferences", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorExpandEntityReferences), (intptr_t)0 THUNK_GENERATOR(0) }, { "referenceNode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorReferenceNode), (intptr_t)0 THUNK_GENERATOR(0) }, { "pointerBeforeReferenceNode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorPointerBeforeReferenceNode), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNodeIteratorConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNodeIteratorTable = { 18, 15, JSNodeIteratorTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNodeIteratorConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNodeIteratorConstructorTable = { 1, 0, JSNodeIteratorConstructorTableValues, 0 }; class JSNodeIteratorConstructor : public DOMConstructorObject { private: JSNodeIteratorConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSNodeIteratorConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSNodeIteratorConstructor* ptr = new (JSC::allocateCell<JSNodeIteratorConstructor>(*exec->heap())) JSNodeIteratorConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSNodeIteratorConstructor::s_info = { "NodeIteratorConstructor", &DOMConstructorObject::s_info, &JSNodeIteratorConstructorTable, 0 }; JSNodeIteratorConstructor::JSNodeIteratorConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSNodeIteratorConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSNodeIteratorPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSNodeIteratorConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSNodeIteratorConstructor, JSDOMWrapper>(exec, &JSNodeIteratorConstructorTable, this, propertyName, slot); } bool JSNodeIteratorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSNodeIteratorConstructor, JSDOMWrapper>(exec, &JSNodeIteratorConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNodeIteratorPrototypeTableValues[] = { { "nextNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNodeIteratorPrototypeFunctionNextNode), (intptr_t)0 THUNK_GENERATOR(0) }, { "previousNode", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNodeIteratorPrototypeFunctionPreviousNode), (intptr_t)0 THUNK_GENERATOR(0) }, { "detach", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNodeIteratorPrototypeFunctionDetach), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNodeIteratorPrototypeTable = { 8, 7, JSNodeIteratorPrototypeTableValues, 0 }; const ClassInfo JSNodeIteratorPrototype::s_info = { "NodeIteratorPrototype", &JSC::JSNonFinalObject::s_info, &JSNodeIteratorPrototypeTable, 0 }; JSObject* JSNodeIteratorPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSNodeIterator>(exec, globalObject); } bool JSNodeIteratorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSNodeIteratorPrototypeTable, this, propertyName, slot); } bool JSNodeIteratorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSNodeIteratorPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSNodeIterator::s_info = { "NodeIterator", &JSDOMWrapper::s_info, &JSNodeIteratorTable, 0 }; JSNodeIterator::JSNodeIterator(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<NodeIterator> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSNodeIterator::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSNodeIterator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSNodeIteratorPrototype::create(exec->globalData(), globalObject, JSNodeIteratorPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSNodeIterator::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSNodeIterator, Base>(exec, &JSNodeIteratorTable, this, propertyName, slot); } bool JSNodeIterator::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSNodeIterator, Base>(exec, &JSNodeIteratorTable, this, propertyName, descriptor); } JSValue jsNodeIteratorRoot(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->root())); return result; } JSValue jsNodeIteratorWhatToShow(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = jsNumber(imp->whatToShow()); return result; } JSValue jsNodeIteratorFilter(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->filter())); return result; } JSValue jsNodeIteratorExpandEntityReferences(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = jsBoolean(imp->expandEntityReferences()); return result; } JSValue jsNodeIteratorReferenceNode(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->referenceNode())); return result; } JSValue jsNodeIteratorPointerBeforeReferenceNode(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(slotBase)); UNUSED_PARAM(exec); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); JSValue result = jsBoolean(imp->pointerBeforeReferenceNode()); return result; } JSValue jsNodeIteratorConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSNodeIterator* domObject = static_cast<JSNodeIterator*>(asObject(slotBase)); return JSNodeIterator::getConstructor(exec, domObject->globalObject()); } JSValue JSNodeIterator::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSNodeIteratorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsNodeIteratorPrototypeFunctionNextNode(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNodeIterator::s_info)) return throwVMTypeError(exec); JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNodeIterator::s_info); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); ExceptionCode ec = 0; JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->nextNode(exec, ec))); setDOMException(exec, ec); if (exec->hadException()) return JSValue::encode(jsUndefined()); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNodeIteratorPrototypeFunctionPreviousNode(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNodeIterator::s_info)) return throwVMTypeError(exec); JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNodeIterator::s_info); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); ExceptionCode ec = 0; JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->previousNode(exec, ec))); setDOMException(exec, ec); if (exec->hadException()) return JSValue::encode(jsUndefined()); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNodeIteratorPrototypeFunctionDetach(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNodeIterator::s_info)) return throwVMTypeError(exec); JSNodeIterator* castedThis = static_cast<JSNodeIterator*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNodeIterator::s_info); NodeIterator* imp = static_cast<NodeIterator*>(castedThis->impl()); imp->detach(); return JSValue::encode(jsUndefined()); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NodeIterator* impl) { return wrap<JSNodeIterator>(exec, globalObject, impl); } NodeIterator* toNodeIterator(JSC::JSValue value) { return value.inherits(&JSNodeIterator::s_info) ? static_cast<JSNodeIterator*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLFrameElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLFrameElementTableValues[] = { { "frameBorder", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementFrameBorder), (intptr_t)setJSHTMLFrameElementFrameBorder THUNK_GENERATOR(0) }, { "longDesc", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementLongDesc), (intptr_t)setJSHTMLFrameElementLongDesc THUNK_GENERATOR(0) }, { "marginHeight", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementMarginHeight), (intptr_t)setJSHTMLFrameElementMarginHeight THUNK_GENERATOR(0) }, { "marginWidth", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementMarginWidth), (intptr_t)setJSHTMLFrameElementMarginWidth THUNK_GENERATOR(0) }, { "name", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementName), (intptr_t)setJSHTMLFrameElementName THUNK_GENERATOR(0) }, { "noResize", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementNoResize), (intptr_t)setJSHTMLFrameElementNoResize THUNK_GENERATOR(0) }, { "scrolling", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementScrolling), (intptr_t)setJSHTMLFrameElementScrolling THUNK_GENERATOR(0) }, { "src", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementSrc), (intptr_t)setJSHTMLFrameElementSrc THUNK_GENERATOR(0) }, { "contentDocument", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementContentDocument), (intptr_t)0 THUNK_GENERATOR(0) }, { "contentWindow", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementContentWindow), (intptr_t)0 THUNK_GENERATOR(0) }, { "location", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementLocation), (intptr_t)setJSHTMLFrameElementLocation THUNK_GENERATOR(0) }, { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementWidth), (intptr_t)0 THUNK_GENERATOR(0) }, { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementHeight), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLFrameElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLFrameElementTable = { 36, 31, JSHTMLFrameElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLFrameElementConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLFrameElementConstructorTable = { 1, 0, JSHTMLFrameElementConstructorTableValues, 0 }; class JSHTMLFrameElementConstructor : public DOMConstructorObject { private: JSHTMLFrameElementConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSHTMLFrameElementConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSHTMLFrameElementConstructor* ptr = new (JSC::allocateCell<JSHTMLFrameElementConstructor>(*exec->heap())) JSHTMLFrameElementConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLFrameElementConstructor::s_info = { "HTMLFrameElementConstructor", &DOMConstructorObject::s_info, &JSHTMLFrameElementConstructorTable, 0 }; JSHTMLFrameElementConstructor::JSHTMLFrameElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSHTMLFrameElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLFrameElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLFrameElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLFrameElementConstructor, JSDOMWrapper>(exec, &JSHTMLFrameElementConstructorTable, this, propertyName, slot); } bool JSHTMLFrameElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLFrameElementConstructor, JSDOMWrapper>(exec, &JSHTMLFrameElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLFrameElementPrototypeTableValues[] = { #if ENABLE(SVG) { "getSVGDocument", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLFrameElementPrototypeFunctionGetSVGDocument), (intptr_t)0 THUNK_GENERATOR(0) }, #endif { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLFrameElementPrototypeTable = { 2, 1, JSHTMLFrameElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLFrameElementPrototype::s_info = { "HTMLFrameElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLFrameElementPrototypeTable, 0 }; JSObject* JSHTMLFrameElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLFrameElement>(exec, globalObject); } bool JSHTMLFrameElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSHTMLFrameElementPrototypeTable, this, propertyName, slot); } bool JSHTMLFrameElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLFrameElementPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSHTMLFrameElement::s_info = { "HTMLFrameElement", &JSHTMLElement::s_info, &JSHTMLFrameElementTable, 0 }; JSHTMLFrameElement::JSHTMLFrameElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLFrameElement> impl) : JSHTMLElement(structure, globalObject, impl) { } void JSHTMLFrameElement::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSHTMLFrameElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSHTMLFrameElementPrototype::create(exec->globalData(), globalObject, JSHTMLFrameElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLElementPrototype::self(exec, globalObject))); } bool JSHTMLFrameElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSHTMLFrameElement, Base>(exec, &JSHTMLFrameElementTable, this, propertyName, slot); } bool JSHTMLFrameElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSHTMLFrameElement, Base>(exec, &JSHTMLFrameElementTable, this, propertyName, descriptor); } JSValue jsHTMLFrameElementFrameBorder(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::frameborderAttr)); return result; } JSValue jsHTMLFrameElementLongDesc(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::longdescAttr)); return result; } JSValue jsHTMLFrameElementMarginHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::marginheightAttr)); return result; } JSValue jsHTMLFrameElementMarginWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::marginwidthAttr)); return result; } JSValue jsHTMLFrameElementName(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::nameAttr)); return result; } JSValue jsHTMLFrameElementNoResize(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::noresizeAttr)); return result; } JSValue jsHTMLFrameElementScrolling(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::scrollingAttr)); return result; } JSValue jsHTMLFrameElementSrc(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getURLAttribute(WebCore::HTMLNames::srcAttr)); return result; } JSValue jsHTMLFrameElementContentDocument(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); return checkNodeSecurity(exec, imp->contentDocument()) ? toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentDocument())) : jsUndefined(); } JSValue jsHTMLFrameElementContentWindow(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->contentWindow())); return result; } JSValue jsHTMLFrameElementLocation(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->location()); return result; } JSValue jsHTMLFrameElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsNumber(imp->width()); return result; } JSValue jsHTMLFrameElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); JSValue result = jsNumber(imp->height()); return result; } JSValue jsHTMLFrameElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLFrameElement* domObject = static_cast<JSHTMLFrameElement*>(asObject(slotBase)); return JSHTMLFrameElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLFrameElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSHTMLFrameElement, Base>(exec, propertyName, value, &JSHTMLFrameElementTable, this, slot); } void setJSHTMLFrameElementFrameBorder(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::frameborderAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementLongDesc(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::longdescAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementMarginHeight(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::marginheightAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementMarginWidth(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::marginwidthAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementName(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::nameAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementNoResize(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setBooleanAttribute(WebCore::HTMLNames::noresizeAttr, value.toBoolean(exec)); } void setJSHTMLFrameElementScrolling(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::scrollingAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementSrc(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(thisObject); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::srcAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLFrameElementLocation(ExecState* exec, JSObject* thisObject, JSValue value) { static_cast<JSHTMLFrameElement*>(thisObject)->setLocation(exec, value); } JSValue JSHTMLFrameElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLFrameElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } #if ENABLE(SVG) EncodedJSValue JSC_HOST_CALL jsHTMLFrameElementPrototypeFunctionGetSVGDocument(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLFrameElement::s_info)) return throwVMTypeError(exec); JSHTMLFrameElement* castedThis = static_cast<JSHTMLFrameElement*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLFrameElement::s_info); HTMLFrameElement* imp = static_cast<HTMLFrameElement*>(castedThis->impl()); ExceptionCode ec = 0; if (!checkNodeSecurity(exec, imp->getSVGDocument(ec))) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getSVGDocument(ec))); setDOMException(exec, ec); return JSValue::encode(result); } #endif }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSMessageChannel); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMessageChannelTableValues[] = { { "port1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelPort1), (intptr_t)0 THUNK_GENERATOR(0) }, { "port2", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelPort2), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMessageChannelConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMessageChannelTable = { 8, 7, JSMessageChannelTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMessageChannelConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMessageChannelConstructorTable = { 1, 0, JSMessageChannelConstructorTableValues, 0 }; const ClassInfo JSMessageChannelConstructor::s_info = { "MessageChannelConstructor", &DOMConstructorObject::s_info, &JSMessageChannelConstructorTable, 0 }; JSMessageChannelConstructor::JSMessageChannelConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSMessageChannelConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSMessageChannelPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSMessageChannelConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSMessageChannelConstructor, JSDOMWrapper>(exec, &JSMessageChannelConstructorTable, this, propertyName, slot); } bool JSMessageChannelConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSMessageChannelConstructor, JSDOMWrapper>(exec, &JSMessageChannelConstructorTable, this, propertyName, descriptor); } ConstructType JSMessageChannelConstructor::getConstructData(ConstructData& constructData) { constructData.native.function = constructJSMessageChannel; return ConstructTypeHost; } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMessageChannelPrototypeTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMessageChannelPrototypeTable = { 1, 0, JSMessageChannelPrototypeTableValues, 0 }; static const HashTable* getJSMessageChannelPrototypeTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSMessageChannelPrototypeTable); } const ClassInfo JSMessageChannelPrototype::s_info = { "MessageChannelPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSMessageChannelPrototypeTable }; JSObject* JSMessageChannelPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSMessageChannel>(exec, globalObject); } static const HashTable* getJSMessageChannelTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSMessageChannelTable); } const ClassInfo JSMessageChannel::s_info = { "MessageChannel", &JSDOMWrapper::s_info, 0, getJSMessageChannelTable }; JSMessageChannel::JSMessageChannel(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<MessageChannel> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSMessageChannel::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSMessageChannel::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSMessageChannelPrototype::create(exec->globalData(), globalObject, JSMessageChannelPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSMessageChannel::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSMessageChannel, Base>(exec, getJSMessageChannelTable(exec), this, propertyName, slot); } bool JSMessageChannel::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSMessageChannel, Base>(exec, getJSMessageChannelTable(exec), this, propertyName, descriptor); } JSValue jsMessageChannelPort1(ExecState* exec, JSValue slotBase, const Identifier&) { JSMessageChannel* castedThis = static_cast<JSMessageChannel*>(asObject(slotBase)); UNUSED_PARAM(exec); MessageChannel* imp = static_cast<MessageChannel*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->port1())); return result; } JSValue jsMessageChannelPort2(ExecState* exec, JSValue slotBase, const Identifier&) { JSMessageChannel* castedThis = static_cast<JSMessageChannel*>(asObject(slotBase)); UNUSED_PARAM(exec); MessageChannel* imp = static_cast<MessageChannel*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->port2())); return result; } JSValue jsMessageChannelConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSMessageChannel* domObject = static_cast<JSMessageChannel*>(asObject(slotBase)); return JSMessageChannel::getConstructor(exec, domObject->globalObject()); } JSValue JSMessageChannel::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSMessageChannelConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, MessageChannel* impl) { return wrap<JSMessageChannel>(exec, globalObject, impl); } MessageChannel* toMessageChannel(JSC::JSValue value) { return value.inherits(&JSMessageChannel::s_info) ? static_cast<JSMessageChannel*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGPathSeg); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGPathSegTableValues[4] = { { "pathSegType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegType), (intptr_t)0 THUNK_GENERATOR(0) }, { "pathSegTypeAsLetter", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPathSegTypeAsLetter), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGPathSegTable = { 8, 7, JSSVGPathSegTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGPathSegConstructorTableValues[21] = { { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGPathSegConstructorTable = { 70, 63, JSSVGPathSegConstructorTableValues, 0 }; COMPILE_ASSERT(0 == SVGPathSeg::PATHSEG_UNKNOWN, SVGPathSegEnumPATHSEG_UNKNOWNIsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == SVGPathSeg::PATHSEG_CLOSEPATH, SVGPathSegEnumPATHSEG_CLOSEPATHIsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == SVGPathSeg::PATHSEG_MOVETO_ABS, SVGPathSegEnumPATHSEG_MOVETO_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(3 == SVGPathSeg::PATHSEG_MOVETO_REL, SVGPathSegEnumPATHSEG_MOVETO_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(4 == SVGPathSeg::PATHSEG_LINETO_ABS, SVGPathSegEnumPATHSEG_LINETO_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(5 == SVGPathSeg::PATHSEG_LINETO_REL, SVGPathSegEnumPATHSEG_LINETO_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(6 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(7 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(8 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(9 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(10 == SVGPathSeg::PATHSEG_ARC_ABS, SVGPathSegEnumPATHSEG_ARC_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(11 == SVGPathSeg::PATHSEG_ARC_REL, SVGPathSegEnumPATHSEG_ARC_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(12 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_ABS, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(13 == SVGPathSeg::PATHSEG_LINETO_HORIZONTAL_REL, SVGPathSegEnumPATHSEG_LINETO_HORIZONTAL_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(14 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_ABS, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(15 == SVGPathSeg::PATHSEG_LINETO_VERTICAL_REL, SVGPathSegEnumPATHSEG_LINETO_VERTICAL_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(16 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(17 == SVGPathSeg::PATHSEG_CURVETO_CUBIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_CUBIC_SMOOTH_RELIsWrongUseDontCheckEnums); COMPILE_ASSERT(18 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABSIsWrongUseDontCheckEnums); COMPILE_ASSERT(19 == SVGPathSeg::PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, SVGPathSegEnumPATHSEG_CURVETO_QUADRATIC_SMOOTH_RELIsWrongUseDontCheckEnums); class JSSVGPathSegConstructor : public DOMConstructorObject { public: JSSVGPathSegConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSSVGPathSegConstructor::s_info = { "SVGPathSegConstructor", &DOMConstructorObject::s_info, &JSSVGPathSegConstructorTable, 0 }; JSSVGPathSegConstructor::JSSVGPathSegConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGPathSegPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSSVGPathSegConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, this, propertyName, slot); } bool JSSVGPathSegConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGPathSegConstructor, JSDOMWrapper>(exec, &JSSVGPathSegConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGPathSegPrototypeTableValues[21] = { { "PATHSEG_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CLOSEPATH", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CLOSEPATH), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_MOVETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_MOVETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_MOVETO_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_ARC_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_ARC_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_ARC_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_HORIZONTAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_HORIZONTAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_VERTICAL_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_LINETO_VERTICAL_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_CUBIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS), (intptr_t)0 THUNK_GENERATOR(0) }, { "PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGPathSegPrototypeTable = { 70, 63, JSSVGPathSegPrototypeTableValues, 0 }; const ClassInfo JSSVGPathSegPrototype::s_info = { "SVGPathSegPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGPathSegPrototypeTable, 0 }; JSObject* JSSVGPathSegPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSVGPathSeg>(exec, globalObject); } bool JSSVGPathSegPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, this, propertyName, slot); } bool JSSVGPathSegPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGPathSegPrototype, JSObject>(exec, &JSSVGPathSegPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSSVGPathSeg::s_info = { "SVGPathSeg", &JSDOMWrapper::s_info, &JSSVGPathSegTable, 0 }; JSSVGPathSeg::JSSVGPathSeg(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGPathSeg> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSSVGPathSeg::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSVGPathSegPrototype(exec->globalData(), globalObject, JSSVGPathSegPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSSVGPathSeg::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, this, propertyName, slot); } bool JSSVGPathSeg::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGPathSeg, Base>(exec, &JSSVGPathSegTable, this, propertyName, descriptor); } JSValue jsSVGPathSegPathSegType(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl()); JSValue result = jsNumber(imp->pathSegType()); return result; } JSValue jsSVGPathSegPathSegTypeAsLetter(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGPathSeg* castedThis = static_cast<JSSVGPathSeg*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGPathSeg* imp = static_cast<SVGPathSeg*>(castedThis->impl()); JSValue result = jsString(exec, imp->pathSegTypeAsLetter()); return result; } JSValue jsSVGPathSegConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGPathSeg* domObject = static_cast<JSSVGPathSeg*>(asObject(slotBase)); return JSSVGPathSeg::getConstructor(exec, domObject->globalObject()); } JSValue JSSVGPathSeg::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSSVGPathSegConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } // Constant getters JSValue jsSVGPathSegPATHSEG_UNKNOWN(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsSVGPathSegPATHSEG_CLOSEPATH(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsSVGPathSegPATHSEG_MOVETO_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsSVGPathSegPATHSEG_MOVETO_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } JSValue jsSVGPathSegPATHSEG_LINETO_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(4)); } JSValue jsSVGPathSegPATHSEG_LINETO_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(5)); } JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(6)); } JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(7)); } JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(8)); } JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(9)); } JSValue jsSVGPathSegPATHSEG_ARC_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(10)); } JSValue jsSVGPathSegPATHSEG_ARC_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(11)); } JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(12)); } JSValue jsSVGPathSegPATHSEG_LINETO_HORIZONTAL_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(13)); } JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(14)); } JSValue jsSVGPathSegPATHSEG_LINETO_VERTICAL_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(15)); } JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(16)); } JSValue jsSVGPathSegPATHSEG_CURVETO_CUBIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(17)); } JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(18)); } JSValue jsSVGPathSegPATHSEG_CURVETO_QUADRATIC_SMOOTH_REL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(19)); } SVGPathSeg* toSVGPathSeg(JSC::JSValue value) { return value.inherits(&JSSVGPathSeg::s_info) ? static_cast<JSSVGPathSeg*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGAnimatedPreserveAspectRatio); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGAnimatedPreserveAspectRatioTableValues[] = { { "baseVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedPreserveAspectRatioBaseVal), (intptr_t)0 THUNK_GENERATOR(0) }, { "animVal", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedPreserveAspectRatioAnimVal), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGAnimatedPreserveAspectRatioConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedPreserveAspectRatioTable = { 8, 7, JSSVGAnimatedPreserveAspectRatioTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGAnimatedPreserveAspectRatioConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedPreserveAspectRatioConstructorTable = { 1, 0, JSSVGAnimatedPreserveAspectRatioConstructorTableValues, 0 }; class JSSVGAnimatedPreserveAspectRatioConstructor : public DOMConstructorObject { private: JSSVGAnimatedPreserveAspectRatioConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSSVGAnimatedPreserveAspectRatioConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSSVGAnimatedPreserveAspectRatioConstructor* ptr = new (JSC::allocateCell<JSSVGAnimatedPreserveAspectRatioConstructor>(*exec->heap())) JSSVGAnimatedPreserveAspectRatioConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSSVGAnimatedPreserveAspectRatioConstructor::s_info = { "SVGAnimatedPreserveAspectRatioConstructor", &DOMConstructorObject::s_info, &JSSVGAnimatedPreserveAspectRatioConstructorTable, 0 }; JSSVGAnimatedPreserveAspectRatioConstructor::JSSVGAnimatedPreserveAspectRatioConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSSVGAnimatedPreserveAspectRatioConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGAnimatedPreserveAspectRatioPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSSVGAnimatedPreserveAspectRatioConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGAnimatedPreserveAspectRatioConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedPreserveAspectRatioConstructorTable, this, propertyName, slot); } bool JSSVGAnimatedPreserveAspectRatioConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGAnimatedPreserveAspectRatioConstructor, JSDOMWrapper>(exec, &JSSVGAnimatedPreserveAspectRatioConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGAnimatedPreserveAspectRatioPrototypeTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGAnimatedPreserveAspectRatioPrototypeTable = { 1, 0, JSSVGAnimatedPreserveAspectRatioPrototypeTableValues, 0 }; const ClassInfo JSSVGAnimatedPreserveAspectRatioPrototype::s_info = { "SVGAnimatedPreserveAspectRatioPrototype", &JSC::JSNonFinalObject::s_info, &JSSVGAnimatedPreserveAspectRatioPrototypeTable, 0 }; JSObject* JSSVGAnimatedPreserveAspectRatioPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSVGAnimatedPreserveAspectRatio>(exec, globalObject); } const ClassInfo JSSVGAnimatedPreserveAspectRatio::s_info = { "SVGAnimatedPreserveAspectRatio", &JSDOMWrapper::s_info, &JSSVGAnimatedPreserveAspectRatioTable, 0 }; JSSVGAnimatedPreserveAspectRatio::JSSVGAnimatedPreserveAspectRatio(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGAnimatedPreserveAspectRatio> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSSVGAnimatedPreserveAspectRatio::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSSVGAnimatedPreserveAspectRatio::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSSVGAnimatedPreserveAspectRatioPrototype::create(exec->globalData(), globalObject, JSSVGAnimatedPreserveAspectRatioPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSSVGAnimatedPreserveAspectRatio::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSSVGAnimatedPreserveAspectRatio, Base>(exec, &JSSVGAnimatedPreserveAspectRatioTable, this, propertyName, slot); } bool JSSVGAnimatedPreserveAspectRatio::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSSVGAnimatedPreserveAspectRatio, Base>(exec, &JSSVGAnimatedPreserveAspectRatioTable, this, propertyName, descriptor); } JSValue jsSVGAnimatedPreserveAspectRatioBaseVal(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGAnimatedPreserveAspectRatio* castedThis = static_cast<JSSVGAnimatedPreserveAspectRatio*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGAnimatedPreserveAspectRatio* imp = static_cast<SVGAnimatedPreserveAspectRatio*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(static_cast<SVGPropertyTearOff<SVGPreserveAspectRatio>*>(imp->baseVal()))); return result; } JSValue jsSVGAnimatedPreserveAspectRatioAnimVal(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGAnimatedPreserveAspectRatio* castedThis = static_cast<JSSVGAnimatedPreserveAspectRatio*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGAnimatedPreserveAspectRatio* imp = static_cast<SVGAnimatedPreserveAspectRatio*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(static_cast<SVGPropertyTearOff<SVGPreserveAspectRatio>*>(imp->animVal()))); return result; } JSValue jsSVGAnimatedPreserveAspectRatioConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGAnimatedPreserveAspectRatio* domObject = static_cast<JSSVGAnimatedPreserveAspectRatio*>(asObject(slotBase)); return JSSVGAnimatedPreserveAspectRatio::getConstructor(exec, domObject->globalObject()); } JSValue JSSVGAnimatedPreserveAspectRatio::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSSVGAnimatedPreserveAspectRatioConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SVGAnimatedPreserveAspectRatio* impl) { return wrap<JSSVGAnimatedPreserveAspectRatio>(exec, globalObject, impl); } SVGAnimatedPreserveAspectRatio* toSVGAnimatedPreserveAspectRatio(JSC::JSValue value) { return value.inherits(&JSSVGAnimatedPreserveAspectRatio::s_info) ? static_cast<JSSVGAnimatedPreserveAspectRatio*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSMutationEvent); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMutationEventTableValues[7] = { { "relatedNode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventRelatedNode), (intptr_t)0 THUNK_GENERATOR(0) }, { "prevValue", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventPrevValue), (intptr_t)0 THUNK_GENERATOR(0) }, { "newValue", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventNewValue), (intptr_t)0 THUNK_GENERATOR(0) }, { "attrName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventAttrName), (intptr_t)0 THUNK_GENERATOR(0) }, { "attrChange", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventAttrChange), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMutationEventTable = { 17, 15, JSMutationEventTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMutationEventConstructorTableValues[4] = { { "MODIFICATION", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventMODIFICATION), (intptr_t)0 THUNK_GENERATOR(0) }, { "ADDITION", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventADDITION), (intptr_t)0 THUNK_GENERATOR(0) }, { "REMOVAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventREMOVAL), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMutationEventConstructorTable = { 8, 7, JSMutationEventConstructorTableValues, 0 }; COMPILE_ASSERT(1 == MutationEvent::MODIFICATION, MutationEventEnumMODIFICATIONIsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == MutationEvent::ADDITION, MutationEventEnumADDITIONIsWrongUseDontCheckEnums); COMPILE_ASSERT(3 == MutationEvent::REMOVAL, MutationEventEnumREMOVALIsWrongUseDontCheckEnums); class JSMutationEventConstructor : public DOMConstructorObject { public: JSMutationEventConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSMutationEventConstructor::s_info = { "MutationEventConstructor", &DOMConstructorObject::s_info, &JSMutationEventConstructorTable, 0 }; JSMutationEventConstructor::JSMutationEventConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSMutationEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSMutationEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSMutationEventConstructor, JSDOMWrapper>(exec, &JSMutationEventConstructorTable, this, propertyName, slot); } bool JSMutationEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSMutationEventConstructor, JSDOMWrapper>(exec, &JSMutationEventConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSMutationEventPrototypeTableValues[5] = { { "MODIFICATION", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventMODIFICATION), (intptr_t)0 THUNK_GENERATOR(0) }, { "ADDITION", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventADDITION), (intptr_t)0 THUNK_GENERATOR(0) }, { "REMOVAL", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsMutationEventREMOVAL), (intptr_t)0 THUNK_GENERATOR(0) }, { "initMutationEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsMutationEventPrototypeFunctionInitMutationEvent), (intptr_t)8 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSMutationEventPrototypeTable = { 8, 7, JSMutationEventPrototypeTableValues, 0 }; const ClassInfo JSMutationEventPrototype::s_info = { "MutationEventPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSMutationEventPrototypeTable, 0 }; JSObject* JSMutationEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSMutationEvent>(exec, globalObject); } bool JSMutationEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot<JSMutationEventPrototype, JSObject>(exec, &JSMutationEventPrototypeTable, this, propertyName, slot); } bool JSMutationEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor<JSMutationEventPrototype, JSObject>(exec, &JSMutationEventPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSMutationEvent::s_info = { "MutationEvent", &JSEvent::s_info, &JSMutationEventTable, 0 }; JSMutationEvent::JSMutationEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<MutationEvent> impl) : JSEvent(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSMutationEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSMutationEventPrototype(exec->globalData(), globalObject, JSMutationEventPrototype::createStructure(exec->globalData(), JSEventPrototype::self(exec, globalObject))); } bool JSMutationEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSMutationEvent, Base>(exec, &JSMutationEventTable, this, propertyName, slot); } bool JSMutationEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSMutationEvent, Base>(exec, &JSMutationEventTable, this, propertyName, descriptor); } JSValue jsMutationEventRelatedNode(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->relatedNode())); return result; } JSValue jsMutationEventPrevValue(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); JSValue result = jsString(exec, imp->prevValue()); return result; } JSValue jsMutationEventNewValue(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); JSValue result = jsString(exec, imp->newValue()); return result; } JSValue jsMutationEventAttrName(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); JSValue result = jsString(exec, imp->attrName()); return result; } JSValue jsMutationEventAttrChange(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); JSValue result = jsNumber(imp->attrChange()); return result; } JSValue jsMutationEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSMutationEvent* domObject = static_cast<JSMutationEvent*>(asObject(slotBase)); return JSMutationEvent::getConstructor(exec, domObject->globalObject()); } JSValue JSMutationEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSMutationEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsMutationEventPrototypeFunctionInitMutationEvent(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSMutationEvent::s_info)) return throwVMTypeError(exec); JSMutationEvent* castedThis = static_cast<JSMutationEvent*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSMutationEvent::s_info); MutationEvent* imp = static_cast<MutationEvent*>(castedThis->impl()); const String& type(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool canBubble(exec->argument(1).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool cancelable(exec->argument(2).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); Node* relatedNode(toNode(exec->argument(3))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& prevValue(ustringToString(exec->argument(4).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& newValue(ustringToString(exec->argument(5).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& attrName(ustringToString(exec->argument(6).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); unsigned short attrChange(exec->argument(7).toUInt32(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->initMutationEvent(type, canBubble, cancelable, relatedNode, prevValue, newValue, attrName, attrChange); return JSValue::encode(jsUndefined()); } // Constant getters JSValue jsMutationEventMODIFICATION(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsMutationEventADDITION(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsMutationEventREMOVAL(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLPreElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLPreElementTableValues[4] = { { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLPreElementWidth), (intptr_t)setJSHTMLPreElementWidth THUNK_GENERATOR(0) }, { "wrap", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLPreElementWrap), (intptr_t)setJSHTMLPreElementWrap THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLPreElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLPreElementTable = { 9, 7, JSHTMLPreElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLPreElementConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLPreElementConstructorTable = { 1, 0, JSHTMLPreElementConstructorTableValues, 0 }; class JSHTMLPreElementConstructor : public DOMConstructorObject { public: JSHTMLPreElementConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLPreElementConstructor::s_info = { "HTMLPreElementConstructor", &DOMConstructorObject::s_info, &JSHTMLPreElementConstructorTable, 0 }; JSHTMLPreElementConstructor::JSHTMLPreElementConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLPreElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLPreElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLPreElementConstructor, JSDOMWrapper>(exec, &JSHTMLPreElementConstructorTable, this, propertyName, slot); } bool JSHTMLPreElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLPreElementConstructor, JSDOMWrapper>(exec, &JSHTMLPreElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLPreElementPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLPreElementPrototypeTable = { 1, 0, JSHTMLPreElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLPreElementPrototype::s_info = { "HTMLPreElementPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSHTMLPreElementPrototypeTable, 0 }; JSObject* JSHTMLPreElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLPreElement>(exec, globalObject); } const ClassInfo JSHTMLPreElement::s_info = { "HTMLPreElement", &JSHTMLElement::s_info, &JSHTMLPreElementTable, 0 }; JSHTMLPreElement::JSHTMLPreElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLPreElement> impl) : JSHTMLElement(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSHTMLPreElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSHTMLPreElementPrototype(exec->globalData(), globalObject, JSHTMLPreElementPrototype::createStructure(exec->globalData(), JSHTMLElementPrototype::self(exec, globalObject))); } bool JSHTMLPreElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSHTMLPreElement, Base>(exec, &JSHTMLPreElementTable, this, propertyName, slot); } bool JSHTMLPreElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSHTMLPreElement, Base>(exec, &JSHTMLPreElementTable, this, propertyName, descriptor); } JSValue jsHTMLPreElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLPreElement* castedThis = static_cast<JSHTMLPreElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLPreElement* imp = static_cast<HTMLPreElement*>(castedThis->impl()); JSValue result = jsNumber(imp->getIntegralAttribute(WebCore::HTMLNames::widthAttr)); return result; } JSValue jsHTMLPreElementWrap(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLPreElement* castedThis = static_cast<JSHTMLPreElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLPreElement* imp = static_cast<HTMLPreElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::wrapAttr)); return result; } JSValue jsHTMLPreElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLPreElement* domObject = static_cast<JSHTMLPreElement*>(asObject(slotBase)); return JSHTMLPreElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLPreElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSHTMLPreElement, Base>(exec, propertyName, value, &JSHTMLPreElementTable, this, slot); } void setJSHTMLPreElementWidth(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLPreElement* castedThis = static_cast<JSHTMLPreElement*>(thisObject); HTMLPreElement* imp = static_cast<HTMLPreElement*>(castedThis->impl()); imp->setIntegralAttribute(WebCore::HTMLNames::widthAttr, value.toInt32(exec)); } void setJSHTMLPreElementWrap(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLPreElement* castedThis = static_cast<JSHTMLPreElement*>(thisObject); HTMLPreElement* imp = static_cast<HTMLPreElement*>(castedThis->impl()); imp->setBooleanAttribute(WebCore::HTMLNames::wrapAttr, value.toBoolean(exec)); } JSValue JSHTMLPreElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLPreElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGFEConvolveMatrixElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGFEConvolveMatrixElementTableValues[21] = { { "in1", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementIn1), (intptr_t)0 THUNK_GENERATOR(0) }, { "orderX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementOrderX), (intptr_t)0 THUNK_GENERATOR(0) }, { "orderY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementOrderY), (intptr_t)0 THUNK_GENERATOR(0) }, { "kernelMatrix", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementKernelMatrix), (intptr_t)0 THUNK_GENERATOR(0) }, { "divisor", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementDivisor), (intptr_t)0 THUNK_GENERATOR(0) }, { "bias", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementBias), (intptr_t)0 THUNK_GENERATOR(0) }, { "targetX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementTargetX), (intptr_t)0 THUNK_GENERATOR(0) }, { "targetY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementTargetY), (intptr_t)0 THUNK_GENERATOR(0) }, { "edgeMode", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementEdgeMode), (intptr_t)0 THUNK_GENERATOR(0) }, { "kernelUnitLengthX", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementKernelUnitLengthX), (intptr_t)0 THUNK_GENERATOR(0) }, { "kernelUnitLengthY", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementKernelUnitLengthY), (intptr_t)0 THUNK_GENERATOR(0) }, { "preserveAlpha", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementPreserveAlpha), (intptr_t)0 THUNK_GENERATOR(0) }, { "x", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementX), (intptr_t)0 THUNK_GENERATOR(0) }, { "y", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementY), (intptr_t)0 THUNK_GENERATOR(0) }, { "width", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementWidth), (intptr_t)0 THUNK_GENERATOR(0) }, { "height", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementHeight), (intptr_t)0 THUNK_GENERATOR(0) }, { "result", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementResult), (intptr_t)0 THUNK_GENERATOR(0) }, { "className", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementClassName), (intptr_t)0 THUNK_GENERATOR(0) }, { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementStyle), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGFEConvolveMatrixElementTable = { 68, 63, JSSVGFEConvolveMatrixElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGFEConvolveMatrixElementConstructorTableValues[5] = { { "SVG_EDGEMODE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_DUPLICATE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_DUPLICATE), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_WRAP", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_WRAP), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_NONE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_NONE), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGFEConvolveMatrixElementConstructorTable = { 9, 7, JSSVGFEConvolveMatrixElementConstructorTableValues, 0 }; class JSSVGFEConvolveMatrixElementConstructor : public DOMConstructorObject { public: JSSVGFEConvolveMatrixElementConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSSVGFEConvolveMatrixElementConstructor::s_info = { "SVGFEConvolveMatrixElementConstructor", &DOMConstructorObject::s_info, &JSSVGFEConvolveMatrixElementConstructorTable, 0 }; JSSVGFEConvolveMatrixElementConstructor::JSSVGFEConvolveMatrixElementConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGFEConvolveMatrixElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSSVGFEConvolveMatrixElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGFEConvolveMatrixElementConstructor, JSDOMWrapper>(exec, &JSSVGFEConvolveMatrixElementConstructorTable, this, propertyName, slot); } bool JSSVGFEConvolveMatrixElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGFEConvolveMatrixElementConstructor, JSDOMWrapper>(exec, &JSSVGFEConvolveMatrixElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGFEConvolveMatrixElementPrototypeTableValues[6] = { { "SVG_EDGEMODE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_DUPLICATE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_DUPLICATE), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_WRAP", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_WRAP), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_EDGEMODE_NONE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGFEConvolveMatrixElementSVG_EDGEMODE_NONE), (intptr_t)0 THUNK_GENERATOR(0) }, { "getPresentationAttribute", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGFEConvolveMatrixElementPrototypeFunctionGetPresentationAttribute), (intptr_t)1 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGFEConvolveMatrixElementPrototypeTable = { 17, 15, JSSVGFEConvolveMatrixElementPrototypeTableValues, 0 }; const ClassInfo JSSVGFEConvolveMatrixElementPrototype::s_info = { "SVGFEConvolveMatrixElementPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGFEConvolveMatrixElementPrototypeTable, 0 }; JSObject* JSSVGFEConvolveMatrixElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSVGFEConvolveMatrixElement>(exec, globalObject); } bool JSSVGFEConvolveMatrixElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot<JSSVGFEConvolveMatrixElementPrototype, JSObject>(exec, &JSSVGFEConvolveMatrixElementPrototypeTable, this, propertyName, slot); } bool JSSVGFEConvolveMatrixElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor<JSSVGFEConvolveMatrixElementPrototype, JSObject>(exec, &JSSVGFEConvolveMatrixElementPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSSVGFEConvolveMatrixElement::s_info = { "SVGFEConvolveMatrixElement", &JSSVGElement::s_info, &JSSVGFEConvolveMatrixElementTable, 0 }; JSSVGFEConvolveMatrixElement::JSSVGFEConvolveMatrixElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGFEConvolveMatrixElement> impl) : JSSVGElement(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSSVGFEConvolveMatrixElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSVGFEConvolveMatrixElementPrototype(exec->globalData(), globalObject, JSSVGFEConvolveMatrixElementPrototype::createStructure(exec->globalData(), JSSVGElementPrototype::self(exec, globalObject))); } bool JSSVGFEConvolveMatrixElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGFEConvolveMatrixElement, Base>(exec, &JSSVGFEConvolveMatrixElementTable, this, propertyName, slot); } bool JSSVGFEConvolveMatrixElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGFEConvolveMatrixElement, Base>(exec, &JSSVGFEConvolveMatrixElementTable, this, propertyName, descriptor); } JSValue jsSVGFEConvolveMatrixElementIn1(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedString> obj = imp->in1Animated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementOrderX(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedInteger> obj = imp->orderXAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementOrderY(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedInteger> obj = imp->orderYAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementKernelMatrix(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedNumberList> obj = imp->kernelMatrixAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementDivisor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedNumber> obj = imp->divisorAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementBias(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedNumber> obj = imp->biasAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementTargetX(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedInteger> obj = imp->targetXAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementTargetY(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedInteger> obj = imp->targetYAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementEdgeMode(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedEnumeration> obj = imp->edgeModeAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementKernelUnitLengthX(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedNumber> obj = imp->kernelUnitLengthXAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementKernelUnitLengthY(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedNumber> obj = imp->kernelUnitLengthYAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementPreserveAlpha(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedBoolean> obj = imp->preserveAlphaAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementX(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedLength> obj = imp->xAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementY(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedLength> obj = imp->yAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedLength> obj = imp->widthAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedLength> obj = imp->heightAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementResult(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedString> obj = imp->resultAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); RefPtr<SVGAnimatedString> obj = imp->classNameAnimated(); JSValue result = toJS(exec, castedThis->globalObject(), obj.get()); return result; } JSValue jsSVGFEConvolveMatrixElementStyle(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); return result; } JSValue jsSVGFEConvolveMatrixElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGFEConvolveMatrixElement* domObject = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(slotBase)); return JSSVGFEConvolveMatrixElement::getConstructor(exec, domObject->globalObject()); } JSValue JSSVGFEConvolveMatrixElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSSVGFEConvolveMatrixElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsSVGFEConvolveMatrixElementPrototypeFunctionGetPresentationAttribute(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGFEConvolveMatrixElement::s_info)) return throwVMTypeError(exec); JSSVGFEConvolveMatrixElement* castedThis = static_cast<JSSVGFEConvolveMatrixElement*>(asObject(thisValue)); SVGFEConvolveMatrixElement* imp = static_cast<SVGFEConvolveMatrixElement*>(castedThis->impl()); const String& name(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getPresentationAttribute(name))); return JSValue::encode(result); } // Constant getters JSValue jsSVGFEConvolveMatrixElementSVG_EDGEMODE_UNKNOWN(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsSVGFEConvolveMatrixElementSVG_EDGEMODE_DUPLICATE(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsSVGFEConvolveMatrixElementSVG_EDGEMODE_WRAP(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsSVGFEConvolveMatrixElementSVG_EDGEMODE_NONE(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSQLException); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSQLExceptionTableValues[4] = { { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSQLExceptionTable = { 9, 7, JSSQLExceptionTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSQLExceptionConstructorTableValues[9] = { { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSQLExceptionConstructorTable = { 16, 15, JSSQLExceptionConstructorTableValues, 0 }; class JSSQLExceptionConstructor : public DOMConstructorObject { public: JSSQLExceptionConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSSQLExceptionConstructor::s_info = { "SQLExceptionConstructor", &DOMConstructorObject::s_info, &JSSQLExceptionConstructorTable, 0 }; JSSQLExceptionConstructor::JSSQLExceptionConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSSQLExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSSQLExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSQLExceptionConstructor, JSDOMWrapper>(exec, &JSSQLExceptionConstructorTable, this, propertyName, slot); } bool JSSQLExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSQLExceptionConstructor, JSDOMWrapper>(exec, &JSSQLExceptionConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSQLExceptionPrototypeTableValues[9] = { { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSQLExceptionPrototypeTable = { 16, 15, JSSQLExceptionPrototypeTableValues, 0 }; static const HashTable* getJSSQLExceptionPrototypeTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSSQLExceptionPrototypeTable); } const ClassInfo JSSQLExceptionPrototype::s_info = { "SQLExceptionPrototype", &JSC::JSObjectWithGlobalObject::s_info, 0, getJSSQLExceptionPrototypeTable }; JSObject* JSSQLExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSQLException>(exec, globalObject); } bool JSSQLExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSQLExceptionPrototype, JSObject>(exec, getJSSQLExceptionPrototypeTable(exec), this, propertyName, slot); } bool JSSQLExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSQLExceptionPrototype, JSObject>(exec, getJSSQLExceptionPrototypeTable(exec), this, propertyName, descriptor); } static const HashTable* getJSSQLExceptionTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSSQLExceptionTable); } const ClassInfo JSSQLException::s_info = { "SQLException", &JSDOMWrapper::s_info, 0, getJSSQLExceptionTable }; JSSQLException::JSSQLException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLException> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSSQLException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSQLExceptionPrototype(exec->globalData(), globalObject, JSSQLExceptionPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSSQLException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSQLException, Base>(exec, getJSSQLExceptionTable(exec), this, propertyName, slot); } bool JSSQLException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSQLException, Base>(exec, getJSSQLExceptionTable(exec), this, propertyName, descriptor); } JSValue jsSQLExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) { JSSQLException* castedThis = static_cast<JSSQLException*>(asObject(slotBase)); UNUSED_PARAM(exec); SQLException* imp = static_cast<SQLException*>(castedThis->impl()); JSValue result = jsNumber(imp->code()); return result; } JSValue jsSQLExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) { JSSQLException* castedThis = static_cast<JSSQLException*>(asObject(slotBase)); UNUSED_PARAM(exec); SQLException* imp = static_cast<SQLException*>(castedThis->impl()); JSValue result = jsString(exec, imp->message()); return result; } JSValue jsSQLExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSQLException* domObject = static_cast<JSSQLException*>(asObject(slotBase)); return JSSQLException::getConstructor(exec, domObject->globalObject()); } JSValue JSSQLException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSSQLExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } // Constant getters JSValue jsSQLExceptionUNKNOWN_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsSQLExceptionDATABASE_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsSQLExceptionVERSION_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsSQLExceptionTOO_LARGE_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } JSValue jsSQLExceptionQUOTA_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(4)); } JSValue jsSQLExceptionSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(5)); } JSValue jsSQLExceptionCONSTRAINT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(6)); } JSValue jsSQLExceptionTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(7)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLException* impl) { return wrap<JSSQLException>(exec, globalObject, impl); } SQLException* toSQLException(JSC::JSValue value) { return value.inherits(&JSSQLException::s_info) ? static_cast<JSSQLException*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSWebGLContextAttributes); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebGLContextAttributesTableValues[] = { { "alpha", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesAlpha), (intptr_t)setJSWebGLContextAttributesAlpha THUNK_GENERATOR(0) }, { "depth", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesDepth), (intptr_t)setJSWebGLContextAttributesDepth THUNK_GENERATOR(0) }, { "stencil", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesStencil), (intptr_t)setJSWebGLContextAttributesStencil THUNK_GENERATOR(0) }, { "antialias", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesAntialias), (intptr_t)setJSWebGLContextAttributesAntialias THUNK_GENERATOR(0) }, { "premultipliedAlpha", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesPremultipliedAlpha), (intptr_t)setJSWebGLContextAttributesPremultipliedAlpha THUNK_GENERATOR(0) }, { "preserveDrawingBuffer", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLContextAttributesPreserveDrawingBuffer), (intptr_t)setJSWebGLContextAttributesPreserveDrawingBuffer THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebGLContextAttributesTable = { 16, 15, JSWebGLContextAttributesTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebGLContextAttributesPrototypeTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebGLContextAttributesPrototypeTable = { 1, 0, JSWebGLContextAttributesPrototypeTableValues, 0 }; const ClassInfo JSWebGLContextAttributesPrototype::s_info = { "WebGLContextAttributesPrototype", &JSC::JSNonFinalObject::s_info, &JSWebGLContextAttributesPrototypeTable, 0 }; JSObject* JSWebGLContextAttributesPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSWebGLContextAttributes>(exec, globalObject); } const ClassInfo JSWebGLContextAttributes::s_info = { "WebGLContextAttributes", &JSDOMWrapper::s_info, &JSWebGLContextAttributesTable, 0 }; JSWebGLContextAttributes::JSWebGLContextAttributes(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLContextAttributes> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSWebGLContextAttributes::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSWebGLContextAttributes::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSWebGLContextAttributesPrototype::create(exec->globalData(), globalObject, JSWebGLContextAttributesPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSWebGLContextAttributes::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSWebGLContextAttributes, Base>(exec, &JSWebGLContextAttributesTable, this, propertyName, slot); } bool JSWebGLContextAttributes::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSWebGLContextAttributes, Base>(exec, &JSWebGLContextAttributesTable, this, propertyName, descriptor); } JSValue jsWebGLContextAttributesAlpha(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->alpha()); return result; } JSValue jsWebGLContextAttributesDepth(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->depth()); return result; } JSValue jsWebGLContextAttributesStencil(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->stencil()); return result; } JSValue jsWebGLContextAttributesAntialias(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->antialias()); return result; } JSValue jsWebGLContextAttributesPremultipliedAlpha(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->premultipliedAlpha()); return result; } JSValue jsWebGLContextAttributesPreserveDrawingBuffer(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(asObject(slotBase)); UNUSED_PARAM(exec); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); JSValue result = jsBoolean(imp->preserveDrawingBuffer()); return result; } void JSWebGLContextAttributes::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSWebGLContextAttributes, Base>(exec, propertyName, value, &JSWebGLContextAttributesTable, this, slot); } void setJSWebGLContextAttributesAlpha(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setAlpha(value.toBoolean(exec)); } void setJSWebGLContextAttributesDepth(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setDepth(value.toBoolean(exec)); } void setJSWebGLContextAttributesStencil(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setStencil(value.toBoolean(exec)); } void setJSWebGLContextAttributesAntialias(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setAntialias(value.toBoolean(exec)); } void setJSWebGLContextAttributesPremultipliedAlpha(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setPremultipliedAlpha(value.toBoolean(exec)); } void setJSWebGLContextAttributesPreserveDrawingBuffer(ExecState* exec, JSObject* thisObject, JSValue value) { JSWebGLContextAttributes* castedThis = static_cast<JSWebGLContextAttributes*>(thisObject); WebGLContextAttributes* imp = static_cast<WebGLContextAttributes*>(castedThis->impl()); imp->setPreserveDrawingBuffer(value.toBoolean(exec)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLContextAttributes* impl) { return wrap<JSWebGLContextAttributes>(exec, globalObject, impl); } WebGLContextAttributes* toWebGLContextAttributes(JSC::JSValue value) { return value.inherits(&JSWebGLContextAttributes::s_info) ? static_cast<JSWebGLContextAttributes*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSGeoposition); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSGeopositionTableValues[3] = { { "coords", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsGeopositionCoords), (intptr_t)0 THUNK_GENERATOR(0) }, { "timestamp", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsGeopositionTimestamp), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSGeopositionTable = { 4, 3, JSGeopositionTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSGeopositionPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSGeopositionPrototypeTable = { 1, 0, JSGeopositionPrototypeTableValues, 0 }; const ClassInfo JSGeopositionPrototype::s_info = { "GeopositionPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSGeopositionPrototypeTable, 0 }; JSObject* JSGeopositionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSGeoposition>(exec, globalObject); } const ClassInfo JSGeoposition::s_info = { "Geoposition", &JSDOMWrapper::s_info, &JSGeopositionTable, 0 }; JSGeoposition::JSGeoposition(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Geoposition> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSGeoposition::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSGeopositionPrototype(exec->globalData(), globalObject, JSGeopositionPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSGeoposition::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSGeoposition, Base>(exec, &JSGeopositionTable, this, propertyName, slot); } bool JSGeoposition::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSGeoposition, Base>(exec, &JSGeopositionTable, this, propertyName, descriptor); } JSValue jsGeopositionCoords(ExecState* exec, JSValue slotBase, const Identifier&) { JSGeoposition* castedThis = static_cast<JSGeoposition*>(asObject(slotBase)); UNUSED_PARAM(exec); Geoposition* imp = static_cast<Geoposition*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->coords())); return result; } JSValue jsGeopositionTimestamp(ExecState* exec, JSValue slotBase, const Identifier&) { JSGeoposition* castedThis = static_cast<JSGeoposition*>(asObject(slotBase)); UNUSED_PARAM(exec); Geoposition* imp = static_cast<Geoposition*>(castedThis->impl()); JSValue result = jsNumber(imp->timestamp()); return result; } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Geoposition* impl) { return wrap<JSGeoposition>(exec, globalObject, impl); } Geoposition* toGeoposition(JSC::JSValue value) { return value.inherits(&JSGeoposition::s_info) ? static_cast<JSGeoposition*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSClientRectList); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSClientRectListTableValues[3] = { { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectListLength), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsClientRectListConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSClientRectListTable = { 5, 3, JSClientRectListTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSClientRectListConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSClientRectListConstructorTable = { 1, 0, JSClientRectListConstructorTableValues, 0 }; class JSClientRectListConstructor : public DOMConstructorObject { public: JSClientRectListConstructor(JSC::ExecState*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); virtual const JSC::ClassInfo* classInfo() const { return &s_info; } static const JSC::ClassInfo s_info; static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) { return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSClientRectListConstructor::s_info = { "ClientRectListConstructor", 0, &JSClientRectListConstructorTable, 0 }; JSClientRectListConstructor::JSClientRectListConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) : DOMConstructorObject(JSClientRectListConstructor::createStructure(globalObject->objectPrototype()), globalObject) { putDirect(exec->propertyNames().prototype, JSClientRectListPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSClientRectListConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSClientRectListConstructor, DOMObject>(exec, &JSClientRectListConstructorTable, this, propertyName, slot); } bool JSClientRectListConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSClientRectListConstructor, DOMObject>(exec, &JSClientRectListConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSClientRectListPrototypeTableValues[2] = { { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsClientRectListPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSClientRectListPrototypeTable = { 2, 1, JSClientRectListPrototypeTableValues, 0 }; const ClassInfo JSClientRectListPrototype::s_info = { "ClientRectListPrototype", 0, &JSClientRectListPrototypeTable, 0 }; JSObject* JSClientRectListPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSClientRectList>(exec, globalObject); } bool JSClientRectListPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSClientRectListPrototypeTable, this, propertyName, slot); } bool JSClientRectListPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSClientRectListPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSClientRectList::s_info = { "ClientRectList", 0, &JSClientRectListTable, 0 }; JSClientRectList::JSClientRectList(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<ClientRectList> impl) : DOMObjectWithGlobalPointer(structure, globalObject) , m_impl(impl) { } JSClientRectList::~JSClientRectList() { forgetDOMObject(this, impl()); } JSObject* JSClientRectList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSClientRectListPrototype(globalObject, JSClientRectListPrototype::createStructure(globalObject->objectPrototype())); } bool JSClientRectList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { const HashEntry* entry = JSClientRectListTable.entry(exec, propertyName); if (entry) { slot.setCustom(this, entry->propertyGetter()); return true; } bool ok; unsigned index = propertyName.toUInt32(&ok, false); if (ok && index < static_cast<ClientRectList*>(impl())->length()) { slot.setCustomIndex(this, index, indexGetter); return true; } return getStaticValueSlot<JSClientRectList, Base>(exec, &JSClientRectListTable, this, propertyName, slot); } bool JSClientRectList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { const HashEntry* entry = JSClientRectListTable.entry(exec, propertyName); if (entry) { PropertySlot slot; slot.setCustom(this, entry->propertyGetter()); descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); return true; } bool ok; unsigned index = propertyName.toUInt32(&ok, false); if (ok && index < static_cast<ClientRectList*>(impl())->length()) { PropertySlot slot; slot.setCustomIndex(this, index, indexGetter); descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); return true; } return getStaticValueDescriptor<JSClientRectList, Base>(exec, &JSClientRectListTable, this, propertyName, descriptor); } bool JSClientRectList::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) { if (propertyName < static_cast<ClientRectList*>(impl())->length()) { slot.setCustomIndex(this, propertyName, indexGetter); return true; } return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); } JSValue jsClientRectListLength(ExecState* exec, JSValue slotBase, const Identifier&) { JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(slotBase)); UNUSED_PARAM(exec); ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl()); JSValue result = jsNumber(exec, imp->length()); return result; } JSValue jsClientRectListConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSClientRectList* domObject = static_cast<JSClientRectList*>(asObject(slotBase)); return JSClientRectList::getConstructor(exec, domObject->globalObject()); } void JSClientRectList::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { for (unsigned i = 0; i < static_cast<ClientRectList*>(impl())->length(); ++i) propertyNames.add(Identifier::from(exec, i)); Base::getOwnPropertyNames(exec, propertyNames, mode); } JSValue JSClientRectList::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSClientRectListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsClientRectListPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSClientRectList::s_info)) return throwVMTypeError(exec); JSClientRectList* castedThis = static_cast<JSClientRectList*>(asObject(thisValue)); ClientRectList* imp = static_cast<ClientRectList*>(castedThis->impl()); int index = exec->argument(0).toInt32(exec); if (index < 0) { setDOMException(exec, INDEX_SIZE_ERR); return JSValue::encode(jsUndefined()); } JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index))); return JSValue::encode(result); } JSValue JSClientRectList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index) { JSClientRectList* thisObj = static_cast<JSClientRectList*>(asObject(slotBase)); return toJS(exec, thisObj->globalObject(), static_cast<ClientRectList*>(thisObj->impl())->item(index)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, ClientRectList* object) { return getDOMObjectWrapper<JSClientRectList>(exec, globalObject, object); } ClientRectList* toClientRectList(JSC::JSValue value) { return value.inherits(&JSClientRectList::s_info) ? static_cast<JSClientRectList*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSPerformanceNavigation); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSPerformanceNavigationTableValues[3] = { { "type", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationType), (intptr_t)0 THUNK_GENERATOR(0) }, { "redirectCount", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationRedirectCount), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSPerformanceNavigationTable = { 5, 3, JSPerformanceNavigationTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSPerformanceNavigationPrototypeTableValues[5] = { { "TYPE_NAVIGATE", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_NAVIGATE), (intptr_t)0 THUNK_GENERATOR(0) }, { "TYPE_RELOAD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_RELOAD), (intptr_t)0 THUNK_GENERATOR(0) }, { "TYPE_BACK_FORWARD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_BACK_FORWARD), (intptr_t)0 THUNK_GENERATOR(0) }, { "TYPE_RESERVED", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsPerformanceNavigationTYPE_RESERVED), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSPerformanceNavigationPrototypeTable = { 9, 7, JSPerformanceNavigationPrototypeTableValues, 0 }; const ClassInfo JSPerformanceNavigationPrototype::s_info = { "PerformanceNavigationPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSPerformanceNavigationPrototypeTable, 0 }; JSObject* JSPerformanceNavigationPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSPerformanceNavigation>(exec, globalObject); } bool JSPerformanceNavigationPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, this, propertyName, slot); } bool JSPerformanceNavigationPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSPerformanceNavigationPrototype, JSObject>(exec, &JSPerformanceNavigationPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSPerformanceNavigation::s_info = { "PerformanceNavigation", &JSDOMWrapper::s_info, &JSPerformanceNavigationTable, 0 }; JSPerformanceNavigation::JSPerformanceNavigation(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<PerformanceNavigation> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSPerformanceNavigation::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSPerformanceNavigationPrototype(exec->globalData(), globalObject, JSPerformanceNavigationPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSPerformanceNavigation::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, this, propertyName, slot); } bool JSPerformanceNavigation::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSPerformanceNavigation, Base>(exec, &JSPerformanceNavigationTable, this, propertyName, descriptor); } JSValue jsPerformanceNavigationType(ExecState* exec, JSValue slotBase, const Identifier&) { JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase)); UNUSED_PARAM(exec); PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl()); JSValue result = jsNumber(imp->type()); return result; } JSValue jsPerformanceNavigationRedirectCount(ExecState* exec, JSValue slotBase, const Identifier&) { JSPerformanceNavigation* castedThis = static_cast<JSPerformanceNavigation*>(asObject(slotBase)); UNUSED_PARAM(exec); PerformanceNavigation* imp = static_cast<PerformanceNavigation*>(castedThis->impl()); JSValue result = jsNumber(imp->redirectCount()); return result; } // Constant getters JSValue jsPerformanceNavigationTYPE_NAVIGATE(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsPerformanceNavigationTYPE_RELOAD(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsPerformanceNavigationTYPE_BACK_FORWARD(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsPerformanceNavigationTYPE_RESERVED(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(255)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, PerformanceNavigation* impl) { return wrap<JSPerformanceNavigation>(exec, globalObject, impl); } PerformanceNavigation* toPerformanceNavigation(JSC::JSValue value) { return value.inherits(&JSPerformanceNavigation::s_info) ? static_cast<JSPerformanceNavigation*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSVGColor); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGColorTableValues[4] = { { "colorType", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorColorType), (intptr_t)0 THUNK_GENERATOR(0) }, { "rgbColor", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorRgbColor), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGColorTable = { 8, 7, JSSVGColorTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGColorConstructorTableValues[5] = { { "SVG_COLORTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_RGBCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_RGBCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_RGBCOLOR_ICCCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_CURRENTCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_CURRENTCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGColorConstructorTable = { 8, 7, JSSVGColorConstructorTableValues, 0 }; COMPILE_ASSERT(0 == SVGColor::SVG_COLORTYPE_UNKNOWN, SVGColorEnumSVG_COLORTYPE_UNKNOWNIsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == SVGColor::SVG_COLORTYPE_RGBCOLOR, SVGColorEnumSVG_COLORTYPE_RGBCOLORIsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == SVGColor::SVG_COLORTYPE_RGBCOLOR_ICCCOLOR, SVGColorEnumSVG_COLORTYPE_RGBCOLOR_ICCCOLORIsWrongUseDontCheckEnums); COMPILE_ASSERT(3 == SVGColor::SVG_COLORTYPE_CURRENTCOLOR, SVGColorEnumSVG_COLORTYPE_CURRENTCOLORIsWrongUseDontCheckEnums); class JSSVGColorConstructor : public DOMConstructorObject { public: JSSVGColorConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSSVGColorConstructor::s_info = { "SVGColorConstructor", &DOMConstructorObject::s_info, &JSSVGColorConstructorTable, 0 }; JSSVGColorConstructor::JSSVGColorConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSSVGColorPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSSVGColorConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSVGColorConstructor, JSDOMWrapper>(exec, &JSSVGColorConstructorTable, this, propertyName, slot); } bool JSSVGColorConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSVGColorConstructor, JSDOMWrapper>(exec, &JSSVGColorConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSVGColorPrototypeTableValues[8] = { { "SVG_COLORTYPE_UNKNOWN", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_UNKNOWN), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_RGBCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_RGBCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_RGBCOLOR_ICCCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_RGBCOLOR_ICCCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SVG_COLORTYPE_CURRENTCOLOR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSVGColorSVG_COLORTYPE_CURRENTCOLOR), (intptr_t)0 THUNK_GENERATOR(0) }, { "setRGBColor", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGColorPrototypeFunctionSetRGBColor), (intptr_t)1 THUNK_GENERATOR(0) }, { "setRGBColorICCColor", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGColorPrototypeFunctionSetRGBColorICCColor), (intptr_t)2 THUNK_GENERATOR(0) }, { "setColor", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsSVGColorPrototypeFunctionSetColor), (intptr_t)3 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSVGColorPrototypeTable = { 17, 15, JSSVGColorPrototypeTableValues, 0 }; const ClassInfo JSSVGColorPrototype::s_info = { "SVGColorPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSSVGColorPrototypeTable, 0 }; JSObject* JSSVGColorPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSVGColor>(exec, globalObject); } bool JSSVGColorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot<JSSVGColorPrototype, JSObject>(exec, &JSSVGColorPrototypeTable, this, propertyName, slot); } bool JSSVGColorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor<JSSVGColorPrototype, JSObject>(exec, &JSSVGColorPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSSVGColor::s_info = { "SVGColor", &JSCSSValue::s_info, &JSSVGColorTable, 0 }; JSSVGColor::JSSVGColor(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SVGColor> impl) : JSCSSValue(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSSVGColor::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSVGColorPrototype(exec->globalData(), globalObject, JSSVGColorPrototype::createStructure(exec->globalData(), JSCSSValuePrototype::self(exec, globalObject))); } bool JSSVGColor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSSVGColor, Base>(exec, &JSSVGColorTable, this, propertyName, slot); } bool JSSVGColor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSSVGColor, Base>(exec, &JSSVGColorTable, this, propertyName, descriptor); } JSValue jsSVGColorColorType(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGColor* imp = static_cast<SVGColor*>(castedThis->impl()); JSValue result = jsNumber(imp->colorType()); return result; } JSValue jsSVGColorRgbColor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(slotBase)); UNUSED_PARAM(exec); SVGColor* imp = static_cast<SVGColor*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->rgbColor())); return result; } JSValue jsSVGColorConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSSVGColor* domObject = static_cast<JSSVGColor*>(asObject(slotBase)); return JSSVGColor::getConstructor(exec, domObject->globalObject()); } JSValue JSSVGColor::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSSVGColorConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsSVGColorPrototypeFunctionSetRGBColor(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGColor::s_info)) return throwVMTypeError(exec); JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGColor::s_info); SVGColor* imp = static_cast<SVGColor*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); ExceptionCode ec = 0; const String& rgbColor(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setRGBColor(rgbColor, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsSVGColorPrototypeFunctionSetRGBColorICCColor(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGColor::s_info)) return throwVMTypeError(exec); JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGColor::s_info); SVGColor* imp = static_cast<SVGColor*>(castedThis->impl()); if (exec->argumentCount() < 2) return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); ExceptionCode ec = 0; const String& rgbColor(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& iccColor(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setRGBColorICCColor(rgbColor, iccColor, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsSVGColorPrototypeFunctionSetColor(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSSVGColor::s_info)) return throwVMTypeError(exec); JSSVGColor* castedThis = static_cast<JSSVGColor*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSSVGColor::s_info); SVGColor* imp = static_cast<SVGColor*>(castedThis->impl()); if (exec->argumentCount() < 3) return throwVMError(exec, createSyntaxError(exec, "Not enough arguments")); ExceptionCode ec = 0; unsigned short colorType(exec->argument(0).toUInt32(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& rgbColor(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& iccColor(ustringToString(exec->argument(2).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setColor(colorType, rgbColor, iccColor, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } // Constant getters JSValue jsSVGColorSVG_COLORTYPE_UNKNOWN(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsSVGColorSVG_COLORTYPE_RGBCOLOR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsSVGColorSVG_COLORTYPE_RGBCOLOR_ICCCOLOR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsSVGColorSVG_COLORTYPE_CURRENTCOLOR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSTextEvent); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTextEventTableValues[] = { { "data", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTextEventData), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTextEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTextEventTable = { 4, 3, JSTextEventTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTextEventConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTextEventConstructorTable = { 1, 0, JSTextEventConstructorTableValues, 0 }; class JSTextEventConstructor : public DOMConstructorObject { private: JSTextEventConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSTextEventConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSTextEventConstructor* ptr = new (JSC::allocateCell<JSTextEventConstructor>(*exec->heap())) JSTextEventConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSTextEventConstructor::s_info = { "TextEventConstructor", &DOMConstructorObject::s_info, &JSTextEventConstructorTable, 0 }; JSTextEventConstructor::JSTextEventConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSTextEventConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTextEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSTextEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSTextEventConstructor, JSDOMWrapper>(exec, &JSTextEventConstructorTable, this, propertyName, slot); } bool JSTextEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSTextEventConstructor, JSDOMWrapper>(exec, &JSTextEventConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTextEventPrototypeTableValues[] = { { "initTextEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTextEventPrototypeFunctionInitTextEvent), (intptr_t)5 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTextEventPrototypeTable = { 2, 1, JSTextEventPrototypeTableValues, 0 }; const ClassInfo JSTextEventPrototype::s_info = { "TextEventPrototype", &JSC::JSNonFinalObject::s_info, &JSTextEventPrototypeTable, 0 }; JSObject* JSTextEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSTextEvent>(exec, globalObject); } bool JSTextEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSTextEventPrototypeTable, this, propertyName, slot); } bool JSTextEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSTextEventPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSTextEvent::s_info = { "TextEvent", &JSUIEvent::s_info, &JSTextEventTable, 0 }; JSTextEvent::JSTextEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TextEvent> impl) : JSUIEvent(structure, globalObject, impl) { } void JSTextEvent::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSTextEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSTextEventPrototype::create(exec->globalData(), globalObject, JSTextEventPrototype::createStructure(exec->globalData(), globalObject, JSUIEventPrototype::self(exec, globalObject))); } bool JSTextEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSTextEvent, Base>(exec, &JSTextEventTable, this, propertyName, slot); } bool JSTextEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSTextEvent, Base>(exec, &JSTextEventTable, this, propertyName, descriptor); } JSValue jsTextEventData(ExecState* exec, JSValue slotBase, const Identifier&) { JSTextEvent* castedThis = static_cast<JSTextEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); TextEvent* imp = static_cast<TextEvent*>(castedThis->impl()); JSValue result = jsString(exec, imp->data()); return result; } JSValue jsTextEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSTextEvent* domObject = static_cast<JSTextEvent*>(asObject(slotBase)); return JSTextEvent::getConstructor(exec, domObject->globalObject()); } JSValue JSTextEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTextEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsTextEventPrototypeFunctionInitTextEvent(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTextEvent::s_info)) return throwVMTypeError(exec); JSTextEvent* castedThis = static_cast<JSTextEvent*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTextEvent::s_info); TextEvent* imp = static_cast<TextEvent*>(castedThis->impl()); const String& typeArg(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool canBubbleArg(exec->argument(1).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool cancelableArg(exec->argument(2).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); DOMWindow* viewArg(toDOMWindow(exec->argument(3))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& dataArg(ustringToString(exec->argument(4).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->initTextEvent(typeArg, canBubbleArg, cancelableArg, viewArg, dataArg); return JSValue::encode(jsUndefined()); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSAudioPannerNode); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSAudioPannerNodeTableValues[12] = { { "panningModel", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodePanningModel), (intptr_t)setJSAudioPannerNodePanningModel THUNK_GENERATOR(0) }, { "distanceModel", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeDistanceModel), (intptr_t)setJSAudioPannerNodeDistanceModel THUNK_GENERATOR(0) }, { "refDistance", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeRefDistance), (intptr_t)setJSAudioPannerNodeRefDistance THUNK_GENERATOR(0) }, { "maxDistance", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeMaxDistance), (intptr_t)setJSAudioPannerNodeMaxDistance THUNK_GENERATOR(0) }, { "rolloffFactor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeRolloffFactor), (intptr_t)setJSAudioPannerNodeRolloffFactor THUNK_GENERATOR(0) }, { "coneInnerAngle", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeConeInnerAngle), (intptr_t)setJSAudioPannerNodeConeInnerAngle THUNK_GENERATOR(0) }, { "coneOuterAngle", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeConeOuterAngle), (intptr_t)setJSAudioPannerNodeConeOuterAngle THUNK_GENERATOR(0) }, { "coneOuterGain", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeConeOuterGain), (intptr_t)setJSAudioPannerNodeConeOuterGain THUNK_GENERATOR(0) }, { "coneGain", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeConeGain), (intptr_t)0 THUNK_GENERATOR(0) }, { "distanceGain", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeDistanceGain), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSAudioPannerNodeTable = { 35, 31, JSAudioPannerNodeTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSAudioPannerNodeConstructorTableValues[4] = { { "EQUALPOWER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeEQUALPOWER), (intptr_t)0 THUNK_GENERATOR(0) }, { "HRTF", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeHRTF), (intptr_t)0 THUNK_GENERATOR(0) }, { "SOUNDFIELD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeSOUNDFIELD), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSAudioPannerNodeConstructorTable = { 9, 7, JSAudioPannerNodeConstructorTableValues, 0 }; COMPILE_ASSERT(0 == AudioPannerNode::EQUALPOWER, AudioPannerNodeEnumEQUALPOWERIsWrongUseDontCheckEnums); COMPILE_ASSERT(1 == AudioPannerNode::HRTF, AudioPannerNodeEnumHRTFIsWrongUseDontCheckEnums); COMPILE_ASSERT(2 == AudioPannerNode::SOUNDFIELD, AudioPannerNodeEnumSOUNDFIELDIsWrongUseDontCheckEnums); class JSAudioPannerNodeConstructor : public DOMConstructorObject { public: JSAudioPannerNodeConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSAudioPannerNodeConstructor::s_info = { "AudioPannerNodeConstructor", &DOMConstructorObject::s_info, &JSAudioPannerNodeConstructorTable, 0 }; JSAudioPannerNodeConstructor::JSAudioPannerNodeConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSAudioPannerNodePrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSAudioPannerNodeConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSAudioPannerNodeConstructor, JSDOMWrapper>(exec, &JSAudioPannerNodeConstructorTable, this, propertyName, slot); } bool JSAudioPannerNodeConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSAudioPannerNodeConstructor, JSDOMWrapper>(exec, &JSAudioPannerNodeConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSAudioPannerNodePrototypeTableValues[7] = { { "EQUALPOWER", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeEQUALPOWER), (intptr_t)0 THUNK_GENERATOR(0) }, { "HRTF", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeHRTF), (intptr_t)0 THUNK_GENERATOR(0) }, { "SOUNDFIELD", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsAudioPannerNodeSOUNDFIELD), (intptr_t)0 THUNK_GENERATOR(0) }, { "setPosition", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioPannerNodePrototypeFunctionSetPosition), (intptr_t)3 THUNK_GENERATOR(0) }, { "setOrientation", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioPannerNodePrototypeFunctionSetOrientation), (intptr_t)3 THUNK_GENERATOR(0) }, { "setVelocity", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsAudioPannerNodePrototypeFunctionSetVelocity), (intptr_t)3 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSAudioPannerNodePrototypeTable = { 17, 15, JSAudioPannerNodePrototypeTableValues, 0 }; const ClassInfo JSAudioPannerNodePrototype::s_info = { "AudioPannerNodePrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSAudioPannerNodePrototypeTable, 0 }; JSObject* JSAudioPannerNodePrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSAudioPannerNode>(exec, globalObject); } bool JSAudioPannerNodePrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot<JSAudioPannerNodePrototype, JSObject>(exec, &JSAudioPannerNodePrototypeTable, this, propertyName, slot); } bool JSAudioPannerNodePrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor<JSAudioPannerNodePrototype, JSObject>(exec, &JSAudioPannerNodePrototypeTable, this, propertyName, descriptor); } const ClassInfo JSAudioPannerNode::s_info = { "AudioPannerNode", &JSAudioNode::s_info, &JSAudioPannerNodeTable, 0 }; JSAudioPannerNode::JSAudioPannerNode(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<AudioPannerNode> impl) : JSAudioNode(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSAudioPannerNode::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSAudioPannerNodePrototype(exec->globalData(), globalObject, JSAudioPannerNodePrototype::createStructure(exec->globalData(), JSAudioNodePrototype::self(exec, globalObject))); } bool JSAudioPannerNode::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSAudioPannerNode, Base>(exec, &JSAudioPannerNodeTable, this, propertyName, slot); } bool JSAudioPannerNode::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSAudioPannerNode, Base>(exec, &JSAudioPannerNodeTable, this, propertyName, descriptor); } JSValue jsAudioPannerNodePanningModel(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->panningModel()); return result; } JSValue jsAudioPannerNodeDistanceModel(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->distanceModel()); return result; } JSValue jsAudioPannerNodeRefDistance(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->refDistance()); return result; } JSValue jsAudioPannerNodeMaxDistance(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->maxDistance()); return result; } JSValue jsAudioPannerNodeRolloffFactor(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->rolloffFactor()); return result; } JSValue jsAudioPannerNodeConeInnerAngle(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->coneInnerAngle()); return result; } JSValue jsAudioPannerNodeConeOuterAngle(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->coneOuterAngle()); return result; } JSValue jsAudioPannerNodeConeOuterGain(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = jsNumber(imp->coneOuterGain()); return result; } JSValue jsAudioPannerNodeConeGain(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->coneGain())); return result; } JSValue jsAudioPannerNodeDistanceGain(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(slotBase)); UNUSED_PARAM(exec); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->distanceGain())); return result; } JSValue jsAudioPannerNodeConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSAudioPannerNode* domObject = static_cast<JSAudioPannerNode*>(asObject(slotBase)); return JSAudioPannerNode::getConstructor(exec, domObject->globalObject()); } void JSAudioPannerNode::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSAudioPannerNode, Base>(exec, propertyName, value, &JSAudioPannerNodeTable, this, slot); } void setJSAudioPannerNodePanningModel(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setPanningModel(value.toUInt32(exec)); } void setJSAudioPannerNodeDistanceModel(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setDistanceModel(value.toUInt32(exec)); } void setJSAudioPannerNodeRefDistance(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setRefDistance(value.toFloat(exec)); } void setJSAudioPannerNodeMaxDistance(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setMaxDistance(value.toFloat(exec)); } void setJSAudioPannerNodeRolloffFactor(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setRolloffFactor(value.toFloat(exec)); } void setJSAudioPannerNodeConeInnerAngle(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setConeInnerAngle(value.toFloat(exec)); } void setJSAudioPannerNodeConeOuterAngle(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setConeOuterAngle(value.toFloat(exec)); } void setJSAudioPannerNodeConeOuterGain(ExecState* exec, JSObject* thisObject, JSValue value) { JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(thisObject); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); imp->setConeOuterGain(value.toFloat(exec)); } JSValue JSAudioPannerNode::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSAudioPannerNodeConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsAudioPannerNodePrototypeFunctionSetPosition(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSAudioPannerNode::s_info)) return throwVMTypeError(exec); JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSAudioPannerNode::s_info); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); float x(exec->argument(0).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float y(exec->argument(1).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float z(exec->argument(2).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setPosition(x, y, z); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsAudioPannerNodePrototypeFunctionSetOrientation(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSAudioPannerNode::s_info)) return throwVMTypeError(exec); JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSAudioPannerNode::s_info); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); float x(exec->argument(0).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float y(exec->argument(1).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float z(exec->argument(2).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setOrientation(x, y, z); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsAudioPannerNodePrototypeFunctionSetVelocity(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSAudioPannerNode::s_info)) return throwVMTypeError(exec); JSAudioPannerNode* castedThis = static_cast<JSAudioPannerNode*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSAudioPannerNode::s_info); AudioPannerNode* imp = static_cast<AudioPannerNode*>(castedThis->impl()); float x(exec->argument(0).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float y(exec->argument(1).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); float z(exec->argument(2).toFloat(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->setVelocity(x, y, z); return JSValue::encode(jsUndefined()); } // Constant getters JSValue jsAudioPannerNodeEQUALPOWER(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsAudioPannerNodeHRTF(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsAudioPannerNodeSOUNDFIELD(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, AudioPannerNode* impl) { return wrap<JSAudioPannerNode>(exec, globalObject, impl); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSDeviceOrientationEvent); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSDeviceOrientationEventTableValues[5] = { { "alpha", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDeviceOrientationEventAlpha), (intptr_t)0 THUNK_GENERATOR(0) }, { "beta", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDeviceOrientationEventBeta), (intptr_t)0 THUNK_GENERATOR(0) }, { "gamma", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDeviceOrientationEventGamma), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDeviceOrientationEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSDeviceOrientationEventTable = { 9, 7, JSDeviceOrientationEventTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSDeviceOrientationEventConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSDeviceOrientationEventConstructorTable = { 1, 0, JSDeviceOrientationEventConstructorTableValues, 0 }; class JSDeviceOrientationEventConstructor : public DOMConstructorObject { public: JSDeviceOrientationEventConstructor(JSC::ExecState*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); virtual const JSC::ClassInfo* classInfo() const { return &s_info; } static const JSC::ClassInfo s_info; static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) { return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSDeviceOrientationEventConstructor::s_info = { "DeviceOrientationEventConstructor", 0, &JSDeviceOrientationEventConstructorTable, 0 }; JSDeviceOrientationEventConstructor::JSDeviceOrientationEventConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) : DOMConstructorObject(JSDeviceOrientationEventConstructor::createStructure(globalObject->objectPrototype()), globalObject) { putDirect(exec->propertyNames().prototype, JSDeviceOrientationEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSDeviceOrientationEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSDeviceOrientationEventConstructor, DOMObject>(exec, &JSDeviceOrientationEventConstructorTable, this, propertyName, slot); } bool JSDeviceOrientationEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSDeviceOrientationEventConstructor, DOMObject>(exec, &JSDeviceOrientationEventConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSDeviceOrientationEventPrototypeTableValues[2] = { { "initDeviceOrientationEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDeviceOrientationEventPrototypeFunctionInitDeviceOrientationEvent), (intptr_t)6 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSDeviceOrientationEventPrototypeTable = { 2, 1, JSDeviceOrientationEventPrototypeTableValues, 0 }; const ClassInfo JSDeviceOrientationEventPrototype::s_info = { "DeviceOrientationEventPrototype", 0, &JSDeviceOrientationEventPrototypeTable, 0 }; JSObject* JSDeviceOrientationEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSDeviceOrientationEvent>(exec, globalObject); } bool JSDeviceOrientationEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSDeviceOrientationEventPrototypeTable, this, propertyName, slot); } bool JSDeviceOrientationEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSDeviceOrientationEventPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSDeviceOrientationEvent::s_info = { "DeviceOrientationEvent", &JSEvent::s_info, &JSDeviceOrientationEventTable, 0 }; JSDeviceOrientationEvent::JSDeviceOrientationEvent(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<DeviceOrientationEvent> impl) : JSEvent(structure, globalObject, impl) { } JSObject* JSDeviceOrientationEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSDeviceOrientationEventPrototype(globalObject, JSDeviceOrientationEventPrototype::createStructure(JSEventPrototype::self(exec, globalObject))); } bool JSDeviceOrientationEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSDeviceOrientationEvent, Base>(exec, &JSDeviceOrientationEventTable, this, propertyName, slot); } bool JSDeviceOrientationEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSDeviceOrientationEvent, Base>(exec, &JSDeviceOrientationEventTable, this, propertyName, descriptor); } JSValue jsDeviceOrientationEventAlpha(ExecState* exec, JSValue slotBase, const Identifier&) { JSDeviceOrientationEvent* castedThis = static_cast<JSDeviceOrientationEvent*>(asObject(slotBase)); return castedThis->alpha(exec); } JSValue jsDeviceOrientationEventBeta(ExecState* exec, JSValue slotBase, const Identifier&) { JSDeviceOrientationEvent* castedThis = static_cast<JSDeviceOrientationEvent*>(asObject(slotBase)); return castedThis->beta(exec); } JSValue jsDeviceOrientationEventGamma(ExecState* exec, JSValue slotBase, const Identifier&) { JSDeviceOrientationEvent* castedThis = static_cast<JSDeviceOrientationEvent*>(asObject(slotBase)); return castedThis->gamma(exec); } JSValue jsDeviceOrientationEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSDeviceOrientationEvent* domObject = static_cast<JSDeviceOrientationEvent*>(asObject(slotBase)); return JSDeviceOrientationEvent::getConstructor(exec, domObject->globalObject()); } JSValue JSDeviceOrientationEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSDeviceOrientationEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsDeviceOrientationEventPrototypeFunctionInitDeviceOrientationEvent(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSDeviceOrientationEvent::s_info)) return throwVMTypeError(exec); JSDeviceOrientationEvent* castedThis = static_cast<JSDeviceOrientationEvent*>(asObject(thisValue)); return JSValue::encode(castedThis->initDeviceOrientationEvent(exec)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSCrypto); /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSCryptoPrototypeTableValues[2] = { { "getRandomValues", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsCryptoPrototypeFunctionGetRandomValues), (intptr_t)1 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSCryptoPrototypeTable = { 2, 1, JSCryptoPrototypeTableValues, 0 }; const ClassInfo JSCryptoPrototype::s_info = { "CryptoPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSCryptoPrototypeTable, 0 }; JSObject* JSCryptoPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSCrypto>(exec, globalObject); } bool JSCryptoPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSCryptoPrototypeTable, this, propertyName, slot); } bool JSCryptoPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSCryptoPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSCrypto::s_info = { "Crypto", &JSDOMWrapper::s_info, 0, 0 }; JSCrypto::JSCrypto(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Crypto> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSCrypto::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSCryptoPrototype(exec->globalData(), globalObject, JSCryptoPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } EncodedJSValue JSC_HOST_CALL jsCryptoPrototypeFunctionGetRandomValues(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSCrypto::s_info)) return throwVMTypeError(exec); JSCrypto* castedThis = static_cast<JSCrypto*>(asObject(thisValue)); Crypto* imp = static_cast<Crypto*>(castedThis->impl()); ExceptionCode ec = 0; ArrayBufferView* array(toArrayBufferView(exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->getRandomValues(array, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, Crypto* impl) { return wrap<JSCrypto>(exec, globalObject, impl); } Crypto* toCrypto(JSC::JSValue value) { return value.inherits(&JSCrypto::s_info) ? static_cast<JSCrypto*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSTouchList); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTouchListTableValues[] = { { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchListLength), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTouchListConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTouchListTable = { 5, 3, JSTouchListTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTouchListConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTouchListConstructorTable = { 1, 0, JSTouchListConstructorTableValues, 0 }; class JSTouchListConstructor : public DOMConstructorObject { private: JSTouchListConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSTouchListConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSTouchListConstructor* ptr = new (JSC::allocateCell<JSTouchListConstructor>(*exec->heap())) JSTouchListConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSTouchListConstructor::s_info = { "TouchListConstructor", &DOMConstructorObject::s_info, &JSTouchListConstructorTable, 0 }; JSTouchListConstructor::JSTouchListConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSTouchListConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSTouchListPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSTouchListConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSTouchListConstructor, JSDOMWrapper>(exec, &JSTouchListConstructorTable, this, propertyName, slot); } bool JSTouchListConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSTouchListConstructor, JSDOMWrapper>(exec, &JSTouchListConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSTouchListPrototypeTableValues[] = { { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsTouchListPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSTouchListPrototypeTable = { 2, 1, JSTouchListPrototypeTableValues, 0 }; const ClassInfo JSTouchListPrototype::s_info = { "TouchListPrototype", &JSC::JSNonFinalObject::s_info, &JSTouchListPrototypeTable, 0 }; JSObject* JSTouchListPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSTouchList>(exec, globalObject); } bool JSTouchListPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSTouchListPrototypeTable, this, propertyName, slot); } bool JSTouchListPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSTouchListPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSTouchList::s_info = { "TouchList", &JSDOMWrapper::s_info, &JSTouchListTable, 0 }; JSTouchList::JSTouchList(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<TouchList> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSTouchList::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSTouchList::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSTouchListPrototype::create(exec->globalData(), globalObject, JSTouchListPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSTouchList::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); const HashEntry* entry = JSTouchListTable.entry(exec, propertyName); if (entry) { slot.setCustom(this, entry->propertyGetter()); return true; } bool ok; unsigned index = propertyName.toUInt32(ok); if (ok && index < static_cast<TouchList*>(impl())->length()) { slot.setCustomIndex(this, index, indexGetter); return true; } return getStaticValueSlot<JSTouchList, Base>(exec, &JSTouchListTable, this, propertyName, slot); } bool JSTouchList::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); const HashEntry* entry = JSTouchListTable.entry(exec, propertyName); if (entry) { PropertySlot slot; slot.setCustom(this, entry->propertyGetter()); descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); return true; } bool ok; unsigned index = propertyName.toUInt32(ok); if (ok && index < static_cast<TouchList*>(impl())->length()) { PropertySlot slot; slot.setCustomIndex(this, index, indexGetter); descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); return true; } return getStaticValueDescriptor<JSTouchList, Base>(exec, &JSTouchListTable, this, propertyName, descriptor); } bool JSTouchList::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); if (propertyName < static_cast<TouchList*>(impl())->length()) { slot.setCustomIndex(this, propertyName, indexGetter); return true; } return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); } JSValue jsTouchListLength(ExecState* exec, JSValue slotBase, const Identifier&) { JSTouchList* castedThis = static_cast<JSTouchList*>(asObject(slotBase)); UNUSED_PARAM(exec); TouchList* imp = static_cast<TouchList*>(castedThis->impl()); JSValue result = jsNumber(imp->length()); return result; } JSValue jsTouchListConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSTouchList* domObject = static_cast<JSTouchList*>(asObject(slotBase)); return JSTouchList::getConstructor(exec, domObject->globalObject()); } void JSTouchList::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); for (unsigned i = 0; i < static_cast<TouchList*>(impl())->length(); ++i) propertyNames.add(Identifier::from(exec, i)); Base::getOwnPropertyNames(exec, propertyNames, mode); } JSValue JSTouchList::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSTouchListConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsTouchListPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTouchList::s_info)) return throwVMTypeError(exec); JSTouchList* castedThis = static_cast<JSTouchList*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTouchList::s_info); TouchList* imp = static_cast<TouchList*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createTypeError(exec, "Not enough arguments")); unsigned index(exec->argument(0).toUInt32(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index))); return JSValue::encode(result); } JSValue JSTouchList::indexGetter(ExecState* exec, JSValue slotBase, unsigned index) { JSTouchList* thisObj = static_cast<JSTouchList*>(asObject(slotBase)); ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info); return toJS(exec, thisObj->globalObject(), static_cast<TouchList*>(thisObj->impl())->item(index)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TouchList* impl) { return wrap<JSTouchList>(exec, globalObject, impl); } TouchList* toTouchList(JSC::JSValue value) { return value.inherits(&JSTouchList::s_info) ? static_cast<JSTouchList*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLElementTableValues[19] = { { "id", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementId), (intptr_t)setJSHTMLElementId THUNK_GENERATOR(0) }, { "title", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementTitle), (intptr_t)setJSHTMLElementTitle THUNK_GENERATOR(0) }, { "lang", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementLang), (intptr_t)setJSHTMLElementLang THUNK_GENERATOR(0) }, { "dir", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementDir), (intptr_t)setJSHTMLElementDir THUNK_GENERATOR(0) }, { "className", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementClassName), (intptr_t)setJSHTMLElementClassName THUNK_GENERATOR(0) }, { "classList", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementClassList), (intptr_t)0 THUNK_GENERATOR(0) }, { "tabIndex", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementTabIndex), (intptr_t)setJSHTMLElementTabIndex THUNK_GENERATOR(0) }, { "draggable", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementDraggable), (intptr_t)setJSHTMLElementDraggable THUNK_GENERATOR(0) }, { "hidden", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementHidden), (intptr_t)setJSHTMLElementHidden THUNK_GENERATOR(0) }, { "innerHTML", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementInnerHTML), (intptr_t)setJSHTMLElementInnerHTML THUNK_GENERATOR(0) }, { "innerText", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementInnerText), (intptr_t)setJSHTMLElementInnerText THUNK_GENERATOR(0) }, { "outerHTML", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementOuterHTML), (intptr_t)setJSHTMLElementOuterHTML THUNK_GENERATOR(0) }, { "outerText", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementOuterText), (intptr_t)setJSHTMLElementOuterText THUNK_GENERATOR(0) }, { "children", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementChildren), (intptr_t)0 THUNK_GENERATOR(0) }, { "contentEditable", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementContentEditable), (intptr_t)setJSHTMLElementContentEditable THUNK_GENERATOR(0) }, { "isContentEditable", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementIsContentEditable), (intptr_t)0 THUNK_GENERATOR(0) }, { "spellcheck", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementSpellcheck), (intptr_t)setJSHTMLElementSpellcheck THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLElementTable = { 67, 63, JSHTMLElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLElementConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLElementConstructorTable = { 1, 0, JSHTMLElementConstructorTableValues, 0 }; class JSHTMLElementConstructor : public DOMConstructorObject { public: JSHTMLElementConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLElementConstructor::s_info = { "HTMLElementConstructor", &DOMConstructorObject::s_info, &JSHTMLElementConstructorTable, 0 }; JSHTMLElementConstructor::JSHTMLElementConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLElementConstructor, JSDOMWrapper>(exec, &JSHTMLElementConstructorTable, this, propertyName, slot); } bool JSHTMLElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLElementConstructor, JSDOMWrapper>(exec, &JSHTMLElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLElementPrototypeTableValues[4] = { { "insertAdjacentElement", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLElementPrototypeFunctionInsertAdjacentElement), (intptr_t)2 THUNK_GENERATOR(0) }, { "insertAdjacentHTML", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLElementPrototypeFunctionInsertAdjacentHTML), (intptr_t)2 THUNK_GENERATOR(0) }, { "insertAdjacentText", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLElementPrototypeFunctionInsertAdjacentText), (intptr_t)2 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLElementPrototypeTable = { 8, 7, JSHTMLElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLElementPrototype::s_info = { "HTMLElementPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSHTMLElementPrototypeTable, 0 }; JSObject* JSHTMLElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLElement>(exec, globalObject); } bool JSHTMLElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSHTMLElementPrototypeTable, this, propertyName, slot); } bool JSHTMLElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLElementPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSHTMLElement::s_info = { "HTMLElement", &JSElement::s_info, &JSHTMLElementTable, 0 }; JSHTMLElement::JSHTMLElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLElement> impl) : JSElement(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSHTMLElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSHTMLElementPrototype(exec->globalData(), globalObject, JSHTMLElementPrototype::createStructure(exec->globalData(), JSElementPrototype::self(exec, globalObject))); } bool JSHTMLElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLElement, Base>(exec, &JSHTMLElementTable, this, propertyName, slot); } bool JSHTMLElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLElement, Base>(exec, &JSHTMLElementTable, this, propertyName, descriptor); } JSValue jsHTMLElementId(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::idAttr)); return result; } JSValue jsHTMLElementTitle(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::titleAttr)); return result; } JSValue jsHTMLElementLang(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::langAttr)); return result; } JSValue jsHTMLElementDir(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::dirAttr)); return result; } JSValue jsHTMLElementClassName(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::classAttr)); return result; } JSValue jsHTMLElementClassList(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->classList())); return result; } JSValue jsHTMLElementTabIndex(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsNumber(imp->tabIndex()); return result; } JSValue jsHTMLElementDraggable(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->draggable()); return result; } JSValue jsHTMLElementHidden(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::hiddenAttr)); return result; } JSValue jsHTMLElementInnerHTML(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->innerHTML()); #if defined(JSC_TAINTED) if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementInnerHTML"; trace_struct.jsfunc = "htmlelement.innerHTML"; trace_struct.action = "propagate"; trace_struct.value = TaintedUtils::UString2string(result.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } #endif return result; } JSValue jsHTMLElementInnerText(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->innerText()); #if defined(JSC_TAINTED) if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementInnerText"; trace_struct.jsfunc = "htmlelement.innerText"; trace_struct.action = "propagate"; trace_struct.value = TaintedUtils::UString2string(result.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } #endif return result; } JSValue jsHTMLElementOuterHTML(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->outerHTML()); #if defined(JSC_TAINTED) if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementOuterHTML"; trace_struct.jsfunc = "htmlelement.outerHTML"; trace_struct.action = "propagate"; trace_struct.value = TaintedUtils::UString2string(result.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } #endif return result; } JSValue jsHTMLElementOuterText(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->outerText()); #if defined(JSC_TAINTED) if (imp->tainted()) { unsigned int tainted = imp->tainted(); result.setTainted(imp->tainted()); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "jsHTMLElementOuterText"; trace_struct.jsfunc = "htmlelement.outerText"; trace_struct.action = "propagate"; trace_struct.value = TaintedUtils::UString2string(result.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } #endif return result; } JSValue jsHTMLElementChildren(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->children())); return result; } JSValue jsHTMLElementContentEditable(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->contentEditable()); return result; } JSValue jsHTMLElementIsContentEditable(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->isContentEditable()); return result; } JSValue jsHTMLElementSpellcheck(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->spellcheck()); return result; } JSValue jsHTMLElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLElement* domObject = static_cast<JSHTMLElement*>(asObject(slotBase)); return JSHTMLElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { lookupPut<JSHTMLElement, Base>(exec, propertyName, value, &JSHTMLElementTable, this, slot); } void setJSHTMLElementId(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::idAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLElementTitle(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::titleAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLElementLang(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::langAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLElementDir(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::dirAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLElementClassName(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::classAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLElementTabIndex(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setTabIndex(value.toInt32(exec)); } void setJSHTMLElementDraggable(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setDraggable(value.toBoolean(exec)); } void setJSHTMLElementHidden(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setBooleanAttribute(WebCore::HTMLNames::hiddenAttr, value.toBoolean(exec)); } /* |-------------------| |----------------| |------------------------------| | string passing in | --> | is it tainted? | --> Y --> | taint the element / document | (bad approach, need to reset the document taint) |___________________| |________________| |______________________________| | | |-------------------| | --> Y --> | taint the element | (best approach) |-------------------| the ideal implementation is to set the element as tainted only (no need to set the doucment as tainted), and then the js can detect the element is tainted or not. however, i found that js level detection does not work for the element now, so i tainted the document for reporting. this method has the side effect, if the element is untatined, then we need to clear the tainted flag of the document. */ void setJSHTMLElementInnerHTML(ExecState* exec, JSObject* thisObject, JSValue value) { #if defined(JSC_TAINTED) unsigned int tainted = TaintedUtils::isTainted(exec, value); #endif JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setInnerHTML(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); #if defined(JSC_TAINTED) unsigned int imp_tainted = imp->tainted(); if (tainted) { // cerr /* char cid[50]; JSValue id = jsString(exec, imp->getAttribute(WebCore::HTMLNames::idAttr)); UString sid = id.toString(exec); snprintf(cid, 50, "%s", sid.utf8(true).data()); cerr << "setJSHTMLElementInnerHTML:SETTING:" << cid << ":" << tainted << ":" << imp_tainted << endl; */ // cerr // // i dont know why this tainted flag cannot be queried from js level // seems like the HTML element is persistent, but it is not the right HTML element, so need to loop through and find out // imp->setTainted(tainted); imp->document()->setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "setJSHTMLElementInnerHTML"; trace_struct.jsfunc = "HTMLElement.innerHTML"; trace_struct.action = "sink"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); // // this condition really difficult to understand. // wanna to reset the innerHTML of this element if it is tainted and passing in string is not tainted. // there is a problem in this code, it is silly to do it, as if the imp->setTainted() is supposed to be work, then there is no need to do in this way. // } else if (imp_tainted == imp->document()->tainted() && imp_tainted != 0 && !tainted) { // cerr /* char cid[50]; JSValue id = jsString(exec, imp->getAttribute(WebCore::HTMLNames::idAttr)); UString sid = id.toString(exec); snprintf(cid, 50, "%s", sid.utf8(true).data()); cerr << "setJSHTMLElementInnerHTML:RESETTING:" << cid << endl; */ // cerr TaintedStructure trace_struct; trace_struct.taintedno = 0; // trace_struct.taintedno = imp_tainted; trace_struct.internalfunc = "setJSHTMLElementInnerHTML"; trace_struct.jsfunc = "HTMLElement.innerHTML"; trace_struct.action = "reset"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); imp->setTainted(0); } #endif } void setJSHTMLElementInnerText(ExecState* exec, JSObject* thisObject, JSValue value) { #if defined(JSC_TAINTED) unsigned int tainted = TaintedUtils::isTainted(exec, value); #endif JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setInnerText(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); #if defined(JSC_TAINTED) unsigned int imp_tainted = imp->tainted(); if (tainted) { imp->setTainted(tainted); imp->document()->setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "setJSHTMLElementInnerText"; trace_struct.jsfunc = "HTMLElement.innerText"; trace_struct.action = "sink"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } else if (imp_tainted == imp->document()->tainted() && imp_tainted != 0 && !tainted) { TaintedStructure trace_struct; trace_struct.taintedno = 0; // trace_struct.taintedno = imp_tainted; trace_struct.internalfunc = "setJSHTMLElementInnerText"; trace_struct.jsfunc = "HTMLElement.innerText"; trace_struct.action = "reset"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); imp->setTainted(0); } #endif } void setJSHTMLElementOuterHTML(ExecState* exec, JSObject* thisObject, JSValue value) { #if defined(JSC_TAINTED) unsigned int tainted = TaintedUtils::isTainted(exec, value); #endif JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setOuterHTML(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); #if defined(JSC_TAINTED) unsigned int imp_tainted = imp->tainted(); if (tainted) { imp->setTainted(tainted); imp->document()->setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "setJSHTMLElementOuterHTML"; trace_struct.jsfunc = "HTMLElement.outerHTML"; trace_struct.action = "sink"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } else if (imp_tainted == imp->document()->tainted() && imp_tainted != 0 && !tainted) { TaintedStructure trace_struct; trace_struct.taintedno = 0; // trace_struct.taintedno = imp_tainted; trace_struct.internalfunc = "setJSHTMLElementOuterHTML"; trace_struct.jsfunc = "HTMLElement.outerHTML"; trace_struct.action = "reset"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); imp->setTainted(0); } #endif } void setJSHTMLElementOuterText(ExecState* exec, JSObject* thisObject, JSValue value) { #if defined(JSC_TAINTED) unsigned int tainted = TaintedUtils::isTainted(exec, value); #endif JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setOuterText(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); #if defined(JSC_TAINTED) unsigned int imp_tainted = imp->tainted(); if (tainted) { imp->setTainted(tainted); imp->document()->setTainted(tainted); TaintedStructure trace_struct; trace_struct.taintedno = tainted; trace_struct.internalfunc = "setJSHTMLElementOuterText"; trace_struct.jsfunc = "HTMLElement.outerText"; trace_struct.action = "sink"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); } else if (imp_tainted == imp->document()->tainted() && imp_tainted != 0 && !tainted) { TaintedStructure trace_struct; trace_struct.taintedno = 0; // trace_struct.taintedno = tainted; trace_struct.internalfunc = "setJSHTMLElementOuterText"; trace_struct.jsfunc = "HTMLElement.outerText"; trace_struct.action = "reset"; trace_struct.value = TaintedUtils::UString2string(value.toString(exec)); TaintedTrace* trace = TaintedTrace::getInstance(); trace->addTaintedTrace(trace_struct); imp->setTainted(0); } #endif } void setJSHTMLElementContentEditable(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setContentEditable(valueToStringWithNullCheck(exec, value), ec); setDOMException(exec, ec); } void setJSHTMLElementSpellcheck(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); imp->setSpellcheck(value.toBoolean(exec)); } JSValue JSHTMLElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsHTMLElementPrototypeFunctionInsertAdjacentElement(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLElement::s_info)) return throwVMTypeError(exec); JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(thisValue)); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; const String& where(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); Element* element(toElement(exec->argument(1))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->insertAdjacentElement(where, element, ec))); setDOMException(exec, ec); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsHTMLElementPrototypeFunctionInsertAdjacentHTML(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLElement::s_info)) return throwVMTypeError(exec); JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(thisValue)); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; const String& where(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& html(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->insertAdjacentHTML(where, html, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsHTMLElementPrototypeFunctionInsertAdjacentText(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLElement::s_info)) return throwVMTypeError(exec); JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(thisValue)); HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl()); ExceptionCode ec = 0; const String& where(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& text(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->insertAdjacentText(where, text, ec); setDOMException(exec, ec); return JSValue::encode(jsUndefined()); } HTMLElement* toHTMLElement(JSC::JSValue value) { return value.inherits(&JSHTMLElement::s_info) ? static_cast<JSHTMLElement*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSWebGLVertexArrayObjectOES); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebGLVertexArrayObjectOESTableValues[2] = { { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebGLVertexArrayObjectOESConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebGLVertexArrayObjectOESTable = { 2, 1, JSWebGLVertexArrayObjectOESTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebGLVertexArrayObjectOESConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebGLVertexArrayObjectOESConstructorTable = { 1, 0, JSWebGLVertexArrayObjectOESConstructorTableValues, 0 }; class JSWebGLVertexArrayObjectOESConstructor : public DOMConstructorObject { public: JSWebGLVertexArrayObjectOESConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSWebGLVertexArrayObjectOESConstructor::s_info = { "WebGLVertexArrayObjectOESConstructor", &DOMConstructorObject::s_info, &JSWebGLVertexArrayObjectOESConstructorTable, 0 }; JSWebGLVertexArrayObjectOESConstructor::JSWebGLVertexArrayObjectOESConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSWebGLVertexArrayObjectOESPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSWebGLVertexArrayObjectOESConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSWebGLVertexArrayObjectOESConstructor, JSDOMWrapper>(exec, &JSWebGLVertexArrayObjectOESConstructorTable, this, propertyName, slot); } bool JSWebGLVertexArrayObjectOESConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSWebGLVertexArrayObjectOESConstructor, JSDOMWrapper>(exec, &JSWebGLVertexArrayObjectOESConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWebGLVertexArrayObjectOESPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWebGLVertexArrayObjectOESPrototypeTable = { 1, 0, JSWebGLVertexArrayObjectOESPrototypeTableValues, 0 }; const ClassInfo JSWebGLVertexArrayObjectOESPrototype::s_info = { "WebGLVertexArrayObjectOESPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSWebGLVertexArrayObjectOESPrototypeTable, 0 }; JSObject* JSWebGLVertexArrayObjectOESPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSWebGLVertexArrayObjectOES>(exec, globalObject); } const ClassInfo JSWebGLVertexArrayObjectOES::s_info = { "WebGLVertexArrayObjectOES", &JSDOMWrapper::s_info, &JSWebGLVertexArrayObjectOESTable, 0 }; JSWebGLVertexArrayObjectOES::JSWebGLVertexArrayObjectOES(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebGLVertexArrayObjectOES> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSWebGLVertexArrayObjectOES::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSWebGLVertexArrayObjectOESPrototype(exec->globalData(), globalObject, JSWebGLVertexArrayObjectOESPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSWebGLVertexArrayObjectOES::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSWebGLVertexArrayObjectOES, Base>(exec, &JSWebGLVertexArrayObjectOESTable, this, propertyName, slot); } bool JSWebGLVertexArrayObjectOES::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSWebGLVertexArrayObjectOES, Base>(exec, &JSWebGLVertexArrayObjectOESTable, this, propertyName, descriptor); } JSValue jsWebGLVertexArrayObjectOESConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSWebGLVertexArrayObjectOES* domObject = static_cast<JSWebGLVertexArrayObjectOES*>(asObject(slotBase)); return JSWebGLVertexArrayObjectOES::getConstructor(exec, domObject->globalObject()); } JSValue JSWebGLVertexArrayObjectOES::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSWebGLVertexArrayObjectOESConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebGLVertexArrayObjectOES* impl) { return wrap<JSWebGLVertexArrayObjectOES>(exec, globalObject, impl); } WebGLVertexArrayObjectOES* toWebGLVertexArrayObjectOES(JSC::JSValue value) { return value.inherits(&JSWebGLVertexArrayObjectOES::s_info) ? static_cast<JSWebGLVertexArrayObjectOES*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLAudioElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLAudioElementTableValues[] = { { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLAudioElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementTable = { 2, 1, JSHTMLAudioElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLAudioElementConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementConstructorTable = { 1, 0, JSHTMLAudioElementConstructorTableValues, 0 }; class JSHTMLAudioElementConstructor : public DOMConstructorObject { private: JSHTMLAudioElementConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSHTMLAudioElementConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSHTMLAudioElementConstructor* ptr = new (JSC::allocateCell<JSHTMLAudioElementConstructor>(*exec->heap())) JSHTMLAudioElementConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLAudioElementConstructor::s_info = { "HTMLAudioElementConstructor", &DOMConstructorObject::s_info, &JSHTMLAudioElementConstructorTable, 0 }; JSHTMLAudioElementConstructor::JSHTMLAudioElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSHTMLAudioElementConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLAudioElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLAudioElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLAudioElementConstructor, JSDOMWrapper>(exec, &JSHTMLAudioElementConstructorTable, this, propertyName, slot); } bool JSHTMLAudioElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLAudioElementConstructor, JSDOMWrapper>(exec, &JSHTMLAudioElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLAudioElementPrototypeTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLAudioElementPrototypeTable = { 1, 0, JSHTMLAudioElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLAudioElementPrototype::s_info = { "HTMLAudioElementPrototype", &JSC::JSNonFinalObject::s_info, &JSHTMLAudioElementPrototypeTable, 0 }; JSObject* JSHTMLAudioElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLAudioElement>(exec, globalObject); } const ClassInfo JSHTMLAudioElement::s_info = { "HTMLAudioElement", &JSHTMLMediaElement::s_info, &JSHTMLAudioElementTable, 0 }; JSHTMLAudioElement::JSHTMLAudioElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLAudioElement> impl) : JSHTMLMediaElement(structure, globalObject, impl) { } void JSHTMLAudioElement::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSHTMLAudioElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSHTMLAudioElementPrototype::create(exec->globalData(), globalObject, JSHTMLAudioElementPrototype::createStructure(exec->globalData(), globalObject, JSHTMLMediaElementPrototype::self(exec, globalObject))); } bool JSHTMLAudioElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, this, propertyName, slot); } bool JSHTMLAudioElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSHTMLAudioElement, Base>(exec, &JSHTMLAudioElementTable, this, propertyName, descriptor); } JSValue jsHTMLAudioElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLAudioElement* domObject = static_cast<JSHTMLAudioElement*>(asObject(slotBase)); return JSHTMLAudioElement::getConstructor(exec, domObject->globalObject()); } JSValue JSHTMLAudioElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLAudioElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSSQLError); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSQLErrorTableValues[3] = { { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorCode), (intptr_t)0 THUNK_GENERATOR(0) }, { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorMessage), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSQLErrorTable = { 4, 3, JSSQLErrorTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSSQLErrorPrototypeTableValues[9] = { { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DATABASE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorDATABASE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "VERSION_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorVERSION_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TOO_LARGE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorTOO_LARGE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "QUOTA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorQUOTA_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SYNTAX_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorSYNTAX_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsSQLErrorTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSSQLErrorPrototypeTable = { 16, 15, JSSQLErrorPrototypeTableValues, 0 }; static const HashTable* getJSSQLErrorPrototypeTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSSQLErrorPrototypeTable); } const ClassInfo JSSQLErrorPrototype::s_info = { "SQLErrorPrototype", &JSC::JSObjectWithGlobalObject::s_info, 0, getJSSQLErrorPrototypeTable }; JSObject* JSSQLErrorPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSSQLError>(exec, globalObject); } bool JSSQLErrorPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSQLErrorPrototype, JSObject>(exec, getJSSQLErrorPrototypeTable(exec), this, propertyName, slot); } bool JSSQLErrorPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSQLErrorPrototype, JSObject>(exec, getJSSQLErrorPrototypeTable(exec), this, propertyName, descriptor); } static const HashTable* getJSSQLErrorTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSSQLErrorTable); } const ClassInfo JSSQLError::s_info = { "SQLError", &JSDOMWrapper::s_info, 0, getJSSQLErrorTable }; JSSQLError::JSSQLError(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<SQLError> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSSQLError::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSSQLErrorPrototype(exec->globalData(), globalObject, JSSQLErrorPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSSQLError::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSSQLError, Base>(exec, getJSSQLErrorTable(exec), this, propertyName, slot); } bool JSSQLError::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSSQLError, Base>(exec, getJSSQLErrorTable(exec), this, propertyName, descriptor); } JSValue jsSQLErrorCode(ExecState* exec, JSValue slotBase, const Identifier&) { JSSQLError* castedThis = static_cast<JSSQLError*>(asObject(slotBase)); UNUSED_PARAM(exec); SQLError* imp = static_cast<SQLError*>(castedThis->impl()); JSValue result = jsNumber(imp->code()); return result; } JSValue jsSQLErrorMessage(ExecState* exec, JSValue slotBase, const Identifier&) { JSSQLError* castedThis = static_cast<JSSQLError*>(asObject(slotBase)); UNUSED_PARAM(exec); SQLError* imp = static_cast<SQLError*>(castedThis->impl()); JSValue result = jsString(exec, imp->message()); return result; } // Constant getters JSValue jsSQLErrorUNKNOWN_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsSQLErrorDATABASE_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsSQLErrorVERSION_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsSQLErrorTOO_LARGE_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } JSValue jsSQLErrorQUOTA_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(4)); } JSValue jsSQLErrorSYNTAX_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(5)); } JSValue jsSQLErrorCONSTRAINT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(6)); } JSValue jsSQLErrorTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(7)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, SQLError* impl) { return wrap<JSSQLError>(exec, globalObject, impl); } SQLError* toSQLError(JSC::JSValue value) { return value.inherits(&JSSQLError::s_info) ? static_cast<JSSQLError*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSWorkerNavigator); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWorkerNavigatorTableValues[6] = { { "appName", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerNavigatorAppName), (intptr_t)0 THUNK_GENERATOR(0) }, { "appVersion", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerNavigatorAppVersion), (intptr_t)0 THUNK_GENERATOR(0) }, { "platform", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerNavigatorPlatform), (intptr_t)0 THUNK_GENERATOR(0) }, { "userAgent", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerNavigatorUserAgent), (intptr_t)0 THUNK_GENERATOR(0) }, { "onLine", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWorkerNavigatorOnLine), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWorkerNavigatorTable = { 18, 15, JSWorkerNavigatorTableValues, 0 }; /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSWorkerNavigatorPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSWorkerNavigatorPrototypeTable = { 1, 0, JSWorkerNavigatorPrototypeTableValues, 0 }; static const HashTable* getJSWorkerNavigatorPrototypeTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSWorkerNavigatorPrototypeTable); } const ClassInfo JSWorkerNavigatorPrototype::s_info = { "WorkerNavigatorPrototype", &JSC::JSObjectWithGlobalObject::s_info, 0, getJSWorkerNavigatorPrototypeTable }; JSObject* JSWorkerNavigatorPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSWorkerNavigator>(exec, globalObject); } static const HashTable* getJSWorkerNavigatorTable(ExecState* exec) { return getHashTableForGlobalData(exec->globalData(), &JSWorkerNavigatorTable); } const ClassInfo JSWorkerNavigator::s_info = { "WorkerNavigator", &JSDOMWrapper::s_info, 0, getJSWorkerNavigatorTable }; JSWorkerNavigator::JSWorkerNavigator(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WorkerNavigator> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSWorkerNavigator::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSWorkerNavigatorPrototype(exec->globalData(), globalObject, JSWorkerNavigatorPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSWorkerNavigator::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSWorkerNavigator, Base>(exec, getJSWorkerNavigatorTable(exec), this, propertyName, slot); } bool JSWorkerNavigator::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSWorkerNavigator, Base>(exec, getJSWorkerNavigatorTable(exec), this, propertyName, descriptor); } JSValue jsWorkerNavigatorAppName(ExecState* exec, JSValue slotBase, const Identifier&) { JSWorkerNavigator* castedThis = static_cast<JSWorkerNavigator*>(asObject(slotBase)); UNUSED_PARAM(exec); WorkerNavigator* imp = static_cast<WorkerNavigator*>(castedThis->impl()); JSValue result = jsString(exec, imp->appName()); return result; } JSValue jsWorkerNavigatorAppVersion(ExecState* exec, JSValue slotBase, const Identifier&) { JSWorkerNavigator* castedThis = static_cast<JSWorkerNavigator*>(asObject(slotBase)); UNUSED_PARAM(exec); WorkerNavigator* imp = static_cast<WorkerNavigator*>(castedThis->impl()); JSValue result = jsString(exec, imp->appVersion()); return result; } JSValue jsWorkerNavigatorPlatform(ExecState* exec, JSValue slotBase, const Identifier&) { JSWorkerNavigator* castedThis = static_cast<JSWorkerNavigator*>(asObject(slotBase)); UNUSED_PARAM(exec); WorkerNavigator* imp = static_cast<WorkerNavigator*>(castedThis->impl()); JSValue result = jsString(exec, imp->platform()); return result; } JSValue jsWorkerNavigatorUserAgent(ExecState* exec, JSValue slotBase, const Identifier&) { JSWorkerNavigator* castedThis = static_cast<JSWorkerNavigator*>(asObject(slotBase)); UNUSED_PARAM(exec); WorkerNavigator* imp = static_cast<WorkerNavigator*>(castedThis->impl()); JSValue result = jsString(exec, imp->userAgent()); return result; } JSValue jsWorkerNavigatorOnLine(ExecState* exec, JSValue slotBase, const Identifier&) { JSWorkerNavigator* castedThis = static_cast<JSWorkerNavigator*>(asObject(slotBase)); UNUSED_PARAM(exec); WorkerNavigator* imp = static_cast<WorkerNavigator*>(castedThis->impl()); JSValue result = jsBoolean(imp->onLine()); return result; } static inline bool isObservable(JSWorkerNavigator* jsWorkerNavigator) { if (jsWorkerNavigator->hasCustomProperties()) return true; return false; } bool JSWorkerNavigatorOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) { JSWorkerNavigator* jsWorkerNavigator = static_cast<JSWorkerNavigator*>(handle.get().asCell()); if (!isObservable(jsWorkerNavigator)) return false; WorkerNavigator* root = jsWorkerNavigator->impl(); return visitor.containsOpaqueRoot(root); } void JSWorkerNavigatorOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) { JSWorkerNavigator* jsWorkerNavigator = static_cast<JSWorkerNavigator*>(handle.get().asCell()); DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context); uncacheWrapper(world, jsWorkerNavigator->impl(), jsWorkerNavigator); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WorkerNavigator* impl) { return wrap<JSWorkerNavigator>(exec, globalObject, impl); } WorkerNavigator* toWorkerNavigator(JSC::JSValue value) { return value.inherits(&JSWorkerNavigator::s_info) ? static_cast<JSWorkerNavigator*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSProgressEvent); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSProgressEventTableValues[5] = { { "lengthComputable", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventLengthComputable), (intptr_t)0 THUNK_GENERATOR(0) }, { "loaded", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventLoaded), (intptr_t)0 THUNK_GENERATOR(0) }, { "total", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventTotal), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsProgressEventConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSProgressEventTable = { 9, 7, JSProgressEventTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSProgressEventConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSProgressEventConstructorTable = { 1, 0, JSProgressEventConstructorTableValues, 0 }; class JSProgressEventConstructor : public DOMConstructorObject { public: JSProgressEventConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSProgressEventConstructor::s_info = { "ProgressEventConstructor", &DOMConstructorObject::s_info, &JSProgressEventConstructorTable, 0 }; JSProgressEventConstructor::JSProgressEventConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSProgressEventPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSProgressEventConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSProgressEventConstructor, JSDOMWrapper>(exec, &JSProgressEventConstructorTable, this, propertyName, slot); } bool JSProgressEventConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSProgressEventConstructor, JSDOMWrapper>(exec, &JSProgressEventConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSProgressEventPrototypeTableValues[2] = { { "initProgressEvent", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsProgressEventPrototypeFunctionInitProgressEvent), (intptr_t)6 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSProgressEventPrototypeTable = { 2, 1, JSProgressEventPrototypeTableValues, 0 }; const ClassInfo JSProgressEventPrototype::s_info = { "ProgressEventPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSProgressEventPrototypeTable, 0 }; JSObject* JSProgressEventPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSProgressEvent>(exec, globalObject); } bool JSProgressEventPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSProgressEventPrototypeTable, this, propertyName, slot); } bool JSProgressEventPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSProgressEventPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSProgressEvent::s_info = { "ProgressEvent", &JSEvent::s_info, &JSProgressEventTable, 0 }; JSProgressEvent::JSProgressEvent(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<ProgressEvent> impl) : JSEvent(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSProgressEvent::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSProgressEventPrototype(exec->globalData(), globalObject, JSProgressEventPrototype::createStructure(exec->globalData(), JSEventPrototype::self(exec, globalObject))); } bool JSProgressEvent::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSProgressEvent, Base>(exec, &JSProgressEventTable, this, propertyName, slot); } bool JSProgressEvent::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSProgressEvent, Base>(exec, &JSProgressEventTable, this, propertyName, descriptor); } JSValue jsProgressEventLengthComputable(ExecState* exec, JSValue slotBase, const Identifier&) { JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); JSValue result = jsBoolean(imp->lengthComputable()); return result; } JSValue jsProgressEventLoaded(ExecState* exec, JSValue slotBase, const Identifier&) { JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); JSValue result = jsNumber(imp->loaded()); return result; } JSValue jsProgressEventTotal(ExecState* exec, JSValue slotBase, const Identifier&) { JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(slotBase)); UNUSED_PARAM(exec); ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); JSValue result = jsNumber(imp->total()); return result; } JSValue jsProgressEventConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSProgressEvent* domObject = static_cast<JSProgressEvent*>(asObject(slotBase)); return JSProgressEvent::getConstructor(exec, domObject->globalObject()); } JSValue JSProgressEvent::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSProgressEventConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsProgressEventPrototypeFunctionInitProgressEvent(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSProgressEvent::s_info)) return throwVMTypeError(exec); JSProgressEvent* castedThis = static_cast<JSProgressEvent*>(asObject(thisValue)); ProgressEvent* imp = static_cast<ProgressEvent*>(castedThis->impl()); const String& typeArg(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool canBubbleArg(exec->argument(1).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool cancelableArg(exec->argument(2).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); bool lengthComputableArg(exec->argument(3).toBoolean(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); unsigned long long loadedArg(static_cast<unsigned long long>(exec->argument(4).toInteger(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); unsigned long long totalArg(static_cast<unsigned long long>(exec->argument(5).toInteger(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); imp->initProgressEvent(typeArg, canBubbleArg, cancelableArg, lengthComputableArg, loadedArg, totalArg); return JSValue::encode(jsUndefined()); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLHRElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLHRElementTableValues[6] = { { "align", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementAlign), (intptr_t)setJSHTMLHRElementAlign THUNK_GENERATOR(0) }, { "noShade", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementNoShade), (intptr_t)setJSHTMLHRElementNoShade THUNK_GENERATOR(0) }, { "size", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementSize), (intptr_t)setJSHTMLHRElementSize THUNK_GENERATOR(0) }, { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementWidth), (intptr_t)setJSHTMLHRElementWidth THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLHRElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementTable = { 17, 15, JSHTMLHRElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLHRElementConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementConstructorTable = { 1, 0, JSHTMLHRElementConstructorTableValues, 0 }; class JSHTMLHRElementConstructor : public DOMConstructorObject { public: JSHTMLHRElementConstructor(JSC::ExecState*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); virtual const JSC::ClassInfo* classInfo() const { return &s_info; } static const JSC::ClassInfo s_info; static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) { return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLHRElementConstructor::s_info = { "HTMLHRElementConstructor", 0, &JSHTMLHRElementConstructorTable, 0 }; JSHTMLHRElementConstructor::JSHTMLHRElementConstructor(ExecState* exec, JSDOMGlobalObject* globalObject) : DOMConstructorObject(JSHTMLHRElementConstructor::createStructure(globalObject->objectPrototype()), globalObject) { putDirect(exec->propertyNames().prototype, JSHTMLHRElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLHRElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLHRElementConstructor, DOMObject>(exec, &JSHTMLHRElementConstructorTable, this, propertyName, slot); } bool JSHTMLHRElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLHRElementConstructor, DOMObject>(exec, &JSHTMLHRElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLHRElementPrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLHRElementPrototypeTable = { 1, 0, JSHTMLHRElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLHRElementPrototype::s_info = { "HTMLHRElementPrototype", 0, &JSHTMLHRElementPrototypeTable, 0 }; JSObject* JSHTMLHRElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLHRElement>(exec, globalObject); } const ClassInfo JSHTMLHRElement::s_info = { "HTMLHRElement", &JSHTMLElement::s_info, &JSHTMLHRElementTable, 0 }; JSHTMLHRElement::JSHTMLHRElement(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLHRElement> impl) : JSHTMLElement(structure, globalObject, impl) { } JSObject* JSHTMLHRElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSHTMLHRElementPrototype(globalObject, JSHTMLHRElementPrototype::createStructure(JSHTMLElementPrototype::self(exec, globalObject))); } bool JSHTMLHRElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLHRElement, Base>(exec, &JSHTMLHRElementTable, this, propertyName, slot); } bool JSHTMLHRElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLHRElement, Base>(exec, &JSHTMLHRElementTable, this, propertyName, descriptor); } JSValue jsHTMLHRElementAlign(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::alignAttr)); return result; } JSValue jsHTMLHRElementNoShade(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::noshadeAttr)); return result; } JSValue jsHTMLHRElementSize(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::sizeAttr)); return result; } JSValue jsHTMLHRElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr)); return result; } JSValue jsHTMLHRElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLHRElement* domObject = static_cast<JSHTMLHRElement*>(asObject(slotBase)); return JSHTMLHRElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLHRElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { lookupPut<JSHTMLHRElement, Base>(exec, propertyName, value, &JSHTMLHRElementTable, this, slot); } void setJSHTMLHRElementAlign(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::alignAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLHRElementNoShade(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); imp->setBooleanAttribute(WebCore::HTMLNames::noshadeAttr, value.toBoolean(exec)); } void setJSHTMLHRElementSize(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::sizeAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLHRElementWidth(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLHRElement* castedThis = static_cast<JSHTMLHRElement*>(thisObject); HTMLHRElement* imp = static_cast<HTMLHRElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value)); } JSValue JSHTMLHRElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLHRElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSHTMLMarqueeElement); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLMarqueeElementTableValues[13] = { { "behavior", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementBehavior), (intptr_t)setJSHTMLMarqueeElementBehavior THUNK_GENERATOR(0) }, { "bgColor", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementBgColor), (intptr_t)setJSHTMLMarqueeElementBgColor THUNK_GENERATOR(0) }, { "direction", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementDirection), (intptr_t)setJSHTMLMarqueeElementDirection THUNK_GENERATOR(0) }, { "height", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementHeight), (intptr_t)setJSHTMLMarqueeElementHeight THUNK_GENERATOR(0) }, { "hspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementHspace), (intptr_t)setJSHTMLMarqueeElementHspace THUNK_GENERATOR(0) }, { "loop", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementLoop), (intptr_t)setJSHTMLMarqueeElementLoop THUNK_GENERATOR(0) }, { "scrollAmount", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementScrollAmount), (intptr_t)setJSHTMLMarqueeElementScrollAmount THUNK_GENERATOR(0) }, { "scrollDelay", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementScrollDelay), (intptr_t)setJSHTMLMarqueeElementScrollDelay THUNK_GENERATOR(0) }, { "trueSpeed", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementTrueSpeed), (intptr_t)setJSHTMLMarqueeElementTrueSpeed THUNK_GENERATOR(0) }, { "vspace", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementVspace), (intptr_t)setJSHTMLMarqueeElementVspace THUNK_GENERATOR(0) }, { "width", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementWidth), (intptr_t)setJSHTMLMarqueeElementWidth THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLMarqueeElementConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLMarqueeElementTable = { 36, 31, JSHTMLMarqueeElementTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLMarqueeElementConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLMarqueeElementConstructorTable = { 1, 0, JSHTMLMarqueeElementConstructorTableValues, 0 }; class JSHTMLMarqueeElementConstructor : public DOMConstructorObject { public: JSHTMLMarqueeElementConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSHTMLMarqueeElementConstructor::s_info = { "HTMLMarqueeElementConstructor", &DOMConstructorObject::s_info, &JSHTMLMarqueeElementConstructorTable, 0 }; JSHTMLMarqueeElementConstructor::JSHTMLMarqueeElementConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSHTMLMarqueeElementPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSHTMLMarqueeElementConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSHTMLMarqueeElementConstructor, JSDOMWrapper>(exec, &JSHTMLMarqueeElementConstructorTable, this, propertyName, slot); } bool JSHTMLMarqueeElementConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSHTMLMarqueeElementConstructor, JSDOMWrapper>(exec, &JSHTMLMarqueeElementConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSHTMLMarqueeElementPrototypeTableValues[3] = { { "start", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMarqueeElementPrototypeFunctionStart), (intptr_t)0 THUNK_GENERATOR(0) }, { "stop", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsHTMLMarqueeElementPrototypeFunctionStop), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSHTMLMarqueeElementPrototypeTable = { 5, 3, JSHTMLMarqueeElementPrototypeTableValues, 0 }; const ClassInfo JSHTMLMarqueeElementPrototype::s_info = { "HTMLMarqueeElementPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSHTMLMarqueeElementPrototypeTable, 0 }; JSObject* JSHTMLMarqueeElementPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSHTMLMarqueeElement>(exec, globalObject); } bool JSHTMLMarqueeElementPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSHTMLMarqueeElementPrototypeTable, this, propertyName, slot); } bool JSHTMLMarqueeElementPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSHTMLMarqueeElementPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSHTMLMarqueeElement::s_info = { "HTMLMarqueeElement", &JSHTMLElement::s_info, &JSHTMLMarqueeElementTable, 0 }; JSHTMLMarqueeElement::JSHTMLMarqueeElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLMarqueeElement> impl) : JSHTMLElement(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSHTMLMarqueeElement::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSHTMLMarqueeElementPrototype(exec->globalData(), globalObject, JSHTMLMarqueeElementPrototype::createStructure(exec->globalData(), JSHTMLElementPrototype::self(exec, globalObject))); } bool JSHTMLMarqueeElement::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSHTMLMarqueeElement, Base>(exec, &JSHTMLMarqueeElementTable, this, propertyName, slot); } bool JSHTMLMarqueeElement::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSHTMLMarqueeElement, Base>(exec, &JSHTMLMarqueeElementTable, this, propertyName, descriptor); } JSValue jsHTMLMarqueeElementBehavior(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::behaviorAttr)); return result; } JSValue jsHTMLMarqueeElementBgColor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::bgcolorAttr)); return result; } JSValue jsHTMLMarqueeElementDirection(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::directionAttr)); return result; } JSValue jsHTMLMarqueeElementHeight(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::heightAttr)); return result; } JSValue jsHTMLMarqueeElementHspace(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsNumber(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::hspaceAttr))); return result; } JSValue jsHTMLMarqueeElementLoop(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsNumber(imp->loop()); return result; } JSValue jsHTMLMarqueeElementScrollAmount(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsNumber(imp->scrollAmount()); return result; } JSValue jsHTMLMarqueeElementScrollDelay(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsNumber(imp->scrollDelay()); return result; } JSValue jsHTMLMarqueeElementTrueSpeed(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::truespeedAttr)); return result; } JSValue jsHTMLMarqueeElementVspace(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsNumber(std::max(0, imp->getIntegralAttribute(WebCore::HTMLNames::vspaceAttr))); return result; } JSValue jsHTMLMarqueeElementWidth(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); UNUSED_PARAM(exec); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::widthAttr)); return result; } JSValue jsHTMLMarqueeElementConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSHTMLMarqueeElement* domObject = static_cast<JSHTMLMarqueeElement*>(asObject(slotBase)); return JSHTMLMarqueeElement::getConstructor(exec, domObject->globalObject()); } void JSHTMLMarqueeElement::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSHTMLMarqueeElement, Base>(exec, propertyName, value, &JSHTMLMarqueeElementTable, this, slot); } void setJSHTMLMarqueeElementBehavior(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::behaviorAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLMarqueeElementBgColor(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::bgcolorAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLMarqueeElementDirection(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::directionAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLMarqueeElementHeight(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::heightAttr, valueToStringWithNullCheck(exec, value)); } void setJSHTMLMarqueeElementHspace(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::hspaceAttr, value.toUInt32(exec)); } void setJSHTMLMarqueeElementLoop(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setLoop(value.toInt32(exec), ec); setDOMException(exec, ec); } void setJSHTMLMarqueeElementScrollAmount(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setScrollAmount(value.toInt32(exec), ec); setDOMException(exec, ec); } void setJSHTMLMarqueeElementScrollDelay(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); ExceptionCode ec = 0; imp->setScrollDelay(value.toInt32(exec), ec); setDOMException(exec, ec); } void setJSHTMLMarqueeElementTrueSpeed(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setBooleanAttribute(WebCore::HTMLNames::truespeedAttr, value.toBoolean(exec)); } void setJSHTMLMarqueeElementVspace(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setUnsignedIntegralAttribute(WebCore::HTMLNames::vspaceAttr, value.toUInt32(exec)); } void setJSHTMLMarqueeElementWidth(ExecState* exec, JSObject* thisObject, JSValue value) { JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(thisObject); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->setAttribute(WebCore::HTMLNames::widthAttr, valueToStringWithNullCheck(exec, value)); } JSValue JSHTMLMarqueeElement::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSHTMLMarqueeElementConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsHTMLMarqueeElementPrototypeFunctionStart(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLMarqueeElement::s_info)) return throwVMTypeError(exec); JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLMarqueeElement::s_info); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->start(); return JSValue::encode(jsUndefined()); } EncodedJSValue JSC_HOST_CALL jsHTMLMarqueeElementPrototypeFunctionStop(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSHTMLMarqueeElement::s_info)) return throwVMTypeError(exec); JSHTMLMarqueeElement* castedThis = static_cast<JSHTMLMarqueeElement*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSHTMLMarqueeElement::s_info); HTMLMarqueeElement* imp = static_cast<HTMLMarqueeElement*>(castedThis->impl()); imp->stop(); return JSValue::encode(jsUndefined()); } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSNamedNodeMap); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNamedNodeMapTableValues[] = { { "length", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNamedNodeMapLength), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsNamedNodeMapConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapTable = { 5, 3, JSNamedNodeMapTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNamedNodeMapConstructorTableValues[] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapConstructorTable = { 1, 0, JSNamedNodeMapConstructorTableValues, 0 }; class JSNamedNodeMapConstructor : public DOMConstructorObject { private: JSNamedNodeMapConstructor(JSC::Structure*, JSDOMGlobalObject*); void finishCreation(JSC::ExecState*, JSDOMGlobalObject*); public: typedef DOMConstructorObject Base; static JSNamedNodeMapConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject) { JSNamedNodeMapConstructor* ptr = new (JSC::allocateCell<JSNamedNodeMapConstructor>(*exec->heap())) JSNamedNodeMapConstructor(structure, globalObject); ptr->finishCreation(exec, globalObject); return ptr; } virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) { return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSNamedNodeMapConstructor::s_info = { "NamedNodeMapConstructor", &DOMConstructorObject::s_info, &JSNamedNodeMapConstructorTable, 0 }; JSNamedNodeMapConstructor::JSNamedNodeMapConstructor(Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { } void JSNamedNodeMapConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject) { Base::finishCreation(exec->globalData()); ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSNamedNodeMapPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSNamedNodeMapConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSNamedNodeMapConstructor, JSDOMWrapper>(exec, &JSNamedNodeMapConstructorTable, this, propertyName, slot); } bool JSNamedNodeMapConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSNamedNodeMapConstructor, JSDOMWrapper>(exec, &JSNamedNodeMapConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSNamedNodeMapPrototypeTableValues[] = { { "getNamedItem", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionGetNamedItem), (intptr_t)1 THUNK_GENERATOR(0) }, { "setNamedItem", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionSetNamedItem), (intptr_t)1 THUNK_GENERATOR(0) }, { "removeNamedItem", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionRemoveNamedItem), (intptr_t)1 THUNK_GENERATOR(0) }, { "item", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionItem), (intptr_t)1 THUNK_GENERATOR(0) }, { "getNamedItemNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionGetNamedItemNS), (intptr_t)2 THUNK_GENERATOR(0) }, { "setNamedItemNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionSetNamedItemNS), (intptr_t)1 THUNK_GENERATOR(0) }, { "removeNamedItemNS", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsNamedNodeMapPrototypeFunctionRemoveNamedItemNS), (intptr_t)2 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSNamedNodeMapPrototypeTable = { 16, 15, JSNamedNodeMapPrototypeTableValues, 0 }; const ClassInfo JSNamedNodeMapPrototype::s_info = { "NamedNodeMapPrototype", &JSC::JSNonFinalObject::s_info, &JSNamedNodeMapPrototypeTable, 0 }; JSObject* JSNamedNodeMapPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSNamedNodeMap>(exec, globalObject); } bool JSNamedNodeMapPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticFunctionSlot<JSObject>(exec, &JSNamedNodeMapPrototypeTable, this, propertyName, slot); } bool JSNamedNodeMapPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticFunctionDescriptor<JSObject>(exec, &JSNamedNodeMapPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSNamedNodeMap::s_info = { "NamedNodeMap", &JSDOMWrapper::s_info, &JSNamedNodeMapTable, 0 }; JSNamedNodeMap::JSNamedNodeMap(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<NamedNodeMap> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { } void JSNamedNodeMap::finishCreation(JSGlobalData& globalData) { Base::finishCreation(globalData); ASSERT(inherits(&s_info)); } JSObject* JSNamedNodeMap::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return JSNamedNodeMapPrototype::create(exec->globalData(), globalObject, JSNamedNodeMapPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype())); } bool JSNamedNodeMap::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); JSValue proto = prototype(); if (proto.isObject() && static_cast<JSObject*>(asObject(proto))->hasProperty(exec, propertyName)) return false; const HashEntry* entry = JSNamedNodeMapTable.entry(exec, propertyName); if (entry) { slot.setCustom(this, entry->propertyGetter()); return true; } bool ok; unsigned index = propertyName.toUInt32(ok); if (ok && index < static_cast<NamedNodeMap*>(impl())->length()) { slot.setCustomIndex(this, index, indexGetter); return true; } if (canGetItemsForName(exec, static_cast<NamedNodeMap*>(impl()), propertyName)) { slot.setCustom(this, nameGetter); return true; } return getStaticValueSlot<JSNamedNodeMap, Base>(exec, &JSNamedNodeMapTable, this, propertyName, slot); } bool JSNamedNodeMap::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); JSValue proto = prototype(); if (proto.isObject() && static_cast<JSObject*>(asObject(proto))->hasProperty(exec, propertyName)) return false; const HashEntry* entry = JSNamedNodeMapTable.entry(exec, propertyName); if (entry) { PropertySlot slot; slot.setCustom(this, entry->propertyGetter()); descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes()); return true; } bool ok; unsigned index = propertyName.toUInt32(ok); if (ok && index < static_cast<NamedNodeMap*>(impl())->length()) { PropertySlot slot; slot.setCustomIndex(this, index, indexGetter); descriptor.setDescriptor(slot.getValue(exec, propertyName), DontDelete | ReadOnly); return true; } if (canGetItemsForName(exec, static_cast<NamedNodeMap*>(impl()), propertyName)) { PropertySlot slot; slot.setCustom(this, nameGetter); descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum); return true; } return getStaticValueDescriptor<JSNamedNodeMap, Base>(exec, &JSNamedNodeMapTable, this, propertyName, descriptor); } bool JSNamedNodeMap::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); if (propertyName < static_cast<NamedNodeMap*>(impl())->length()) { slot.setCustomIndex(this, propertyName, indexGetter); return true; } return getOwnPropertySlot(exec, Identifier::from(exec, propertyName), slot); } JSValue jsNamedNodeMapLength(ExecState* exec, JSValue slotBase, const Identifier&) { JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(slotBase)); UNUSED_PARAM(exec); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); JSValue result = jsNumber(imp->length()); return result; } JSValue jsNamedNodeMapConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSNamedNodeMap* domObject = static_cast<JSNamedNodeMap*>(asObject(slotBase)); return JSNamedNodeMap::getConstructor(exec, domObject->globalObject()); } void JSNamedNodeMap::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); for (unsigned i = 0; i < static_cast<NamedNodeMap*>(impl())->length(); ++i) propertyNames.add(Identifier::from(exec, i)); Base::getOwnPropertyNames(exec, propertyNames, mode); } JSValue JSNamedNodeMap::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSNamedNodeMapConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionGetNamedItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); const String& name(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getNamedItem(name))); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionSetNamedItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); ExceptionCode ec = 0; Node* node(toNode(exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->setNamedItem(node, ec))); setDOMException(exec, ec); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionRemoveNamedItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); ExceptionCode ec = 0; const String& name(ustringToString(exec->argument(0).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->removeNamedItem(name, ec))); setDOMException(exec, ec); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionItem(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); unsigned index(exec->argument(0).toUInt32(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->item(index))); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionGetNamedItemNS(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); const String& namespaceURI(valueToStringWithNullCheck(exec, exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& localName(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->getNamedItemNS(namespaceURI, localName))); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionSetNamedItemNS(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); ExceptionCode ec = 0; Node* node(toNode(exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->setNamedItemNS(node, ec))); setDOMException(exec, ec); return JSValue::encode(result); } EncodedJSValue JSC_HOST_CALL jsNamedNodeMapPrototypeFunctionRemoveNamedItemNS(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSNamedNodeMap::s_info)) return throwVMTypeError(exec); JSNamedNodeMap* castedThis = static_cast<JSNamedNodeMap*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSNamedNodeMap::s_info); NamedNodeMap* imp = static_cast<NamedNodeMap*>(castedThis->impl()); ExceptionCode ec = 0; const String& namespaceURI(valueToStringWithNullCheck(exec, exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); const String& localName(ustringToString(exec->argument(1).toString(exec))); if (exec->hadException()) return JSValue::encode(jsUndefined()); JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->removeNamedItemNS(namespaceURI, localName, ec))); setDOMException(exec, ec); return JSValue::encode(result); } JSValue JSNamedNodeMap::indexGetter(ExecState* exec, JSValue slotBase, unsigned index) { JSNamedNodeMap* thisObj = static_cast<JSNamedNodeMap*>(asObject(slotBase)); ASSERT_GC_OBJECT_INHERITS(thisObj, &s_info); return toJS(exec, thisObj->globalObject(), static_cast<NamedNodeMap*>(thisObj->impl())->item(index)); } static inline bool isObservable(JSNamedNodeMap* jsNamedNodeMap) { if (jsNamedNodeMap->hasCustomProperties()) return true; return false; } bool JSNamedNodeMapOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) { JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell()); if (!isObservable(jsNamedNodeMap)) return false; Element* element = jsNamedNodeMap->impl()->element(); if (!element) return false; void* root = WebCore::root(element); return visitor.containsOpaqueRoot(root); } void JSNamedNodeMapOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) { JSNamedNodeMap* jsNamedNodeMap = static_cast<JSNamedNodeMap*>(handle.get().asCell()); DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context); uncacheWrapper(world, jsNamedNodeMap->impl(), jsNamedNodeMap); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, NamedNodeMap* impl) { return wrap<JSNamedNodeMap>(exec, globalObject, impl); } NamedNodeMap* toNamedNodeMap(JSC::JSValue value) { return value.inherits(&JSNamedNodeMap::s_info) ? static_cast<JSNamedNodeMap*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSIDBDatabaseException); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSIDBDatabaseExceptionTableValues[5] = { { "code", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionCode), (intptr_t)0 THUNK_GENERATOR(0) }, { "name", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionName), (intptr_t)0 THUNK_GENERATOR(0) }, { "message", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionMessage), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSIDBDatabaseExceptionTable = { 10, 7, JSIDBDatabaseExceptionTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSIDBDatabaseExceptionConstructorTableValues[15] = { { "NO_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNO_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NON_TRANSIENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNON_TRANSIENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DATA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionDATA_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NOT_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNOT_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SERIAL_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionSERIAL_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "RECOVERABLE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionRECOVERABLE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TRANSIENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionTRANSIENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DEADLOCK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionDEADLOCK_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "READ_ONLY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionREAD_ONLY_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSIDBDatabaseExceptionConstructorTable = { 34, 31, JSIDBDatabaseExceptionConstructorTableValues, 0 }; class JSIDBDatabaseExceptionConstructor : public DOMConstructorObject { public: JSIDBDatabaseExceptionConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSIDBDatabaseExceptionConstructor::s_info = { "IDBDatabaseExceptionConstructor", &DOMConstructorObject::s_info, &JSIDBDatabaseExceptionConstructorTable, 0 }; JSIDBDatabaseExceptionConstructor::JSIDBDatabaseExceptionConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSIDBDatabaseExceptionPrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSIDBDatabaseExceptionConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSIDBDatabaseExceptionConstructor, JSDOMWrapper>(exec, &JSIDBDatabaseExceptionConstructorTable, this, propertyName, slot); } bool JSIDBDatabaseExceptionConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSIDBDatabaseExceptionConstructor, JSDOMWrapper>(exec, &JSIDBDatabaseExceptionConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSIDBDatabaseExceptionPrototypeTableValues[16] = { { "NO_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNO_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "UNKNOWN_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionUNKNOWN_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NON_TRANSIENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNON_TRANSIENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NOT_FOUND_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNOT_FOUND_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "CONSTRAINT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionCONSTRAINT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DATA_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionDATA_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "NOT_ALLOWED_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionNOT_ALLOWED_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "SERIAL_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionSERIAL_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "RECOVERABLE_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionRECOVERABLE_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TRANSIENT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionTRANSIENT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "TIMEOUT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionTIMEOUT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "DEADLOCK_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionDEADLOCK_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "READ_ONLY_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionREAD_ONLY_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "ABORT_ERR", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsIDBDatabaseExceptionABORT_ERR), (intptr_t)0 THUNK_GENERATOR(0) }, { "toString", DontDelete | DontEnum | Function, (intptr_t)static_cast<NativeFunction>(jsIDBDatabaseExceptionPrototypeFunctionToString), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSIDBDatabaseExceptionPrototypeTable = { 34, 31, JSIDBDatabaseExceptionPrototypeTableValues, 0 }; const ClassInfo JSIDBDatabaseExceptionPrototype::s_info = { "IDBDatabaseExceptionPrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSIDBDatabaseExceptionPrototypeTable, 0 }; JSObject* JSIDBDatabaseExceptionPrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSIDBDatabaseException>(exec, globalObject); } bool JSIDBDatabaseExceptionPrototype::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticPropertySlot<JSIDBDatabaseExceptionPrototype, JSObject>(exec, &JSIDBDatabaseExceptionPrototypeTable, this, propertyName, slot); } bool JSIDBDatabaseExceptionPrototype::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticPropertyDescriptor<JSIDBDatabaseExceptionPrototype, JSObject>(exec, &JSIDBDatabaseExceptionPrototypeTable, this, propertyName, descriptor); } const ClassInfo JSIDBDatabaseException::s_info = { "IDBDatabaseException", &JSDOMWrapper::s_info, &JSIDBDatabaseExceptionTable, 0 }; JSIDBDatabaseException::JSIDBDatabaseException(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<IDBDatabaseException> impl) : JSDOMWrapper(structure, globalObject) , m_impl(impl) { ASSERT(inherits(&s_info)); } JSObject* JSIDBDatabaseException::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSIDBDatabaseExceptionPrototype(exec->globalData(), globalObject, JSIDBDatabaseExceptionPrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype())); } bool JSIDBDatabaseException::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSIDBDatabaseException, Base>(exec, &JSIDBDatabaseExceptionTable, this, propertyName, slot); } bool JSIDBDatabaseException::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSIDBDatabaseException, Base>(exec, &JSIDBDatabaseExceptionTable, this, propertyName, descriptor); } JSValue jsIDBDatabaseExceptionCode(ExecState* exec, JSValue slotBase, const Identifier&) { JSIDBDatabaseException* castedThis = static_cast<JSIDBDatabaseException*>(asObject(slotBase)); UNUSED_PARAM(exec); IDBDatabaseException* imp = static_cast<IDBDatabaseException*>(castedThis->impl()); JSValue result = jsNumber(imp->code()); return result; } JSValue jsIDBDatabaseExceptionName(ExecState* exec, JSValue slotBase, const Identifier&) { JSIDBDatabaseException* castedThis = static_cast<JSIDBDatabaseException*>(asObject(slotBase)); UNUSED_PARAM(exec); IDBDatabaseException* imp = static_cast<IDBDatabaseException*>(castedThis->impl()); JSValue result = jsString(exec, imp->name()); return result; } JSValue jsIDBDatabaseExceptionMessage(ExecState* exec, JSValue slotBase, const Identifier&) { JSIDBDatabaseException* castedThis = static_cast<JSIDBDatabaseException*>(asObject(slotBase)); UNUSED_PARAM(exec); IDBDatabaseException* imp = static_cast<IDBDatabaseException*>(castedThis->impl()); JSValue result = jsString(exec, imp->message()); return result; } JSValue jsIDBDatabaseExceptionConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSIDBDatabaseException* domObject = static_cast<JSIDBDatabaseException*>(asObject(slotBase)); return JSIDBDatabaseException::getConstructor(exec, domObject->globalObject()); } JSValue JSIDBDatabaseException::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSIDBDatabaseExceptionConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } EncodedJSValue JSC_HOST_CALL jsIDBDatabaseExceptionPrototypeFunctionToString(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSIDBDatabaseException::s_info)) return throwVMTypeError(exec); JSIDBDatabaseException* castedThis = static_cast<JSIDBDatabaseException*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSIDBDatabaseException::s_info); IDBDatabaseException* imp = static_cast<IDBDatabaseException*>(castedThis->impl()); JSC::JSValue result = jsString(exec, imp->toString()); return JSValue::encode(result); } // Constant getters JSValue jsIDBDatabaseExceptionNO_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(0)); } JSValue jsIDBDatabaseExceptionUNKNOWN_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(1)); } JSValue jsIDBDatabaseExceptionNON_TRANSIENT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(2)); } JSValue jsIDBDatabaseExceptionNOT_FOUND_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(3)); } JSValue jsIDBDatabaseExceptionCONSTRAINT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(4)); } JSValue jsIDBDatabaseExceptionDATA_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(5)); } JSValue jsIDBDatabaseExceptionNOT_ALLOWED_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(6)); } JSValue jsIDBDatabaseExceptionSERIAL_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(7)); } JSValue jsIDBDatabaseExceptionRECOVERABLE_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(8)); } JSValue jsIDBDatabaseExceptionTRANSIENT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(9)); } JSValue jsIDBDatabaseExceptionTIMEOUT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(10)); } JSValue jsIDBDatabaseExceptionDEADLOCK_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(11)); } JSValue jsIDBDatabaseExceptionREAD_ONLY_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(12)); } JSValue jsIDBDatabaseExceptionABORT_ERR(ExecState* exec, JSValue, const Identifier&) { UNUSED_PARAM(exec); return jsNumber(static_cast<int>(13)); } JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, IDBDatabaseException* impl) { return wrap<JSIDBDatabaseException>(exec, globalObject, impl); } IDBDatabaseException* toIDBDatabaseException(JSC::JSValue value) { return value.inherits(&JSIDBDatabaseException::s_info) ? static_cast<JSIDBDatabaseException*>(asObject(value))->impl() : 0; } }
namespace WebCore { ASSERT_CLASS_FITS_IN_CELL(JSCSSPageRule); /* Hash table */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSCSSPageRuleTableValues[4] = { { "selectorText", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSPageRuleSelectorText), (intptr_t)setJSCSSPageRuleSelectorText THUNK_GENERATOR(0) }, { "style", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSPageRuleStyle), (intptr_t)0 THUNK_GENERATOR(0) }, { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSPageRuleConstructor), (intptr_t)0 THUNK_GENERATOR(0) }, { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSCSSPageRuleTable = { 8, 7, JSCSSPageRuleTableValues, 0 }; /* Hash table for constructor */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSCSSPageRuleConstructorTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSCSSPageRuleConstructorTable = { 1, 0, JSCSSPageRuleConstructorTableValues, 0 }; class JSCSSPageRuleConstructor : public DOMConstructorObject { public: JSCSSPageRuleConstructor(JSC::ExecState*, JSC::Structure*, JSDOMGlobalObject*); virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); static const JSC::ClassInfo s_info; static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype) { return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info); } protected: static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; }; const ClassInfo JSCSSPageRuleConstructor::s_info = { "CSSPageRuleConstructor", &DOMConstructorObject::s_info, &JSCSSPageRuleConstructorTable, 0 }; JSCSSPageRuleConstructor::JSCSSPageRuleConstructor(ExecState* exec, Structure* structure, JSDOMGlobalObject* globalObject) : DOMConstructorObject(structure, globalObject) { ASSERT(inherits(&s_info)); putDirect(exec->globalData(), exec->propertyNames().prototype, JSCSSPageRulePrototype::self(exec, globalObject), DontDelete | ReadOnly); } bool JSCSSPageRuleConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { return getStaticValueSlot<JSCSSPageRuleConstructor, JSDOMWrapper>(exec, &JSCSSPageRuleConstructorTable, this, propertyName, slot); } bool JSCSSPageRuleConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { return getStaticValueDescriptor<JSCSSPageRuleConstructor, JSDOMWrapper>(exec, &JSCSSPageRuleConstructorTable, this, propertyName, descriptor); } /* Hash table for prototype */ #if ENABLE(JIT) #define THUNK_GENERATOR(generator) , generator #else #define THUNK_GENERATOR(generator) #endif static const HashTableValue JSCSSPageRulePrototypeTableValues[1] = { { 0, 0, 0, 0 THUNK_GENERATOR(0) } }; #undef THUNK_GENERATOR static JSC_CONST_HASHTABLE HashTable JSCSSPageRulePrototypeTable = { 1, 0, JSCSSPageRulePrototypeTableValues, 0 }; const ClassInfo JSCSSPageRulePrototype::s_info = { "CSSPageRulePrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSCSSPageRulePrototypeTable, 0 }; JSObject* JSCSSPageRulePrototype::self(ExecState* exec, JSGlobalObject* globalObject) { return getDOMPrototype<JSCSSPageRule>(exec, globalObject); } const ClassInfo JSCSSPageRule::s_info = { "CSSPageRule", &JSCSSRule::s_info, &JSCSSPageRuleTable, 0 }; JSCSSPageRule::JSCSSPageRule(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<CSSPageRule> impl) : JSCSSRule(structure, globalObject, impl) { ASSERT(inherits(&s_info)); } JSObject* JSCSSPageRule::createPrototype(ExecState* exec, JSGlobalObject* globalObject) { return new (exec) JSCSSPageRulePrototype(exec->globalData(), globalObject, JSCSSPageRulePrototype::createStructure(exec->globalData(), JSCSSRulePrototype::self(exec, globalObject))); } bool JSCSSPageRule::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueSlot<JSCSSPageRule, Base>(exec, &JSCSSPageRuleTable, this, propertyName, slot); } bool JSCSSPageRule::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); return getStaticValueDescriptor<JSCSSPageRule, Base>(exec, &JSCSSPageRuleTable, this, propertyName, descriptor); } JSValue jsCSSPageRuleSelectorText(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSPageRule* castedThis = static_cast<JSCSSPageRule*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSPageRule* imp = static_cast<CSSPageRule*>(castedThis->impl()); JSValue result = jsStringOrNull(exec, imp->selectorText()); return result; } JSValue jsCSSPageRuleStyle(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSPageRule* castedThis = static_cast<JSCSSPageRule*>(asObject(slotBase)); UNUSED_PARAM(exec); CSSPageRule* imp = static_cast<CSSPageRule*>(castedThis->impl()); JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->style())); return result; } JSValue jsCSSPageRuleConstructor(ExecState* exec, JSValue slotBase, const Identifier&) { JSCSSPageRule* domObject = static_cast<JSCSSPageRule*>(asObject(slotBase)); return JSCSSPageRule::getConstructor(exec, domObject->globalObject()); } void JSCSSPageRule::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) { ASSERT_GC_OBJECT_INHERITS(this, &s_info); lookupPut<JSCSSPageRule, Base>(exec, propertyName, value, &JSCSSPageRuleTable, this, slot); } void setJSCSSPageRuleSelectorText(ExecState* exec, JSObject* thisObject, JSValue value) { JSCSSPageRule* castedThis = static_cast<JSCSSPageRule*>(thisObject); CSSPageRule* imp = static_cast<CSSPageRule*>(castedThis->impl()); imp->setSelectorText(valueToStringWithNullCheck(exec, value)); } JSValue JSCSSPageRule::getConstructor(ExecState* exec, JSGlobalObject* globalObject) { return getDOMConstructor<JSCSSPageRuleConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject)); } }