Closed Bug 1797920 Opened 2 years ago Closed 2 years ago

getSelection().anchorNode returns wrong node after executing document.execCommand(..)

Categories

(Core :: DOM: Editor, defect)

Firefox 106
Desktop
All
defect

Tracking

()

RESOLVED DUPLICATE of bug 1792386

People

(Reporter: jimmy, Unassigned)

Details

Steps to reproduce:

Please go to https://jsfiddle.net/cjnm378d/

Double click on a word in the editable div to turn a word BOLD. When document.execCommand("bold") is applied, other browsers will update the selection to become the text node within the newly created bold tag. But not Firefox. Firefox moves the selection to the text node before the bold tag.

Actual results:

Firefox does not update selection to text node within newly created item but instead keeps it on the text node BEFORE the bold tag.

Expected results:

Firefox should update the selection to the text node within the newly created bold tag like other browsers do.

The Bugbug bot thinks this bug should belong to the 'Toolkit::Application Update' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Application Update
Product: Firefox → Toolkit
Component: Application Update → Untriaged
Product: Toolkit → Firefox
Component: Untriaged → DOM: Editor
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All

Managed to reproduce the issue on Window 10 x64, macOS 11.6 and on Ubuntu 20.04 x64.

Severity: -- → S4
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Hardware: All → Desktop

An editor incompatibility seems a little worse than S4 to me, but maybe I'm wrong.

Severity: S4 → S2

I'm currently trying to fix this in bug 1792386.

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