Loading editor/libeditor/html/nsHTMLEditor.cpp +1 −10 Original line number Diff line number Diff line Loading @@ -2937,16 +2937,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsAString& aTagName, nsIDOMElement newElement->SetAttribute(NS_LITERAL_STRING("_moz_dirty"), EmptyString()); // Set default values for new elements if (TagName.EqualsLiteral("hr")) { // Note that we read the user's attributes for these from prefs (in InsertHLine JS) res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("width"), NS_LITERAL_STRING("100%"), true); NS_ENSURE_SUCCESS(res, res); res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("size"), NS_LITERAL_STRING("2"), true); } else if (TagName.EqualsLiteral("table")) { if (TagName.EqualsLiteral("table")) { res = newElement->SetAttribute(NS_LITERAL_STRING("cellpadding"),NS_LITERAL_STRING("2")); NS_ENSURE_SUCCESS(res, res); res = newElement->SetAttribute(NS_LITERAL_STRING("cellspacing"),NS_LITERAL_STRING("2")); Loading editor/libeditor/html/tests/Makefile.in +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ _TEST_FILES = \ green.png \ test_bug290026.html \ test_bug291780.html \ test_bug316447.html \ test_bug332636.html \ test_bug332636.html^headers^ \ test_bug372345.html \ Loading editor/libeditor/html/tests/test_bug316447.html 0 → 100644 +16 −0 Original line number Diff line number Diff line <!DOCTYPE html> <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=316447 --> <title>Test for Bug 316447</title> <script src="/tests/SimpleTest/SimpleTest.js"></script> <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=316447">Mozilla Bug 316447</a> <div contenteditable><br></div> <script> /** Test for Bug 316447 **/ getSelection().selectAllChildren(document.querySelector("div")); document.execCommand("inserthorizontalrule"); is(document.querySelector("div").innerHTML, "<hr>", "Wrong innerHTML"); </script> Loading
editor/libeditor/html/nsHTMLEditor.cpp +1 −10 Original line number Diff line number Diff line Loading @@ -2937,16 +2937,7 @@ nsHTMLEditor::CreateElementWithDefaults(const nsAString& aTagName, nsIDOMElement newElement->SetAttribute(NS_LITERAL_STRING("_moz_dirty"), EmptyString()); // Set default values for new elements if (TagName.EqualsLiteral("hr")) { // Note that we read the user's attributes for these from prefs (in InsertHLine JS) res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("width"), NS_LITERAL_STRING("100%"), true); NS_ENSURE_SUCCESS(res, res); res = SetAttributeOrEquivalent(newElement, NS_LITERAL_STRING("size"), NS_LITERAL_STRING("2"), true); } else if (TagName.EqualsLiteral("table")) { if (TagName.EqualsLiteral("table")) { res = newElement->SetAttribute(NS_LITERAL_STRING("cellpadding"),NS_LITERAL_STRING("2")); NS_ENSURE_SUCCESS(res, res); res = newElement->SetAttribute(NS_LITERAL_STRING("cellspacing"),NS_LITERAL_STRING("2")); Loading
editor/libeditor/html/tests/Makefile.in +1 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ _TEST_FILES = \ green.png \ test_bug290026.html \ test_bug291780.html \ test_bug316447.html \ test_bug332636.html \ test_bug332636.html^headers^ \ test_bug372345.html \ Loading
editor/libeditor/html/tests/test_bug316447.html 0 → 100644 +16 −0 Original line number Diff line number Diff line <!DOCTYPE html> <!-- https://bugzilla.mozilla.org/show_bug.cgi?id=316447 --> <title>Test for Bug 316447</title> <script src="/tests/SimpleTest/SimpleTest.js"></script> <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=316447">Mozilla Bug 316447</a> <div contenteditable><br></div> <script> /** Test for Bug 316447 **/ getSelection().selectAllChildren(document.querySelector("div")); document.execCommand("inserthorizontalrule"); is(document.querySelector("div").innerHTML, "<hr>", "Wrong innerHTML"); </script>