| Index: third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
|
| diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
|
| index e552937f93862693dd0f8926ac4cf707b92df801..127a973e91f98bc956626dc9aeeebac1dcf96c51 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/ReplaceNodeWithSpanCommand.cpp
|
| @@ -50,7 +50,7 @@ ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand(RawPtr<HTMLElement> eleme
|
|
|
| static void swapInNodePreservingAttributesAndChildren(HTMLElement* newElement, HTMLElement& elementToReplace)
|
| {
|
| - ASSERT(elementToReplace.inDocument());
|
| + ASSERT(elementToReplace.inShadowIncludingDocument());
|
| RawPtr<ContainerNode> parentNode = elementToReplace.parentNode();
|
| parentNode->insertBefore(newElement, &elementToReplace);
|
|
|
| @@ -67,7 +67,7 @@ static void swapInNodePreservingAttributesAndChildren(HTMLElement* newElement, H
|
|
|
| void ReplaceNodeWithSpanCommand::doApply(EditingState*)
|
| {
|
| - if (!m_elementToReplace->inDocument())
|
| + if (!m_elementToReplace->inShadowIncludingDocument())
|
| return;
|
| if (!m_spanElement)
|
| m_spanElement = HTMLSpanElement::create(m_elementToReplace->document());
|
| @@ -76,7 +76,7 @@ void ReplaceNodeWithSpanCommand::doApply(EditingState*)
|
|
|
| void ReplaceNodeWithSpanCommand::doUnapply()
|
| {
|
| - if (!m_spanElement->inDocument())
|
| + if (!m_spanElement->inShadowIncludingDocument())
|
| return;
|
| swapInNodePreservingAttributesAndChildren(m_elementToReplace.get(), *m_spanElement);
|
| }
|
|
|