Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: Source/core/editing/ReplaceSelectionCommand.cpp

Issue 110723005: Make calls to AtomicString(const String&) explicit in editing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 3c9a6292213e0c8f3e4e838265bc7e0d5ef8259e..16d13f62d110864cf7bcd814a002b28210b1dd30 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -513,8 +513,9 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(Insert
continue;
}
removeNodeAttribute(element, styleAttr);
- } else if (newInlineStyle->style()->propertyCount() != inlineStyle->propertyCount())
- setNodeAttribute(element, styleAttr, newInlineStyle->style()->asText());
+ } else if (newInlineStyle->style()->propertyCount() != inlineStyle->propertyCount()) {
+ setNodeAttribute(element, styleAttr, AtomicString(newInlineStyle->style()->asText()));
+ }
// FIXME: Tolerate differences in id, class, and style attributes.
if (isNonTableCellHTMLBlockElement(element) && areIdenticalElements(element, element->parentNode())
@@ -788,8 +789,9 @@ void ReplaceSelectionCommand::handleStyleSpans(InsertedNodes& insertedNodes)
if (style->isEmpty() || !wrappingStyleSpan->firstChild()) {
insertedNodes.willRemoveNodePreservingChildren(*wrappingStyleSpan);
removeNodePreservingChildren(wrappingStyleSpan);
- } else
- setNodeAttribute(wrappingStyleSpan, styleAttr, style->style()->asText());
+ } else {
+ setNodeAttribute(wrappingStyleSpan, styleAttr, AtomicString(style->style()->asText()));
+ }
}
void ReplaceSelectionCommand::mergeEndIfNeeded()
« Source/core/editing/ApplyStyleCommand.cpp ('K') | « Source/core/editing/EditorCommand.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698