Closed Bug 93168 Opened 23 years ago Closed 19 years ago

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

Categories

(Core :: Layout: Text and Fonts, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: Eric.Zurcher, Assigned: rbs)

References

()

Details

(Keywords: css1, testcase, Whiteboard: [CSS1-5.4.5])

Attachments

(3 files)

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"
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
->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
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]
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
Attached file testcase #2
Attached patch fixSplinter Review
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+
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+
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: