summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/HTMLEditor.cpp
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2020-05-22 18:38:33 -0400
committerMoonchild <moonchild@palemoon.org>2020-08-07 21:29:36 +0000
commit2f022ab1faeb4703ecd9d7ca6b912bbe397531f6 (patch)
treeda9ff096d8731c080b0a90f376b2a3745c6f0e49 /editor/libeditor/HTMLEditor.cpp
parent14e7f881be45078115aade9b2e6ccf8091a70b1a (diff)
downloadUXP-2f022ab1faeb4703ecd9d7ca6b912bbe397531f6.tar
UXP-2f022ab1faeb4703ecd9d7ca6b912bbe397531f6.tar.gz
UXP-2f022ab1faeb4703ecd9d7ca6b912bbe397531f6.tar.lz
UXP-2f022ab1faeb4703ecd9d7ca6b912bbe397531f6.tar.xz
UXP-2f022ab1faeb4703ecd9d7ca6b912bbe397531f6.zip
Issue #1621 - Part 3: Use nsIAtom to change attirbute if possible.
We can replace old nsIEditor API with nsIAtom version. Ref: Bug 1324996
Diffstat (limited to 'editor/libeditor/HTMLEditor.cpp')
-rw-r--r--editor/libeditor/HTMLEditor.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp
index cf0be447d..0a2ec023a 100644
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -2584,7 +2584,7 @@ HTMLEditor::CreateElementWithDefaults(const nsAString& aTagName)
// New call to use instead to get proper HTML element, bug 39919
nsCOMPtr<nsIAtom> realTagAtom = NS_Atomize(realTagName);
- nsCOMPtr<Element> newElement = CreateHTMLContent(realTagAtom);
+ RefPtr<Element> newElement = CreateHTMLContent(realTagAtom);
if (!newElement) {
return nullptr;
}
@@ -2616,8 +2616,7 @@ HTMLEditor::CreateElementWithDefaults(const nsAString& aTagName)
} else if (tagName.EqualsLiteral("td")) {
nsresult rv =
SetAttributeOrEquivalent(
- static_cast<nsIDOMElement*>(newElement->AsDOMNode()),
- NS_LITERAL_STRING("valign"), NS_LITERAL_STRING("top"), true);
+ newElement, nsGkAtoms::valign, NS_LITERAL_STRING("top"), true);
NS_ENSURE_SUCCESS(rv, nullptr);
}
// ADD OTHER TAGS HERE