[webkit-reviews] Patch for Bug #3406 - CSS1: letters following apostrophe are wrongly capitalized when text-transform:capitalize applied

Andrew Wellington proton at wiretapped.net
Fri Jun 10 04:06:09 PDT 2005


Nick Shanks pointed out a problem with this patch. It wouldn't pick  
up words after a quote. For example "hello" should become "Hello".  
I've updated the patch and added some more tests suggested by Nick.

It should now handle these situations correctly from my testing. The  
behaviour is now:
Loop through the string and capitalise every word calculating a word  
as the first alpha-numeric character after a space.

-------------- next part --------------
layer at (0,0) size 800x600
  RenderCanvas at (0,0) size 800x600
layer at (0,0) size 800x102
  RenderBlock {HTML} at (0,0) size 800x102
    RenderBody {BODY} at (8,16) size 784x70
      RenderBlock {P} at (0,0) size 784x36
        RenderText {TEXT} at (0,0) size 759x36
          text run at (0,0) width 759: "There should be a capital letter at the start of each of the words below, but not after the apostrophe in the word. Note that"
          text run at (0,18) width 195: "frogs should not be capitalised."
      RenderBlock {P} at (0,52) size 784x18
        RenderText {TEXT} at (0,0) size 357x18
          text run at (0,0) width 318: "Todd's Susan's Fred \"Safari\x{2019}s Nai\x{308}ve Nut'in\" \"123"
          text run at (318,0) width 39: "frogs\""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/webkit-reviews/attachments/20050610/84933bff/capitalize.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: capitalize.patch
Type: application/octet-stream
Size: 1101 bytes
Desc: not available
Url : http://lists.macosforge.org/pipermail/webkit-reviews/attachments/20050610/84933bff/capitalize.obj
-------------- next part --------------

On 10/06/2005, at 7:35 PM, Andrew Wellington wrote:

> Hi all,
> Attached is a fix for bug #3406, and regression test.
> Andrew
> <capitalize.html>
> <capitalize-expected.txt>
> <capitalize.patch>

More information about the webkit-reviews mailing list