本文整理汇总了C++中HTMLDocument::write方法的典型用法代码示例。如果您正苦于以下问题:C++ HTMLDocument::write方法的具体用法?C++ HTMLDocument::write怎么用?C++ HTMLDocument::write使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTMLDocument
的用法示例。
在下文中一共展示了HTMLDocument::write方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: documentWrite
static inline void documentWrite(ExecState& state, JSHTMLDocument* thisDocument, NewlineRequirement addNewline)
{
HTMLDocument* document = &thisDocument->wrapped();
// DOM only specifies single string argument, but browsers allow multiple or no arguments.
size_t size = state.argumentCount();
String firstString = state.argument(0).toString(&state)->value(&state);
SegmentedString segmentedString = firstString;
if (size != 1) {
if (!size)
segmentedString.clear();
else {
for (size_t i = 1; i < size; ++i) {
String subsequentString = state.uncheckedArgument(i).toString(&state)->value(&state);
segmentedString.append(SegmentedString(subsequentString));
}
}
}
if (addNewline)
segmentedString.append(SegmentedString(String(&newlineCharacter, 1)));
Document* activeDocument = findCallingDocument(state);
document->write(segmentedString, activeDocument);
}
示例2: createHTMLDocument
HTMLDocument* DOMImplementation::createHTMLDocument(const String& title)
{
DocumentInit init = DocumentInit::fromContext(document().contextDocument())
.withRegistrationContext(document().registrationContext());
HTMLDocument* d = HTMLDocument::create(init);
d->open();
d->write("<!doctype html><html><head></head><body></body></html>");
if (!title.isNull()) {
HTMLHeadElement* headElement = d->head();
DCHECK(headElement);
HTMLTitleElement* titleElement = HTMLTitleElement::create(*d);
headElement->appendChild(titleElement);
titleElement->appendChild(d->createTextNode(title), ASSERT_NO_EXCEPTION);
}
d->setSecurityOrigin(document().getSecurityOrigin());
d->setContextFeatures(document().contextFeatures());
return d;
}
示例3: activeDOMWindow
void V8HTMLDocument::writeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
HTMLDocument* htmlDocument = V8HTMLDocument::toNative(args.Holder());
htmlDocument->write(writeHelperGetString(args), activeDOMWindow()->document());
}
示例4: activeDOMWindow
v8::Handle<v8::Value> V8HTMLDocument::writeMethodCustom(const v8::Arguments& args)
{
HTMLDocument* htmlDocument = V8HTMLDocument::toNative(args.Holder());
htmlDocument->write(writeHelperGetString(args), activeDOMWindow()->document());
return v8::Undefined();
}