Open Bug 639579 Opened 13 years ago Updated 2 years ago

Selecting text by double-clicking includes leading whitespace characters if there's more than 2 whitespaces separated by tags

Categories

(Core :: DOM: Selection, defect)

x86_64
Windows 7
defect

Tracking

()

UNCONFIRMED

People

(Reporter: brille1, Unassigned)

References

Details

(Keywords: dupeme)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12


It's impossible to copy information like bank account data from a HTML based e-mail into an online banking form. Firefox always includes leading whitespace when double-clicking a word, e.g. a bank account number. The leading whitespace keeps the content from fitting HTML <input> elements having the "maxlength" attribute set, expecting nothing but the data to be input.


Reproducible: Always

Steps to Reproduce:
1. create some HTML file containing below markup and open the file in Firefox,
2. double-click one of the numbers,
3. copy the selected text,
4. paste from the clipboard to some text editor and examine the result.


Here's the sample data (fakes):

<br>Account number        201234605<br>Institute number       70012310<br>

Actual Results:  
       201234605

Expected Results:  
201234605
Summary: Copying text by double-clicking includes leading whitespace characters → Selecting text by double-clicking includes leading whitespace characters
Works for me
Mozilla/5.0 (Windows; U; Windows NT 6.1; ja; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ID:20110303024726
Yes, you are right.

This only seems to happen with text copied from Hotmail or EBay. There must be something in their markup that's causing Firefox to show this behaviour.

Unfortunately I can't tell what is the particular cause for this issue to occur.
Version: unspecified → 3.6 Branch
If I write like that:

<b>Username:</b>
<a href="mail@yandex.ru">mail@yandex.ru</a>

...I will have text with space between them. And double clicking on mail address will select also the whitespace.
Writing like that:

<b>Username: </b><a href="mail@yandex.ru">mail@yandex.ru</a>

.. is Ok.(In second example I put whitespace after colon)

Firefox 38.0 (Ubuntu)
PS. If someone want to test - tell me your mail - I will send you mail in html form.
>>>   My Info:   Win7_64, Nightly 46, 32bit, ID 20160107030235
STR:
1. On the following pages, doubleclick string "9001"
 A) data:text/html,<b>Testing level &nbsp;</b> &nbsp; &nbsp; <a> 9001 (over nine thousand)</a>
 B) data:text/html,<b>Testing level: &nbsp;</b> &nbsp; &nbsp; <a> 9001 (over nine thousand)</a>

Results:
 A) Selected text:   "level         9001 "
 B) Selected text:   "       9001 "

Expectations:
 A), B) Selected text should be "9001 "  (i.e. eat spaces to the right, at least on Windows)

Notes:
 Removing "&nbsp;"s also exposes the issue. Also, there may be other examples of this bug.
Status: UNCONFIRMED → NEW
Component: General → Selection
Ever confirmed: true
Product: Firefox → Core
Summary: Selecting text by double-clicking includes leading whitespace characters → Selecting text by double-clicking includes leading whitespace characters if there's more than 2 whitespaces separated by tags
Whiteboard: [dupeme]
Version: 3.6 Branch → Trunk
Seems duplication of Bug 1232322
Thanks. This on (639579) is definitely older than bug 853361 that caused the issue in comment 4.
It's unclear how to deal with this bug since it's so old and has no valid STR
Status: NEW → UNCONFIRMED
Ever confirmed: false
Any new results? This bug still exists.

A simple Trim() before creating a text selection when double-clicking web page text would do.
Keywords: dupeme
Whiteboard: [dupeme]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.