当前位置: 首页>>代码示例>>C++>>正文


C++ HTMLInputElement::canHaveSelection方法代码示例

本文整理汇总了C++中HTMLInputElement::canHaveSelection方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLInputElement::canHaveSelection方法的具体用法?C++ HTMLInputElement::canHaveSelection怎么用?C++ HTMLInputElement::canHaveSelection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HTMLInputElement的用法示例。


在下文中一共展示了HTMLInputElement::canHaveSelection方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setSelectionEnd

void JSHTMLInputElement::setSelectionEnd(ExecState* exec, JSValue value)
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        throwTypeError(exec);

    input->setSelectionEnd(value.toInt32(exec));
}
开发者ID:RasterCode,项目名称:wke,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例2: selectionDirection

JSValue JSHTMLInputElement::selectionDirection(ExecState* exec) const
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        return throwTypeError(exec);

    return jsString(exec, input->selectionDirection());
}
开发者ID:RasterCode,项目名称:wke,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例3: selectionEnd

JSValue JSHTMLInputElement::selectionEnd(ExecState* exec) const
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        return throwError(exec, TypeError);

    return jsNumber(exec, input->selectionEnd());
}
开发者ID:boyliang,项目名称:ComponentSuperAccessor,代码行数:8,代码来源:JSHTMLInputElementCustom.cpp

示例4: setSelectionDirection

void JSHTMLInputElement::setSelectionDirection(ExecState* exec, JSValue value)
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection()) {
        throwTypeError(exec);
        return;
    }

    input->setSelectionDirection(ustringToString(value.toString(exec)));
}
开发者ID:RasterCode,项目名称:wke,代码行数:10,代码来源:JSHTMLInputElementCustom.cpp

示例5: throwTypeError

v8::Handle<v8::Value> V8HTMLInputElement::selectionDirectionAttrGetterCustom(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
    v8::Handle<v8::Object> holder = info.Holder();
    HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);

    if (!imp->canHaveSelection())
        return throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());

    return v8String(imp->selectionDirection(), info.GetIsolate());
}
开发者ID:harlanlewis,项目名称:webkit,代码行数:10,代码来源:V8HTMLInputElementCustom.cpp

示例6: setSelectionRange

JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec)
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        return throwTypeError(exec);

    int start = exec->argument(0).toInt32(exec);
    int end = exec->argument(1).toInt32(exec);

    input->setSelectionRange(start, end);
    return jsUndefined();
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:12,代码来源:JSHTMLInputElementCustom.cpp

示例7: setSelectionRange

JSValue JSHTMLInputElement::setSelectionRange(ExecState* exec, const ArgList& args)
{
    HTMLInputElement* input = static_cast<HTMLInputElement*>(impl());
    if (!input->canHaveSelection())
        return throwError(exec, TypeError);

    int start = args.at(0).toInt32(exec);
    int end = args.at(1).toInt32(exec);

    input->setSelectionRange(start, end);
    return jsUndefined();
}
开发者ID:boyliang,项目名称:ComponentSuperAccessor,代码行数:12,代码来源:JSHTMLInputElementCustom.cpp

示例8: throwError

v8::Handle<v8::Value> V8HTMLInputElement::setSelectionRangeCallback(const v8::Arguments& args)
{
    INC_STATS("DOM.HTMLInputElement.setSelectionRange");
    v8::Handle<v8::Object> holder = args.Holder();
    HTMLInputElement* imp = V8DOMWrapper::convertDOMWrapperToNode<HTMLInputElement>(holder);

    if (!imp->canHaveSelection())
        return throwError("Calling setSelectionRange on an input element that cannot have a selection.");

    int start = args[0]->Int32Value();
    int end = args[1]->Int32Value();

    imp->setSelectionRange(start, end);
    return v8::Undefined();
}
开发者ID:flying-dutchmen,项目名称:3DS_w3Browser,代码行数:15,代码来源:V8HTMLInputElementCustom.cpp


注:本文中的HTMLInputElement::canHaveSelection方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。