mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Issue #1621 - Part 3: Use nsIAtom to change attirbute if possible.
We can replace old nsIEditor API with nsIAtom version. Ref: Bug 1324996
This commit is contained in:
parent
b6b2792a35
commit
ec1301a85d
7 changed files with 51 additions and 64 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue