Open Bug 1797844 Opened 3 years ago Updated 3 years ago

document.execCommand("unlink") breaks when double linebreaks and underline is in play

Categories

(Core :: DOM: Core & HTML, defect)

Firefox 106
Desktop
All
defect

Tracking

()

Tracking Status
firefox106 --- affected
firefox107 --- affected
firefox108 --- affected

People

(Reporter: jimmy, Unassigned)

Details

Steps to reproduce:

Go to https://jsfiddle.net/q5uzjg7w/7/ and follow the instructions.
Notice how Firefox is unable to remove links when double linebreaks and underline elements are contained in the selection.

Works properly in Chrome 106 and Safari 16.

Actual results:

Firefox did not remove all links. Links are not removed from line 3 and line 5.

Expected results:

Firefox should have removed all links

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

Severity: -- → S4
Status: UNCONFIRMED → NEW
Has STR: --- → yes
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → Desktop

Also, document.execCommand("outdent") does not work on a list item if line breaks has been added at the. Proof: https://jsfiddle.net/fa1qmwxz/2/

Please consider discarding the entire Selection API and write a new from scratch which is compatible with Chromium and Webkit. It's very frustrating working with Firefox's implementation.

EDIT:
Also, document.execCommand("outdent") does not work on a list item if line breaks has been added at the END. Proof: https://jsfiddle.net/fa1qmwxz/2/

Please consider discarding the entire Selection API and write a new from scratch which is compatible with Chromium and Webkit. It's very frustrating working with Firefox's implementation.

You need to log in before you can comment on or make changes to this bug.