diff options
author | Gaming4JC <g4jc@hyperbola.info> | 2020-05-22 18:38:33 -0400 |
---|---|---|
committer | Gaming4JC <g4jc@hyperbola.info> | 2020-07-31 15:59:58 -0400 |
commit | 1115c63bf788dad121f65cf465ebf73562b4d029 (patch) | |
tree | 11447919a62454e454c78db034baf5f053f23532 /editor/libeditor/HTMLEditor.cpp | |
parent | 1c0c7cf583e6adda168cf59cad3aad3e38e7c058 (diff) | |
download | uxp-1115c63bf788dad121f65cf465ebf73562b4d029.tar.gz |
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.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp index 4cda49ab51..6a630cb1c4 100644 --- a/editor/libeditor/HTMLEditor.cpp +++ b/editor/libeditor/HTMLEditor.cpp @@ -2529,7 +2529,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; } @@ -2561,8 +2561,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 |