diff --git a/accessible/src/base/EventQueue.cpp b/accessible/src/base/EventQueue.cpp index 2e5b162fbed..b0a485f5937 100644 --- a/accessible/src/base/EventQueue.cpp +++ b/accessible/src/base/EventQueue.cpp @@ -226,9 +226,7 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent) // If tailEvent contains thisEvent // then - // if show of tailEvent contains a grand parent of thisEvent - // then assert - // else if hide of tailEvent contains a grand parent of thisEvent + // if show or hide of tailEvent contains a grand parent of thisEvent // then ignore thisEvent and its show and hide events // otherwise ignore thisEvent but not its show and hide events Accessible* thisParent = thisEvent->mAccessible; @@ -237,9 +235,12 @@ EventQueue::CoalesceReorderEvents(AccEvent* aTailEvent) AccReorderEvent* tailReorder = downcast_accEvent(aTailEvent); uint32_t eventType = tailReorder->IsShowHideEventTarget(thisParent); - if (eventType == nsIAccessibleEvent::EVENT_SHOW) { - NS_ERROR("Accessible tree was created after it was modified! Huh?"); - } else if (eventType == nsIAccessibleEvent::EVENT_HIDE) { + // Sometimes InvalidateChildren() and + // DocAccessible::CacheChildrenInSubtree() can conspire to reparent an + // accessible in this case no need for mutation events. Se bug 883708 + // for details. + if (eventType == nsIAccessibleEvent::EVENT_SHOW || + eventType == nsIAccessibleEvent::EVENT_HIDE) { AccReorderEvent* thisReorder = downcast_accEvent(thisEvent); thisReorder->DoNotEmitAll(); } else { diff --git a/accessible/tests/mochitest/treeupdate/a11y.ini b/accessible/tests/mochitest/treeupdate/a11y.ini index ed670758255..0d64f6ef2be 100644 --- a/accessible/tests/mochitest/treeupdate/a11y.ini +++ b/accessible/tests/mochitest/treeupdate/a11y.ini @@ -2,6 +2,7 @@ [test_ariadialog.html] [test_bug852150.xhtml] +[test_bug883708.xhtml] [test_bug895082.html] [test_canvas.html] [test_colorpicker.xul] diff --git a/accessible/tests/mochitest/treeupdate/test_bug883708.xhtml b/accessible/tests/mochitest/treeupdate/test_bug883708.xhtml new file mode 100644 index 00000000000..6265a1c7f00 --- /dev/null +++ b/accessible/tests/mochitest/treeupdate/test_bug883708.xhtml @@ -0,0 +1,33 @@ + + + + + + + + + + Mozilla Bug 883708 + + +

+ +
+  
+ +
+ diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 6cd7669b241..dde3efd2a63 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -1733,15 +1733,6 @@ RuntimeService::Init() MAX_WORKERS_PER_DOMAIN); gMaxWorkersPerDomain = std::max(0, maxPerDomain); - mDetectorName = Preferences::GetLocalizedCString("intl.charset.detector"); - - nsCOMPtr platformCharset = - do_GetService(NS_PLATFORMCHARSET_CONTRACTID, &rv); - if (NS_SUCCEEDED(rv)) { - rv = platformCharset->GetCharset(kPlatformCharsetSel_PlainTextInFile, - mSystemCharset); - } - rv = InitOSFileConstants(); if (NS_FAILED(rv)) { return rv; diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h index 57a17a59c33..f770be5d543 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h @@ -96,9 +96,6 @@ private: // Only used on the main thread. nsCOMPtr mIdleThreadTimer; - nsCString mDetectorName; - nsCString mSystemCharset; - static JSSettings sDefaultJSSettings; static bool sDefaultPreferences[WORKERPREF_COUNT]; @@ -153,18 +150,6 @@ public: void ForgetSharedWorker(WorkerPrivate* aWorkerPrivate); - const nsACString& - GetDetectorName() const - { - return mDetectorName; - } - - const nsACString& - GetSystemCharset() const - { - return mSystemCharset; - } - const NavigatorStrings& GetNavigatorStrings() const { diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index 92ff70a1c25..ae34d64bb71 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -7819,10 +7819,13 @@ GetTemplateObjectForNative(JSContext *cx, HandleScript script, jsbytecode *pc, // done to provide templates to Ion for inlining these natives later on. if (native == js_Array) { + // Note: the template array won't be used if its length is inaccurately + // computed here. (We allocate here because compilation may occur on a + // separate thread where allocation is impossible.) size_t count = 0; - if (args.hasDefined(1)) + if (args.length() != 1) count = args.length(); - else if (args.hasDefined(0) && args[0].isInt32() && args[0].toInt32() > 0) + else if (args.length() == 1 && args[0].isInt32() && args[0].toInt32() >= 0) count = args[0].toInt32(); res.set(NewDenseUnallocatedArray(cx, count, nullptr, TenuredObject)); if (!res) diff --git a/netwerk/cache2/CacheIOThread.cpp b/netwerk/cache2/CacheIOThread.cpp index 0003f4f38b5..42c11998ae4 100644 --- a/netwerk/cache2/CacheIOThread.cpp +++ b/netwerk/cache2/CacheIOThread.cpp @@ -122,8 +122,6 @@ void CacheIOThread::ThreadFunc() lock.NotifyAll(); - static PRIntervalTime const waitTime = PR_MillisecondsToInterval(5000); - do { loopStart: // Reset the lowest level now, so that we can detect a new event on @@ -160,14 +158,17 @@ loopStart: } if (EventsPending()) - goto loopStart; + continue; - lock.Wait(waitTime); + if (mShutdown) + break; + + lock.Wait(PR_INTERVAL_NO_TIMEOUT); if (EventsPending()) - goto loopStart; + continue; - } while (!mShutdown); + } while (true); MOZ_ASSERT(!EventsPending()); } // lock