Summary: | Konqueror does not render "http://www.bbc.co.uk/weather/ukweather/" pages | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Derek Huskisson <derek> |
Component: | kjs | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | maksim |
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | patch |
Description
Derek Huskisson
2006-11-07 09:19:17 UTC
Testcase: g_now = new Date(); g_now.setTime(NaN); g_now.setTime(Date.parse("November 7, 2006 14:00:00")); Somehow the second setTime doesn't go through after the first one... Created attachment 18457 [details]
patch
This should fix it --- setTime doesn't rely on the internal value, so no reason
to disallow it if the internal value is NaN.
SVN commit 603353 by orlovich: Regression test for #136992, and the bug the fix for which introduced this bug... CCBUG:136992 M +6 -0 Date.js --- trunk/tests/khtmltests/regression/tests/js/Date.js #603352:603353 @@ -317,4 +317,10 @@ shouldBe("new Date('00/00/2006').toString()", "new Date('Nov 30 2005').toString()"); shouldBe("new Date('01/452/2006').toString()", "new Date('Mar 28 2007').toString()"); +// Not crashing when trying set* ops on NaNs +shouldBeTrue("isNaN(new Date(NaN).setFullYear(1900))"); + +//... but should permit doing setTime on NaN (#136992) +shouldBe("new Date(NaN).setTime(1162939650000)", "1162939650000"); + debug("End Of Test"); SVN commit 603351 by orlovich: Permit changing the internal value of invalid dates. Fixes the BBC UK Weather page.. BUG:136992 M +6 -6 date_object.cpp --- branches/KDE/3.5/kdelibs/kjs/date_object.cpp #603350:603351 @@ -417,7 +417,6 @@ case GetSeconds: case GetMilliSeconds: case GetTimezoneOffset: - case SetTime: case SetMilliSeconds: case SetSeconds: case SetMinutes: @@ -429,6 +428,12 @@ } } + if (id == SetTime) { + result = Number(roundValue(exec,args[0])); + thisObj.setInternalValue(result); + return result; + } + // check whether time value is outside time_t's usual range // make the necessary transformations if necessary int realYearOffset = 0; @@ -538,11 +543,6 @@ case GetTimezoneOffset: result = Number(timeZoneOffset(t)); break; - case SetTime: - milli = roundValue(exec,args[0]); - result = Number(milli); - thisObj.setInternalValue(result); - break; case SetMilliSeconds: fillStructuresUsingTimeArgs(exec, args, 1, &ms, t); break; |