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

RESOLVED FIXED in Future

Status

()

Core
Layout: Text
P3
normal
RESOLVED FIXED
17 years ago
13 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

17 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

17 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

17 years ago
->Style System.
FYI, DOM Style is for dynamic modification of CSS and stylesheets.
Assignee: jst → dbaron
Component: DOM Style → Style System
Created attachment 47242 [details]
testcase
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

16 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

Updated

16 years ago
Target Milestone: --- → mozilla1.2
Keywords: testcase
Whiteboard: [CSS1-5.4.5]

Comment 6

16 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 → ---

Updated

15 years ago
Priority: -- → P3
Target Milestone: --- → Future

Comment 8

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

Comment 9

13 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

13 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 12

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

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

Comment 13

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