[contenteditable] `RightClick` move caret at the start of the `contenteditable` element
Categories
(Core :: DOM: UI Events & Focus Handling, defect, P3)
Tracking
()
People
(Reporter: pomili.lorenzo85, Assigned: masayuki)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Steps to reproduce:
open the attached file and right click on the child div
Actual results:
the caret is moved at the start of the contenteditable
element
Expected results:
the caret should be moved where the click happens, like when you use left click
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Editor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 2•1 year ago
|
||
#1 regression:
Good build: A caret appears at the right mouse click position.
Bad build: The caret is not shown.
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=06b2977afb85&tochange=569a45bfb71c
Suspect of #1 regression: ab8c0ebe600b7687cba76d7c2a429772ac9c0830 Graeme McCutcheon — Bug 682338 - Focus context menu's target on platforms where the context menu is shown on mousedown, not where it's shown on mouseup. r=enndeakin
#2 regression
The build from ae1dfa192faf: The caret is not shown as same as the above bad build.
Bad build: The caret is shown at the contenteditable element.
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ae1dfa192faf&tochange=92c87e95915e
Suspect of #2 regression: 030d8d4684982327356a377cbb13c82b665ce992 Masayuki Nakano — Bug 1083629 Use nsHTMLEditor::IsAcceptableInputEvent() instead of nsEditor::IsDescendantOfEditorRoot() for checking if a mouse down event target is in focused HTML editor r=ehsan
Updated•1 year ago
|
Comment 3•1 year ago
|
||
Other browsers seem to select the word that the user clicks on.
Assignee | ||
Comment 4•1 year ago
|
||
Well, it seems that the patch was written with wrong assumption.
On the other hand, I'm not sure that it's right behavior that caret is not moved with a right click in caret browsing mode. There is no handler for it, that was what I didn't expect.
Assignee | ||
Comment 5•1 year ago
|
||
Hmm, there was a request for making the old (and expected by the reporter here) behavior cancelable.
Assignee | ||
Comment 6•1 year ago
|
||
Oh, and the old behavior may be triggered in unexpected cases too.
Assignee | ||
Comment 7•1 year ago
|
||
It seems that we can fix this with touching nsIFrame::HandleEvent
. Taking a look...
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 8•1 year ago
|
||
The patch will change Selection
result so I don't think we should/can fix this in ESR branches.
Comment 9•1 year ago
|
||
The component has been changed since the backlog priority was decided, so we're resetting it.
For more information, please visit BugBot documentation.
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 10•1 year ago
|
||
FYI: Safari works similar to Chrome, but select a word under the cursor.
Updated•11 months ago
|
Reporter | ||
Comment 11•11 months ago
|
||
Hello,
just to be sure did you switch it to wontfix
because you reschedule the fix?
I'm asking because with the current behvaior is not possible to understand where the user has clicked.
So in some cases is not possible to align the browsers behviors when you work on an WYSIWYG editor like TinyMCE
Comment 12•11 months ago
|
||
(In reply to pomili.lorenzo85 from comment #11)
Hello,
just to be sure did you switch it towontfix
because you reschedule the fix?
Hi, the bug is not resolved aswontfix
. The current release and upcoming release is set towontfix
since we don't have a patch.
The bug is in the team's backlog.
Reporter | ||
Comment 13•11 months ago
|
||
ok, thanks for the clarification :)
Assignee | ||
Comment 14•9 months ago
|
||
The other browsers move focus and Selection
whe right click even if the
clicked element is not editable and even if there is a non-collapsed selection.
Fortunately, we already have similar code for the middle button press.
Therefore, we can make it run when the pressed button is the secondary button.
This also fixes bug 416546 and does not resurrect bug 709476.
However, this patch adds 2 prefs for making users customizable. Our traditional
behavior is, we never collapse non-collapses selection with a right click even
if clicked outside the selection. This allows users to open context menu for
selected text much easier. Therefore, even though the behavior is different
from the others, we should keep the traditional behavior, but some users may
want the other browsers' behavior instead. For them, this should be switchable
by a pref.
Additionally, I'm still not sure collapsing selection with a right click in
non-editable content especially for users using the caret browsing mode.
Therefore, for making things safer, this adds a pref to disable the new behavior
in the non-editable content.
Comment 15•9 months ago
|
||
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/81712ea02609 Make `nsIFrame::HandleEvent` move caret when secondary mouse button down r=edgar,emilio,dom-core
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/42439 for changes under testing/web-platform/tests
Comment 17•9 months ago
|
||
bugherder |
Upstream PR merged by moz-wptsync-bot
Updated•9 months ago
|
Updated•9 months ago
|
Comment 19•8 months ago
|
||
Reproducible on a 2023-10-08 Nightly build on macOS 12.
Verified as fixed on Firefox 120.0b5 and Nightly 121.0a1 on macOS 12, Windows 10, Ubuntu 22.
Assignee | ||
Updated•8 months ago
|
Assignee | ||
Updated•8 months ago
|
Comment 20•8 months ago
•
|
||
backed out for 120.0rc2 for causing bug 1864334
Backout link
Backout push
Assignee | ||
Updated•8 months ago
|
Description
•