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


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

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


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

示例1: executeApply

void SplitElementCommand::executeApply()
{
    if (m_atChild->parentNode() != m_element2)
        return;
    
    Vector<RefPtr<Node>> children;
    for (Node* node = m_element2->firstChild(); node != m_atChild; node = node->nextSibling())
        children.append(node);
    
    ExceptionCode ec = 0;
    
    ContainerNode* parent = m_element2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;
    parent->insertBefore(m_element1.get(), m_element2.get(), ec);
    if (ec)
        return;

    // Delete id attribute from the second element because the same id cannot be used for more than one element
    m_element2->removeAttribute(HTMLNames::idAttr);

    size_t size = children.size();
    for (size_t i = 0; i < size; ++i)
        m_element1->appendChild(children[i], ec);
}
开发者ID:AndriyKalashnykov,项目名称:webkit,代码行数:25,代码来源:SplitElementCommand.cpp

示例2: doReapply

void SplitTextNodeCommand::doReapply()
{
    if (!m_text1 || !m_text2)
        return;

    ContainerNode* parent = m_text2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;

    insertText1AndTrimText2();
}
开发者ID:eocanha,项目名称:webkit,代码行数:11,代码来源:SplitTextNodeCommand.cpp

示例3: doApply

void SplitTextNodeCommand::doApply()
{
    ContainerNode* parent = m_text2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;

    String prefixText = m_text2->substringData(0, m_offset, IGNORE_EXCEPTION);
    if (prefixText.isEmpty())
        return;

    m_text1 = Text::create(document(), prefixText);
    ASSERT(m_text1);
    document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);

    insertText1AndTrimText2();
}
开发者ID:Jamesducque,项目名称:mojo,代码行数:16,代码来源:SplitTextNodeCommand.cpp

示例4: doApply

void SplitTextNodeCommand::doApply()
{
    ContainerNode* parent = m_text2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;

    auto result = m_text2->substringData(0, m_offset);
    if (result.hasException())
        return;
    auto prefixText = result.releaseReturnValue();
    if (prefixText.isEmpty())
        return;

    m_text1 = Text::create(document(), WTFMove(prefixText));
    ASSERT(m_text1);
    document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);

    insertText1AndTrimText2();
}
开发者ID:eocanha,项目名称:webkit,代码行数:19,代码来源:SplitTextNodeCommand.cpp

示例5: executeApply

void SplitElementCommand::executeApply()
{
    if (m_atChild->parentNode() != m_element2)
        return;

    WillBeHeapVector<RefPtrWillBeMember<Node>> children;
    for (Node* node = m_element2->firstChild(); node != m_atChild; node = node->nextSibling())
        children.append(node);

    TrackExceptionState exceptionState;

    ContainerNode* parent = m_element2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;
    parent->insertBefore(m_element1.get(), m_element2.get(), exceptionState);
    if (exceptionState.hadException())
        return;

    // Delete id attribute from the second element because the same id cannot be used for more than one element
    m_element2->removeAttribute(HTMLNames::idAttr);

    for (const auto& child : children)
        m_element1->appendChild(child, exceptionState);
}
开发者ID:astojilj,项目名称:chromium-crosswalk,代码行数:24,代码来源:SplitElementCommand.cpp

示例6: doUnapply

void MergeIdenticalElementsCommand::doUnapply()
{
    ASSERT(m_element1);
    ASSERT(m_element2);

    RefPtrWillBeRawPtr<Node> atChild = m_atChild.release();

    ContainerNode* parent = m_element2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;

    TrackExceptionState exceptionState;

    parent->insertBefore(m_element1.get(), m_element2.get(), exceptionState);
    if (exceptionState.hadException())
        return;

    WillBeHeapVector<RefPtrWillBeMember<Node>> children;
    for (Node* child = m_element2->firstChild(); child && child != atChild; child = child->nextSibling())
        children.append(child);

    for (auto& child : children)
        m_element1->appendChild(child.release(), exceptionState);
}
开发者ID:dstockwell,项目名称:blink,代码行数:24,代码来源:MergeIdenticalElementsCommand.cpp

示例7: doUnapply

void MergeIdenticalElementsCommand::doUnapply()
{
    ASSERT(m_element1);
    ASSERT(m_element2);

    RefPtr<Node> atChild = m_atChild.release();

    ContainerNode* parent = m_element2->parentNode();
    if (!parent || !parent->hasEditableStyle())
        return;

    ExceptionCode ec = 0;

    parent->insertBefore(*m_element1, m_element2.get(), ec);
    if (ec)
        return;

    Vector<Ref<Node>> children;
    for (Node* child = m_element2->firstChild(); child && child != atChild; child = child->nextSibling())
        children.append(*child);

    for (auto& child : children)
        m_element1->appendChild(WTF::move(child), ec);
}
开发者ID:robvogelaar,项目名称:WebKitForWayland,代码行数:24,代码来源:MergeIdenticalElementsCommand.cpp


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