Closed Bug 1407352 Opened 2 years ago Closed 2 years ago

Avoid calling GetChildAt() in DeleteRangeTransaction::CreateTxnsToDeleteBetween()

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

References

Details

Attachments

(1 file)

No description provided.
Assignee: nobody → ehsan
Blocks: 651120
Comment on attachment 8917083 [details] [diff] [review]
Avoid calling GetChildAt() in DeleteRangeTransaction::CreateTxnsToDeleteBetween()

>@@ -148,17 +151,17 @@ DeleteRangeTransaction::CreateTxnsToDeleteBetween(nsINode* aNode,
>     // So, the transaction shouldn't be recorded.
>     if (NS_WARN_IF(!deleteTextTransaction->CanDoIt())) {
>       return NS_ERROR_FAILURE;
>     }
>     AppendChild(deleteTextTransaction);
>     return NS_OK;
>   }
> 
>-  nsCOMPtr<nsIContent> child = aNode->GetChildAt(aStartOffset);
>+  nsCOMPtr<nsIContent> child = aChildAtStartOffset;

|child| is used only for initializing DeleteNodeTransaction() and calling GetNextSibling(). So, this can be nsIContent*.
Attachment #8917083 - Flags: review?(masayuki) → review+
Pushed by eakhgari@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ccda121ca4b1
Avoid calling GetChildAt() in DeleteRangeTransaction::CreateTxnsToDeleteBetween(); r=masayuki
https://hg.mozilla.org/mozilla-central/rev/ccda121ca4b1
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.