From 624cdf4412ee3b7b079fe07d17565eae4bdbe3e6 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Fri, 2 Sep 2011 09:15:54 -0400 Subject: [PATCH] Revert to 176fae7de173 which was fine. Sorry for breaking the history, won't trust TBPL, ever again. :( --- .../branding/nightly/pref/firefox-branding.js | 3 +- .../unofficial/pref/firefox-branding.js | 3 +- content/smil/crashtests/678847-1.svg | 3 ++ content/smil/crashtests/678938-1.svg | 11 +++++ content/smil/crashtests/crashtests.list | 4 +- content/smil/nsSMILAnimationFunction.cpp | 15 ++++++ content/smil/nsSMILTimedElement.cpp | 36 +++++++++++---- content/smil/nsSMILTimedElement.h | 1 + gfx/cairo/README | 2 + gfx/cairo/cairo/src/cairo-misc.c | 2 +- gfx/cairo/cairo/src/cairoint.h | 2 +- gfx/cairo/lround-c99-only.patch | 46 +++++++++++++++++++ js/src/jstracer.cpp | 1 - .../svg/smil/anim-discrete-values-2.svg | 31 +++++++++++++ .../svg/smil/anim-discrete-values-3.svg | 21 +++++++++ layout/reftests/svg/smil/reftest.list | 2 + .../zipwriter/src/nsDeflateConverter.cpp | 2 + widget/src/android/AndroidJNI.cpp | 7 ++- 18 files changed, 170 insertions(+), 22 deletions(-) create mode 100644 content/smil/crashtests/678847-1.svg create mode 100644 content/smil/crashtests/678938-1.svg create mode 100644 gfx/cairo/lround-c99-only.patch create mode 100644 layout/reftests/svg/smil/anim-discrete-values-2.svg create mode 100644 layout/reftests/svg/smil/anim-discrete-values-3.svg diff --git a/browser/branding/nightly/pref/firefox-branding.js b/browser/branding/nightly/pref/firefox-branding.js index 13e9dd53c86e..ddcafbd00e9b 100644 --- a/browser/branding/nightly/pref/firefox-branding.js +++ b/browser/branding/nightly/pref/firefox-branding.js @@ -1,8 +1,7 @@ pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/"); pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/"); // The time interval between checks for a new version (in seconds) -// nightly=8 hours, official=24 hours -pref("app.update.interval", 28800); +pref("app.update.interval", 7200); // 2 hours // The time interval between the downloading of mar file chunks in the // background (in seconds) pref("app.update.download.backgroundInterval", 60); diff --git a/browser/branding/unofficial/pref/firefox-branding.js b/browser/branding/unofficial/pref/firefox-branding.js index 17a7ce468e1d..b3e8634aa003 100644 --- a/browser/branding/unofficial/pref/firefox-branding.js +++ b/browser/branding/unofficial/pref/firefox-branding.js @@ -1,8 +1,7 @@ pref("startup.homepage_override_url","http://www.mozilla.org/projects/%APP%/%VERSION%/whatsnew/"); pref("startup.homepage_welcome_url","http://www.mozilla.org/projects/%APP%/%VERSION%/firstrun/"); // The time interval between checks for a new version (in seconds) -// nightly=8 hours, official=24 hours -pref("app.update.interval", 28800); +pref("app.update.interval", 86400); // 24 hours // The time interval between the downloading of mar file chunks in the // background (in seconds) pref("app.update.download.backgroundInterval", 60); diff --git a/content/smil/crashtests/678847-1.svg b/content/smil/crashtests/678847-1.svg new file mode 100644 index 000000000000..1fa2718cbb75 --- /dev/null +++ b/content/smil/crashtests/678847-1.svg @@ -0,0 +1,3 @@ + + + diff --git a/content/smil/crashtests/678938-1.svg b/content/smil/crashtests/678938-1.svg new file mode 100644 index 000000000000..f3f8308fa50f --- /dev/null +++ b/content/smil/crashtests/678938-1.svg @@ -0,0 +1,11 @@ + + + + diff --git a/content/smil/crashtests/crashtests.list b/content/smil/crashtests/crashtests.list index 631dfb9403d2..d3e0f95ee2f5 100644 --- a/content/smil/crashtests/crashtests.list +++ b/content/smil/crashtests/crashtests.list @@ -37,6 +37,8 @@ load 615872-1.svg load 650732-1.svg load 665334-1.svg load 669225-1.svg -load 670313-1.svg load 669225-2.svg +load 670313-1.svg load 678822-1.svg +load 678847-1.svg +load 678938-1.svg diff --git a/content/smil/nsSMILAnimationFunction.cpp b/content/smil/nsSMILAnimationFunction.cpp index 1763381c0ad2..b7866cc93a58 100644 --- a/content/smil/nsSMILAnimationFunction.cpp +++ b/content/smil/nsSMILAnimationFunction.cpp @@ -478,6 +478,21 @@ nsSMILAnimationFunction::InterpolateResult(const nsSMILValueArray& aValues, if (calcMode == CALC_DISCRETE || NS_FAILED(rv)) { double scaledSimpleProgress = ScaleSimpleProgress(simpleProgress, CALC_DISCRETE); + + // Floating-point errors can mean that, for example, a sample time of 29s in + // a 100s duration animation gives us a simple progress of 0.28999999999 + // instead of the 0.29 we'd expect. Normally this isn't a noticeable + // problem, but when we have sudden jumps in animation values (such as is + // the case here with discrete animation) we can get unexpected results. + // + // To counteract this, before we perform a floor() on the animation + // progress, we add a tiny fudge factor to push us into the correct interval + // in cases where floating-point errors might cause us to fall short. + static const double kFloatingPointFudgeFactor = 1.0e-16; + if (scaledSimpleProgress + kFloatingPointFudgeFactor <= 1.0) { + scaledSimpleProgress += kFloatingPointFudgeFactor; + } + if (IsToAnimation()) { // We don't follow SMIL 3, 12.6.4, where discrete to animations // are the same as animations. Instead, we treat it as a diff --git a/content/smil/nsSMILTimedElement.cpp b/content/smil/nsSMILTimedElement.cpp index d3eec352d69b..c754dc937494 100644 --- a/content/smil/nsSMILTimedElement.cpp +++ b/content/smil/nsSMILTimedElement.cpp @@ -758,10 +758,10 @@ nsSMILTimedElement::Rewind() mSeekState == SEEK_BACKWARD_FROM_ACTIVE, "Rewind in the middle of a forwards seek?"); - ClearIntervals(); - // ClearIntervals puts us in to the POSTACTIVE state but we're doing a full - // rewind so go back to the startup state + // Putting us in the startup state will ensure we skip doing any interval + // updates mElementState = STATE_STARTUP; + ClearIntervals(); UnsetBeginSpec(RemoveNonDynamic); UnsetEndSpec(RemoveNonDynamic); @@ -784,6 +784,8 @@ nsSMILTimedElement::Rewind() mPrevRegisteredMilestone = sMaxMilestone; RegisterMilestone(); + NS_ABORT_IF_FALSE(!mCurrentInterval, + "Current interval is set at end of rewind"); } namespace @@ -1332,7 +1334,9 @@ nsSMILTimedElement::ClearSpecs(TimeValueSpecList& aSpecs, void nsSMILTimedElement::ClearIntervals() { - mElementState = STATE_POSTACTIVE; + if (mElementState != STATE_STARTUP) { + mElementState = STATE_POSTACTIVE; + } mCurrentRepeatIteration = 0; ResetCurrentInterval(); @@ -1684,14 +1688,15 @@ nsSMILTimedElement::GetNextInterval(const nsSMILInterval* aPrevInterval, // a) We never had any end attribute to begin with (and hence we should // just use the active duration after allowing for the possibility of // an end instance provided by a DOM call), OR - // b) We have an end attribute but no end instances--this is a special - // case that is needed for syncbase timing so that animations of the - // following sort: can be - // resolved (see SVGT 1.2 Test Suite animate-elem-221-t.svg) by first - // establishing an interval of unresolved duration, OR + // b) We have no resolved (not incl. indefinite) end instances + // (SMIL only says "if the instance list is empty"--but if we have + // indefinite/unresolved instance times then there must be a good + // reason we haven't used them (since they'll be >= tempBegin) such as + // avoiding creating a self-referential loop. In any case, the interval + // should be allowed to be open.), OR // c) We have end events which leave the interval open-ended. PRBool openEndedIntervalOk = mEndSpecs.IsEmpty() || - mEndInstances.IsEmpty() || + !HaveResolvedEndTimes() || EndHasEventConditions(); if (!tempEnd && !openEndedIntervalOk) return PR_FALSE; // Bad interval @@ -2248,6 +2253,17 @@ nsSMILTimedElement::GetPreviousInterval() const : mOldIntervals[mOldIntervals.Length()-1].get(); } +PRBool +nsSMILTimedElement::HaveResolvedEndTimes() const +{ + if (mEndInstances.IsEmpty()) + return PR_FALSE; + + // mEndInstances is sorted so if the first time is not resolved then none of + // them are + return mEndInstances[0]->Time().IsResolved(); +} + PRBool nsSMILTimedElement::EndHasEventConditions() const { diff --git a/content/smil/nsSMILTimedElement.h b/content/smil/nsSMILTimedElement.h index f214df5e5955..9ecd40dcf695 100644 --- a/content/smil/nsSMILTimedElement.h +++ b/content/smil/nsSMILTimedElement.h @@ -525,6 +525,7 @@ protected: const nsSMILInstanceTime* GetEffectiveBeginInstance() const; const nsSMILInterval* GetPreviousInterval() const; PRBool HasPlayed() const { return !mOldIntervals.IsEmpty(); } + PRBool HaveResolvedEndTimes() const; PRBool EndHasEventConditions() const; // Reset the current interval by first passing ownership to a temporary diff --git a/gfx/cairo/README b/gfx/cairo/README index 4c694156b07d..3605a8da1742 100644 --- a/gfx/cairo/README +++ b/gfx/cairo/README @@ -172,6 +172,8 @@ fixup-unbounded.patch: Hack to work around bad assumption. quartz-get-image-performance: Make cairo_quartz_get_image faster in the failure case by not flushing unless we are going to succeed. +lround-c99-only.patch: Only use lround in C99 programs. + ==== pixman patches ==== pixman-android-cpu-detect.patch: Add CPU detection support for Android, where we can't reliably access /proc/self/auxv. diff --git a/gfx/cairo/cairo/src/cairo-misc.c b/gfx/cairo/cairo/src/cairo-misc.c index 603725955813..e0ed70cb6172 100644 --- a/gfx/cairo/cairo/src/cairo-misc.c +++ b/gfx/cairo/cairo/src/cairo-misc.c @@ -483,7 +483,7 @@ _cairo_operator_bounded_by_either (cairo_operator_t op) } -#if DISABLE_SOME_FLOATING_POINT +#if DISABLE_SOME_FLOATING_POINT || __STDC_VERSION__ < 199901L /* This function is identical to the C99 function lround(), except that it * performs arithmetic rounding (floor(d + .5) instead of away-from-zero rounding) and * has a valid input range of (INT_MIN, INT_MAX] instead of diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h index e44442a908a2..828fde8f1b72 100644 --- a/gfx/cairo/cairo/src/cairoint.h +++ b/gfx/cairo/cairo/src/cairoint.h @@ -974,7 +974,7 @@ _cairo_round (double r) return floor (r + .5); } -#if DISABLE_SOME_FLOATING_POINT +#if DISABLE_SOME_FLOATING_POINT || __STDC_VERSION__ < 199901L cairo_private int _cairo_lround (double d) cairo_const; #else diff --git a/gfx/cairo/lround-c99-only.patch b/gfx/cairo/lround-c99-only.patch new file mode 100644 index 000000000000..9002235f0e2c --- /dev/null +++ b/gfx/cairo/lround-c99-only.patch @@ -0,0 +1,46 @@ +Only use lround in C99 programs. + +diff --git a/gfx/cairo/cairo/src/cairo-misc.c b/gfx/cairo/cairo/src/cairo-misc.c +--- a/gfx/cairo/cairo/src/cairo-misc.c ++++ b/gfx/cairo/cairo/src/cairo-misc.c +@@ -478,17 +478,17 @@ _cairo_operator_bounded_by_either (cairo + case CAIRO_OPERATOR_IN: + case CAIRO_OPERATOR_DEST_IN: + case CAIRO_OPERATOR_DEST_ATOP: + return 0; + } + + } + +-#if DISABLE_SOME_FLOATING_POINT ++#if DISABLE_SOME_FLOATING_POINT || __STDC_VERSION__ < 199901L + /* This function is identical to the C99 function lround(), except that it + * performs arithmetic rounding (floor(d + .5) instead of away-from-zero rounding) and + * has a valid input range of (INT_MIN, INT_MAX] instead of + * [INT_MIN, INT_MAX]. It is much faster on both x86 and FPU-less systems + * than other commonly used methods for rounding (lround, round, rint, lrint + * or float (d + 0.5)). + * + * The reason why this function is much faster on x86 than other +diff --git a/gfx/cairo/cairo/src/cairoint.h b/gfx/cairo/cairo/src/cairoint.h +--- a/gfx/cairo/cairo/src/cairoint.h ++++ b/gfx/cairo/cairo/src/cairoint.h +@@ -969,17 +969,17 @@ _cairo_restrict_value (double value, dou + * away from 0. _cairo_round rounds halfway cases toward negative infinity. + * This matches the rounding behaviour of _cairo_lround. */ + static inline double cairo_const + _cairo_round (double r) + { + return floor (r + .5); + } + +-#if DISABLE_SOME_FLOATING_POINT ++#if DISABLE_SOME_FLOATING_POINT || __STDC_VERSION__ < 199901L + cairo_private int + _cairo_lround (double d) cairo_const; + #else + #define _cairo_lround lround + #endif + + cairo_private uint16_t + _cairo_half_from_float (float f) cairo_const; diff --git a/js/src/jstracer.cpp b/js/src/jstracer.cpp index 99c9c4d2e6c9..6ffe74f56640 100644 --- a/js/src/jstracer.cpp +++ b/js/src/jstracer.cpp @@ -17171,7 +17171,6 @@ LoopProfile::profileOperation(JSContext* cx, JSOp op) stackPush(StackValue(v1.isConst && v2.isConst)); } else if (op == JSOP_AND) { bool b = !!js_ValueToBoolean(cx->regs().sp[-1]); - StackValue v = stackAt(-1); if (b) stackPop(); } else { diff --git a/layout/reftests/svg/smil/anim-discrete-values-2.svg b/layout/reftests/svg/smil/anim-discrete-values-2.svg new file mode 100644 index 000000000000..c05693e143e9 --- /dev/null +++ b/layout/reftests/svg/smil/anim-discrete-values-2.svg @@ -0,0 +1,31 @@ + + + Test discrete keyTimes are scaled correctly (Bug 681645) + + + + diff --git a/layout/reftests/svg/smil/anim-discrete-values-3.svg b/layout/reftests/svg/smil/anim-discrete-values-3.svg new file mode 100644 index 000000000000..c6b850bfd651 --- /dev/null +++ b/layout/reftests/svg/smil/anim-discrete-values-3.svg @@ -0,0 +1,21 @@ + + + Test discrete keyTimes are scaled correctly (Bug 681645) + + + + diff --git a/layout/reftests/svg/smil/reftest.list b/layout/reftests/svg/smil/reftest.list index ccba051c23a9..ec5331521a25 100644 --- a/layout/reftests/svg/smil/reftest.list +++ b/layout/reftests/svg/smil/reftest.list @@ -55,6 +55,8 @@ include event/reftest.list # General tests == anim-discrete-values-1.svg anim-standard-ref.svg +== anim-discrete-values-2.svg anim-standard-ref.svg +== anim-discrete-values-3.svg anim-standard-ref.svg == anim-discrete-replace-sum-1.svg anim-standard-ref.svg == anim-discrete-sum-none-1.svg anim-standard-ref.svg == anim-discrete-sum-sum-1.svg anim-standard-ref.svg diff --git a/modules/libjar/zipwriter/src/nsDeflateConverter.cpp b/modules/libjar/zipwriter/src/nsDeflateConverter.cpp index 9975a8bccfa8..841c22d1f7bf 100644 --- a/modules/libjar/zipwriter/src/nsDeflateConverter.cpp +++ b/modules/libjar/zipwriter/src/nsDeflateConverter.cpp @@ -76,6 +76,8 @@ nsresult nsDeflateConverter::Init() case WRAP_GZIP: window += 16; break; + default: + break; } zerr = deflateInit2(&mZstream, mLevel, Z_DEFLATED, window, 8, diff --git a/widget/src/android/AndroidJNI.cpp b/widget/src/android/AndroidJNI.cpp index ec7c8cb33538..6aadc8e85e9a 100644 --- a/widget/src/android/AndroidJNI.cpp +++ b/widget/src/android/AndroidJNI.cpp @@ -171,12 +171,11 @@ Java_org_mozilla_gecko_GeckoAppShell_onChangeNetworkLinkStatus(JNIEnv *jenv, jcl } NS_EXPORT void JNICALL -Java_org_mozilla_gecko_GeckoAppShell_reportJavaCrash(JNIEnv *, jclass, jstring stack) +Java_org_mozilla_gecko_GeckoAppShell_reportJavaCrash(JNIEnv *jenv, jclass, jstring stack) { #ifdef MOZ_CRASHREPORTER - nsJNIString javaStack(stack); - CrashReporter::AppendAppNotesToCrashReport( - NS_ConvertUTF16toUTF8(javaStack)); + nsJNIString javaStack(stack, jenv); + CrashReporter::AppendAppNotesToCrashReport(NS_ConvertUTF16toUTF8(javaStack)); #endif abort(); }