'text-transform: capitalize' causes collapsed/expanded letter spacing

RESOLVED FIXED in Future

Status

()

P3
normal
RESOLVED FIXED
18 years ago
14 years ago

People

(Reporter: Eric.Zurcher, Assigned: rbs)

Tracking

({css1, testcase})

Trunk
Future
css1, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [CSS1-5.4.5], URL)

Attachments

(3 attachments)

(Reporter)

Description

18 years ago
When the "capitalize" text transform is active, any <span> or </span> tags
embedded within a word are expanded into spaces. 

Consider the document at http://www.w3.org/Style/CSS/Test/current/sec545.htm -
at the end of the third text paragraph, the word "Letter" is rendered as 
"Lett er".

The following small document also illustrates the problem:

<html>
<head>
<style type="text/css">
.cap {text-transform: capitalize;}
</style>
</head>
<body>
abc<span>def<span class="cap">ghi<span>jkl</span>mno</span>pqr</span>stu
</body>
</html>

This is rendered as "abcdefghi jkl mno pqrstu", rather than as
"abcdefghijklmnopqrstu"

Comment 1

18 years ago
I am seeing this too.

It seems that when mozilla applies the capitalize style, it inserts a space
after the span if one is not already there.  Therefore, you cannot do something
like <span style="text-transform:capitalize;">l<span>oo</span>k</span>.  This
will produce "L ook" instead of "Look".
Status: UNCONFIRMED → NEW
Ever confirmed: true

Comment 2

18 years ago
->Style System.
FYI, DOM Style is for dynamic modification of CSS and stylesheets.
Assignee: jst → dbaron
Component: DOM Style → Style System
I'm seeing compression rather than expansion between o and p.  In any case, this
is a layout bug.
Assignee: dbaron → karnaze
Component: Style System → Layout
Keywords: css1
QA Contact: ian → petersen
Summary: <span> and </span> tags result in spaces inserted within words when the "capitalize" text-transform is applied. → 'text-transform: capitalize' causes collapsed/expanded letter spacing

Comment 5

17 years ago
i see an expansion, not a compression between the o and the p.

not table specific, over tot he core owner.
Assignee: karnaze → attinasi
Target Milestone: --- → mozilla1.2
Keywords: testcase
Whiteboard: [CSS1-5.4.5]

Comment 6

17 years ago
Reconfirmed using FizzillaCFM/2002070913. Extra space seen between "i" and "j"
in testcase attachment. Setting All/All.
OS: Windows NT → All
Hardware: PC → All
.
Assignee: attinasi → font
Component: Layout → Layout: Fonts and Text
QA Contact: cpetersen0953 → ian
Target Milestone: mozilla1.2alpha → ---
Priority: -- → P3
Target Milestone: --- → Future

Comment 8

14 years ago
Created attachment 179831 [details]
testcase #2
(Assignee)

Comment 9

14 years ago
Created attachment 179949 [details] [diff] [review]
fix

Due to different code paths, the bug arises from the fact that the text is
measured in capitalized form and rendered as uncapitalized ('S' is wider than
's'). The patch gets the capitalization right (i.e., as  |gCaseConv->ToTitle()|
does).
Assignee: layout.fonts-and-text → rbs
Status: NEW → ASSIGNED
Attachment #179949 - Flags: superreview?(bzbarsky)
Attachment #179949 - Flags: review?(bzbarsky)
Comment on attachment 179949 [details] [diff] [review]
fix

Nice catch!  r+sr=bzbarsky
Attachment #179949 - Flags: superreview?(bzbarsky)
Attachment #179949 - Flags: superreview+
Attachment #179949 - Flags: review?(bzbarsky)
Attachment #179949 - Flags: review+
(Assignee)

Comment 11

14 years ago
Comment on attachment 179949 [details] [diff] [review]
fix

Asking approval for 1.8b2. A simple fix that was however hard to get.
Attachment #179949 - Flags: approval1.8b2?
Comment on attachment 179949 [details] [diff] [review]
fix

a=asa
Attachment #179949 - Flags: approval1.8b2? → approval1.8b2+
(Assignee)

Comment 13

14 years ago
Checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.