Open Bug 1953524 Opened 5 days ago Updated 2 days ago

When printing only "Selection", if selection started at the beginning of a text line which happens to have white-space in the source before it, text line gets a spurious "..." (…) ellipsization prefix

Categories

(Core :: Printing: Output, defect)

Firefox 136
defect

Tracking

()

People

(Reporter: nekohayo, Unassigned, Mentored)

Details

(Keywords: good-first-bug)

Attachments

(2 files)

Attached video Demonstration video.mp4

See attached demonstration video.

Steps to reproduce

  1. Go to an article such as https://www.health.harvard.edu/pain/is-your-pillow-hurting-your-health
  2. Select from the beginning of the first header (title) line, "Is your pillow hurting your health?" and downwards
  3. Ctrl+P
  4. Select "Selection" instead of "Original"

Actual results

Notice the resulting document's first line being prefixed with …, so it reads "...Is your pillow hurting your health?"

Expected results

No "..." prefix.

Workaround

If you start your selection on the line before, i.e. including the invisible paragraph/line break, then the heading in the resulting document does not get prefixed with "...".


This was tested with Firefox 136.0 (from Fedora 41's repositories) on Linux, but it has also affected every previous Firefox version I used.

Huh, interestingly, it doesn't happen with right click -> Print selection...

Huh, nvm, it does, if you just mouse drag. If you triple-click the header and drag down it doesn't. This is probably the white-space in the header confusing us.

It seems we should just check whether any character in the text node that starts the selection is non-whitespace here. Should be a relatively easy fix?

Mentor: emilio
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug
Summary: When printing only "Selection", if selection started at the beginning of a text line, text line gets a spurious "..." (…) ellipsization prefix → When printing only "Selection", if selection started at the beginning of a text line which happens to have white-space in the source before it, text line gets a spurious "..." (…) ellipsization prefix

Reduced test-case would be:

data:text/html,<h1>  foo  </h1><h1>Bar</h1>
Severity: -- → S3

See screencast in comment 4; bug is visible at e.g. t=6s (but the bug is not visible at the end of the video when I instead do select-all, which avoids the issue similar to triple-click per comment 2).

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

Attachment

General

Creator:
Created:
Updated:
Size: