Closed Bug 1401225 Opened 9 years ago Closed 9 years ago

EditorBase::SetTextImpl() uses the wrong length when collapsing the selection

Categories

(Core :: DOM: Editor, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox-esr52 --- unaffected
firefox55 --- unaffected
firefox56 --- unaffected
firefox57 + fixed

People

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

References

Details

(Keywords: regression)

Attachments

(1 file)

I discovered this because of try server failures of my patch for bug 1399722. Before that patch we didn't run this block of code, but the length I was passing here is wrong: <https://searchfox.org/mozilla-central/rev/1c13d5cf85f904afb8976c02a80daa252b893fca/editor/libeditor/EditorBase.cpp#2749> This length is set in the beginning of the function to the length of the old text content of the text node <https://searchfox.org/mozilla-central/rev/1c13d5cf85f904afb8976c02a80daa252b893fca/editor/libeditor/EditorBase.cpp#2716> But then we modify the text content here: <https://searchfox.org/mozilla-central/rev/1c13d5cf85f904afb8976c02a80daa252b893fca/editor/libeditor/EditorBase.cpp#2741> The old code used to do the right thing: <https://hg.mozilla.org/integration/mozilla-inbound/rev/baeb2b439c08#l3.61>
Blocks: 1399722
tracking as new regression in 57
Attachment #8909905 - Flags: review?(masayuki) → review+
Pushed by eakhgari@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/4d924f659b8c Pass the correct length when collapsing the selection in EditorBase::SetTextImpl(); r=masayuki
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: