text-transform: capitalize doesn't capitalize all words

VERIFIED FIXED

Status

()

Core
Layout: Text
P2
normal
VERIFIED FIXED
11 years ago
10 years ago

People

(Reporter: Adam Guthrie, Assigned: roc)

Tracking

({regression, testcase})

Trunk
x86
Windows XP
regression, testcase
Points:
---
Dependency tree / graph
Bug Flags:
blocking1.9 +
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [dbaron-1.9:RwCt])

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

11 years ago
Created attachment 274016 [details]
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.
(Reporter)

Updated

11 years ago
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.
(Reporter)

Comment 2

11 years ago
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]
Created attachment 285646 [details] [diff] [review]
fix capitalization

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)
Created attachment 285647 [details]
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]
Priority: -- → P1
Priority: P1 → P2
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]
Created attachment 287970 [details] [diff] [review]
updated patch
Attachment #285646 - Attachment is obsolete: true
Whiteboard: [dbaron-1.9:RwCt][needs new patch] → [dbaron-1.9:RwCt][needs landing]
Checked in.
Status: NEW → RESOLVED
Last Resolved: 11 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]

Comment 14

10 years ago
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.