Open Bug 1874539 Opened 9 months ago Updated 9 months ago

user-select: none causes a line break when copying content

Categories

(Core :: DOM: Serializers, defect)

Firefox 123
defect

Tracking

()

People

(Reporter: reg-mozilla, Unassigned)

References

(Depends on 1 open bug)

Details

Attachments

(1 file)

Attached file test.html

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

Steps to reproduce:

Create a HTML file with the following content:

<pre>
<span>Test</span> <span style="user-select:none">screen reader only text</span> <span>line</span>
</pre>

Then open the file and copy the content.

Actual results:

The text copied contains a line break for the hidden element.

Expected results:

There should be no line break in the copied content.

Note: this is important for providing screen reader support and retain the ability to copy text (e.g. code) from a website.

The Bugbug bot thinks this bug should belong to the 'Core::Layout: Form Controls' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Layout: Form Controls
Product: Firefox → Core

can confirm the behaviour. Repros on a build from Jan2022 so not a regression.

Chrome has a different behaviour where it doesnt have the newline.

Status: UNCONFIRMED → NEW
Component: Layout: Form Controls → Layout: Text and Fonts
Ever confirmed: true
Component: Layout: Text and Fonts → DOM: Selection
Component: DOM: Selection → DOM: Serializers

Ah, user-select:none causes splitting the selection range (bug 1773065). So, once it's fixed, this will be fixed.

Severity: -- → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: