Beispiel #1
0
JSValue* JSClipboard::getValueProperty(ExecState* exec, int token) const
{
    Clipboard* clipboard = impl();
    switch (token) {
        case DropEffect:
            ASSERT(clipboard->isForDragging() || clipboard->dropEffect().isNull());
            return jsStringOrUndefined(clipboard->dropEffect());
        case EffectAllowed:
            ASSERT(clipboard->isForDragging() || clipboard->effectAllowed().isNull());
            return jsStringOrUndefined(clipboard->effectAllowed());
        case Types:
        {
            HashSet<String> types = clipboard->types();
            if (types.isEmpty())
                return jsNull();
            else {
                List list;
                HashSet<String>::const_iterator end = types.end();
                for (HashSet<String>::const_iterator it = types.begin(); it != end; ++it)
                    list.append(jsString(UString(*it)));
                return exec->lexicalInterpreter()->builtinArray()->construct(exec, list);
            }
        }
        default:
            return 0;
    }
}
Beispiel #2
0
JSValue jsClipboardDropEffect(ExecState* exec, JSValue slotBase, const Identifier&)
{
    JSClipboard* castedThis = static_cast<JSClipboard*>(asObject(slotBase));
    UNUSED_PARAM(exec);
    Clipboard* imp = static_cast<Clipboard*>(castedThis->impl());
    JSValue result = jsStringOrUndefined(exec, imp->dropEffect());
    return result;
}
Beispiel #3
0
JSValue* JSClipboard::getValueProperty(ExecState* exec, int token) const
{
    switch (token) {
    case DropEffectAttrNum: {
        Clipboard* imp = static_cast<Clipboard*>(impl());
        return jsStringOrUndefined(exec, imp->dropEffect());
    }
    case EffectAllowedAttrNum: {
        Clipboard* imp = static_cast<Clipboard*>(impl());
        return jsStringOrUndefined(exec, imp->effectAllowed());
    }
    case TypesAttrNum: {
        return types(exec);
    }
    case ConstructorAttrNum:
        return getConstructor(exec);
    }
    return 0;
}
static v8::Handle<v8::Value> dropEffectAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    Clipboard* imp = V8Clipboard::toNative(info.Holder());
    return v8StringOrUndefined(imp->dropEffect(), info.GetIsolate());
}
static v8::Handle<v8::Value> dropEffectAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    INC_STATS("DOM.Clipboard.dropEffect._get");
    Clipboard* imp = V8Clipboard::toNative(info.Holder());
    return v8StringOrUndefined(imp->dropEffect());
}