Last Comment Bug 12460 - Cannot select or edit or search generated content and alt text [GC]
: Cannot select or edit or search generated content and alt text [GC]
Status: NEW
[Hixie-P3] When verifying, we must ch...
: helpwanted, testcase
Product: Core
Classification: Components
Component: Selection (show other bugs)
: Trunk
: All All
: P3 normal with 57 votes (vote)
: Future
Assigned To: Nobody; OK to take it and work on it
:
: Jet Villegas (:jet)
Mentors:
http://www.prometheus-music.com/gecko...
: 14453 17451 18453 19480 25314 26135 26168 28816 28912 72734 147801 232361 243648 245491 246562 261654 274592 283494 286061 289802 296728 299830 302990 311799 311905 312090 316591 317268 370027 371150 452847 460022 475493 490805 508543 588716 625869 761079 782082 837506 892250 1096063 1096069 1216438 (view as bug list)
Depends on: 28057
Blocks: 57722 82676 223766 424628 474971 549150 758580 1096071 1108608 13068 35044 36408 87673 394867
  Show dependency treegraph
 
Reported: 1999-08-25 10:44 PDT by Eli Goldberg
Modified: 2016-08-18 06:13 PDT (History)
92 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Page with link to nonexisting image & ALT text (144 bytes, text/html)
1999-08-25 10:45 PDT, Eli Goldberg
no flags Details
Invalid image file that will display as a URL (143.79 KB, image/gif)
1999-08-25 10:46 PDT, Eli Goldberg
no flags Details
Testcase: Quotation marks generated with :before and :after on the "code" element. (261 bytes, text/html)
2004-07-24 06:51 PDT, shadytrees
no flags Details
CSS to stop select cursor showing on generated content (84 bytes, text/css)
2006-07-08 08:24 PDT, Ian Moody [:Kwan]
dbaron: review-
Details

Description Eli Goldberg 1999-08-25 10:44:40 PDT
* TITLE/SUMMARY
I-Beam used for unselectable ALT text & invalid image URLs

* STEPS TO REPRODUCE
0) Launch Apprunner
1) Display either of the following two URLs:
 http://www.prometheus-music.com/gecko/selectalt.html (attached at test case)
 http://slip/projects/marvin/imaging/img-stress-gif/merr-01.gif (also attached)
2) Place the mouse pointer over the ALT text displayed, and attempt to select it.

* RESULT
 - What happened
Despite the fact that the cursor changes to an I-beam, the text cannot be
selected. Per Mac OS HI guidelines (p. 270), the I-beam is only to be displayed
while it's over text to imply selection and/or insertion ability.

 - What was expected

Either the cursor shouldn't be changed to one used to indicate selection ability,
or the text in question should be selectable.

* REGRESSION

 - Occurs On
        Mac OS Apprunner (8.24.99 AM optimized build)
        Win32 Apprunner (8.24.99 AM optimized build [NT 4, Service Pack 3])
        Linux Apprunner (a recent optimized build w/ an invalid date string of
1999070614)

 - Doesn't Occur On
        N/A



* CONFIGURATIONS TESTED

- [Mac] Beige Power Mac G3 (266 MHz PowerPC 750), 96 MB RAM (VM on; 1 MB of VM
used), 1024x768 (Thousands of Colors), Mac OS 8.6

- [Win32] Vectra VL (233 MHz P2), 96 MB RAM, 800x600 (True Color), NT 4.0 SP3.

- [Linux] Vectra VL (266 MHz P2), 96 MB RAM. Red Hat Linux 6.0 (GNOME).
Comment 1 Eli Goldberg 1999-08-25 10:45:59 PDT
Created attachment 1384 [details]
Page with link to nonexisting image & ALT text
Comment 2 Eli Goldberg 1999-08-25 10:46:59 PDT
Created attachment 1385 [details]
Invalid image file that will display as a URL
Comment 3 mjudge 1999-08-25 15:08:59 PDT
hmm is the mouse cursor me?? well i will take assignment until i can find out
Comment 4 Hixie (not reading bugmail) 1999-08-31 09:29:59 PDT
As agreed with Beth, assigning myself as QA contact for all 'alt text' bugs...
Comment 5 Hixie (not reading bugmail) 1999-09-08 14:49:59 PDT
The problem isn't that we have the wrong cursor, the problem is that we can't
select the alt text! Why can we not select the alt text?
Comment 6 mjudge 1999-09-14 17:27:59 PDT
the alt text for some reason has NO parent. i dont understand why not. i THINK
its generated content.
Comment 7 mjudge 1999-09-21 21:35:59 PDT
ok the text is now selectable. please reverify.i have made a lot of changes in
this code and this looks fixed now. I cant be sure if i fixed this 100% please
reverify, thanks guys
Comment 8 Hixie (not reading bugmail) 1999-09-26 15:50:59 PDT
I'm reopening this bug, because although we can select the alt text, it is not
being copied to the clipboard when you do Edit|Copy...
Comment 9 rubydoo123 1999-10-14 16:33:59 PDT
14453 is related to this bug, I am marking that as a dup of this. Generated
content should be selectable, should be able to copy and paste. You should not
be able to edit it. Keeping this at M12, this should be fixed for beta
Comment 10 rubydoo123 1999-10-14 17:18:59 PDT
*** Bug 14453 has been marked as a duplicate of this bug. ***
Comment 11 rubydoo123 1999-10-14 17:41:59 PDT
We need to be consistent with how we provide selection of generated data. We
also need to be predictable from the user perspective. Generated data should be
selectable, and the user should also be able to copy it, the user should not be
able to edit it. Taking a quick stab at what is generated and the behavior
expected from the browser window, I came up with this list:
1. lists (UL, OL, DL, etc.) -- if a user selects several list items, and they
select copy, what should get dropped into the clipboard? The HTML? The visual
rendering such as numbers and bullets? Would the user expect to highlight the
bullets and have them copied? (I would suspect that the user would anticipate
copying the HTML so when they paste it is dropped in in the appropriate format),
but what if they paste into another application?
2. Alt text -- What happens if the user selects to edit the page -- should the
alt text be dropped in as part of the text stream? (No, it shouldn't -- it
should be part of the IMG dialog).
3. General Entity text -- If the user selects to edit the page -- what should
they see? Should they see the entity or the replaced text?
4. JavaScript generated -- If the user selects to edit the page -- what should
they see?

In any event, in all of the cases mentioned, in the browser window, the user
should be able to select the content and copy it.
Comment 12 rubydoo123 1999-11-16 08:59:59 PST
changing summary to better reflect the issue
Comment 13 leger 1999-11-16 16:13:59 PST
Definitely need this for Beta, but not dogfood. Putting on the PDT- radar.
Comment 14 rubydoo123 1999-11-22 06:33:59 PST
*** Bug 19480 has been marked as a duplicate of this bug. ***
Comment 15 kinmoz 1999-12-01 10:19:59 PST
Adding myself to the Cc list.
Comment 16 rubydoo123 1999-12-01 14:49:59 PST
moving to M13
Comment 17 rubydoo123 1999-12-23 10:15:59 PST
updating summary fields
Comment 18 mjudge 2000-01-06 10:29:59 PST
*** Bug 18453 has been marked as a duplicate of this bug. ***
Comment 19 Eli Goldberg 2000-01-11 15:21:59 PST
Ian, when you verify this bug, could you please also take a look at bug #18453
--- or QA assign it to me when you're done verifying so that I can do so?

Thanks!
Comment 20 Hixie (not reading bugmail) 2000-01-11 15:54:59 PST
elig: Will do.
Comment 21 mjudge 2000-01-12 15:55:59 PST
latering to m14 this will take a while to implement.
Comment 22 rubydoo123 2000-01-13 13:15:59 PST
setting the milestone
Comment 23 rubydoo123 2000-01-28 16:51:15 PST
*** Bug 25314 has been marked as a duplicate of this bug. ***
Comment 24 Charles Manske 2000-02-01 15:38:57 PST
*** Bug 26135 has been marked as a duplicate of this bug. ***
Comment 25 rubydoo123 2000-02-03 08:06:02 PST
*** Bug 17451 has been marked as a duplicate of this bug. ***
Comment 26 rubydoo123 2000-02-03 15:48:22 PST
setting keyword
Comment 27 rubydoo123 2000-02-07 16:17:39 PST
*** Bug 26168 has been marked as a duplicate of this bug. ***
Comment 28 mjudge 2000-02-15 11:20:06 PST
this cannot be fixed due to a problem in CSS. we will fix this after m14 I will 
not put the beta at risk for this. vidur troy and I will be working with the 
style guys -aka pierre- to resolve this as soon as possible.
Comment 29 mjudge 2000-02-17 14:50:42 PST
please reevaluate i think its PDT-
Comment 30 Asa Dotzler [:asa] 2000-02-22 18:50:30 PST
*** Bug 28912 has been marked as a duplicate of this bug. ***
Comment 31 David Baron :dbaron: ⌚️UTC-8 2000-02-27 14:24:50 PST
This bug also causes problems with selecting and copying text in view-source,
since view-source also uses generated content.
Comment 32 Kathleen Brade 2000-03-06 17:14:13 PST
*** Bug 28816 has been marked as a duplicate of this bug. ***
Comment 33 Eli Goldberg 2000-03-07 13:39:51 PST
Ian, when you verify this bug, would you be open to your choice of:

a) QA Assigning it to me in order to go through the duplicates and confirm that
they don't contain any remaining side issues.

b) Going through the duplicates and confirming that they don't contain any
remaining side issues. ;)

Thanks!
Comment 34 Hixie (not reading bugmail) 2000-03-07 14:01:59 PST
I don't mind which we do. It'll probably depend on when this is fixed -- if I'm
still at Uni then coursework may mean that I don't get enough time to go through
all the DUPs.
Comment 35 Jim Roskind 2000-04-10 09:36:51 PDT
It sounds like this is mostly done... and hence probably not a blocker for the 
M15 stability checkpoint branch.  I'm pushing this to M16
Comment 36 mjudge 2000-04-12 00:02:41 PDT
yeah this is a dup of some bug I allready have.. cant find it . I will leave
this one open. the problem is that the iterator code does not work right yet for
generated content YET... ;)
Comment 37 rubydoo123 2000-05-09 10:23:44 PDT
m17
Comment 38 Charles Manske 2000-05-09 12:37:10 PDT
With all this is blocking, why isn't it M16 beta2?
Comment 39 leger 2000-05-11 14:57:32 PDT
beppe/mjudge - what is left to do here?  Is what is done so far enough for 
beta2?

sujay, since elig is out, can you check out the latest on the functionality here 
with the latest build? Thanks!
Comment 40 sujay 2000-05-11 15:47:32 PDT
I just tried this using 5/11 build and I was able to select
the text, but as Beth mentioned...can't Copy it...
Comment 41 Peter Trudelle 2000-05-15 14:29:05 PDT
[nsbeta2+] will take fix by 6/1
Comment 42 rubydoo123 2000-05-24 15:34:16 PDT
m16
Comment 43 rubydoo123 2000-05-25 09:08:28 PDT
moving this off beta2 list, the current model being used to generate the view 
source file inhibits the ability to select portions of the file. Mike devoted 
several weeks at trying to resolve the issues for this. What needs to happen, is 
for the current model to change from its current method to a method that uses 
plaintext for example. In the current state, even if the user is able to 
select the content, they will not be able to perform functions such as 
copy/paste. The work-around for the user is to make a local copy and display the 
source either in the html edit mode in composer or through another plaintext 
editor. Moving to m20, setting as an rfe
Comment 44 rubydoo123 2000-06-06 13:46:32 PDT
moving to future milestone
Comment 45 rubydoo123 2000-06-06 15:49:51 PDT
moving back to previous owner
Comment 46 rubydoo123 2000-07-27 14:41:40 PDT
adding help wanted to the keywords
Comment 47 Boris Zbarsky [:bz] (still a bit busy) 2002-05-05 00:38:52 PDT
I thought I'd poke at this. Two problems I've run into so far:

1)  Selecting only works if stuff can be QIed to an nsIDOMNode.  Some generated
    content is associated with an nsAttributeContent, which does not implement
    nsIDOMNode.
2)  The text frames that come from nsTextNode content (eg strings in the
    "content" css property) never get HandlePress called on them when clicked
    (thus strongly suggesting that the proper events are simply never
    dispatched to them).
Comment 48 Hixie (not reading bugmail) 2002-05-29 07:35:30 PDT
*** Bug 147801 has been marked as a duplicate of this bug. ***
Comment 49 Adam Hauner 2002-05-29 07:44:29 PDT
BTW this is IMHO bug, not enhancement. If you agree, change please severity.
Comment 50 Tim Powell 2003-01-10 10:26:57 PST
The following blog provides another example of this and may be helpful as a
testcase:
http://www.holovaty.com/blog/archive/2002/12/20/0454
Comment 51 Samuel Sieb 2003-10-26 15:16:58 PST
Who should the owner be for this bug?  This is a usability issue for chatzilla.
 If anyone can provide a pointer of where to start, I might be able to look into
it.  We see the issue with regards to CSS generated content.  For example our
nicks look like "<nick>" where the angle brackets are added via css.  When you
try to select it to copy, you only get "nick".
Comment 52 Boris Zbarsky [:bz] (still a bit busy) 2003-10-26 15:39:12 PST
first, some people (glazou) think generated content should NOT be selectable.  
I happen to disagree, but in any case....

There are a few issues here.  First, the code at
http://lxr.mozilla.org/seamonkey/source/layout/html/base/src/nsFrame.cpp#1206
explicitly sets generated content not selectable.  I seem to recall that when I
took that out there were still issues with it.  That was partially because I was
testing on a page that used attr() and nsAttributeContent does not implement
nsIDOMNode (which selection needs).  That's covered by bug 214013

I suspect that selection relies on GetContentAndOffsetsFromPoint() doing
something reasonable.  See
http://lxr.mozilla.org/seamonkey/source/layout/html/base/src/nsFrame.cpp#1989. 
It's interesting to me that we no longer skip anonymous nodes there....
Generated content is, in the end, another form of anonymous content (in our
implementation) .  In any case, this may need fixing.

On the bright side,
http://lxr.mozilla.org/seamonkey/source/layout/html/base/src/nsTextFrame.cpp#1950
(nsTextFrame::GetContentAndOffsetsForSelection) seems to know something about
generated content.

Finally, once the above issues are addressed, there may be further bugs just
because selection is represented by DOM ranges and generated content is not
present in the DOM....

Hope that helps.
Comment 53 Carlie J. Coats, Jr. 2003-10-31 10:44:27 PST
Is this related to the situation I just found:

    Mozilla Mail (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031016)
    generates a "relaying denied" error pop-up from which I can't select and copy
    the message text, and put it into an email message to my sysadmin.

    My system:  RedHat 9, running the vendor-supplied XFree86 4 and KDE.

Being able to copy error-message text into messages to your sysadmin is a
*necessary* functionality, no matter *what* some people think about generated
content not being selectable.

Carlie J. Coats, Jr.                        carlie.coats@baronams.com
Environmental Modeling Center                    phone: (919)248-9241
Baron Advanced Meteorological Systems              fax: (919)248-9245
3021 Cornwallis Road                                 P. O. Box 110064
Research Triangle Park, N. C.  27709-5064                         USA
Comment 54 David Baron :dbaron: ⌚️UTC-8 2003-10-31 10:51:01 PST
No, not related.
Comment 55 David Baron :dbaron: ⌚️UTC-8 2004-01-27 14:59:13 PST
*** Bug 232361 has been marked as a duplicate of this bug. ***
Comment 56 :aceman 2004-03-15 06:18:20 PST
The generated content should be selectable, or it could be a (hidden) pref.
Users will not understand why can't they select a text string clearly displayed
in the page, when everything else works.
Comment 57 Frank Wein [:mcsmurf] 2004-05-14 14:55:14 PDT
*** Bug 243648 has been marked as a duplicate of this bug. ***
Comment 58 samuel 2004-05-28 12:17:08 PDT
 Boris Zbarsky Wrote: 
    Finally, once the above issues are addressed, there may be further bugs just
because selection is represented by DOM ranges and generated content is not
present in the DOM....

Perhaps part of the solution would be to put generated text into the DOM with
something around it to indicated that it is generated and not 'real'?
Comment 59 Kevin Ar18 2004-06-03 16:57:31 PDT
In reply to comment #58 (the last comment), Samuel's suggestion about adding the
elements to the DOM but marking them as not real sounds somewhat similiar to
something I read in the W3 specs.

You can read about it here:
http://www.w3.org/TR/CSS21/selector.html#first-line-pseudo)
It describes a suggested method for handling pseudo elements in the browser.

An ordinary HTML paragraph . . . might be "rewritten" by user agents to include
the fictional tag sequence for :first-line. This fictional tag sequence helps to
show how properties are inherited.
<see url for example(s)>
If a pseudo-element breaks up a real element, the desired effect can often be
described by a fictional tag sequence that closes and then re-opens the element.
Thus, if we mark up the previous paragraph with a SPAN element:
<see url for example(s)>
A UA should act as if the fictional start tag of the first-line pseudo-element
is just inside the innermost enclosing block-level element. (Since CSS1 and CSS2
were silent on this case, authors should not rely on this behavior.) Here is an
example. The fictional tag sequence for
<see url for example(s)>

I don't know if this helps or not.
Comment 60 Kevin Ar18 2004-06-03 17:00:49 PDT
*** Bug 245491 has been marked as a duplicate of this bug. ***
Comment 61 Simon Montagu :smontagu 2004-06-13 09:23:18 PDT
*** Bug 246562 has been marked as a duplicate of this bug. ***
Comment 62 shadytrees 2004-07-24 06:51:30 PDT
Created attachment 154196 [details]
Testcase: Quotation marks generated with :before and :after on the "code" element.
Comment 63 Michael Newton 2005-02-04 12:21:38 PST
I'd still like to see this fixed!  If anyone wants to look at this, the code
referred to in comment 52 has had a lot of bitrot in the past 18 months.
The line in nsFrame::IsSelectable, where generated content is explicitly not
selected, is now at
http://lxr.mozilla.org/seamonkey/source/layout/generic/nsFrame.cpp#1183
The line in nsFrame::GetContentAndOffsetsFromPoint where we skip generated
frames is http://lxr.mozilla.org/seamonkey/source/layout/generic/nsFrame.cpp#1889

Just a note: With the ALT text testcase, I cannot select the text if I start the
selection within the text.  But if I start the selection outside the image
element (the cursor is still an arrow) I can select, copy, and then paste the
text.  I imagine the code in nsFrame::IsSelectable is responsible for that, but
would probably have other ill effects if it was changed.

I am seriously considering learning C++ one of these days!

Mozilla/5.0 (Windows; U; Windows NT 5.0; en-CA; rv:1.7.5) Gecko/20041107 Firefox/1.0
Comment 64 Kevin Ar18 2005-02-04 12:39:14 PST
Would the suggestions from Comments #58 and Comment #59 be a viable solution to
take care of it not currently being a part of the DOM?
Comment 65 dolphinling 2005-02-24 15:00:20 PST
*** Bug 283494 has been marked as a duplicate of this bug. ***
Comment 66 :Gijs Kruitbosch 2005-03-14 00:15:49 PST
Is there any progress on this bug? As mentioned in comment 63, some things that
were previously stopping this bug from being fixed have now been fixed /
changed. Bzbarsky, is there any chance of this bug being fixed, or are there
still problems which seem to be / are blocking this bug?
Comment 67 Elmar Ludwig 2005-03-14 06:40:48 PST
*** Bug 286061 has been marked as a duplicate of this bug. ***
Comment 68 Anne (:annevk) 2005-04-10 10:26:56 PDT
*** Bug 289802 has been marked as a duplicate of this bug. ***
Comment 69 :Gavin Sharp [email: gavin@gavinsharp.com] 2005-06-05 13:49:43 PDT
*** Bug 296728 has been marked as a duplicate of this bug. ***
Comment 70 Elmar Ludwig 2005-07-06 10:14:13 PDT
*** Bug 299830 has been marked as a duplicate of this bug. ***
Comment 71 Frank Wein [:mcsmurf] 2005-08-01 13:56:32 PDT
*** Bug 302990 has been marked as a duplicate of this bug. ***
Comment 72 Julien Cayzac 2005-08-02 10:27:50 PDT
Opened: 1999-08-25 10:44 PDT
Any chance to see this bug fixed in the next ten year or so?
Is handling a DOM tree overlay for pseudo elements that difficult?
Comment 73 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-10-09 11:18:58 PDT
*** Bug 311799 has been marked as a duplicate of this bug. ***
Comment 74 Masayuki Nakano [:masayuki] (Mozilla Japan) 2005-10-10 08:42:55 PDT
*** Bug 311905 has been marked as a duplicate of this bug. ***
Comment 75 Martijn Wargers [:mwargers] (not working for Mozilla) 2005-10-11 13:55:47 PDT
*** Bug 312090 has been marked as a duplicate of this bug. ***
Comment 76 Peter van der Woude [:Peter6] 2005-10-14 01:54:21 PDT
*** Bug 261654 has been marked as a duplicate of this bug. ***
Comment 77 soeren149 2005-10-22 13:53:39 PDT
* TITLE
found 2 additional bugs which fit into generated content problem

* SUMMARY
1. :first-letter won't work, if the first letter is a tag, i. e.
* STEPS TO REPRODUCE
------------
p:first-letter{font:40px} <-- in stylesheet
<p><img src"foobar">text</p>
------------
* RESULT
the first letter of "text" stays unchanged, instead of being bigger than normal.


* SUMMARY
2. :first-letter is buggy, if the first letter is a number and you have
additional positioning, i. e.

* STEPS TO REPRODUCE
------------
p:first-letter{font:40px;bottom:20px;} <-- in stylesheet
<p>123 456 789</p>
------------
* RESULT
the first number should be positioned 20px higher, but nothing happens.


* CONFIGURATIONS TESTED
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b5) Gecko/20051006
Firefox/1.4.1 - Build ID: 2005100614
Comment 78 soeren149 2005-10-25 06:40:02 PDT
to get things rollin' i tried to change the fields priority, severity and target milestone, but it seems that only some people are allowed to do it :-(
it's just a shame that this bug exists more than 6 years and it's rated "enhancement"!
it's over time this bug gets done!!!
the future [target milestone] is NOW!
thx
ps: sorry for my harsh words ... i'll try to calm down a bit
Comment 79 William Bumgarner [:zsinj] 2005-11-02 14:24:43 PST
*** Bug 274592 has been marked as a duplicate of this bug. ***
Comment 80 Erik Fabert 2005-11-15 13:41:11 PST
*** Bug 316591 has been marked as a duplicate of this bug. ***
Comment 81 Elmar Ludwig 2005-11-21 04:12:24 PST
*** Bug 317268 has been marked as a duplicate of this bug. ***
Comment 82 Ian Moody [:Kwan] 2006-07-08 08:24:34 PDT
Created attachment 228537 [details]
CSS to stop select cursor showing on generated content

As a fix to enable selecting generated content seems a way off why not stop the select cursor appearing for now?
Comment 83 David Baron :dbaron: ⌚️UTC-8 2006-07-08 08:27:40 PDT
Comment on attachment 228537 [details]
CSS to stop select cursor showing on generated content

I think this would make the style system do a lot more work when testing to see if it needs to generated :before and :after pseudo-elements.

Fixing this ought to be a one line fix in nsTextFrame::GetCursor (checking for NS_FRAME_GENERATED_CONTENT or whatever it's called).
Comment 84 Uri Bernstein (Google) 2006-07-10 06:34:22 PDT
*** Bug 72734 has been marked as a duplicate of this bug. ***
Comment 85 David Baron :dbaron: ⌚️UTC-8 2006-10-25 10:24:18 PDT
Note that bug 357957 is proposing removing some code that *might* be useful for fixing this bug, so anybody who works on this bug should see if it actually is useful and decide whether to restore it or replace it.
Comment 86 Phil Ringnalda (:philor) 2007-02-10 20:26:31 PST
*** Bug 370027 has been marked as a duplicate of this bug. ***
Comment 87 Neil Deakin 2007-02-21 10:48:57 PST
*** Bug 371150 has been marked as a duplicate of this bug. ***
Comment 88 Gábor Stefanik 2007-03-25 03:52:13 PDT
Bug, not enhancement.
Comment 89 Daniel Faber 2008-06-24 04:14:33 PDT
There's an issue that is probably related to this bug report:

Here's the test case: http://daniel-faber.de/_files/mozilla-selection-of-generated-content.html
The x in front of each line is generated content.  When I select text in this page, sometimes the x' get highlighted and sometimes not.  It seems to depend on the path I move the mouse pointer.

Here is a screenshot: http://daniel-faber.de/_files/mozilla-selection-of-generated-content.png
It's three times the second section of my test case.  The red arrow shows the path of the mouse pointer while pressing the left mouse button.

When the Firefox window loses the focus, the highlighted area sometimes changes!

The selected text for copy to clipboard is always the same and does not include the generated content, it's just the inconsistent highlighting that bothers me.

I'm using Firefox 3 on Kubuntu 8.04.  Should I open a separate bug for this issue or do you think this comment is enought?
Comment 90 Daniel.S 2008-07-06 07:37:32 PDT
(In reply to comment #89)
> I'm using Firefox 3 on Kubuntu 8.04.  Should I open a separate bug for this
> issue or do you think this comment is enought?

There's Bug 394867 already.
Comment 91 Phil Ringnalda (:philor) 2008-08-29 15:42:16 PDT
*** Bug 452847 has been marked as a duplicate of this bug. ***
Comment 92 Simon Montagu :smontagu 2009-01-27 01:13:00 PST
*** Bug 475493 has been marked as a duplicate of this bug. ***
Comment 93 David Baron :dbaron: ⌚️UTC-8 2009-04-07 14:45:34 PDT
*** Bug 460022 has been marked as a duplicate of this bug. ***
Comment 94 Daniel.S 2009-04-30 07:48:31 PDT
*** Bug 490805 has been marked as a duplicate of this bug. ***
Comment 95 Gábor Stefanik 2009-08-30 09:51:41 PDT
Could we get a status update on this bug? Anything stopping this from getting fixed? 10 years since this bug was filed, it has still seen no work at all...
Comment 96 Kevin Brosnan 2009-09-15 07:31:59 PDT
*** Bug 508543 has been marked as a duplicate of this bug. ***
Comment 97 Kroc Camen 2009-10-18 10:05:46 PDT
Is there no work-around for this? I am trying to simply display the ID of a heading when hovered over, so that the user can select the bookmark anchor.

I.e. `h2[id]:hover:after {content: " #" attr(id);}`
Comment 98 Joseph 2010-03-24 21:25:57 PDT
Problem occurs in Firefox... isdraggable is still set to true because it appears to be for all images, but the cursor is set for the text underneath.  I will try to find a file that does one or the other when I get time.
Comment 99 Joseph 2010-03-25 06:44:39 PDT
I think in the file https://hg.mozilla.org/mozilla-central/file/aacac6efbbd4/layout/generic/nsImageFrame.cpp the alt text is added to the image frame. 

the function BuildDisplayList at the if block "if (!imageOK || !haveSize)" (line 1231) should probably set it to not draggable.  The getDraggable function line 828 in https://hg.mozilla.org/mozilla-central/file/aacac6efbbd4/content/html/content/src/nsGenericHTMLElement.cpp checks the nsGkAtoms::draggable to see if element can be dragged, so maybe that needs to be set to false, but I'm unsure.
Comment 100 Benoit Jacob [:bjacob] (mostly away) 2010-08-28 07:48:38 PDT
I tried Joseph's suggestion by doing the change below, but that didn't result in any user-visible change. (Disclaimer: totally unfamiliar with layout code).

diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -65,16 +65,17 @@
 #include "nsNetUtil.h"
 #include "nsHTMLContainerFrame.h"
 #include "prprf.h"
 #include "nsIFontMetrics.h"
 #include "nsCSSRendering.h"
 #include "nsILink.h"
 #include "nsIDOMHTMLAnchorElement.h"
 #include "nsIDOMHTMLImageElement.h"
+#include "nsGenericHTMLElement.h"
 #include "nsIDeviceContext.h"
 #include "nsINameSpaceManager.h"
 #include "nsTextFragment.h"
 #include "nsIDOMHTMLMapElement.h"
 #include "nsImageMapUtils.h"
 #include "nsIScriptSecurityManager.h"
 #ifdef ACCESSIBILITY
 #include "nsIAccessibilityService.h"
@@ -1226,16 +1227,17 @@ nsImageFrame::BuildDisplayList(nsDisplay
       currentRequest->GetImageStatus(&imageStatus);
     if (imageStatus & imgIRequest::STATUS_SIZE_AVAILABLE)
       haveSize = PR_TRUE;
 
     // We should never have the size and not have an image container
     NS_ABORT_IF_FALSE(!haveSize || imgCon, "Have size but not container?");
 
     if (!imageOK || !haveSize) {
+      nsGenericHTMLElement::FromContent(mContent)->SetDraggable(PR_FALSE);
       // No image yet, or image load failed. Draw the alt-text and an icon
       // indicating the status
       rv = aLists.Content()->AppendNewToTop(new (aBuilder)
           nsDisplayGeneric(aBuilder, this, PaintAltFeedback, "AltFeedback",
                            nsDisplayItem::TYPE_ALT_FEEDBACK));
       NS_ENSURE_SUCCESS(rv, rv);
     }
     else {
Comment 101 Boris Zbarsky [:bz] (still a bit busy) 2011-01-14 12:59:36 PST
*** Bug 625869 has been marked as a duplicate of this bug. ***
Comment 102 Sean Newman 2011-11-13 13:16:18 PST
more than 12 years old bug. Maybe the Chosen One, who'd once fix it was already born and now he's somewhere at kindergarten.
Or maybe not and we'll have to wait until the next century...
Comment 103 Eric Eggert 2011-12-14 12:01:45 PST
(Stunning that this bug is still open after 12 years.)

As the generated content is transferred to screen readers (since Firefox 4 [1]) this should be accessible to users who want to copy and paste that text. It can contain important information like the format of a linked file[2] so I don’t see where the difference is.

[1] http://twitter.com/MarcoZehe/status/146175210066948096
[2] http://jsfiddle.net/yatil/Yft93/
Comment 104 decembre56 2012-02-27 15:29:15 PST
I have the same problem.
It's with an userstyle.
Screenshot and code here :
<a href="http://forum.userstyles.org/discussion/30179/the-content-added-with-the-selector-after-cant-be-selected-and-copy-#Item_1">The content added with the selector &quot;:after&quot; can't be selected and copy ?</a>

A solution after all these tears ?
;-)
Comment 105 Matthias Versen [:Matti] 2012-06-04 14:35:39 PDT
*** Bug 761079 has been marked as a duplicate of this bug. ***
Comment 106 Mardeg 2012-08-13 01:41:58 PDT
*** Bug 782082 has been marked as a duplicate of this bug. ***
Comment 107 decembre56 2012-11-26 03:08:50 PST
No solutions???
Comment 108 Alice0775 White 2013-02-03 09:48:27 PST
*** Bug 837506 has been marked as a duplicate of this bug. ***
Comment 109 Matthew N. [:MattN] (PM me if requests are blocking you) 2013-08-23 18:38:43 PDT
*** Bug 892250 has been marked as a duplicate of this bug. ***
Comment 110 Edmund Wong (:ewong) 2014-01-24 02:16:35 PST
Earlier, I asked bz on irc (#developers) about this.  His basic response
are as follows:  

bz	This stuff is complicated
bz_sleep	Word of advice. Right now we represent selections as DOM ranges.
bz_sleep	The basic issue with anonymous content is you can't have a range partially in it and partially in normal content...
bz_sleep	Which is why this bug is still open.
ewong	oh
bz_sleep	So you either have to change how ranges behave.
bz_sleep	Or change how the selection is represented internally.
bz_sleep	(or both)

fyi to whoever is interested in fixing this.
Comment 111 Jeffrey Yasskin 2014-07-03 23:53:40 PDT
This is probably going to need to be optional per `content:` value: some, like the generated content for <q>, ought to be copyable and searchable. Others, like the generated content for <wbr> or several of the examples on http://viget.com/inspire/css-generated-content are presentational and shouldn't be copied or interfere with searches.
Comment 112 Alice0775 White 2014-11-09 11:28:43 PST
*** Bug 588716 has been marked as a duplicate of this bug. ***
Comment 113 Alice0775 White 2014-11-09 11:28:54 PST
*** Bug 1096063 has been marked as a duplicate of this bug. ***
Comment 114 Joanmarie Diggs 2014-11-09 11:51:58 PST
*** Bug 1096069 has been marked as a duplicate of this bug. ***
Comment 115 Boris Zbarsky [:bz] (still a bit busy) 2015-10-20 11:24:17 PDT
*** Bug 1216438 has been marked as a duplicate of this bug. ***
Comment 116 Daniel 2016-03-06 11:25:19 PST
As a temporary solution, the mouse cursor should at least be changed to indicate that text selection isn’t possible.

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