[Cosmo-dev] Re: [commits-cosmo] (mde) [3543] Fix for bug 7917 -- Have Safari ignore test cases that its broken Date implementation can't handle.

Mikeal Rogers mikeal at osafoundation.org
Wed Jan 31 16:45:12 PST 2007


I think this is fixed in the next release, so if you put in  
workaround code you're just going to have to rip it all out again in  
a few months.

You can find out for sure by testing them against the latest webkit  
nightly http://nightly.webkit.org/

-Mikeal

On Jan 31, 2007, at 5:33 PM, Bobby Rullo wrote:

> Is this really the solution? In other cases (UI stuff for example)  
> we put in workaround code to handle differences in browsers, even  
> if it makes us grumble.
>
> Is this something that could come up using the UI? If so, we might  
> need a better fix than ignoring test cases.
>
> bobby
>
> On Jan 31, 2007, at 4:06 PM, svncheckin at osafoundation.org wrote:
>
>> Revision
>> 3543
>> Author
>> mde
>> Date
>> 2007-01-31 16:06:06 -0800 (Wed, 31 Jan 2007)
>> Log Message
>>
>> Fix for bug 7917 -- Have Safari ignore test cases that its broken  
>> Date implementation can't handle.
>> Modified Paths
>>
>> cosmo/trunk/src/test/unit/js/cosmo/datetime/test_date.js
>> Diff
>>
>> Modified: cosmo/trunk/src/test/unit/js/cosmo/datetime/test_date.js  
>> (3542 => 3543)
>>
>> --- cosmo/trunk/src/test/unit/js/cosmo/datetime/test_date.js	 
>> 2007-01-31 23:27:03 UTC (rev 3542)
>> +++ cosmo/trunk/src/test/unit/js/cosmo/datetime/test_date.js	 
>> 2007-02-01 00:06:06 UTC (rev 3543)
>> @@ -204,17 +204,23 @@
>>      jum.assertEquals(2, dt.getMonth());
>>      jum.assertEquals(1, dt.getDate());
>>
>> -    dt = new D(2006, 9, 23, 22, 12, 55, 6);
>> -    dt.setMonth(14);
>> -    jum.assertEquals(2007, dt.getYear());
>> -    jum.assertEquals(2, dt.getMonth());
>> -
>> -    // Date wraparoud -- Set month to Feb with date of 31st
>> -    // should wrap date to March 3rd
>> -    dt = new D(2006, 0, 31);
>> -    dt.setMonth(1);
>> -    jum.assertEquals(2, dt.getMonth());
>> -    jum.assertEquals(3, dt.getDate());
>> +    // Wraparound broken in Safari 2, see WebKit bug 4892
>> +    // http://bugs.webkit.org/show_bug.cgi?id=489
>> +    // Safari 2 == Safari/412 to Safari/419.3
>> +    // http://developer.apple.com/internet/safari/uamatrix.html
>> +    if (navigator.userAgent.indexOf('Safari/41') == -1) {
>> +        dt = new D(2006, 9, 23, 22, 12, 55, 6);
>> +        dt.setMonth(14);
>> +        jum.assertEquals(2007, dt.getYear());
>> +        jum.assertEquals(2, dt.getMonth());
>> +
>> +        // Date wraparoud -- Set month to Feb with date of 31st
>> +        // should wrap date to March 3rd
>> +        dt = new D(2006, 0, 31);
>> +        dt.setMonth(1);
>> +        jum.assertEquals(2, dt.getMonth());
>> +        jum.assertEquals(3, dt.getDate());
>> +    }
>>  }
>>
>>  function test_dateUTCSetters() {
>> @@ -229,12 +235,18 @@
>>      jum.assertEquals(6, dt.getUTCHours());
>>      jum.assertEquals(6, dt.getHours());
>>
>> -    dt = new D(2006, 9, 23, 22, 12, 55, 6, 'America/Chicago');
>> -    dt.setUTCHours(54);
>> -    // Should all be the same -- zero offset
>> -    jum.assertEquals(25, dt.getUTCDate());
>> -    jum.assertEquals(25, dt.getDate());
>> -    jum.assertEquals(6, dt.getUTCHours());
>> -    jum.assertEquals(11, dt.getHours());
>> +    // Wraparound broken in Safari 2, see WebKit bug 4892
>> +    // http://bugs.webkit.org/show_bug.cgi?id=489
>> +    // Safari 2 == Safari/412 to Safari/419.3
>> +    // http://developer.apple.com/internet/safari/uamatrix.html
>> +    if (navigator.userAgent.indexOf('Safari/41') == -1) {
>> +        dt = new D(2006, 9, 23, 22, 12, 55, 6, 'America/Chicago');
>> +        dt.setUTCHours(54);
>> +        // Should all be the same -- zero offset
>> +        jum.assertEquals(25, dt.getUTCDate());
>> +        jum.assertEquals(25, dt.getDate());
>> +        jum.assertEquals(6, dt.getUTCHours());
>> +        jum.assertEquals(11, dt.getHours());
>> +    }
>>  }
>>
>>
>> _______________________________________________
>> Commits-Cosmo mailing list
>> Commits-Cosmo at osafoundation.org
>> http://lists.osafoundation.org/cgi-bin/mailman/listinfo/commits-cosmo
>
> _______________________________________________
> cosmo-dev mailing list
> cosmo-dev at lists.osafoundation.org
> http://lists.osafoundation.org/mailman/listinfo/cosmo-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/cosmo-dev/attachments/20070131/aef0d1a3/attachment.html


More information about the cosmo-dev mailing list