Bug 6185 - CSS1: character styled with :first-letter is not selectable
Summary: CSS1: character styled with :first-letter is not selectable
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
Keywords: HasReduction, InRadar
: 16875 128705 (view as bug list)
Depends on: 43830
Blocks: 58911 26443
  Show dependency treegraph
Reported: 2005-12-21 13:17 PST by Joost de Valk (AlthA)
Modified: 2024-01-06 00:54 PST (History)
14 users (show)

See Also:

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 PDT, Joshua Lock (joshuagl)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joost de Valk (AlthA) 2005-12-21 13:17:12 PST
When a first letter is styled through the :first-letter, it is not selectable.
Comment 1 Joost de Valk (AlthA) 2005-12-21 13:17:39 PST
Created attachment 5209 [details]
Comment 2 Eric Seidel (no email) 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 Julian Bennett Holmes 2007-02-12 18:32:35 PST
I'm pretty sure anything styled with first:letter isn't generated 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 mitz 2008-01-15 08:36:12 PST
*** Bug 16875 has been marked as a duplicate of this bug. ***
Comment 5 Mark Rowe (bdash) 2008-01-15 08:41:22 PST
Comment 6 Joshua Lock (joshuagl) 2012-06-13 20:11:04 PDT
Created attachment 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 Joshua Lock (joshuagl) 2012-06-13 20:12:38 PDT
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 GregR 2014-02-13 10:18:25 PST
*** Bug 128705 has been marked as a duplicate of this bug. ***
Comment 9 GregR 2014-02-13 10:20:58 PST
Demo of issue: http://jsfiddle.net/P3TLx/6/
Comment 10 pavlos 2015-10-19 03:03:34 PDT
any work happening about all the contenteditable/first-letter issues?