/*
    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"
#include "JSWebKitCSSMatrix.h"

#include "ExceptionCode.h"
#include "JSDOMBinding.h"
#include "JSWebKitCSSMatrix.h"
#include "URL.h"
#include "WebKitCSSMatrix.h"
#include <runtime/Error.h>
#include <runtime/JSString.h>
#include <wtf/GetPtr.h>

using namespace JSC;

namespace WebCore {

/* Hash table */

static const HashTableValue JSWebKitCSSMatrixTableValues[] =
{
    { "a", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixA), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixA) },
    { "b", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixB), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixB) },
    { "c", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixC), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixC) },
    { "d", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixD), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixD) },
    { "e", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixE), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixE) },
    { "f", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixF), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixF) },
    { "m11", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM11), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM11) },
    { "m12", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM12), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM12) },
    { "m13", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM13), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM13) },
    { "m14", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM14), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM14) },
    { "m21", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM21), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM21) },
    { "m22", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM22), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM22) },
    { "m23", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM23), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM23) },
    { "m24", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM24), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM24) },
    { "m31", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM31), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM31) },
    { "m32", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM32), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM32) },
    { "m33", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM33), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM33) },
    { "m34", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM34), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM34) },
    { "m41", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM41), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM41) },
    { "m42", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM42), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM42) },
    { "m43", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM43), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM43) },
    { "m44", DontDelete, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixM44), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSWebKitCSSMatrixM44) },
    { "constructor", DontEnum | ReadOnly, NoIntrinsic, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsWebKitCSSMatrixConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWebKitCSSMatrixTable = { 66, 63, true, JSWebKitCSSMatrixTableValues, 0 };
/* Hash table for constructor */

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

static const HashTable JSWebKitCSSMatrixConstructorTable = { 1, 0, false, JSWebKitCSSMatrixConstructorTableValues, 0 };
EncodedJSValue JSC_HOST_CALL JSWebKitCSSMatrixConstructor::constructJSWebKitCSSMatrix(ExecState* exec)
{
    JSWebKitCSSMatrixConstructor* castedThis = jsCast<JSWebKitCSSMatrixConstructor*>(exec->callee());
    ExceptionCode ec = 0;
    const String& cssValue(argumentOrNull(exec, 0).isEmpty() ? String() : argumentOrNull(exec, 0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    RefPtr<WebKitCSSMatrix> object = WebKitCSSMatrix::create(cssValue, ec);
    if (ec) {
        setDOMException(exec, ec);
        return JSValue::encode(JSValue());
    }
    return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
}

const ClassInfo JSWebKitCSSMatrixConstructor::s_info = { "WebKitCSSMatrixConstructor", &Base::s_info, &JSWebKitCSSMatrixConstructorTable, 0, CREATE_METHOD_TABLE(JSWebKitCSSMatrixConstructor) };

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

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

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

ConstructType JSWebKitCSSMatrixConstructor::getConstructData(JSCell*, ConstructData& constructData)
{
    constructData.native.function = constructJSWebKitCSSMatrix;
    return ConstructTypeHost;
}

/* Hash table for prototype */

static const HashTableValue JSWebKitCSSMatrixPrototypeTableValues[] =
{
    { "setMatrixValue", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionSetMatrixValue), (intptr_t) (0) },
    { "multiply", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionMultiply), (intptr_t) (0) },
    { "inverse", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionInverse), (intptr_t) (0) },
    { "translate", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionTranslate), (intptr_t) (0) },
    { "scale", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionScale), (intptr_t) (0) },
    { "rotate", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionRotate), (intptr_t) (0) },
    { "rotateAxisAngle", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionRotateAxisAngle), (intptr_t) (0) },
    { "skewX", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionSkewX), (intptr_t) (0) },
    { "skewY", JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionSkewY), (intptr_t) (0) },
    { "toString", DontEnum | JSC::Function, NoIntrinsic, (intptr_t)static_cast<NativeFunction>(jsWebKitCSSMatrixPrototypeFunctionToString), (intptr_t) (0) },
    { 0, 0, NoIntrinsic, 0, 0 }
};

static const HashTable JSWebKitCSSMatrixPrototypeTable = { 33, 31, false, JSWebKitCSSMatrixPrototypeTableValues, 0 };
const ClassInfo JSWebKitCSSMatrixPrototype::s_info = { "WebKitCSSMatrixPrototype", &Base::s_info, &JSWebKitCSSMatrixPrototypeTable, 0, CREATE_METHOD_TABLE(JSWebKitCSSMatrixPrototype) };

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

bool JSWebKitCSSMatrixPrototype::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSWebKitCSSMatrixPrototype* thisObject = jsCast<JSWebKitCSSMatrixPrototype*>(object);
    return getStaticFunctionSlot<JSObject>(exec, JSWebKitCSSMatrixPrototypeTable, thisObject, propertyName, slot);
}

const ClassInfo JSWebKitCSSMatrix::s_info = { "WebKitCSSMatrix", &Base::s_info, &JSWebKitCSSMatrixTable, 0 , CREATE_METHOD_TABLE(JSWebKitCSSMatrix) };

JSWebKitCSSMatrix::JSWebKitCSSMatrix(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<WebKitCSSMatrix> impl)
    : JSDOMWrapper(structure, globalObject)
    , m_impl(impl.leakRef())
{
}

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

JSObject* JSWebKitCSSMatrix::createPrototype(VM& vm, JSGlobalObject* globalObject)
{
    return JSWebKitCSSMatrixPrototype::create(vm, globalObject, JSWebKitCSSMatrixPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
}

void JSWebKitCSSMatrix::destroy(JSC::JSCell* cell)
{
    JSWebKitCSSMatrix* thisObject = static_cast<JSWebKitCSSMatrix*>(cell);
    thisObject->JSWebKitCSSMatrix::~JSWebKitCSSMatrix();
}

JSWebKitCSSMatrix::~JSWebKitCSSMatrix()
{
    releaseImplIfNotNull();
}

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

EncodedJSValue jsWebKitCSSMatrixA(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.a());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixB(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.b());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixC(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.c());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixD(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.d());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixE(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.e());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixF(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.f());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM11(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m11());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM12(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m12());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM13(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m13());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM14(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m14());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM21(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m21());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM22(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m22());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM23(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m23());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM24(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m24());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM31(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m31());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM32(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m32());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM33(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m33());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM34(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m34());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM41(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m41());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM42(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m42());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM43(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m43());
    return JSValue::encode(result);
}


EncodedJSValue jsWebKitCSSMatrixM44(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis)
        return throwVMTypeError(exec);
    UNUSED_PARAM(exec);
    WebKitCSSMatrix& impl = castedThis->impl();
    JSValue result = jsNumber(impl.m44());
    return JSValue::encode(result);
}


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

void setJSWebKitCSSMatrixA(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setA(nativeValue);
}


void setJSWebKitCSSMatrixB(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setB(nativeValue);
}


void setJSWebKitCSSMatrixC(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setC(nativeValue);
}


void setJSWebKitCSSMatrixD(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setD(nativeValue);
}


void setJSWebKitCSSMatrixE(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setE(nativeValue);
}


void setJSWebKitCSSMatrixF(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setF(nativeValue);
}


void setJSWebKitCSSMatrixM11(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM11(nativeValue);
}


void setJSWebKitCSSMatrixM12(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM12(nativeValue);
}


void setJSWebKitCSSMatrixM13(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM13(nativeValue);
}


void setJSWebKitCSSMatrixM14(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM14(nativeValue);
}


void setJSWebKitCSSMatrixM21(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM21(nativeValue);
}


void setJSWebKitCSSMatrixM22(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM22(nativeValue);
}


void setJSWebKitCSSMatrixM23(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM23(nativeValue);
}


void setJSWebKitCSSMatrixM24(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM24(nativeValue);
}


void setJSWebKitCSSMatrixM31(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM31(nativeValue);
}


void setJSWebKitCSSMatrixM32(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM32(nativeValue);
}


void setJSWebKitCSSMatrixM33(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM33(nativeValue);
}


void setJSWebKitCSSMatrixM34(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM34(nativeValue);
}


void setJSWebKitCSSMatrixM41(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM41(nativeValue);
}


void setJSWebKitCSSMatrixM42(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM42(nativeValue);
}


void setJSWebKitCSSMatrixM43(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM43(nativeValue);
}


void setJSWebKitCSSMatrixM44(ExecState* exec, JSObject* /* baseObject */, EncodedJSValue thisValue, EncodedJSValue encodedValue)
{
    JSValue value = JSValue::decode(encodedValue);
    UNUSED_PARAM(exec);
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(JSValue::decode(thisValue));
    if (!castedThis) {
        throwVMTypeError(exec);
        return;
    }
    WebKitCSSMatrix& impl = castedThis->impl();
    double nativeValue(value.toNumber(exec));
    if (exec->hadException())
        return;
    impl.setM44(nativeValue);
}


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

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionSetMatrixValue(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    ExceptionCode ec = 0;
    const String& string(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    impl.setMatrixValue(string, ec);
    setDOMException(exec, ec);
    return JSValue::encode(jsUndefined());
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionMultiply(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    WebKitCSSMatrix* secondMatrix(toWebKitCSSMatrix(exec->argument(0)));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.multiply(secondMatrix)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionInverse(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    ExceptionCode ec = 0;

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.inverse(ec)));
    setDOMException(exec, ec);
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionTranslate(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double x(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double y(exec->argument(1).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double z(exec->argument(2).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.translate(x, y, z)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionScale(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double scaleX(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double scaleY(exec->argument(1).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double scaleZ(exec->argument(2).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.scale(scaleX, scaleY, scaleZ)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionRotate(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double rotX(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double rotY(exec->argument(1).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double rotZ(exec->argument(2).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.rotate(rotX, rotY, rotZ)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionRotateAxisAngle(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double x(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double y(exec->argument(1).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double z(exec->argument(2).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());
    double angle(exec->argument(3).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.rotateAxisAngle(x, y, z, angle)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionSkewX(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double angle(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.skewX(angle)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionSkewY(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();
    double angle(exec->argument(0).toNumber(exec));
    if (exec->hadException())
        return JSValue::encode(jsUndefined());

    JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.skewY(angle)));
    return JSValue::encode(result);
}

EncodedJSValue JSC_HOST_CALL jsWebKitCSSMatrixPrototypeFunctionToString(ExecState* exec)
{
    JSValue thisValue = exec->hostThisValue();
    JSWebKitCSSMatrix* castedThis = jsDynamicCast<JSWebKitCSSMatrix*>(thisValue);
    if (!castedThis)
        return throwVMTypeError(exec);
    ASSERT_GC_OBJECT_INHERITS(castedThis, JSWebKitCSSMatrix::info());
    WebKitCSSMatrix& impl = castedThis->impl();

    JSC::JSValue result = jsStringWithCache(exec, impl.toString());
    return JSValue::encode(result);
}

bool JSWebKitCSSMatrixOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
    UNUSED_PARAM(handle);
    UNUSED_PARAM(visitor);
    return false;
}

void JSWebKitCSSMatrixOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSWebKitCSSMatrix* jsWebKitCSSMatrix = jsCast<JSWebKitCSSMatrix*>(handle.get().asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsWebKitCSSMatrix->impl(), jsWebKitCSSMatrix);
    jsWebKitCSSMatrix->releaseImpl();
}

#if ENABLE(BINDING_INTEGRITY)
#if PLATFORM(WIN)
#pragma warning(disable: 4483)
extern "C" { extern void (*const __identifier("??_7WebKitCSSMatrix@WebCore@@6B@")[])(); }
#else
extern "C" { extern void* _ZTVN7WebCore15WebKitCSSMatrixE[]; }
#endif
#endif
JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, WebKitCSSMatrix* impl)
{
    if (!impl)
        return jsNull();
    if (JSValue result = getExistingWrapper<JSWebKitCSSMatrix>(exec, impl))
        return result;

#if ENABLE(BINDING_INTEGRITY)
    void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
#if PLATFORM(WIN)
    void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7WebKitCSSMatrix@WebCore@@6B@"));
#else
    void* expectedVTablePointer = &_ZTVN7WebCore15WebKitCSSMatrixE[2];
#if COMPILER(CLANG)
    // If this fails WebKitCSSMatrix does not have a vtable, so you need to add the
    // ImplementationLacksVTable attribute to the interface definition
    COMPILE_ASSERT(__is_polymorphic(WebKitCSSMatrix), WebKitCSSMatrix_is_not_polymorphic);
#endif
#endif
    // If you hit this assertion you either have a use after free bug, or
    // WebKitCSSMatrix has subclasses. If WebKitCSSMatrix has subclasses that get passed
    // to toJS() we currently require WebKitCSSMatrix you to opt out of binding hardening
    // by adding the SkipVTableValidation attribute to the interface IDL definition
    RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
#endif
    ReportMemoryCost<WebKitCSSMatrix>::reportMemoryCost(exec, impl);
    return createNewWrapper<JSWebKitCSSMatrix>(exec, globalObject, impl);
}

WebKitCSSMatrix* toWebKitCSSMatrix(JSC::JSValue value)
{
    return value.inherits(JSWebKitCSSMatrix::info()) ? &jsCast<JSWebKitCSSMatrix*>(value)->impl() : 0;
}

}
