本文整理汇总了C++中JSHTMLElement::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ JSHTMLElement::impl方法的具体用法?C++ JSHTMLElement::impl怎么用?C++ JSHTMLElement::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSHTMLElement
的用法示例。
在下文中一共展示了JSHTMLElement::impl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: runtimeObjectGetter
JSValue runtimeObjectGetter(ExecState* exec, const Identifier&, const PropertySlot& slot)
{
JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slot.slotBase()));
HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
RuntimeObjectImp* runtimeObject = getRuntimeObject(exec, element);
return runtimeObject ? runtimeObject : jsUndefined();
}
示例2: jsHTMLElementInnerHTML
JSValue jsHTMLElementInnerHTML(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->innerHTML());
#ifdef JSC_TAINTED
if (imp->tainted()) {
unsigned int tainted = imp->tainted();
result.setTainted(imp->tainted());
TaintedStructure trace_struct;
trace_struct.taintedno = tainted;
trace_struct.internalfunc = "jsHTMLElementInnerHTML";
trace_struct.jsfunc = "htmlelement.innerHTML";
trace_struct.action = "propagate";
char msg[20];
stringstream msgss;
snprintf(msg, 20, "%s", result.toString(exec).utf8(true).data());
msgss << msg;
msgss >> trace_struct.value;
TaintedTrace* trace = TaintedTrace::getInstance();
trace->addTaintedTrace(trace_struct);
}
示例3: jsHTMLElementChildren
JSValue jsHTMLElementChildren(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->children()));
return result;
}
示例4: jsHTMLElementHidden
JSValue jsHTMLElementHidden(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsBoolean(imp->hasAttribute(WebCore::HTMLNames::hiddenAttr));
return result;
}
示例5: setJSHTMLElementContentEditable
void setJSHTMLElementContentEditable(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
ExceptionCode ec = 0;
imp->setContentEditable(valueToStringWithNullCheck(exec, value), ec);
setDOMException(exec, ec);
}
示例6: jsHTMLElementTabIndex
JSValue jsHTMLElementTabIndex(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsNumber(imp->tabIndex());
return result;
}
示例7: jsHTMLElementClassName
JSValue jsHTMLElementClassName(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->getAttribute(WebCore::HTMLNames::classAttr));
return result;
}
示例8: jsHTMLElementContentEditable
JSValue jsHTMLElementContentEditable(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsString(exec, imp->contentEditable());
return result;
}
示例9: jsHTMLElementSpellcheck
JSValue jsHTMLElementSpellcheck(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
JSValue result = jsBoolean(imp->spellcheck());
return result;
}
示例10: nameGetter
JSValue* JSHTMLFrameSetElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(slot.slotBase());
HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
Node* frame = element->children()->namedItem(propertyName);
if (Document* doc = static_cast<HTMLFrameElement*>(frame)->contentDocument()) {
if (JSDOMWindowShell* window = toJSDOMWindowShell(doc->frame()))
return window;
}
return jsUndefined();
}
示例11: nameGetter
JSValue JSHTMLFrameSetElement::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSHTMLElement* thisObj = static_cast<JSHTMLElement*>(asObject(slotBase));
HTMLElement* element = static_cast<HTMLElement*>(thisObj->impl());
Node* frame = element->children()->namedItem(identifierToAtomicString(propertyName));
if (Document* doc = static_cast<HTMLFrameElement*>(frame)->contentDocument()) {
if (JSDOMWindowShell* window = toJSDOMWindowShell(doc->frame(), currentWorld(exec)))
return window;
}
return jsUndefined();
}
示例12: nameGetter
JSValue JSHTMLFormElement::nameGetter(ExecState* exec, const Identifier& propertyName, const PropertySlot& slot)
{
JSHTMLElement* jsForm = static_cast<JSHTMLFormElement*>(asObject(slot.slotBase()));
HTMLFormElement* form = static_cast<HTMLFormElement*>(jsForm->impl());
Vector<RefPtr<Node> > namedItems;
form->getNamedElements(propertyName, namedItems);
if (namedItems.isEmpty())
return jsUndefined();
if (namedItems.size() == 1)
return toJS(exec, namedItems[0].get());
// FIXME: HTML5 specifies that this should be a RadioNodeList.
return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());
}
示例13: nameGetter
JSValue JSHTMLFormElement::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSHTMLElement* jsForm = jsCast<JSHTMLFormElement*>(asObject(slotBase));
HTMLFormElement* form = toHTMLFormElement(jsForm->impl());
Vector<RefPtr<Node> > namedItems;
form->getNamedElements(propertyNameToAtomicString(propertyName), namedItems);
if (namedItems.isEmpty())
return jsUndefined();
if (namedItems.size() == 1)
return toJS(exec, jsForm->globalObject(), namedItems[0].get());
// FIXME: HTML5 specifies that this should be a RadioNodeList.
return toJS(exec, jsForm->globalObject(), StaticNodeList::adopt(namedItems).get());
}
示例14: setJSHTMLElementOuterText
void setJSHTMLElementOuterText(ExecState* exec, JSObject* thisObject, JSValue value)
{
#if defined(JSC_TAINTED)
unsigned int tainted = TaintedUtils::isTainted(exec, value);
#endif
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(thisObject);
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
ExceptionCode ec = 0;
imp->setOuterText(valueToStringWithNullCheck(exec, value), ec);
setDOMException(exec, ec);
#if defined(JSC_TAINTED)
unsigned int imp_tainted = imp->tainted();
if (tainted) {
imp->setTainted(tainted);
imp->document()->setTainted(tainted);
TaintedStructure trace_struct;
trace_struct.taintedno = tainted;
trace_struct.internalfunc = "setJSHTMLElementOuterText";
trace_struct.jsfunc = "HTMLElement.outerText";
trace_struct.action = "sink";
trace_struct.value = TaintedUtils::UString2string(value.toString(exec));
TaintedTrace* trace = TaintedTrace::getInstance();
trace->addTaintedTrace(trace_struct);
} else if (imp_tainted == imp->document()->tainted()
&& imp_tainted != 0
&& !tainted) {
TaintedStructure trace_struct;
trace_struct.taintedno = 0;
// trace_struct.taintedno = tainted;
trace_struct.internalfunc = "setJSHTMLElementOuterText";
trace_struct.jsfunc = "HTMLElement.outerText";
trace_struct.action = "reset";
trace_struct.value = TaintedUtils::UString2string(value.toString(exec));
TaintedTrace* trace = TaintedTrace::getInstance();
trace->addTaintedTrace(trace_struct);
imp->setTainted(0);
}
#endif
}
示例15: jsHTMLElementPrototypeFunctionInsertAdjacentText
EncodedJSValue JSC_HOST_CALL jsHTMLElementPrototypeFunctionInsertAdjacentText(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSHTMLElement::s_info))
return throwVMTypeError(exec);
JSHTMLElement* castedThis = static_cast<JSHTMLElement*>(asObject(thisValue));
HTMLElement* imp = static_cast<HTMLElement*>(castedThis->impl());
ExceptionCode ec = 0;
const String& where(ustringToString(exec->argument(0).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
const String& text(ustringToString(exec->argument(1).toString(exec)));
if (exec->hadException())
return JSValue::encode(jsUndefined());
imp->insertAdjacentText(where, text, ec);
setDOMException(exec, ec);
return JSValue::encode(jsUndefined());
}