Closed Bug 285629 Opened 20 years ago Closed 20 years ago

Text copy/paste ignores style "display: none"

Categories

(Firefox :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 39098

People

(Reporter: gerrit, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0.1-1.3.2
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0.1-1.3.2

When the text in the main field of
http://topjaklont.student.utwente.nl/en/bug.html is copied to the clipboard, the
text copied is not the text visibly selected. The text with style "display:
none", which is of course not shown by the renderer, is also copied to the
clipboard: when pasting the text, one sees a lot of text one didn't know
existed. The style "display: none" is ignored.

Reproducible: Always

Steps to Reproduce:
1. Go to http://topjaklont.student.utwente.nl/en/bug.html
2. Select the text "This document is very short"
3. Paste it somewhere else.

Actual Results:  
When the text is pasted, the result is:

 This is a demonstration of an interesting effect in Firefox. Perhaps it
deserves the name 'bug'. The document you are reading has a lot of invisible
text. This can be very frustating, because you think you have read it all when
you reach the final word "short", but in reality there is more after it, and
certainly more before it.

Expected Results:  
The result should be:

"This document is very short"

At "Additional Information", I suggest a number of possible solutions.

It is debatable whether it is a bug or not, but in my opinion, it is. A user can
easily get fooled by copying and pasting text. It might be a potential security
problem (not a major one though). Possible solutions:

* If available, apply a stylesheet with "media=tty" to the selected text. Of
available css media tyes, this most closely resembles selecting text. Advantage:
webmaster can control what text gets selected. Disadvantage: webmaster can
control what text gets selected.
* Apply the same stylesheet to the text as the stylesheet used to view the
document. Advantage: what you see is what you get. Disadvantage: it becomes
impossible to add information: At http://en.wikipedia.org, any external link has
the URL behind it, which is invisible in the default stylesheet but visible in
the print stylesheet (and without any stylesheet). When coping the text, it is
useful to have the external link information.
* Provide the user with the choice between any of those variants
* Warn the user when the text copied to the clipboard is not the selected text

*** This bug has been marked as a duplicate of 39098 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.