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


C++ HTMLDocument::write方法代码示例

本文整理汇总了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);
}
开发者ID:hnney,项目名称:webkit,代码行数:25,代码来源:JSHTMLDocumentCustom.cpp

示例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;
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:18,代码来源:DOMImplementation.cpp

示例3: activeDOMWindow

void V8HTMLDocument::writeMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& args)
{
    HTMLDocument* htmlDocument = V8HTMLDocument::toNative(args.Holder());
    htmlDocument->write(writeHelperGetString(args), activeDOMWindow()->document());
}
开发者ID:halton,项目名称:blink-crosswalk,代码行数:5,代码来源:V8HTMLDocumentCustom.cpp

示例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();
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:6,代码来源:V8HTMLDocumentCustom.cpp


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