diff --git a/mozilla/editor/base/nsEditor.cpp b/mozilla/editor/base/nsEditor.cpp index b0157e8235c..6a7137f31b0 100644 --- a/mozilla/editor/base/nsEditor.cpp +++ b/mozilla/editor/base/nsEditor.cpp @@ -2795,8 +2795,11 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode) if (NS_SUCCEEDED(sourceAttribute->GetName(sourceAttrName))) { nsAutoString sourceAttrValue; - if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue)) && - !sourceAttrValue.IsEmpty()) + /* + Presence of an attribute in the named node map indicates that it was set on the + element even if it has no value. + */ + if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue))) { if (destInBody) SetAttribute(destElement, sourceAttrName, sourceAttrValue); diff --git a/mozilla/editor/libeditor/base/nsEditor.cpp b/mozilla/editor/libeditor/base/nsEditor.cpp index b0157e8235c..6a7137f31b0 100644 --- a/mozilla/editor/libeditor/base/nsEditor.cpp +++ b/mozilla/editor/libeditor/base/nsEditor.cpp @@ -2795,8 +2795,11 @@ nsEditor::CloneAttributes(nsIDOMNode *aDestNode, nsIDOMNode *aSourceNode) if (NS_SUCCEEDED(sourceAttribute->GetName(sourceAttrName))) { nsAutoString sourceAttrValue; - if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue)) && - !sourceAttrValue.IsEmpty()) + /* + Presence of an attribute in the named node map indicates that it was set on the + element even if it has no value. + */ + if (NS_SUCCEEDED(sourceAttribute->GetValue(sourceAttrValue))) { if (destInBody) SetAttribute(destElement, sourceAttrName, sourceAttrValue);