Bug 3409 - CSS1: Safari ignores "text-transform" attribute in "first-line" CSS rules
: CSS1: Safari ignores "text-transform" attribute in "first-line" CSS rules
Status: ASSIGNED
: WebKit
CSS
: 412
: PC All
: P2 Normal
Assigned To:
:
: HasReduction, InRadar, ReviewedForRadar
:
: 9610 34753
  Show dependency treegraph
 
Reported: 2005-06-10 01:20 PST by
Modified: 2013-09-30 09:27 PST (History)


Attachments
Simple testcase 1 (1.27 KB, text/html)
2005-06-22 09:55 PST, Brent Northam
no flags Details


Note

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


Description From 2005-06-10 01:20:16 PST
3/1/04 3:21 PM Tony Thomson:
* SUMMARY
Safari seems to ignore the "text-transform" attribute of "first-line" CSS rules.

* STEPS TO REPRODUCE
1. Load the attached sample web page in Safari 1.2 and Firefox 0.8.

* RESULTS
Notice that the first line of the the contact-info div doesn't render as all caps in Safari, but does in 
Firefox and IE.

* REGRESSION
Occurs in:
- Safari 1.2
Does not occur in:
- Firefox 0.8
- IE 5.2.3

* NOTES
Safari seems to ignore the "text-transform" attribute only with the "first-line" property, but not when 
placed normally in a div:
Works:             div#contact-info { text-transform: uppercase; }
Doesn't work:   div#contact-info:first-line {  text-transform: uppercase; }
Other attributes (like "font-weight") render normally in the "first-line" property.
------- Comment #1 From 2005-06-10 01:21:38 PST -------
Not sure I can attach the test case since it has someone's content, maybe someone should just make a 
simple new case.
------- Comment #2 From 2005-06-10 01:23:01 PST -------
Apple Bug: 3574595
------- Comment #3 From 2005-06-22 09:55:13 PST -------
Created an attachment (id=2544) [details]
Simple testcase 1

Here's a simple testcase that shows the bug using build 412 with a WebKit built
from CVS on 6/22/05.
------- Comment #4 From 2006-06-24 13:19:46 PST -------
*** Bug 9244 has been marked as a duplicate of this bug. ***
------- Comment #5 From 2006-09-10 01:11:08 PST -------
Is this bug still active? No movement in the last year? It is still apparent in the current build (419.3).
------- Comment #6 From 2006-09-10 16:37:15 PST -------
It is still active.  This bug is really hard to fix the right way, since text-transform would have to be completely re-architected in order to fix it.  Right now text-transform is just done on an entire DOM text node.   text-transform has to be rewritten in order to transform individual text line boxes instead.

Might be possible to come up with a hack that works though.
------- Comment #7 From 2009-02-09 09:16:41 PST -------
This bug has been inactive for two years—any plans to fix this?

Still broken in 40777 
------- Comment #8 From 2009-04-09 21:27:31 PST -------
This bug is pretty hard to fix.  

text-transform actually affects metrics, so applying this to first-line creates huge complications in the engine.  Effectively the current implementation of text-transform has to just be thrown out and completely rewritten from scratch.

calcPrefWidths would need to transform the text character by character as it measured while it was looking at the first line.  findNextLineBreak would need to do the same.

An effective way of doing this would be to actually pass a transform constant all the way down into the Font code and have it do the transformation when measuring and rendering.  This would be somewhat similar to how synthesized small-caps works today.
------- Comment #9 From 2009-08-02 15:27:25 PST -------
*** Bug 27829 has been marked as a duplicate of this bug. ***
------- Comment #10 From 2009-09-23 19:19:08 PST -------
Confirmed to exist in Safari 4.0.3, and Google Chrome 4.0.206.1.  I realize it's hard to change - but it *is* a 5 year old bug now.
------- Comment #11 From 2010-01-09 06:06:22 PST -------
Am I correct in assuming that the root cause of this bug also causes :first-line pseudo-elements to be rendered in the browser's default font (it appears) when a text-transform is applied?
------- Comment #12 From 2010-10-09 13:42:23 PST -------
*** Bug 47451 has been marked as a duplicate of this bug. ***
------- Comment #13 From 2010-10-09 20:22:38 PST -------
Any plans to fix this bug? it's upsetting to learn that this bug remains unfix after 5 years++
------- Comment #14 From 2011-05-16 19:25:46 PST -------
It seems to be same as "[Bug 34753] CSS 2.1: first-line-selector-008.htm test fails".
I've uploaded patch on '34753' and I'm waiting for review.
------- Comment #15 From 2011-12-12 09:56:59 PST -------
Is there any improvement yet? how can I follow up.. I need to do a presentation on Wednesday for this bug report..
------- Comment #16 From 2012-04-11 07:51:55 PST -------
I confirm that this is still a bug in Safari 5.0.6 and Chrome 18.0.1, nearly seven years later. Given that Firefox does this correctly and presumably you can look at their backend (Gecko being FOSS), how are they doing it?
------- Comment #17 From 2012-04-26 17:13:44 PST -------
*** Bug 84993 has been marked as a duplicate of this bug. ***
------- Comment #18 From 2012-07-30 08:12:11 PST -------
Just another vote for this bug
------- Comment #19 From 2012-07-30 08:39:45 PST -------
Hi Dave,

I had tried to fix this issue in https://bugs.webkit.org/show_bug.cgi?id=34753 (first line decoration and transform)
The approach was not correct... Wanted to know if its possible to work on this bug ?
------- Comment #20 From 2013-08-08 17:30:10 PST -------
Yep, just observed this today in Chrome 28.0.1500.95 (Official Build 213514).