Closed Bug 1404916 Opened 7 years ago Closed 1 years ago

nsContentIterator is used over anonymous content

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

58 Branch
enhancement

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox58 --- wontfix
firefox119 --- fixed

People

(Reporter: catalinb, Assigned: emilio)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(2 files)

This is a follow-up for bug 1395973. nsFind will initialize nsContentIterator with anonymous endpoints, but we can't really iterate over it. This currently works out of luck. It would be nice fix this and maybe stop using (node, offset) for initializing nsContentIterator.
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: minor → S4

This shows up in the profiles from bug 1844470: ContentIteratorBase::GetNextSibling spends much of its time in this check:

https://searchfox.org/mozilla-central/rev/6e2fb6cde8ba14b9d9a6367ba61a97ad1f13b1c2/dom/base/ContentIterator.cpp#626-631

// XXX This is a hack to preserve previous behaviour: This should be fixed
// in bug 1404916. If we were positioned on anonymous content, move to
// the first child of our parent.
if (parent->GetLastChild() && parent->GetLastChild() != aNode) {
  return parent->GetFirstChild();
}

Emilio, do you know what to do with this bug?

Blocks: 1844470
Flags: needinfo?(emilio)
Depends on: 1849838

Hard to know off-hand without knowing what fails without it, but at the very least we should be able to replace that check by something faster. Just sent a patch to bug 1849838 doing that. Will send a try run removing it and see what blows up. Comment 0 mentions nsFind but nsFind no longer uses ContentIterator. So maybe it can just go?

Flags: needinfo?(emilio)

Comment 0 mentions nsFind but nsFind no longer uses this code. So let's
try to remove this.

Assignee: nobody → emilio
Status: NEW → ASSIGNED
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2303dc7d7757 Remove ContentIterator native-anonymous hack. r=smaug
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: