Closed Bug 389707 Opened 17 years ago Closed 17 years ago

text-transform: capitalize doesn't capitalize all words

Categories

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

x86
Windows XP
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: ispiked, Assigned: roc)

References

Details

(Keywords: regression, testcase, Whiteboard: [dbaron-1.9:RwCt])

Attachments

(4 files, 1 obsolete file)

Attached file testcase
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a7pre) Gecko/2007072605 Minefield/3.0a7pre

First seen in the navigational menu on amazon.com.

Steps to reproduce:
1. Load the testcase.

Actual results:
Not all the first letters of the words are capitalized.

Expected results:
All the first letters of the words are capitalized.

This is a regression from bug 367177.
Summary: text-transform: capitalize is doesn't capitalize all words → text-transform: capitalize doesn't capitalize all words
D'oh, I should have thought of that! Hmm.
Can we get away with shipping 1.9 with this?
Flags: blocking1.9?
Yeah, I think this should block.
Assignee: nobody → roc
Flags: blocking1.9? → blocking1.9+
The right way to implement capitalization seems to be to capitalize any letter that's preceded by the start of the block or white-space, followed by zero or more Ps, Pi, Po, Pf, Pe characters.

I think I'll do this by adding support to nsLineBreaker to return capitalization hints. But I can't do that until the patch in bug 393096 lands.
Depends on: 393096
Whiteboard: [depends on 393096]
Whiteboard: [depends on 393096] → [depends on 393096][dbaron-1.9:RwCt]
Whiteboard: [depends on 393096][dbaron-1.9:RwCt] → [dbaron-1.9:RwCt]
Attached patch fix capitalization (obsolete) — Splinter Review
This is more or less what I said I was going to do.

We add functionality to nsLineBreaker to determine which characters should be capitalized. This is the right place because it has all necessary context. This requires moving the punctuation CCmap to nsContentUtils.

Then we hook that up with nsTextRunTransformations to store in nsTransformedTextRun which characters should be capitalized.
Attachment #285646 - Flags: review?(smontagu)
Attached file testcase
This testcase tests punctuation and I'll check it in as a reftest.
Whiteboard: [dbaron-1.9:RwCt] → [dbaron-1.9:RwCt][need review]
Comment on attachment 285646 [details] [diff] [review]
fix capitalization

I tried this with various funky characters, and it doesn't capitalize after ZWJ ZWNJ LRM hyphen and SHY (even when breaking the line at the hyphen or SHY), but does capitalize after ZWSP, all of which seems correct to me.
Attachment #285646 - Flags: review?(smontagu) → review+
Whiteboard: [dbaron-1.9:RwCt][need review] → [dbaron-1.9:RwCt][need landing]
The second hunk of the layout/generic/nsTextFrameThebes.cpp changes is completely bitrot. Needs new patch.
Whiteboard: [dbaron-1.9:RwCt][need landing] → [dbaron-1.9:RwCt][needs new patch]
Whiteboard: [dbaron-1.9:RwCt][needs new patch] → [dbaron-1.9:RwCt][needs landing]
Checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
this bug might break the Japanese line-breaking. the Japanese text is sometimes broken at shortly even when the right side has space. (open parentheses sometimes force breaking the lines.) I'll check it ASAP.
er, please ignore comment 12. the bug is older than this fix. (bug 404087)
Whiteboard: [dbaron-1.9:RwCt][needs landing] → [dbaron-1.9:RwCt]
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9pre) Gecko/2008050810 Minefield/3.0pre

Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.