/*
    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(TEMPLATE_ELEMENT)

#include "JSHTMLTemplateElement.h"

#include "HTMLTemplateElement.h"
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSHTMLTemplateElementTableValues[] =
{
    { "content", DontDelete | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTemplateElementContent), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsHTMLTemplateElementConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSHTMLTemplateElementTable = { 5, 3, true, JSHTMLTemplateElementTableValues, 0 };
/* Hash table for constructor */

static const HashTableValue JSHTMLTemplateElementConstructorTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSHTMLTemplateElementConstructorTable = { 1, 0, false, JSHTMLTemplateElementConstructorTableValues, 0 };
const ClassInfo JSHTMLTemplateElementConstructor::s_info = { "HTMLTemplateElementConstructor", &Base::s_info, &JSHTMLTemplateElementConstructorTable, 0, CREATE_METHOD_TABLE(JSHTMLTemplateElementConstructor) };

JSHTMLTemplateElementConstructor::JSHTMLTemplateElementConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
    : DOMConstructorObject(structure, globalObject)
{
}

void JSHTMLTemplateElementConstructor::finishCreation(VM& vm, JSDOMGlobalObject* globalObject)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
    putDirect(vm, vm.propertyNames->prototype, JSHTMLTemplateElementPrototype::self(vm, globalObject), DontDelete | ReadOnly);
    putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontDelete | DontEnum);
}

bool JSHTMLTemplateElementConstructor::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    return getStaticValueSlot<JSHTMLTemplateElementConstructor, JSDOMWrapper>(exec, JSHTMLTemplateElementConstructorTable, jsCast<JSHTMLTemplateElementConstructor*>(object), propertyName, slot);
}

/* Hash table for prototype */

static const HashTableValue JSHTMLTemplateElementPrototypeTableValues[] =
{
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSHTMLTemplateElementPrototypeTable = { 1, 0, false, JSHTMLTemplateElementPrototypeTableValues, 0 };
const ClassInfo JSHTMLTemplateElementPrototype::s_info = { "HTMLTemplateElementPrototype", &Base::s_info, &JSHTMLTemplateElementPrototypeTable, 0, CREATE_METHOD_TABLE(JSHTMLTemplateElementPrototype) };

JSObject* JSHTMLTemplateElementPrototype::self(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMPrototype<JSHTMLTemplateElement>(vm, globalObject);
}

const ClassInfo JSHTMLTemplateElement::s_info = { "HTMLTemplateElement", &Base::s_info, &JSHTMLTemplateElementTable, 0 , CREATE_METHOD_TABLE(JSHTMLTemplateElement) };

JSHTMLTemplateElement::JSHTMLTemplateElement(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<HTMLTemplateElement> impl)
    : JSHTMLElement(structure, globalObject, impl)
{
}

void JSHTMLTemplateElement::finishCreation(VM& vm)
{
    Base::finishCreation(vm);
    ASSERT(inherits(info()));
}

JSObject* JSHTMLTemplateElement::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSHTMLTemplateElementPrototype::create(vm, globalObject, JSHTMLTemplateElementPrototype::createStructure(vm, globalObject, JSHTMLElementPrototype::self(vm, globalObject)));
}

bool JSHTMLTemplateElement::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSHTMLTemplateElement* thisObject = jsCast<JSHTMLTemplateElement*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());
    return getStaticValueSlot<JSHTMLTemplateElement, Base>(exec, JSHTMLTemplateElementTable, thisObject, propertyName, slot);
}

EncodedJSValue jsHTMLTemplateElementContent(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSHTMLTemplateElement* castedThis = jsDynamicCast<JSHTMLTemplateElement*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    return JSValue::encode(castedThis->content(exec));
}


EncodedJSValue jsHTMLTemplateElementConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSHTMLTemplateElement* domObject = jsDynamicCast<JSHTMLTemplateElement*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSHTMLTemplateElement::getConstructor(exec->vm(), domObject->globalObject()));
}

JSValue JSHTMLTemplateElement::getConstructor(VM& vm, JSGlobalObject* globalObject)
{
    return getDOMConstructor<JSHTMLTemplateElementConstructor>(vm, jsCast<JSDOMGlobalObject*>(globalObject));
}


}

#endif // ENABLE(TEMPLATE_ELEMENT)
