Closed Bug 1892376 Opened 1 year ago Closed 1 year ago

Make `EditorBase::CloneAttributesWithTransaction()` not use `nsDOMAttributeMap`

Categories

(Core :: DOM: Editor, defect)

defect

Tracking

()

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

Details

Attachments

(1 file)

https://phabricator.services.mozilla.com/D207241#inline-1149106

I'll note that using nsDOMAttributeMap for code like this is not great, it's really only meant to be used from JS. It creates attribute nodes for all attributes, which you don't really need here. It would be better to use Element::GetAttrCount/GetAttrInfoAt, which allows you to get the nodeinfo and value for all attributes for an element.

nsDOMAttributeMap::GetAttribute creates dom::Attr so that it's not cheap.
Instead it should access Element::mAttrs with the accessors or
BorrowedAttrInfo.

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/2379d951ae10 Make `EditorBase` and `HTMLEditor` not use `nsDOMAttributeMap` r=peterv,dom-core
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: