Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index b89cddad9a02e69ae7f314beb579b652e8b014b4..ec41014d4dbb7611752f10992d05ef9ccbc04cef 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -169,7 +169,7 @@ ReplacementFragment::ReplacementFragment(Document* document, DocumentFragment* f |
if (!editableRoot->getAttributeEventListener(EventTypeNames::webkitBeforeTextInserted) |
// FIXME: Remove these checks once textareas and textfields actually register an event handler. |
- && !(shadowAncestorElement && shadowAncestorElement->renderer() && shadowAncestorElement->renderer()->isTextControl()) |
+ && !(shadowAncestorElement && shadowAncestorElement->layoutObject() && shadowAncestorElement->layoutObject()->isTextControl()) |
&& editableRoot->layoutObjectIsRichlyEditable()) { |
removeInterchangeNodes(m_fragment.get()); |
return; |
@@ -571,7 +571,7 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert |
// Mutate using the CSSOM wrapper so we get the same event behavior as a script. |
if (isBlock(element)) |
element->style()->setPropertyInternal(CSSPropertyDisplay, "inline", false, IGNORE_EXCEPTION); |
- if (element->renderer() && element->renderer()->style()->isFloating()) |
+ if (element->layoutObject() && element->layoutObject()->style()->isFloating()) |
element->style()->setPropertyInternal(CSSPropertyFloat, "none", false, IGNORE_EXCEPTION); |
} |
} |
@@ -684,7 +684,7 @@ void ReplaceSelectionCommand::moveElementOutOfAncestor(PassRefPtrWillBeRawPtr<El |
static inline bool nodeHasVisibleRenderText(Text& text) |
{ |
- return text.renderer() && text.renderer()->renderedTextLength() > 0; |
+ return text.layoutObject() && text.layoutObject()->renderedTextLength() > 0; |
} |
void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& insertedNodes) |
@@ -932,8 +932,8 @@ void ReplaceSelectionCommand::doApply() |
return; |
// We can skip matching the style if the selection is plain text. |
- if ((selection.start().deprecatedNode()->renderer() && selection.start().deprecatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY) |
- && (selection.end().deprecatedNode()->renderer() && selection.end().deprecatedNode()->renderer()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY)) |
+ if ((selection.start().deprecatedNode()->layoutObject() && selection.start().deprecatedNode()->layoutObject()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY) |
+ && (selection.end().deprecatedNode()->layoutObject() && selection.end().deprecatedNode()->layoutObject()->style()->userModify() == READ_WRITE_PLAINTEXT_ONLY)) |
m_matchStyle = false; |
if (m_matchStyle) { |
@@ -1111,7 +1111,7 @@ void ReplaceSelectionCommand::doApply() |
Element* blockStart = enclosingBlock(insertionPos.deprecatedNode()); |
if ((isHTMLListElement(refNode.get()) || (isLegacyAppleHTMLSpanElement(refNode.get()) && isHTMLListElement(refNode->firstChild()))) |
- && blockStart && blockStart->renderer()->isListItem()) |
+ && blockStart && blockStart->layoutObject()->isListItem()) |
refNode = insertAsListItems(toHTMLElement(refNode), blockStart, insertionPos, insertedNodes); |
else { |
insertNodeAt(refNode, insertionPos); |
@@ -1317,7 +1317,7 @@ void ReplaceSelectionCommand::addSpacesForSmartReplace() |
bool needsTrailingSpace = !isEndOfParagraph(endOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(endOfInsertedContent.characterAfter(), false); |
if (needsTrailingSpace && endNode) { |
- bool collapseWhiteSpace = !endNode->renderer() || endNode->renderer()->style()->collapseWhiteSpace(); |
+ bool collapseWhiteSpace = !endNode->layoutObject() || endNode->layoutObject()->style()->collapseWhiteSpace(); |
if (endNode->isTextNode()) { |
insertTextIntoNode(toText(endNode), endOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " "); |
if (m_endOfInsertedContent.containerNode() == endNode) |
@@ -1341,7 +1341,7 @@ void ReplaceSelectionCommand::addSpacesForSmartReplace() |
bool needsLeadingSpace = !isStartOfParagraph(startOfInsertedContent) && !isCharacterSmartReplaceExemptConsideringNonBreakingSpace(startOfInsertedContent.previous().characterAfter(), true); |
if (needsLeadingSpace && startNode) { |
- bool collapseWhiteSpace = !startNode->renderer() || startNode->renderer()->style()->collapseWhiteSpace(); |
+ bool collapseWhiteSpace = !startNode->layoutObject() || startNode->layoutObject()->style()->collapseWhiteSpace(); |
if (startNode->isTextNode()) { |
insertTextIntoNode(toText(startNode), startOffset, collapseWhiteSpace ? nonBreakingSpaceString() : " "); |
if (m_endOfInsertedContent.containerNode() == startNode && m_endOfInsertedContent.offsetInContainerNode()) |