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

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

Issue 99333011: Make sure getAttribute() / setAttribute() callers use AtomicStrings (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
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/ApplyStyleCommand.cpp b/Source/core/editing/ApplyStyleCommand.cpp
index bdb2dec932f8cd676ec034fca7af0bac528ef34e..ec1b5f3588c43106e0309c1f71b076cd52786f7e 100644
--- a/Source/core/editing/ApplyStyleCommand.cpp
+++ b/Source/core/editing/ApplyStyleCommand.cpp
@@ -1443,19 +1443,19 @@ void ApplyStyleCommand::applyInlineStyleChange(PassRefPtr<Node> passedStart, Pas
if (styleChange.applyFontColor() || styleChange.applyFontFace() || styleChange.applyFontSize()) {
if (fontContainer) {
if (styleChange.applyFontColor())
- setNodeAttribute(fontContainer, colorAttr, styleChange.fontColor());
+ setNodeAttribute(fontContainer, colorAttr, AtomicString(styleChange.fontColor()));
if (styleChange.applyFontFace())
- setNodeAttribute(fontContainer, faceAttr, styleChange.fontFace());
+ setNodeAttribute(fontContainer, faceAttr, AtomicString(styleChange.fontFace()));
if (styleChange.applyFontSize())
- setNodeAttribute(fontContainer, sizeAttr, styleChange.fontSize());
+ setNodeAttribute(fontContainer, sizeAttr, AtomicString(styleChange.fontSize()));
} else {
RefPtr<Element> fontElement = createFontElement(document());
if (styleChange.applyFontColor())
- fontElement->setAttribute(colorAttr, styleChange.fontColor());
+ fontElement->setAttribute(colorAttr, AtomicString(styleChange.fontColor()));
if (styleChange.applyFontFace())
- fontElement->setAttribute(faceAttr, styleChange.fontFace());
+ fontElement->setAttribute(faceAttr, AtomicString(styleChange.fontFace()));
if (styleChange.applyFontSize())
- fontElement->setAttribute(sizeAttr, styleChange.fontSize());
+ fontElement->setAttribute(sizeAttr, AtomicString(styleChange.fontSize()));
surroundNodeRangeWithElement(startNode, endNode, fontElement.get());
}
}
@@ -1469,12 +1469,13 @@ void ApplyStyleCommand::applyInlineStyleChange(PassRefPtr<Node> passedStart, Pas
if (!existingText.isEmpty())
cssText.append(' ');
cssText.append(styleChange.cssStyle());
- setNodeAttribute(styleContainer, styleAttr, cssText.toString());
- } else
- setNodeAttribute(styleContainer, styleAttr, styleChange.cssStyle());
+ setNodeAttribute(styleContainer, styleAttr, cssText.toAtomicString());
+ } else {
+ setNodeAttribute(styleContainer, styleAttr, AtomicString(styleChange.cssStyle()));
+ }
} else {
RefPtr<Element> styleElement = createStyleSpanElement(document());
- styleElement->setAttribute(styleAttr, styleChange.cssStyle());
+ styleElement->setAttribute(styleAttr, AtomicString(styleChange.cssStyle()));
surroundNodeRangeWithElement(startNode, endNode, styleElement.release());
}
}
« no previous file with comments | « Source/core/dom/Document.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698