Bug 6185 - CSS1: character styled with :first-letter is not selectable
: CSS1: character styled with :first-letter is not selectable
Status: NEW
: WebKit
CSS
: 420+
: Macintosh Mac OS X 10.4
: P2 Normal
Assigned To:
:
: HasReduction, InRadar
: 43830
: 26443 58911
  Show dependency treegraph
 
Reported: 2005-12-21 13:17 PST by
Modified: 2014-02-13 10:20 PST (History)


Attachments
Testcase (578 bytes, text/html)
2005-12-21 13:17 PST, Joost de Valk (AlthA)
no flags Details
Demonstrate more details (2.01 KB, text/html)
2012-06-13 20:11 PST, Joshua Lock (joshuagl)
no flags Details


Note

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


Description From 2005-12-21 13:17:12 PST
When a first letter is styled through the :first-letter, it is not selectable.
------- Comment #1 From 2005-12-21 13:17:39 PST -------
Created an attachment (id=5209) [details]
Testcase
------- Comment #2 From 2005-12-21 15:47:33 PST -------
This is a known issue that selections can not include generated text, which I assume the first letter is in 
this instance.  The reason being that selections in WebCore are represented by DOMRange objects, and 
thus can not include anonymous render tree content.  It's possible there is already a dup in bugzilla, there 
are also dups in Radar.
------- Comment #3 From 2007-02-12 18:32:35 PST -------
I'm pretty sure anything styled with first:letter isn't generated content:
http://www.w3.org/TR/css3-content/

Generated content is stuff like "content: footnote;" and even list numbers: "li { display: list-item; list-style: decimal; }"

But stuff that is written into the HTML and then styled with CSS isn't generated content.
------- Comment #4 From 2008-01-15 08:36:12 PST -------
*** Bug 16875 has been marked as a duplicate of this bug. ***
------- Comment #5 From 2008-01-15 08:41:22 PST -------
<rdar://problem/5688237>
------- Comment #6 From 2012-06-13 20:11:04 PST -------
Created an attachment (id=147471) [details]
Demonstrate more details

I have begun trying to understand this issue some and have discovered several additional details:

* If the selection begins with a :first-letter styled element the styled letter is not highlighted as selected (but is copied to the clipboard, more below). 
* However any following :first-letter styled elements are highlighted as selected.
* If the selection does not begin with a :first-letter styled element all selected contents are highlighted.
* The clipboard, once the selection is copied, includes the entire selection (rather than simply what is highlighted).
* But the length of the selection, when testing the extentOffset property of the selection object, does not match what I'd expect.

The attachment demonstrates each of the points above (except demonstrating pasting the copied selection).
------- Comment #7 From 2012-06-13 20:12:38 PST -------
I intend to start looking into fixing this bug next week so any pointers to relevant parts of WebCore for someone new to WebKit would be appreciated.
------- Comment #8 From 2014-02-13 10:18:25 PST -------
*** Bug 128705 has been marked as a duplicate of this bug. ***
------- Comment #9 From 2014-02-13 10:20:58 PST -------
Demo of issue: http://jsfiddle.net/P3TLx/6/