本文整理汇总了C++中JSHTMLDocument::impl方法的典型用法代码示例。如果您正苦于以下问题:C++ JSHTMLDocument::impl方法的具体用法?C++ JSHTMLDocument::impl怎么用?C++ JSHTMLDocument::impl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JSHTMLDocument
的用法示例。
在下文中一共展示了JSHTMLDocument::impl方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: jsHTMLDocumentPlugins
JSValue jsHTMLDocumentPlugins(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->plugins()));
return result;
}
示例2: jsHTMLDocumentVlinkColor
JSValue jsHTMLDocumentVlinkColor(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
JSValue result = jsString(exec, imp->vlinkColor());
return result;
}
示例3: jsHTMLDocumentHeight
JSValue jsHTMLDocumentHeight(ExecState* exec, JSValue slotBase, const Identifier&)
{
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(slotBase));
UNUSED_PARAM(exec);
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
JSValue result = jsNumber(imp->height());
return result;
}
示例4: jsHTMLDocumentPrototypeFunctionWriteln
EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionWriteln(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSHTMLDocument::s_info))
return throwVMTypeError(exec);
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
#if defined(JSC_TAINTED)
JSValue s = exec->argument(0);
if (s.isString() && s.isTainted() > 0) {
HTMLDocument* d1 = static_cast<HTMLDocument*>(castedThis->impl());
d1->setTainted(s.isTainted());
TaintedStructure trace_struct;
trace_struct.taintedno = s.isTainted();
trace_struct.internalfunc = "jsHTMLDocumentPrototypeFunctionWriteln";
trace_struct.jsfunc = "document.writeln";
trace_struct.action = "sink";
trace_struct.value = TaintedUtils::UString2string(s.toString(exec));
TaintedTrace* trace = TaintedTrace::getInstance();
trace->addTaintedTrace(trace_struct);
}
if (s.inherits(&StringObject::s_info)) {
unsigned int tainted = asStringObject(s)->isTainted();
if (tainted) {
HTMLDocument* d2 = static_cast<HTMLDocument*>(castedThis->impl());
d2->setTainted(tainted);
TaintedStructure trace_struct;
trace_struct.taintedno = tainted;
trace_struct.internalfunc = "jsHTMLDocumentPrototypeFunctionWriteln";
trace_struct.jsfunc = "document.writeln";
trace_struct.action = "sink";
trace_struct.value = TaintedUtils::UString2string(s.toString(exec));
TaintedTrace* trace = TaintedTrace::getInstance();
trace->addTaintedTrace(trace_struct);
}
}
#endif
return JSValue::encode(castedThis->writeln(exec));
}
示例5: jsHTMLDocumentPrototypeFunctionClose
EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionClose(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSHTMLDocument::s_info))
return throwVMTypeError(exec);
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
imp->close();
return JSValue::encode(jsUndefined());
}
示例6: jsHTMLDocumentPrototypeFunctionHasFocus
EncodedJSValue JSC_HOST_CALL jsHTMLDocumentPrototypeFunctionHasFocus(ExecState* exec)
{
JSValue thisValue = exec->hostThisValue();
if (!thisValue.inherits(&JSHTMLDocument::s_info))
return throwVMTypeError(exec);
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(asObject(thisValue));
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
JSC::JSValue result = jsBoolean(imp->hasFocus());
return JSValue::encode(result);
}
示例7: nameGetter
JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, PropertyName propertyName)
{
JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(asObject(slotBase));
HTMLDocument* document = toHTMLDocument(thisObj->impl());
AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
if (!atomicPropertyName || !document->documentNamedItemMap().contains(atomicPropertyName))
return jsUndefined();
if (UNLIKELY(!document->documentNamedItemMap().containsSingle(atomicPropertyName))) {
RefPtr<HTMLCollection> collection = document->documentNamedItems(atomicPropertyName);
ASSERT(!collection->isEmpty());
ASSERT(!collection->hasExactlyOneItem());
return toJS(exec, thisObj->globalObject(), WTF::getPtr(collection));
}
Node* node = document->documentNamedItemMap().getElementByDocumentNamedItem(atomicPropertyName, document);
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
return toJS(exec, frame);
return toJS(exec, thisObj->globalObject(), node);
}
示例8: nameGetter
EncodedJSValue JSHTMLDocument::nameGetter(ExecState* exec, JSObject* slotBase, EncodedJSValue, PropertyName propertyName)
{
JSHTMLDocument* thisObj = jsCast<JSHTMLDocument*>(slotBase);
HTMLDocument& document = thisObj->impl();
AtomicStringImpl* atomicPropertyName = propertyName.publicName();
if (!atomicPropertyName || !document.hasDocumentNamedItem(*atomicPropertyName))
return JSValue::encode(jsUndefined());
if (UNLIKELY(document.documentNamedItemContainsMultipleElements(*atomicPropertyName))) {
RefPtr<HTMLCollection> collection = document.documentNamedItems(atomicPropertyName);
ASSERT(collection->length() > 1);
return JSValue::encode(toJS(exec, thisObj->globalObject(), WTF::getPtr(collection)));
}
Element* element = document.documentNamedItem(*atomicPropertyName);
if (UNLIKELY(is<HTMLIFrameElement>(*element))) {
if (Frame* frame = downcast<HTMLIFrameElement>(*element).contentFrame())
return JSValue::encode(toJS(exec, frame));
}
return JSValue::encode(toJS(exec, thisObj->globalObject(), element));
}
示例9: nameGetter
JSValue JSHTMLDocument::nameGetter(ExecState* exec, JSValue slotBase, const Identifier& propertyName)
{
JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(asObject(slotBase));
HTMLDocument* document = static_cast<HTMLDocument*>(thisObj->impl());
String name = identifierToString(propertyName);
RefPtr<HTMLCollection> collection = document->documentNamedItems(name);
unsigned length = collection->length();
if (!length)
return jsUndefined();
if (length == 1) {
Node* node = collection->firstItem();
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
return toJS(exec, frame);
return toJS(exec, node);
}
return toJS(exec, collection.get());
}
示例10: nameGetter
JSValue* JSHTMLDocument::nameGetter(ExecState* exec, JSObject* originalObject, const Identifier& propertyName, const PropertySlot& slot)
{
JSHTMLDocument* thisObj = static_cast<JSHTMLDocument*>(slot.slotBase());
HTMLDocument* doc = static_cast<HTMLDocument*>(thisObj->impl());
String name = propertyName;
RefPtr<HTMLCollection> collection = doc->documentNamedItems(name);
unsigned length = collection->length();
if (!length)
return jsUndefined();
if (length == 1) {
Node* node = collection->firstItem();
Frame* frame;
if (node->hasTagName(iframeTag) && (frame = static_cast<HTMLIFrameElement*>(node)->contentFrame()))
return Window::retrieve(frame);
return toJS(exec, node);
}
return toJS(exec, collection.get());
}
示例11: setJSHTMLDocumentVlinkColor
void setJSHTMLDocumentVlinkColor(ExecState* exec, JSObject* thisObject, JSValue value)
{
JSHTMLDocument* castedThis = static_cast<JSHTMLDocument*>(thisObject);
HTMLDocument* imp = static_cast<HTMLDocument*>(castedThis->impl());
imp->setVlinkColor(valueToStringWithNullCheck(exec, value));
}