Open Bug 1454054 Opened 7 years ago Updated 2 years ago

Remove QI in nsRange::CollectClientRectsAndText()

Categories

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

enhancement

Tracking

()

People

(Reporter: mccr8, Unassigned)

Details

I removed one of these QIs, but the other could also be removed. (In reply to Boris Zbarsky [:bz] (no decent commit message means r-) from comment #5) > ::: dom/base/nsRange.cpp:3077 > (Diff revision 1) > > nsresult rv = iter.Init(aRange); > > if (NS_FAILED(rv)) return; > > > > if (iter.IsDone()) { > > // the range is collapsed, only continue if the cursor is in a text node > > nsCOMPtr<nsIContent> content = do_QueryInterface(aStartContainer); > > You could avoid this QI like so: > > if (aStartContainer->IsText()) { > nsTextFrame* textFrame = > GetTextFrameForContent(aStartContainer->AsText(), aFlushLayout); > > etc. > > ::: dom/base/nsRange.cpp:3104 > (Diff revision 1) > > } > > > > do { > > nsCOMPtr<nsINode> node = iter.GetCurrentNode(); > > iter.Next(); > > nsCOMPtr<nsIContent> content = do_QueryInterface(node); > > Should be able to avoi this QI too, but that's more work. Maybe file a > followup?
Priority: -- → P3
Component: DOM → DOM: Core & HTML
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.