v8::Handle<v8::Value> toV8(PassRefPtr<SVGFontFaceNameElement > impl)
{
    return toV8(impl.get());
}
v8::Handle<v8::Value> toV8(PassRefPtr<SVGTRefElement > impl)
{
    return toV8(impl.get());
}
Esempio n. 3
0
void injectInternalsObject(v8::Local<v8::Context> context)
{
    ScriptState* scriptState = ScriptState::from(context);
    ScriptState::Scope scope(scriptState);
    v8::Handle<v8::Object> global = scriptState->context()->Global();
    ExecutionContext* executionContext = scriptState->executionContext();
    if (executionContext->isDocument())
        global->Set(v8::String::NewFromUtf8(scriptState->isolate(), Internals::internalsId), toV8(Internals::create(toDocument(executionContext)), global, scriptState->isolate()));
}
Esempio n. 4
0
v8::Handle<v8::Value> toV8Slow(Node* impl, bool forceNewObject)
{
    if (!impl)
        return v8::Null();

    if (!forceNewObject) {
        v8::Handle<v8::Value> wrapper = V8DOMWrapper::getWrapper(impl);
        if (!wrapper.IsEmpty())
            return wrapper;
    }
    switch (impl->nodeType()) {
    case Node::ELEMENT_NODE:
        return toV8(static_cast<Element*>(impl), forceNewObject);
    case Node::ATTRIBUTE_NODE:
        return toV8(static_cast<Attr*>(impl), forceNewObject);
    case Node::TEXT_NODE:
        return toV8(static_cast<Text*>(impl), forceNewObject);
    case Node::CDATA_SECTION_NODE:
        return toV8(static_cast<CDATASection*>(impl), forceNewObject);
    case Node::ENTITY_REFERENCE_NODE:
        return toV8(static_cast<EntityReference*>(impl), forceNewObject);
    case Node::ENTITY_NODE:
        return toV8(static_cast<Entity*>(impl), forceNewObject);
    case Node::PROCESSING_INSTRUCTION_NODE:
        return toV8(static_cast<ProcessingInstruction*>(impl), forceNewObject);
    case Node::COMMENT_NODE:
        return toV8(static_cast<Comment*>(impl), forceNewObject);
    case Node::DOCUMENT_NODE:
        return toV8(static_cast<Document*>(impl), forceNewObject);
    case Node::DOCUMENT_TYPE_NODE:
        return toV8(static_cast<DocumentType*>(impl), forceNewObject);
    case Node::DOCUMENT_FRAGMENT_NODE:
        return toV8(static_cast<DocumentFragment*>(impl), forceNewObject);
    case Node::NOTATION_NODE:
        return toV8(static_cast<Notation*>(impl), forceNewObject);
    case Node::SHADOW_ROOT_NODE: // There's no IDL class for ShadowRoot, fall-through to default and use Node instead.
    default: break; // XPATH_NAMESPACE_NODE
    }
    return V8Node::wrap(impl, forceNewObject);
}
Esempio n. 5
0
v8::Handle<v8::Value> toV8(PassRefPtr<HTMLSourceElement > impl) {
  return toV8(impl.get());
}
Esempio n. 6
0
// Keep the request's wrapper alive as long as the cursor's wrapper is alive,
// so that the same script object is seen each time the cursor is used.
v8::Local<v8::Object> IDBCursor::associateWithWrapper(v8::Isolate* isolate, const WrapperTypeInfo* wrapperType, v8::Local<v8::Object> wrapper)
{
    wrapper = ScriptWrappable::associateWithWrapper(isolate, wrapperType, wrapper);
    if (!wrapper.IsEmpty())
        V8HiddenValue::setHiddenValue(ScriptState::current(isolate), wrapper, V8HiddenValue::idbCursorRequest(isolate), toV8(m_request.get(), wrapper, isolate));
    return wrapper;
}
Esempio n. 7
0
v8::Handle<v8::Value> toV8NoInline(SVGTestInterface* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
    return toV8(impl, creationContext, isolate);
}
Esempio n. 8
0
static v8::Handle<v8::Value> getBBoxCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGEllipseElement.getBBox");
    SVGEllipseElement* imp = V8SVGEllipseElement::toNative(args.Holder());
    return toV8(WTF::getPtr(SVGPropertyTearOff<FloatRect>::create(imp->getBBox())));
}
Esempio n. 9
0
static v8::Handle<v8::Value> getScreenCTMCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.SVGEllipseElement.getScreenCTM");
    SVGEllipseElement* imp = V8SVGEllipseElement::toNative(args.Holder());
    return toV8(WTF::getPtr(SVGPropertyTearOff<SVGMatrix>::create(imp->getScreenCTM())));
}
static v8::Handle<v8::Value> toV8(const IDBAny* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
    if (!impl)
        return v8::Null(isolate);

    switch (impl->type()) {
    case IDBAny::UndefinedType:
        return v8::Undefined(isolate);
    case IDBAny::NullType:
        return v8::Null(isolate);
    case IDBAny::DOMStringListType:
        return toV8(impl->domStringList(), creationContext, isolate);
    case IDBAny::IDBCursorType: {
        // Ensure request wrapper is kept alive at least as long as the cursor wrapper,
        // so that event listeners are retained.
        v8::Handle<v8::Value> cursor = toV8(impl->idbCursor(), creationContext, isolate);
        v8::Handle<v8::Value> request = toV8(impl->idbCursor()->request(), creationContext, isolate);
        V8HiddenValue::setHiddenValue(isolate, cursor->ToObject(), V8HiddenValue::idbCursorRequest(isolate), request);
        return cursor;
    }
    case IDBAny::IDBCursorWithValueType: {
        // Ensure request wrapper is kept alive at least as long as the cursor wrapper,
        // so that event listeners are retained.
        v8::Handle<v8::Value> cursor = toV8(impl->idbCursorWithValue(), creationContext, isolate);
        v8::Handle<v8::Value> request = toV8(impl->idbCursorWithValue()->request(), creationContext, isolate);
        V8HiddenValue::setHiddenValue(isolate, cursor->ToObject(), V8HiddenValue::idbCursorRequest(isolate), request);
        return cursor;
    }
    case IDBAny::IDBDatabaseType:
        return toV8(impl->idbDatabase(), creationContext, isolate);
    case IDBAny::IDBIndexType:
        return toV8(impl->idbIndex(), creationContext, isolate);
    case IDBAny::IDBObjectStoreType:
        return toV8(impl->idbObjectStore(), creationContext, isolate);
    case IDBAny::IDBTransactionType:
        return toV8(impl->idbTransaction(), creationContext, isolate);
    case IDBAny::BufferType:
        return deserializeIDBValueBuffer(isolate, impl->buffer(), impl->blobInfo());
    case IDBAny::StringType:
        return v8String(isolate, impl->string());
    case IDBAny::IntegerType:
        return v8::Number::New(isolate, impl->integer());
    case IDBAny::KeyType:
        return toV8(impl->key(), creationContext, isolate);
    case IDBAny::KeyPathType:
        return toV8(impl->keyPath(), creationContext, isolate);
    case IDBAny::BufferKeyAndKeyPathType: {
        v8::Handle<v8::Value> value = deserializeIDBValueBuffer(isolate, impl->buffer(), impl->blobInfo());
        v8::Handle<v8::Value> key = toV8(impl->key(), creationContext, isolate);
        bool injected = injectV8KeyIntoV8Value(isolate, key, value, impl->keyPath());
        ASSERT_UNUSED(injected, injected);
        return value;
    }
    }

    ASSERT_NOT_REACHED();
    return v8::Undefined(isolate);
}
Esempio n. 11
0
v8::Handle<v8::Value> toV8(PassRefPtr<ImageData > impl)
{
    return toV8(impl.get());
}
v8::Handle<v8::Value> toV8(PassRefPtr<SVGPathSegCurvetoQuadraticSmoothAbs > impl)
{
    return toV8(impl.get());
}
Esempio n. 13
0
v8::Handle<v8::Value> toV8(PassRefPtr<MediaError > impl) {
  return toV8(impl.get());
}
static v8::Handle<v8::Value> webkitGetEntriesCallback(const v8::Arguments& args)
{
    Performance* imp = V8Performance::toNative(args.Holder());
    return toV8(imp->webkitGetEntries(), args.Holder(), args.GetIsolate());
}
Esempio n. 15
0
static v8::Handle<v8::Value> typeAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGComponentTransferFunctionElement.type._get");
    SVGComponentTransferFunctionElement* imp = V8SVGComponentTransferFunctionElement::toNative(info.Holder());
    return toV8(static_pointer_cast<SVGAnimatedEnumeration>(imp->typeAnimated()));
}
Esempio n. 16
0
static v8::Handle<v8::Value> ryAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGEllipseElement.ry._get");
    SVGEllipseElement* imp = V8SVGEllipseElement::toNative(info.Holder());
    return toV8(imp->ryAnimated());
}
Esempio n. 17
0
static v8::Handle<v8::Value> offsetAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGComponentTransferFunctionElement.offset._get");
    SVGComponentTransferFunctionElement* imp = V8SVGComponentTransferFunctionElement::toNative(info.Holder());
    return toV8(imp->offsetAnimated());
}
Esempio n. 18
0
static v8::Handle<v8::Value> systemLanguageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGEllipseElement.systemLanguage._get");
    SVGEllipseElement* imp = V8SVGEllipseElement::toNative(info.Holder());
    return toV8(WTF::getPtr(SVGStaticListPropertyTearOff<SVGStringList>::create(imp, imp->systemLanguage())));
}
Esempio n. 19
0
 static v8::Handle<v8::Value> contentWindowAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.HTMLIFrameElement.contentWindow._get");
   HTMLIFrameElement* imp = V8HTMLIFrameElement::toNative(info.Holder());
   return toV8(imp->contentWindow());
 }
Esempio n. 20
0
v8::Handle<v8::Value> toV8(Event* impl)
{
    if (!impl)
        return v8::Null();
    if (impl->isUIEvent()) {
        if (impl->isKeyboardEvent())
            return toV8(static_cast<KeyboardEvent*>(impl));
        if (impl->isTextEvent())
            return toV8(static_cast<TextEvent*>(impl));
        if (impl->isMouseEvent())
            return toV8(static_cast<MouseEvent*>(impl));
        if (impl->isWheelEvent())
            return toV8(static_cast<WheelEvent*>(impl));
#if ENABLE(SVG)
        if (impl->isSVGZoomEvent())
            return toV8(static_cast<SVGZoomEvent*>(impl));
#endif
        if (impl->isCompositionEvent())
            return toV8(static_cast<CompositionEvent*>(impl));
        return toV8(static_cast<UIEvent*>(impl));
    }
    if (impl->isMutationEvent())
        return toV8(static_cast<MutationEvent*>(impl));
    if (impl->isOverflowEvent())
        return toV8(static_cast<OverflowEvent*>(impl));
    if (impl->isMessageEvent())
        return toV8(static_cast<MessageEvent*>(impl));
    if (impl->isPageTransitionEvent())
        return toV8(static_cast<PageTransitionEvent*>(impl));
    if (impl->isPopStateEvent())
        return toV8(static_cast<PopStateEvent*>(impl));
    if (impl->isProgressEvent()) {
        if (impl->isXMLHttpRequestProgressEvent())
            return toV8(static_cast<XMLHttpRequestProgressEvent*>(impl));
        return toV8(static_cast<ProgressEvent*>(impl));
    }
    if (impl->isWebKitAnimationEvent())
        return toV8(static_cast<WebKitAnimationEvent*>(impl));
    if (impl->isWebKitTransitionEvent())
        return toV8(static_cast<WebKitTransitionEvent*>(impl));
#if ENABLE(WORKERS)
    if (impl->isErrorEvent())
        return toV8(static_cast<ErrorEvent*>(impl));
#endif
#if ENABLE(DOM_STORAGE)
    if (impl->isStorageEvent())
        return toV8(static_cast<StorageEvent*>(impl));
#endif
    if (impl->isBeforeLoadEvent())
        return toV8(static_cast<BeforeLoadEvent*>(impl));
    return V8Event::wrap(impl);
}
static v8::Handle<v8::Value> farthestViewportElementAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.SVGLineElement.farthestViewportElement._get");
    SVGLineElement* imp = V8SVGLineElement::toNative(info.Holder());
    return toV8(imp->farthestViewportElement());
}
Esempio n. 22
0
static v8::Handle<v8::Value> validityAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.HTMLTextAreaElement.validity._get");
    HTMLTextAreaElement* imp = V8HTMLTextAreaElement::toNative(info.Holder());
    return toV8(imp->validity());
}
Esempio n. 23
0
v8::Handle<v8::Value> toV8(PassRefPtr<PopStateEvent > impl) {
    return toV8(impl.get());
}
Esempio n. 24
0
static v8::Handle<v8::Value> viewAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.UIEvent.view._get");
    UIEvent* imp = V8UIEvent::toNative(info.Holder());
    return toV8(imp->view());
}
v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
    return toV8(impl, creationContext, isolate);
}
Esempio n. 26
0
v8::Handle<v8::Value> toV8(PassRefPtr<CSSFontFaceRule > impl) {
  return toV8(impl.get());
}
Esempio n. 27
0
 virtual void setUint8Array(const char* propertyName, const blink::WebVector<unsigned char>& vector)
 {
     RefPtr<Uint8Array> uint8Array = Uint8Array::create(vector.data(), vector.size());
     m_dictionary.set(propertyName, toV8(uint8Array.get(), m_holder, m_isolate));
 }
Esempio n. 28
0
 static v8::Handle<v8::Value> styleAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info) {
   INC_STATS("DOM.CSSFontFaceRule.style._get");
   CSSFontFaceRule* imp = V8CSSFontFaceRule::toNative(info.Holder());
   return toV8(imp->style());
 }
Esempio n. 29
0
v8::Handle<v8::Value> toV8(HTMLCollection* impl, v8::Isolate* isolate)
{
    if (impl->type() == DocAll)
        return toV8(static_cast<HTMLAllCollection*>(impl), isolate);
    return V8HTMLCollection::wrap(impl, isolate);
}
v8::Handle<v8::Value> toV8(PassRefPtr<WebGLUniformLocation > impl)
{
    return toV8(impl.get());
}