      }
  
      RefPtr<Selection> selection = GetSelection();
-@@ -2623,11 +2624,6 @@ HTMLEditor::CreateElementWithDefaults(const nsAString& aTagName)
+     if (selection) {
+       nsCOMPtr<nsISelectionListener>listener;
+       listener = do_QueryInterface(mTypeInState);
+       if (listener) {
+         selection->AddSelectionListener(listener);
+@@ -2618,21 +2619,16 @@ HTMLEditor::CreateElementWithDefaults(co
+       return nullptr;
+     }
+     newElement->SetAttribute(NS_LITERAL_STRING("border"),
+                              NS_LITERAL_STRING("1"), rv);
+     if (NS_WARN_IF(rv.Failed())) {
        rv.SuppressException();
        return nullptr;
      }

       ((aProperty == nsGkAtoms::b &&
         element->IsHTMLElement(nsGkAtoms::strong)) ||
        (aProperty == nsGkAtoms::i &&
@@ -277,7 +282,8 @@ HTMLEditor::IsSimpleModifiableNode(nsIContent* aContent,
   // style supports it
   if (!mCSSEditUtils->IsCSSEditableProperty(element, aProperty, aAttribute) ||
       !element->IsHTMLElement(nsGkAtoms::span) ||

 } // namespace mozilla
+
diff --git a/editor/libeditor/HTMLEditor.h b/editor/libeditor/HTMLEditor.h
--- a/editor/libeditor/HTMLEditor.h
+++ b/editor/libeditor/HTMLEditor.h
@@ -711,17 +711,18 @@ protected:
                                        int32_t aStartOffset,
                                        int32_t aEndOffset,
                                        nsIAtom& aProperty,
                                        const nsAString* aAttribute,
                                        const nsAString& aValue);
   nsresult SetInlinePropertyOnNode(nsIContent& aNode,
                                    nsIAtom& aProperty,
                                    const nsAString* aAttribute,
