Bug 112541

Summary: :first-letter & :after pseudoclasses do not work right together.
Product: [Applications] konqueror Reporter: Jelle Boomstra <kdebug>
Component: khtml rendererAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: finex, james
Priority: NOR    
Version: 3.3.2   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test case attached
coreect testcase with separate css

Description Jelle Boomstra 2005-09-13 16:58:42 UTC
Version:           3.3.2 (using KDE 3.3.2,  (3.1))
Compiler:          gcc version 3.3.6 (Debian 1:3.3.6-5)
OS:                Linux (i686) release 2.6.11-skas3-v8

create the following files:
first-letter-after.html:
<!-- ----------------------------------------------- -->
<html>
<head>
<LINK rel="StyleSheet" type="text/css" href="first-letter-after.css">
<title>Bugtest kde :first-letter &amp; :after pseudoclasses </title>
</head>
<body>
<p>The first letter of the paragraph will have a red background. But the first letter (and any punctuation in front of it)  of the :after content is also treated that way, where it obviously should not, see for yourself </p>
</body>
</html>
<!-- ----------------------------------------------------- -->
first-letter-after.css:
/*------------------------------------------------------*/
P:after { content: ";:.,'!?12345end of paragraph:" }
P:first-letter {BACKGROUND-COLOR:red;}
/*------------------------------------------------------*/

this will show ;:.,'!?1 with a red background, while it should not. Not this will not work for some reason if you inline the style.

Obviously this is not a serious bug, more a nuisance.
Comment 1 Tommi Tervo 2005-09-13 17:16:52 UTC
Created attachment 12550 [details]
test case attached

Cannot reproduce, only first letter background is red.
Comment 2 Jelle Boomstra 2005-09-13 17:24:24 UTC
The previously attached test case is incorrect. as noted, it works correctly if you inline the style, but fails when you use a separate css. 
Comment 3 Jelle Boomstra 2005-09-13 17:29:37 UTC
Created attachment 12551 [details]
coreect testcase with separate css

this file references a file on my home box, so may not always work.
Comment 4 Tommi Tervo 2005-09-13 17:45:49 UTC
Hmm, intresting bug.
Comment 5 Allan Sandfeld 2006-04-28 01:02:28 UTC
Bug still applies in Konqueror pre-3.5.3
Comment 6 James Spahlinger 2008-04-19 12:01:00 UTC
Works for me with konqueror 4.0.3

As the provided link is down, I recreated the testcase. Please see http://nixeagle.org/kdebugs/112541/testcase.html

In addition as this bug has a testcase, please change the summary of this bug to reflect this fact.

Using Gentoo Linux ~x86 (testing in gentoo lingo). KDE and the majority of packages compiled using gcc 4.3.0.
Comment 7 FiNeX 2008-04-25 13:23:53 UTC
KDE 3.5.9 render the testcase on #6 like konqueror trunk (revision 800924)