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


C++ ContainerNode::appendChild方法代码示例

本文整理汇总了C++中ContainerNode::appendChild方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerNode::appendChild方法的具体用法?C++ ContainerNode::appendChild怎么用?C++ ContainerNode::appendChild使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContainerNode的用法示例。


在下文中一共展示了ContainerNode::appendChild方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: createShadowSubtree

void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
{
    ASSERT(element()->shadow());

    Document* document = element()->document();
    ContainerNode* container = element()->userAgentShadowRoot();

    RefPtr<DateTimeEditElement> dateTimeEditElement(DateTimeEditElement::create(document, *this));
    m_dateTimeEditElement = dateTimeEditElement.get();
    container->appendChild(m_dateTimeEditElement);
    updateInnerTextValue();

    RefPtr<SpinButtonElement> spinButton = SpinButtonElement::create(document, *this);
    m_spinButtonElement = spinButton.get();
    container->appendChild(spinButton);

    bool shouldAddPickerIndicator = false;
#if ENABLE(DATALIST_ELEMENT)
    if (InputType::themeSupportsDataListUI(this))
        shouldAddPickerIndicator = true;
#endif
    RefPtr<RenderTheme> theme = document->page() ? document->page()->theme() : RenderTheme::defaultTheme();
    if (theme->supportsCalendarPicker(formControlType())) {
        shouldAddPickerIndicator = true;
        m_pickerIndicatorIsAlwaysVisible = true;
    }
    if (shouldAddPickerIndicator) {
        RefPtr<PickerIndicatorElement> pickerElement = PickerIndicatorElement::create(document, *this);
        m_pickerIndicatorElement = pickerElement.get();
        container->appendChild(m_pickerIndicatorElement);
        m_pickerIndicatorIsVisible = true;
        updatePickerIndicatorVisibility();
    }
}
开发者ID:,项目名称:,代码行数:34,代码来源:

示例2: loadIntoContainer

void PluginPlaceholderImpl::loadIntoContainer(ContainerNode& container)
{
    m_placeholderElement->remove(ASSERT_NO_EXCEPTION);
    update();
    container.removeChildren();
    container.appendChild(m_placeholderElement);
}
开发者ID:smilusingjavascript,项目名称:blink,代码行数:7,代码来源:PluginPlaceholderImpl.cpp

示例3: cloneTarget

void SVGUseElement::cloneTarget(ContainerNode& container, SVGElement& target) const
{
    Ref<SVGElement> targetClone = static_pointer_cast<SVGElement>(target.cloneElementWithChildren(document())).releaseNonNull();
    associateClonesWithOriginals(targetClone.get(), target);
    removeDisallowedElementsFromSubtree(targetClone.get());
    transferSizeAttributesToTargetClone(targetClone.get());
    container.appendChild(WTF::move(targetClone));
}
开发者ID:cheekiatng,项目名称:webkit,代码行数:8,代码来源:SVGUseElement.cpp

示例4: fillContainerFromString

static void fillContainerFromString(ContainerNode& paragraph, const String& string)
{
    Document& document = paragraph.document();

    if (string.isEmpty()) {
        paragraph.appendChild(createBlockPlaceholderElement(document), ASSERT_NO_EXCEPTION);
        return;
    }

    ASSERT(string.find('\n') == notFound);

    Vector<String> tabList;
    string.split('\t', true, tabList);
    String tabText = emptyString();
    bool first = true;
    size_t numEntries = tabList.size();
    for (size_t i = 0; i < numEntries; ++i) {
        const String& s = tabList[i];

        // append the non-tab textual part
        if (!s.isEmpty()) {
            if (!tabText.isEmpty()) {
                paragraph.appendChild(createTabSpanElement(document, tabText), ASSERT_NO_EXCEPTION);
                tabText = emptyString();
            }
            Ref<Node> textNode = document.createTextNode(stringWithRebalancedWhitespace(s, first, i + 1 == numEntries));
            paragraph.appendChild(WTF::move(textNode), ASSERT_NO_EXCEPTION);
        }

        // there is a tab after every entry, except the last entry
        // (if the last character is a tab, the list gets an extra empty entry)
        if (i + 1 != numEntries)
            tabText.append('\t');
        else if (!tabText.isEmpty())
            paragraph.appendChild(createTabSpanElement(document, tabText), ASSERT_NO_EXCEPTION);

        first = false;
    }
}
开发者ID:rhythmkay,项目名称:webkit,代码行数:39,代码来源:markup.cpp

示例5: createShadowSubtree

void MultipleFieldsTemporalInputTypeView::createShadowSubtree() {
  DCHECK(element().shadow());

  // Element must not have a layoutObject here, because if it did
  // DateTimeEditElement::customStyleForLayoutObject() is called in
  // appendChild() before the field wrapper element is created.
  // FIXME: This code should not depend on such craziness.
  DCHECK(!element().layoutObject());

  Document& document = element().document();
  ContainerNode* container = element().userAgentShadowRoot();

  container->appendChild(DateTimeEditElement::create(document, *this));
  element().updateView();
  container->appendChild(ClearButtonElement::create(document, *this));
  container->appendChild(SpinButtonElement::create(document, *this));

  if (LayoutTheme::theme().supportsCalendarPicker(
          m_inputType->formControlType()))
    m_pickerIndicatorIsAlwaysVisible = true;
  container->appendChild(PickerIndicatorElement::create(document, *this));
  m_pickerIndicatorIsVisible = true;
  updatePickerIndicatorVisibility();
}
开发者ID:ollie314,项目名称:chromium,代码行数:24,代码来源:MultipleFieldsTemporalInputTypeView.cpp

示例6: createShadowSubtree

void BaseMultipleFieldsDateAndTimeInputType::createShadowSubtree()
{
    ASSERT(element().shadow());

    // Element must not have a renderer here, because if it did
    // DateTimeEditElement::customStyleForRenderer() is called in appendChild()
    // before the field wrapper element is created.
    // FIXME: This code should not depend on such craziness.
    ASSERT(!element().renderer());

    Document& document = element().document();
    ContainerNode* container = element().userAgentShadowRoot();

    container->appendChild(DateTimeEditElement::create(document, *this));
    element().updateView();
    container->appendChild(ClearButtonElement::create(document, *this));
    container->appendChild(SpinButtonElement::create(document, *this));

    if (RenderTheme::theme().supportsCalendarPicker(formControlType()))
        m_pickerIndicatorIsAlwaysVisible = true;
    container->appendChild(PickerIndicatorElement::create(document, *this));
    m_pickerIndicatorIsVisible = true;
    updatePickerIndicatorVisibility();
}
开发者ID:kjthegod,项目名称:WebKit,代码行数:24,代码来源:BaseMultipleFieldsDateAndTimeInputType.cpp

示例7: viaInspectorStyleSheet

InspectorStyleSheet* InspectorCSSAgent::viaInspectorStyleSheet(Document* document, bool createIfAbsent)
{
    if (!document) {
        ASSERT(!createIfAbsent);
        return 0;
    }

    RefPtr<InspectorStyleSheet> inspectorStyleSheet = m_documentToInspectorStyleSheet.get(document);
    if (inspectorStyleSheet || !createIfAbsent)
        return inspectorStyleSheet.get();

    ExceptionCode ec = 0;
    RefPtr<Element> styleElement = document->createElement("style", ec);
    if (!ec)
        styleElement->setAttribute("type", "text/css", ec);
    if (!ec) {
        ContainerNode* targetNode;
        // HEAD is absent in ImageDocuments, for example.
        if (document->head())
            targetNode = document->head();
        else if (document->body())
            targetNode = document->body();
        else
            return 0;
        targetNode->appendChild(styleElement, ec);
    }
    if (ec)
        return 0;
    StyleSheetList* styleSheets = document->styleSheets();
    StyleSheet* styleSheet = styleSheets->item(styleSheets->length() - 1);
    if (!styleSheet->isCSSStyleSheet())
        return 0;
    CSSStyleSheet* cssStyleSheet = static_cast<CSSStyleSheet*>(styleSheet);
    String id = String::number(m_lastStyleSheetId++);
    inspectorStyleSheet = InspectorStyleSheet::create(id, cssStyleSheet, "inspector", m_domAgent->documentURLString(document));
    m_idToInspectorStyleSheet.set(id, inspectorStyleSheet);
    m_cssStyleSheetToInspectorStyleSheet.set(cssStyleSheet, inspectorStyleSheet);
    m_documentToInspectorStyleSheet.set(document, inspectorStyleSheet);
    return inspectorStyleSheet.get();
}
开发者ID:NewDreamUser2,项目名称:webkit-webcl,代码行数:40,代码来源:InspectorCSSAgent.cpp


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