Bug 11671

Summary: REGRESSION (r13702): text-transform: capitalize changes non-breaking spaces to spaces
Product: WebKit Reporter: mitz
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, bdakin
Priority: P1 Keywords: HasReduction, Regression
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
URL: http://abadacapoeira.de
Attachments:
Description Flags
Preserve non-breaking spaces when capitalizing
none
Preserve non-breaking spaces when capitalizing ap: review+

mitz
Reported 2006-11-21 14:18:12 PST
[Split off from bug 11630, where this was not the main issue] The testcase (attachment 11590 [details]) demonstrates that text-transform:capitalize changes non-breaking spaces to normal spaces. In shipping Safari, Firefox and Opera, there is a gap between the two 100x100 squares due to the text, which includes non-breaking spaces. This is also the case in TOT if text-transform: capitalize is not specified. From StringImpl::capitalize: // Replace &nbsp with a real space since ICU no longer treats &nbsp as a word separator. This was added in r13702 to address <rdar://problem/4502311> text-transform:capitalize needs to treat nbsp as a regular space when ICU changes. I think the solution might be as simple as copying from m_data[i - 1] instead of stringWithPrevious[i] in the loop that copies the non-capitalized characters.
Attachments
Preserve non-breaking spaces when capitalizing (36.35 KB, patch)
2006-12-26 08:58 PST, mitz
no flags
Preserve non-breaking spaces when capitalizing (38.78 KB, patch)
2006-12-26 13:00 PST, mitz
ap: review+
mitz
Comment 1 2006-12-26 08:58:33 PST
Created attachment 12033 [details] Preserve non-breaking spaces when capitalizing Includes test and change log. No layout test regressions.
mitz
Comment 2 2006-12-26 13:00:47 PST
Created attachment 12044 [details] Preserve non-breaking spaces when capitalizing This version also improves the fix for <rdar://problem/4502311> from r13702 by applying it to 'previous'. A test for the case that the previous character is a non-breaking space is included, although with current ICU, this patch does not affect this case.
Alexey Proskuryakov
Comment 3 2006-12-26 13:14:43 PST
Comment on attachment 12044 [details] Preserve non-breaking spaces when capitalizing r=me As discussed on IRC, it would be nice to know more about what happened to nbsp in the new Unicode standard (I don't understand why it stops being a word separator), but that's outside the scope of this bug.
Alexey Proskuryakov
Comment 4 2006-12-26 13:49:32 PST
I'm not sure if the whole hack with replacing nbsps is necessary anymore, given that Unicode 5 has restored their behavior of word separators. This fix seems good to land anyway.
Alexey Proskuryakov
Comment 5 2006-12-28 10:33:52 PST
Committed revision 18453. Corrected expected results (the patch had old pixel results).
Note You need to log in before you can comment on or make changes to this bug.