Closed Bug 1771701 Opened 2 years ago Closed 6 months ago

Select All selects only editable nodes if the document body ends with editable nodes and there is no selection ranges

Categories

(Core :: DOM: Selection, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 1789967

People

(Reporter: masayuki, Unassigned)

References

Details

(Keywords: parity-chrome)

STR:

  1. Load https://jsfiddle.net/d_toybox/1hrdu06x/3/

In this case, document.execCommand("selectAll") is executed without selection ranges.

Another STR:

  1. Load https://jsfiddle.net/d_toybox/1hrdu06x/4/
  2. Press Ctrl - A or Cmd - A to select all

One you click the preceding non-editable text node, i.e., collapse selection into the non-editable text node, this is not reproducible.

Actual Result:

Only editable text is selected.

Expected Result:

Select all text which you see.

I guess that Selection sets focus node to the last node in the <body> and if it's editable, sets the selection root to the editing host.

This may lead odd state of HTMLEditor like bug 1771570. Therefore, even though this is a minor issue, but should have normal or more priority to avoid unrealistic assertion hits in HTMLEditor.

Oh, that's odd. The test fails in the latest browsers, but it worked when I run it in Chrome stable. I'll check it later.
https://wpt.fyi/results/editing/other/selectall-without-focus.html?label=experimental&label=master&aligned

Flags: needinfo?(masayuki)

(In reply to Masayuki Nakano [:masayuki] (he/him)(JST, +0900) from comment #2)

Oh, that's odd. The test fails in the latest browsers, but it worked when I run it in Chrome stable. I'll check it later.
https://wpt.fyi/results/editing/other/selectall-without-focus.html?label=experimental&label=master&aligned

Odd, it works if I run only it in Chrome, but does not work if I run all tests in the folder... So, it hits at least a bug of Chrome, but it's not related to the test purpose so that I need to find a way to test it in WPT. I'll keep investigating.

The failure is caused by odd bug of Chromium (and perhaps, Safari too). I filed an issue.

This was fixed by bug 1789967.

Status: NEW → RESOLVED
Closed: 6 months ago
Duplicate of bug: 1789967
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.