本文整理汇总了C++中JSDOMSelection类的典型用法代码示例。如果您正苦于以下问题:C++ JSDOMSelection类的具体用法?C++ JSDOMSelection怎么用?C++ JSDOMSelection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了JSDOMSelection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsDOMSelectionPrototypeFunctionSetBaseAndExtent
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionSetBaseAndExtent(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMSelection::info());
DOMSelection& impl = castedThis->impl();
ExceptionCode ec = 0;
Node* baseNode(toNode(exec->argument(0)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
int baseOffset(toInt32(exec, exec->argument(1), NormalConversion));
if (exec->hadException())
return JSValue::encode(jsUndefined());
Node* extentNode(toNode(exec->argument(2)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
int extentOffset(toInt32(exec, exec->argument(3), NormalConversion));
if (exec->hadException())
return JSValue::encode(jsUndefined());
impl.setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset, ec);
setDOMException(exec, ec);
return JSValue::encode(jsUndefined());
}
示例2: jsDOMSelectionPrototypeFunctionSetBaseAndExtent
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionSetBaseAndExtent(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSDOMSelection::s_info))
return throwVMTypeError(exec);
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMSelection::s_info);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
ExceptionCode ec = 0;
Node* baseNode(toNode(exec->argument(0)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
int baseOffset(exec->argument(1).toInt32(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
Node* extentNode(toNode(exec->argument(2)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
int extentOffset(exec->argument(3).toInt32(exec));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->setBaseAndExtent(baseNode, baseOffset, extentNode, extentOffset, ec);
setDOMException(exec, ec);
return JSValue::encode(jsUndefined());
}
示例3: finalize
void JSDOMSelectionOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
JSDOMSelection* jsDOMSelection = jsCast<JSDOMSelection*>(handle.get().asCell());
DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
uncacheWrapper(world, &jsDOMSelection->impl(), jsDOMSelection);
jsDOMSelection->releaseImpl();
}
示例4: jsDOMSelectionType
JSValue jsDOMSelectionType(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(slotBase));
UNUSED_PARAM(exec);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
JSValue result = jsString(exec, imp->type());
return result;
}
示例5: jsDOMSelectionExtentOffset
JSValue jsDOMSelectionExtentOffset(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(slotBase));
UNUSED_PARAM(exec);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
JSValue result = jsNumber(imp->extentOffset());
return result;
}
示例6: jsDOMSelectionIsCollapsed
JSValue jsDOMSelectionIsCollapsed(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(slotBase));
UNUSED_PARAM(exec);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
JSValue result = jsBoolean(imp->isCollapsed());
return result;
}
示例7: jsDOMSelectionExtentNode
JSValue jsDOMSelectionExtentNode(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(slotBase));
UNUSED_PARAM(exec);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->extentNode()));
return result;
}
示例8: jsDOMSelectionConstructor
EncodedJSValue jsDOMSelectionConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
JSDOMSelection* domObject = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
if (!domObject)
return throwVMTypeError(exec);
if (!domObject)
return throwVMTypeError(exec);
return JSValue::encode(JSDOMSelection::getConstructor(exec->vm(), domObject->globalObject()));
}
示例9: isReachableFromOpaqueRoots
bool JSDOMSelectionOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
{
JSDOMSelection* jsDOMSelection = jsCast<JSDOMSelection*>(handle.get().asCell());
if (!isObservable(jsDOMSelection))
return false;
Frame* root = jsDOMSelection->impl().frame();
if (!root)
return false;
return visitor.containsOpaqueRoot(root);
}
示例10: jsDOMSelectionType
EncodedJSValue jsDOMSelectionType(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
UNUSED_PARAM(slotBase);
if (!castedThis)
return throwVMTypeError(exec);
UNUSED_PARAM(exec);
DOMSelection& impl = castedThis->impl();
JSValue result = jsStringWithCache(exec, impl.type());
return JSValue::encode(result);
}
示例11: jsDOMSelectionBaseNode
EncodedJSValue jsDOMSelectionBaseNode(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
UNUSED_PARAM(slotBase);
if (!castedThis)
return throwVMTypeError(exec);
UNUSED_PARAM(exec);
DOMSelection& impl = castedThis->impl();
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(impl.baseNode()));
return JSValue::encode(result);
}
示例12: jsDOMSelectionPrototypeFunctionEmpty
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionEmpty(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMSelection::info());
DOMSelection& impl = castedThis->impl();
impl.empty();
return JSValue::encode(jsUndefined());
}
示例13: jsDOMSelectionExtentOffset
EncodedJSValue jsDOMSelectionExtentOffset(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue thisValue, PropertyName)
{
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(JSValue::decode(thisValue));
UNUSED_PARAM(slotBase);
if (!castedThis)
return throwVMTypeError(exec);
UNUSED_PARAM(exec);
DOMSelection& impl = castedThis->impl();
JSValue result = jsNumber(impl.extentOffset());
return JSValue::encode(result);
}
示例14: jsDOMSelectionPrototypeFunctionToString
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionToString(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
JSDOMSelection* castedThis = jsDynamicCast<JSDOMSelection*>(thisValue);
if (!castedThis)
return throwVMTypeError(exec);
ASSERT_GC_OBJECT_INHERITS(castedThis, JSDOMSelection::info());
DOMSelection& impl = castedThis->impl();
JSC::JSValue result = jsStringWithCache(exec, impl.toString());
return JSValue::encode(result);
}
示例15: jsDOMSelectionPrototypeFunctionEmpty
EncodedJSValue JSC_HOST_CALL jsDOMSelectionPrototypeFunctionEmpty(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSDOMSelection::s_info))
return throwVMTypeError(exec);
JSDOMSelection* castedThis = static_cast<JSDOMSelection*>(asObject(thisValue));
ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDOMSelection::s_info);
DOMSelection* imp = static_cast<DOMSelection*>(castedThis->impl());
imp->empty();
return JSValue::encode(jsUndefined());
}