static v8::Handle<v8::Value> getPointAtLengthCallback(const v8::Arguments& args)
{
    SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
    V8TRYCATCH(float, distance, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    return toV8Fast(WTF::getPtr(SVGPropertyTearOff<FloatPoint>::create(imp->getPointAtLength(distance))), args, imp);
}
static v8::Handle<v8::Value> namedItemCallback(const v8::Arguments& args)
{
    DOMPlugin* imp = V8DOMPlugin::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return toV8(imp->namedItem(name), args.Holder(), args.GetIsolate());
}
Exemplo n.º 3
0
static v8::Handle<v8::Value> methodCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.TestMediaQueryListListener.method");
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    TestMediaQueryListListener* imp = V8TestMediaQueryListListener::toNative(args.Holder());
    EXCEPTION_BLOCK(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
    imp->method(listener);
    return v8Undefined();
}
Exemplo n.º 4
0
static v8::Handle<v8::Value> setCustomValidityCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.HTMLOutputElement.setCustomValidity");
    if (args.Length() < 1)
        return throwError("Not enough arguments", V8Proxy::TypeError);
    HTMLOutputElement* imp = V8HTMLOutputElement::toNative(args.Holder());
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, error, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
    imp->setCustomValidity(error);
    return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> itemCallback(const v8::Arguments& args)
{
    DOMPlugin* imp = V8DOMPlugin::toNative(args.Holder());
    V8TRYCATCH(unsigned, index, toUInt32(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
    return toV8(imp->item(index), args.Holder(), args.GetIsolate());
}
static v8::Handle<v8::Value> hasExtensionCallback(const v8::Arguments& args)
{
    SVGClipPathElement* imp = V8SVGClipPathElement::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, extension, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return v8Boolean(imp->hasExtension(extension), args.GetIsolate());
}
Exemplo n.º 7
0
static v8::Handle<v8::Value> createDocumentTypeCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.DOMImplementation.createDocumentType");
    DOMImplementation* imp = V8DOMImplementation::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, qualifiedName, MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined));
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, publicId, MAYBE_MISSING_PARAMETER(args, 1, MissingIsUndefined));
    STRING_TO_V8PARAMETER_EXCEPTION_BLOCK(V8Parameter<WithUndefinedOrNullCheck>, systemId, MAYBE_MISSING_PARAMETER(args, 2, MissingIsUndefined));
    RefPtr<DocumentType> result = imp->createDocumentType(qualifiedName, publicId, systemId, ec);
    if (UNLIKELY(ec))
        goto fail;
    return toV8(result.release());
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> removeListenerCallback(const v8::Arguments& args)
{
    MediaQueryList* imp = V8MediaQueryList::toNative(args.Holder());
    V8TRYCATCH(RefPtr<MediaQueryListListener>, listener, MediaQueryListListener::create(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)));
    imp->removeListener(listener);
    return v8Undefined();
}
Exemplo n.º 9
0
static v8::Handle<v8::Value> isVertexArrayOESCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.OESVertexArrayObject.isVertexArrayOES");
    OESVertexArrayObject* imp = V8OESVertexArrayObject::toNative(args.Holder());
    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLVertexArrayObjectOES::HasInstance(args[0])) {
        V8Proxy::throwTypeError();
        return notHandledByInterceptor();
    }
    EXCEPTION_BLOCK(WebGLVertexArrayObjectOES*, arrayObject, V8WebGLVertexArrayObjectOES::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8WebGLVertexArrayObjectOES::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    return v8Boolean(imp->isVertexArrayOES(arrayObject));
}
Exemplo n.º 10
0
static v8::Handle<v8::Value> multiplyCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGMatrix.multiply");
    if (args.Length() < 1)
        return throwError("Not enough arguments", V8Proxy::TypeError);
    RefPtr<SVGPropertyTearOff<SVGMatrix> > wrapper = V8SVGMatrix::toNative(args.Holder());
    if (wrapper->role() == AnimValRole) {
        V8Proxy::setDOMException(NO_MODIFICATION_ALLOWED_ERR);
        return v8::Handle<v8::Value>();
    }
    SVGMatrix& impInstance = wrapper->propertyReference();
    SVGMatrix* imp = &impInstance;
    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8SVGMatrix::HasInstance(args[0])) {
        V8Proxy::throwTypeError();
        return notHandledByInterceptor();
    }
    EXCEPTION_BLOCK(RefPtr<SVGPropertyTearOff<SVGMatrix> >, secondMatrix, V8SVGMatrix::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8SVGMatrix::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    if (!secondMatrix) {
        V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);
        return v8::Handle<v8::Value>();
    }
    return toV8(WTF::getPtr(SVGPropertyTearOff<SVGMatrix>::create(imp->multiply(secondMatrix->propertyReference()))));
}
static v8::Handle<v8::Value> lookupNamespaceURICallback(const v8::Arguments& args)
{
    XPathNSResolver* imp = V8XPathNSResolver::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, prefix, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return v8StringOrNull(imp->lookupNamespaceURI(prefix), args.GetIsolate());
}
static v8::Handle<v8::Value> transformToDocumentCallback(const v8::Arguments& args)
{
    XSLTProcessor* imp = V8XSLTProcessor::toNative(args.Holder());
    V8TRYCATCH(Node*, source, V8Node::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined))) : 0);
    return toV8(imp->transformToDocument(source), args.Holder(), args.GetIsolate());
}
static v8::Handle<v8::Value> setCustomValidityCallback(const v8::Arguments& args)
{
    if (args.Length() < 1)
        return throwNotEnoughArgumentsError(args.GetIsolate());
    HTMLButtonElement* imp = V8HTMLButtonElement::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<WithUndefinedOrNullCheck>, error, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    imp->setCustomValidity(error);
    return v8Undefined();
}
static v8::Handle<v8::Value> containsCallback(const v8::Arguments& args)
{
    DOMStringList* imp = V8DOMStringList::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, string, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return v8Boolean(imp->contains(string), args.GetIsolate());
}
static v8::Handle<v8::Value> getPathSegAtLengthCallback(const v8::Arguments& args)
{
    SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
    V8TRYCATCH(float, distance, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    return v8UnsignedInteger(imp->getPathSegAtLength(distance), args.GetIsolate());
}
Exemplo n.º 16
0
static v8::Handle<v8::Value> bindVertexArrayOESCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.OESVertexArrayObject.bindVertexArrayOES");
    OESVertexArrayObject* imp = V8OESVertexArrayObject::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLVertexArrayObjectOES::HasInstance(args[0])) {
        V8Proxy::throwTypeError();
        return notHandledByInterceptor();
    }
    EXCEPTION_BLOCK(WebGLVertexArrayObjectOES*, arrayObject, V8WebGLVertexArrayObjectOES::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8WebGLVertexArrayObjectOES::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    imp->bindVertexArrayOES(arrayObject, ec);
    if (UNLIKELY(ec))
        goto fail;
    return v8::Handle<v8::Value>();
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> createSVGPathSegLinetoVerticalRelCallback(const v8::Arguments& args)
{
    SVGPathElement* imp = V8SVGPathElement::toNative(args.Holder());
    V8TRYCATCH(float, y, static_cast<float>(MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined)->NumberValue()));
    return toV8Fast(imp->createSVGPathSegLinetoVerticalRel(y), args, imp);
}
Exemplo n.º 18
0
static v8::Handle<v8::Value> setOrientToAngleCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGMarkerElement.setOrientToAngle");
    SVGMarkerElement* imp = V8SVGMarkerElement::toNative(args.Holder());
    EXCEPTION_BLOCK(RefPtr<SVGPropertyTearOff<SVGAngle> >, angle, V8SVGAngle::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8SVGAngle::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    if (!angle) {
        V8Proxy::setDOMException(WebCore::TYPE_MISMATCH_ERR);
        return v8::Handle<v8::Value>();
    }
    imp->setOrientToAngle(angle->propertyReference());
    return v8::Handle<v8::Value>();
}
static v8::Handle<v8::Value> getPresentationAttributeCallback(const v8::Arguments& args)
{
    SVGFEColorMatrixElement* imp = V8SVGFEColorMatrixElement::toNative(args.Holder());
    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, name, MAYBE_MISSING_PARAMETER(args, 0, DefaultIsUndefined));
    return toV8Fast(imp->getPresentationAttribute(name), args, imp);
}
Exemplo n.º 20
0
static v8::Handle<v8::Value> initializeCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGLengthList.initialize");
    if (args.Length() < 1)
        return throwError("Not enough arguments", V8Proxy::TypeError);
    RefPtr<SVGListPropertyTearOff<SVGLengthList> > imp = V8SVGLengthList::toNative(args.Holder());
    ExceptionCode ec = 0;
    {
    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8SVGLength::HasInstance(args[0])) {
        V8Proxy::throwTypeError();
        return notHandledByInterceptor();
    }
    EXCEPTION_BLOCK(RefPtr<SVGPropertyTearOff<SVGLength> >, item, V8SVGLength::HasInstance(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined)) ? V8SVGLength::toNative(v8::Handle<v8::Object>::Cast(MAYBE_MISSING_PARAMETER(args, 0, MissingIsUndefined))) : 0);
    RefPtr<SVGPropertyTearOff<SVGLength> > result = imp->initialize(item, ec);
    if (UNLIKELY(ec))
        goto fail;
    return toV8(result.release());
    }
    fail:
    V8Proxy::setDOMException(ec);
    return v8::Handle<v8::Value>();
}