Closed Bug 1655135 Opened 5 years ago Closed 5 years ago

Word selection one letter short before newline with white-space: pre-line and eat_space true

Categories

(Core :: Layout: Text and Fonts, defect, P3)

78 Branch
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: jscher2000, Assigned: MatsPalmgren_bugz)

Details

Attachments

(2 files)

Attached file wordselect.html

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

Steps to reproduce:

In the attached (also hosted at https://www.jeffersonscher.com/res/wordselect.html )

double-clicked the last word in a line to select it. Note: These lines end with a newline before the closing tag.

Actual results:

When the line has white-space: pre-line applied, and Firefox has the Windows default of layout.word_select.eat_space_to_next_word = true, the last character in the word is excluded from the selection. This does not occur if layout.word_select.eat_space_to_next_word is set to false.

Expected results:

The entire word should be selected regardless of the "eat space" setting.

This was discovered accidentally after some recent style rule changes on SUMO.

Status: UNCONFIRMED → NEW
Component: Untriaged → Layout
Ever confirmed: true
Product: Firefox → Core

ni? to jfkthame. I didn't know layout.word_select.eat_space_to_next_word is true on Windows.

Severity: -- → S3
Component: Layout → Layout: Text and Fonts
Flags: needinfo?(jfkthame)

Huh, curious! This doesn't seem to be a regression, or at least not any time recent (I tried a FF50 build and it reproduced there), so I guess it's probably been broken since forever.

It's fairly edge-casey, given that it seems to just affect white-space: pre-line which is not particularly common AFAIK, but it's clearly a bug.

Flags: needinfo?(jfkthame)

I can take this one...

Assignee: nobody → mats
Priority: -- → P3

FTR, that code was added in bug 645914.

Pushed by mpalmgren@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b48b830ea4fd Don't adjust the PeekOffsetWord offset for 'white-space: pre-line'. In that case the newline is excluded because it's treated as trimmed space. r=jfkthame
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → 81 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: