Multiple spaces become single space when copy from page

NEW
Unassigned

Status

()

3 years ago
3 years ago

People

(Reporter: scow, Unassigned)

Tracking

43 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:43.0) Gecko/20100101 Firefox/43.0 Iceweasel/43.0.2
Build ID: 20151228074541

Steps to reproduce:

reproduce:

for example, on the web:

https://git.gnome.org/browse/file-roller/diff/src/dlg-package-installer.c?id=4b64c5ece7a4e209799b72845b1587d4b9323940

I copy the text "-package_installer_terminated (InstallerData   *idata,"
(right button -> copy)

between "InstallerData" and  "*idata" they are three spaces

I paste in a text editor (pluma)


Actual results:

on the text editor, right click -> paste

I see

-package_installer_terminated (InstallerData *idata,

only paste one space


Expected results:

must be paste the three spaces:

-package_installer_terminated (InstallerData   *idata,

Comment 1

3 years ago
white-space: pre; in table.diff td {} seems works for display only, it seems to be "pre-line" when copying.
Status: UNCONFIRMED → NEW
Component: Untriaged → CSS Parsing and Computation
Ever confirmed: true
OS: Unspecified → All
Product: Firefox → Core
Hardware: Unspecified → All
Summary: copy -> paste text in web , various spaces (char ' ') dont copy succesfull → Multiple spaces become single space when copy from page
This works correctly if I highlight at least two lines.  So seems like an issue only with selections that don't include the actual node the style is on or something like that.

Simple testcase:

  data:text/html,<div style="white-space: pre">Some     text</div>

and highlighting from 'm' to 'x'.  Note that if I replace the "div" with a "span" the problem disappears.

This has nothing to do with CSS parsing; this is all text serializer stuff.  Ehsan, do we even have a place where this should live, other than "DOM"?
Component: CSS Parsing and Computation → DOM
Flags: needinfo?(ehsan)
Component: DOM → Serializers
Flags: needinfo?(ehsan)
You need to log in before you can comment on or make changes to this bug.