Closed Bug 1793390 Opened 3 years ago Closed 3 years ago

line-iterator.html needs to collapse `Selection` somewhere first

Categories

(Core :: Layout: Block and Inline, defect)

defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox105 --- unaffected
firefox106 --- unaffected
firefox107 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

The test calls Selection.modify.
https://searchfox.org/mozilla-central/rev/12a34801fbaa6f14e20515a44b1fd77179b02617/testing/talos/talos/tests/perf-reftest-singletons/line-iterator.html#20,22,27

And it does nothing if there is no selection range:
https://searchfox.org/mozilla-central/rev/12a34801fbaa6f14e20515a44b1fd77179b02617/dom/base/Selection.cpp#3304-3305,3311-3313

However, it does not initialize Selection by itself. Therefore, the test does nothing with Selection API because bug 1789967 stopped creating a Selection range at the page load.

Set release status flags based on info from the regressing bug 1789967

Oh, but the test calls focus() here:
https://searchfox.org/mozilla-central/rev/560b7b1b174ed36912b969eee0c1920f3c59bc56/testing/talos/talos/tests/perf-reftest-singletons/line-iterator.html#16

Therefore, Selection must be collapsed at start of the contenteditable.

However, actually, I see Selection::Modify does noting in the first loop. Something could be broken at setting focus in HTMLEditor...

Ah, I see. While talos tests run, the URL bar has focus, thus, focus is not moved into the editor with a focus() call in content.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED

It calls pre[contenteditable].focus(), but when talos tests run, the URL bar
keeps having focus. Therefore, the focus() call in content cannot steal focus
from the chrome UI. Then, it does not pay the cost of Selection.modify in
the first loop because it does nothing when there is no selection ranges.
(Before bug 1789967, Selection was collapsed to end of the document at
loading by HTMLEditor, but it's now not performed, and due to the silent
failure of the call of focus(), nobody collapse selection in the document.)

Depends on D158551

Attachment #9297089 - Attachment description: Bug 1793390 - Make `line-iterator.html` collapse `Selection` to into the editable element by itself → Bug 1793390 - Make `line-iterator.html` collapse `Selection` into the editable element by itself
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/c4a4f6e02326 Make `line-iterator.html` collapse `Selection` into the editable element by itself r=perftest-reviewers,sparky
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
Regressions: 1794765
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: