Closed Bug 1890915 Opened 1 year ago Closed 1 year ago

A lot of warnings in `nsDOMAttributeMap::IndexedGetter()` when you run some editing WPT

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)

It warns that it's called with too big index.

It's called by EditorBase::CloneAttributesWithTransaction(), HTMLEditor::CopyAttributes() and HTMLEditor::InsertLinkAroundSelectionAsAction() via nsDOMAttributeMap::Item(). A call in EditorBase::CloneAttributesWithTransaction() obviously causes the warning and the other callers look like fine.

while (RefPtr<Attr> attr = attributes->Item(0)) causes a warning in
nsDOMAttributeMap::IndexedGetter() because of out of bounds. Additionally,
we should not make a loop with live DOM tree information if the loop updates
the DOM tree. Therefore, this patch makes it collect all attributes first
before touching the DOM tree.

Depends on D207240

Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/4b17d2a2a7ae Make `EditorBase::CloneAttributesWithTransaction()` collect all attributes before updating the DOM tree r=m_kato
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: