Open Bug 1746926 Opened 4 years ago Updated 4 years ago

Firefox considers just unselected node when window.getSelection() is called

Categories

(Core :: DOM: Selection, defect)

Firefox 95
defect

Tracking

()

UNCONFIRMED

People

(Reporter: littleendu, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0

Steps to reproduce:

Using this document:

<html>
<body>
    <span>Foo</span>
    <span>Foo</span>
</body>
</html>

Select both spans then, without releasing left click, move to unselect one of the spans. Your selection should look like " Foo" or "Foo ".

Now calling window.getSelection() will have both the anchorNode and focusNode be one of the <span>s

Actual results:

Incorrect window.getSelection() result

Expected results:

window.getSelection() returns the #text node as anchorNode/focusNode

Summary: Firefox considers just unselected node when windows.getSelection() is called → Firefox considers just unselected node when window.getSelection() is called

The Bugbug bot thinks this bug should belong to the 'Core::Widget: Win32' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.

Component: Untriaged → Widget: Win32
Product: Firefox → Core

The severity field is not set for this bug.
:jimm, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(jmathies)
Component: Widget: Win32 → DOM: Core & HTML
Flags: needinfo?(jmathies)
Component: DOM: Core & HTML → DOM: Selection
You need to log in before you can comment on or make changes to this bug.