blob: 6cbef764f1904213ac054b7fa9bb4120d659bc60 [file] [log] [blame]
/*
This file is part of the WebKit open source project.
This file has been generated by generate-bindings.pl. DO NOT MODIFY!
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "config.h"
#if ENABLE(FONT_LOAD_EVENTS)
#include "JSCSSFontFaceLoadEvent.h"
#include "JSCSSFontFaceRule.h"
#include "JSDOMBinding.h"
#include "JSDOMError.h"
#include <wtf/GetPtr.h>
using namespace JSC;
namespace WebCore {
// Attributes
JSC::EncodedJSValue jsCSSFontFaceLoadEventFontface(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
JSC::EncodedJSValue jsCSSFontFaceLoadEventError(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
bool setJSCSSFontFaceLoadEventConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
class JSCSSFontFaceLoadEventPrototype : public JSC::JSNonFinalObject {
public:
typedef JSC::JSNonFinalObject Base;
static JSCSSFontFaceLoadEventPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
{
JSCSSFontFaceLoadEventPrototype* ptr = new (NotNull, JSC::allocateCell<JSCSSFontFaceLoadEventPrototype>(vm.heap)) JSCSSFontFaceLoadEventPrototype(vm, globalObject, structure);
ptr->finishCreation(vm);
return ptr;
}
DECLARE_INFO;
static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
{
return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
}
private:
JSCSSFontFaceLoadEventPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
: JSC::JSNonFinalObject(vm, structure)
{
}
void finishCreation(JSC::VM&);
};
/* Hash table for prototype */
static const HashTableValue JSCSSFontFaceLoadEventPrototypeTableValues[] =
{
{ "fontface", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSFontFaceLoadEventFontface), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
{ "error", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCSSFontFaceLoadEventError), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
};
const ClassInfo JSCSSFontFaceLoadEventPrototype::s_info = { "CSSFontFaceLoadEventPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSCSSFontFaceLoadEventPrototype) };
void JSCSSFontFaceLoadEventPrototype::finishCreation(VM& vm)
{
Base::finishCreation(vm);
reifyStaticProperties(vm, JSCSSFontFaceLoadEventPrototypeTableValues, *this);
}
const ClassInfo JSCSSFontFaceLoadEvent::s_info = { "CSSFontFaceLoadEvent", &Base::s_info, 0, CREATE_METHOD_TABLE(JSCSSFontFaceLoadEvent) };
JSCSSFontFaceLoadEvent::JSCSSFontFaceLoadEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref<CSSFontFaceLoadEvent>&& impl)
: JSEvent(structure, globalObject, WTFMove(impl))
{
}
JSObject* JSCSSFontFaceLoadEvent::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
return JSCSSFontFaceLoadEventPrototype::create(vm, globalObject, JSCSSFontFaceLoadEventPrototype::createStructure(vm, globalObject, JSEvent::prototype(vm, globalObject)));
}
JSObject* JSCSSFontFaceLoadEvent::prototype(VM& vm, JSGlobalObject* globalObject)
{
return getDOMPrototype<JSCSSFontFaceLoadEvent>(vm, globalObject);
}
EncodedJSValue jsCSSFontFaceLoadEventFontface(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSCSSFontFaceLoadEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "CSSFontFaceLoadEvent", "fontface");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), impl.fontface());
return JSValue::encode(result);
}
EncodedJSValue jsCSSFontFaceLoadEventError(ExecState* state, EncodedJSValue thisValue, PropertyName)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
UNUSED_PARAM(throwScope);
UNUSED_PARAM(thisValue);
JSValue decodedThisValue = JSValue::decode(thisValue);
auto* castedThis = jsDynamicCast<JSCSSFontFaceLoadEvent*>(decodedThisValue);
if (UNLIKELY(!castedThis)) {
return throwGetterTypeError(*state, throwScope, "CSSFontFaceLoadEvent", "error");
}
auto& impl = castedThis->wrapped();
JSValue result = toJS(state, castedThis->globalObject(), impl.error());
return JSValue::encode(result);
}
bool setJSCSSFontFaceLoadEventConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
VM& vm = state->vm();
auto throwScope = DECLARE_THROW_SCOPE(vm);
JSValue value = JSValue::decode(encodedValue);
JSCSSFontFaceLoadEventPrototype* domObject = jsDynamicCast<JSCSSFontFaceLoadEventPrototype*>(JSValue::decode(thisValue));
if (UNLIKELY(!domObject)) {
throwVMTypeError(state, throwScope);
return false;
}
// Shadowing a built-in constructor
return domObject->putDirect(state->vm(), state->propertyNames().constructor, value);
}
}
#endif // ENABLE(FONT_LOAD_EVENTS)