本文整理汇总了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);
}
示例2: doReapply
void SplitTextNodeCommand::doReapply()
{
if (!m_text1 || !m_text2)
return;
ContainerNode* parent = m_text2->parentNode();
if (!parent || !parent->hasEditableStyle())
return;
insertText1AndTrimText2();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}