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)
Tracking
()
People
(Reporter: masayuki, Unassigned)
References
Details
(Keywords: parity-chrome)
STR:
In this case, document.execCommand("selectAll")
is executed without selection ranges.
Another STR:
- Load https://jsfiddle.net/d_toybox/1hrdu06x/4/
- Press
Ctrl
-A
orCmd
-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
.
Reporter | ||
Comment 1•2 years ago
|
||
Now this is in WPT:
https://searchfox.org/mozilla-central/source/testing/web-platform/tests/editing/other/selectall-without-focus.html
Reporter | ||
Comment 2•2 years ago
|
||
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
Reporter | ||
Updated•2 years ago
|
Reporter | ||
Comment 3•2 years ago
|
||
(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.
Reporter | ||
Comment 4•2 years ago
|
||
The failure is caused by odd bug of Chromium (and perhaps, Safari too). I filed an issue.
Reporter | ||
Comment 5•6 months ago
|
||
This was fixed by bug 1789967.
Description
•