javascript selectNodeContents & copy-paste adds 4 spaces indentation (phpbb code tag "select all" issue)

NEW
Unassigned

Status

()

P5
normal
7 years ago
2 months ago

People

(Reporter: vicedar, Unassigned)

Tracking

23 Branch
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

7 years ago
Created attachment 600359 [details]
doesnot_work.html

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build ID: 20120216101208

Steps to reproduce:

Go to any phpbb forum topic that uses a bbcode code tag.
Examples:
http://www.phpbb.com/kb/article/adding-custom-bbcodes-in-phpbb3/
http://www.phpbb.com/community/viewtopic.php?f=46&t=579376
any topic from http://www.phpbb.com/community/viewtopic.php?f=46


Actual results:

By clicking "select all" for code tags in any phpbb forum and if you copy-paste the selected code/text, it prepends 4 spaces on every line of selected code/text.



Expected results:

It should not preprend 4 space characters.

Note: There is a workaround that uses setStart and setEnd (attached), but I believe that this is a Firefox bug with selectNodeContents, since it doesn't occur with Chrome/Chromium nor Internet Explorer.
(Reporter)

Comment 1

7 years ago
Created attachment 600360 [details]
Workaround with setStart and setEnd

Updated

7 years ago
Attachment #600359 - Attachment mime type: text/plain → text/html

Updated

7 years ago
Attachment #600360 - Attachment mime type: text/plain → text/html
Looks like this is still happening in FF 23 and in the current Nightly.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
Version: 10 Branch → 23 Branch
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.