Closed Bug 1386484 Opened 7 years ago Closed 7 years ago

Make SetTextTransaction less expensive to create

Categories

(Core :: DOM: Editor, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Attachment #8892718 - Flags: review?(masayuki)
Attachment #8892719 - Flags: review?(masayuki)
Assignee: nobody → ehsan
Comment on attachment 8892718 [details] [diff] [review] Part 1: Inline SetTextTransaction::SetTextTransaction() I wonder, why don't we move the code in SetTextTransaction::DoTransaction() to EditorBase::SetTextImpl() or make it a new method of EditorBase? Then, we don't need to create the instance.
Flags: needinfo?(ehsan)
You're right, this class has really lost its purpose to exist now!
Flags: needinfo?(ehsan)
Attachment #8892718 - Attachment is obsolete: true
Attachment #8892718 - Flags: review?(masayuki)
Attachment #8892719 - Attachment is obsolete: true
Attachment #8892719 - Flags: review?(masayuki)
Besides some unnecessary copying and malloc overhead that this removes, it also removes a call to dom::Text::GetData() which we used to only make to get the old length of the text node before modifying it. Turns out that this old length was already obtained once in SetTextImpl().
Attachment #8893144 - Flags: review?(masayuki)
Comment on attachment 8893144 [details] [diff] [review] Remove the SetTextTransaction class and embed its functionality into EditorBase::SetTextImpl() Excellent!
Attachment #8893144 - Flags: review?(masayuki) → review+
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/baeb2b439c08 Remove the SetTextTransaction class and embed its functionality into EditorBase::SetTextImpl(); r=masayuki
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Depends on: 1401225
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: