diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4 index 517f5b77af6..b311a8a9414 100644 --- a/build/autoconf/icu.m4 +++ b/build/autoconf/icu.m4 @@ -22,7 +22,7 @@ AC_DEFUN([MOZ_CONFIG_ICU], [ fi MOZ_ICU_VERSION="$version" - if test -n "${JS_SHARED_LIBRARY}${MOZ_NATIVE_ICU}"; then + if test -z "${JS_STANDALONE}" -a -n "${JS_SHARED_LIBRARY}${MOZ_NATIVE_ICU}"; then MOZ_SHARED_ICU=1 fi diff --git a/content/canvas/src/WebGLFramebuffer.cpp b/content/canvas/src/WebGLFramebuffer.cpp index 7502bd5bfa8..66438975b10 100644 --- a/content/canvas/src/WebGLFramebuffer.cpp +++ b/content/canvas/src/WebGLFramebuffer.cpp @@ -504,7 +504,7 @@ bool WebGLFramebuffer::CheckColorAttachementNumber(GLenum attachment, const char if (mContext->IsExtensionEnabled(WebGLContext::WEBGL_draw_buffers)) { if (attachment < LOCAL_GL_COLOR_ATTACHMENT0 || - attachment > GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mGLMaxColorAttachments)) + attachment >= GLenum(LOCAL_GL_COLOR_ATTACHMENT0 + mContext->mGLMaxColorAttachments)) { mContext->ErrorInvalidEnum(errorFormating, functionName, attachment); return false; diff --git a/content/html/content/src/HTMLInputElement.cpp b/content/html/content/src/HTMLInputElement.cpp index 806363da52f..a44d0cc45a0 100644 --- a/content/html/content/src/HTMLInputElement.cpp +++ b/content/html/content/src/HTMLInputElement.cpp @@ -614,6 +614,8 @@ private: NS_IMETHODIMP HTMLInputElement::nsFilePickerShownCallback::Done(int16_t aResult) { + mInput->PickerClosed(); + if (aResult == nsIFilePicker::returnCancel) { return NS_OK; } @@ -796,6 +798,8 @@ nsColorPickerShownCallback::Done(const nsAString& aColor) */ nsresult rv = NS_OK; + mInput->PickerClosed(); + if (!aColor.IsEmpty()) { UpdateInternal(aColor, false); } @@ -839,6 +843,11 @@ HTMLInputElement::IsPopupBlocked() const nsresult HTMLInputElement::InitColorPicker() { + if (mPickerRunning) { + NS_WARNING("Just one nsIColorPicker is allowed"); + return NS_ERROR_FAILURE; + } + nsCOMPtr doc = OwnerDoc(); nsCOMPtr win = doc->GetWindow(); @@ -869,12 +878,22 @@ HTMLInputElement::InitColorPicker() nsCOMPtr callback = new nsColorPickerShownCallback(this, colorPicker); - return colorPicker->Open(callback); + rv = colorPicker->Open(callback); + if (NS_SUCCEEDED(rv)) { + mPickerRunning = true; + } + + return rv; } nsresult HTMLInputElement::InitFilePicker(FilePickerType aType) { + if (mPickerRunning) { + NS_WARNING("Just one nsIFilePicker is allowed"); + return NS_ERROR_FAILURE; + } + // Get parent nsPIDOMWindow object. nsCOMPtr doc = OwnerDoc(); @@ -955,10 +974,16 @@ HTMLInputElement::InitFilePicker(FilePickerType aType) } } - return filePicker->Open(callback); + rv = filePicker->Open(callback); + if (NS_SUCCEEDED(rv)) { + mPickerRunning = true; + } + + return rv; } HTMLInputElement::gUploadLastDir->FetchDirectoryAndDisplayPicker(doc, filePicker, callback); + mPickerRunning = true; return NS_OK; } @@ -1094,6 +1119,8 @@ HTMLInputElement::HTMLInputElement(already_AddRefed aNodeInfo, , mIsDraggingRange(false) , mProgressTimerIsActive(false) , mNumberControlSpinnerIsSpinning(false) + , mNumberControlSpinnerSpinsUp(false) + , mPickerRunning(false) { // We are in a type=text so we now we currenty need a nsTextEditorState. mInputData.mState = new nsTextEditorState(this); @@ -7178,6 +7205,12 @@ HTMLInputElement::UpdateHasRange() } } +void +HTMLInputElement::PickerClosed() +{ + mPickerRunning = false; +} + JSObject* HTMLInputElement::WrapNode(JSContext* aCx, JS::Handle aScope) { diff --git a/content/html/content/src/HTMLInputElement.h b/content/html/content/src/HTMLInputElement.h index a6fd14a866c..3b2392ff852 100644 --- a/content/html/content/src/HTMLInputElement.h +++ b/content/html/content/src/HTMLInputElement.h @@ -203,6 +203,9 @@ public: void SetFiles(const nsTArray >& aFiles, bool aSetValueChanged); void SetFiles(nsIDOMFileList* aFiles, bool aSetValueChanged); + // Called when a nsIFilePicker or a nsIColorPicker terminate. + void PickerClosed(); + void SetCheckedChangedInternal(bool aCheckedChanged); bool GetCheckedChanged() const { return mCheckedChanged; @@ -1267,6 +1270,7 @@ protected: bool mProgressTimerIsActive : 1; bool mNumberControlSpinnerIsSpinning : 1; bool mNumberControlSpinnerSpinsUp : 1; + bool mPickerRunning : 1; private: static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, diff --git a/gfx/tests/gtest/TestAsyncPanZoomController.cpp b/gfx/tests/gtest/TestAsyncPanZoomController.cpp index 0d2a64b744b..0687b74bef6 100644 --- a/gfx/tests/gtest/TestAsyncPanZoomController.cpp +++ b/gfx/tests/gtest/TestAsyncPanZoomController.cpp @@ -21,6 +21,7 @@ using namespace mozilla::gfx; using namespace mozilla::layers; using ::testing::_; using ::testing::NiceMock; +using ::testing::AtLeast; class MockContentController : public GeckoContentController { public: @@ -169,7 +170,7 @@ TEST(AsyncPanZoomController, Pinch) { apzc->SetFrameMetrics(fm); // the visible area of the document in CSS pixels is x=300 y=300 w=50 h=100 - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(2); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); ApzcPinch(apzc, 250, 300, 1.25); @@ -209,7 +210,7 @@ TEST(AsyncPanZoomController, Overzoom) { apzc->SetFrameMetrics(fm); // the visible area of the document in CSS pixels is x=10 y=0 w=100 h=100 - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(1); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); ApzcPinch(apzc, 50, 50, 0.5); @@ -353,7 +354,7 @@ TEST(AsyncPanZoomController, Pan) { apzc->SetFrameMetrics(TestFrameMetrics()); apzc->NotifyLayersUpdated(TestFrameMetrics(), true); - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(4); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); int time = 0; @@ -386,7 +387,7 @@ TEST(AsyncPanZoomController, Fling) { apzc->SetFrameMetrics(TestFrameMetrics()); apzc->NotifyLayersUpdated(TestFrameMetrics(), true); - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(2); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); int time = 0; @@ -416,7 +417,7 @@ TEST(AsyncPanZoomController, OverScrollPanning) { apzc->SetFrameMetrics(TestFrameMetrics()); apzc->NotifyLayersUpdated(TestFrameMetrics(), true); - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(4); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); // Pan sufficiently to hit overscroll behavior @@ -659,7 +660,7 @@ TEST(APZCTreeManager, HitTesting2) { int time = 0; // Silence GMock warnings about "uninteresting mock function calls". EXPECT_CALL(*mcc, PostDelayedTask(_,_)).Times(1); - EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(2); + EXPECT_CALL(*mcc, SendAsyncScrollDOMEvent(_,_,_)).Times(AtLeast(1)); EXPECT_CALL(*mcc, RequestContentRepaint(_)).Times(1); ApzcPan(apzcroot, manager, time, 100, 50); diff --git a/js/public/HashTable.h b/js/public/HashTable.h index f650af7569b..eb98804c8e6 100644 --- a/js/public/HashTable.h +++ b/js/public/HashTable.h @@ -1523,6 +1523,7 @@ class HashTable : private AllocPolicy p.mutationCount = mutationCount; { mozilla::ReentrancyGuard g(*this); + JS_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed p.entry_ = &lookup(l, p.keyHash, sCollisionBit); } return p.found() || add(p, mozilla::Forward(u)); diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 28da52c750c..14a5eade8c9 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -125,6 +125,7 @@ include $(topsrcdir)/config/config.mk # Ensure that this happens before including rules.mk ifdef ENABLE_INTL_API ifndef MOZ_NATIVE_ICU +ifdef MOZ_SHARED_ICU ifeq ($(OS_ARCH),WINNT) # Library names: On Windows, ICU uses modified library names for static # and debug libraries. @@ -156,6 +157,7 @@ ifdef ICU_FILES endif endif endif +endif include $(topsrcdir)/config/rules.mk diff --git a/js/src/build/autoconf/icu.m4 b/js/src/build/autoconf/icu.m4 index 517f5b77af6..b311a8a9414 100644 --- a/js/src/build/autoconf/icu.m4 +++ b/js/src/build/autoconf/icu.m4 @@ -22,7 +22,7 @@ AC_DEFUN([MOZ_CONFIG_ICU], [ fi MOZ_ICU_VERSION="$version" - if test -n "${JS_SHARED_LIBRARY}${MOZ_NATIVE_ICU}"; then + if test -z "${JS_STANDALONE}" -a -n "${JS_SHARED_LIBRARY}${MOZ_NATIVE_ICU}"; then MOZ_SHARED_ICU=1 fi diff --git a/js/src/builtin/TestingFunctions.cpp b/js/src/builtin/TestingFunctions.cpp index 15dbbea8caa..45bd7317cac 100644 --- a/js/src/builtin/TestingFunctions.cpp +++ b/js/src/builtin/TestingFunctions.cpp @@ -1119,11 +1119,11 @@ SetJitCompilerOption(JSContext *cx, unsigned argc, jsval *vp) } static bool -SetIonAssertGraphCoherency(JSContext *cx, unsigned argc, jsval *vp) +SetIonCheckGraphCoherency(JSContext *cx, unsigned argc, jsval *vp) { CallArgs args = CallArgsFromVp(argc, vp); #ifdef JS_ION - jit::js_IonOptions.assertGraphConsistency = ToBoolean(args.get(0)); + jit::js_IonOptions.checkGraphConsistency = ToBoolean(args.get(0)); #endif args.rval().setUndefined(); return true; @@ -1577,8 +1577,8 @@ static const JSFunctionSpecWithHelp TestingFunctions[] = { "setCompilerOption(