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

Nicholas Shanks contact at nickshanks.com
Fri Jun 10 03:32:32 PDT 2005


On 10 Jun 2005, at 10:35, Andrew Wellington wrote:

> Hi all,
> Attached is a fix for bug #3406, and regression test.
> Andrew

Sorry to break the bad news, but this patch is no good :-(
it will fail for lots of circumstances, e.g following quotes :

“hello” should become “Hello”

I am also working on a patch, but have yet to run it through the  
webkit tests.
Try this instead:

     for (unsigned int i = 1; i < l; i++)
         // keep the same if character before is alphanumeric, or is  
apos/rsquo and character before that is alphanumeric; otherwise  
capitalize
         c->s[i] = (s[i-1].isLetterOrNumber() || (i>1 && (s[i-1] ==  
QChar(0x0027) || s[i-1] == QChar(0x2019)) && s[i-2].isLetterOrNumber 
())) ? s[i] : s[i].upper();


I will attach a diff to the bug in a moment, once I've checked it.

Could you merge your test case with the one I attached to #3406? That  
would be great!
Note that Safari 2.0 passes the test case but the ToT currently does  
not. Something regressed in the handling of QStrings (and nothing to  
do with me!), but I have no idea what that might have been.

- Nick.




More information about the webkit-reviews mailing list