diff --git a/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp b/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp
index 516faf86ec0..d8ad6abfe2d 100644
--- a/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLCSSUtils.cpp
@@ -1059,6 +1059,7 @@ nsHTMLCSSUtils::GetCSSEquivalentToHTMLInlineStyleSet(nsIDOMNode * aNode,
nsresult res = GetElementContainerOrSelf(aNode, getter_AddRefs(theElement));
if (NS_FAILED(res)) return res;
nsCOMPtr theNode = do_QueryInterface(theElement);
+ aValueString.Truncate();
if (theElement && IsCSSEditableProperty(theNode, aHTMLProperty, aAttribute)) {
// Yes, the requested HTML style has a CSS equivalence in this implementation
diff --git a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
index d6cd0712c58..20e3da80825 100644
--- a/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
+++ b/mozilla/editor/libeditor/html/nsHTMLEditorStyle.cpp
@@ -1119,7 +1119,7 @@ nsHTMLEditor::GetInlinePropertyBase(nsIAtom *aProperty,
mHTMLCSSUtils->IsCSSEditableProperty(node, aProperty, aAttribute)) {
// the HTML styles defined by aProperty/aAttribute has a CSS equivalence
// in this implementation for node; let's check if it carries those css styles
- if (aValue) firstValue.Assign(*aValue);
+ if (aValue) theValue.Assign(*aValue);
mHTMLCSSUtils->IsCSSEquivalentToHTMLInlineStyleSet(node, aProperty, aAttribute,
isSet, theValue,
COMPUTED_STYLE_TYPE);