diff options
Diffstat (limited to 'dom')
24 files changed, 65 insertions, 152 deletions
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index a34752554..107daaede 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -9341,62 +9341,6 @@ nsContentUtils::SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible) } } -/* static */ void -nsContentUtils::GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl) -{ - MOZ_ASSERT(aDocShell); - - // Simulate receiver context for web platform test - if (Preferences::GetBool("dom.presentation.testing.simulate-receiver")) { - nsCOMPtr<nsIDocument> doc; - - nsCOMPtr<nsPIDOMWindowOuter> docShellWin = - do_QueryInterface(aDocShell->GetScriptGlobalObject()); - if (docShellWin) { - doc = docShellWin->GetExtantDoc(); - } - - if (NS_WARN_IF(!doc)) { - return; - } - - nsCOMPtr<nsIURI> uri = doc->GetDocumentURI(); - if (NS_WARN_IF(!uri)) { - return; - } - - nsAutoCString uriStr; - uri->GetSpec(uriStr); - aPresentationUrl = NS_ConvertUTF8toUTF16(uriStr); - return; - } - - if (XRE_IsContentProcess()) { - nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot; - aDocShell->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot)); - nsCOMPtr<nsIDocShellTreeItem> root; - aDocShell->GetRootTreeItem(getter_AddRefs(root)); - if (sameTypeRoot.get() == root.get()) { - // presentation URL is stored in TabChild for the top most - // <iframe mozbrowser> in content process. - TabChild* tabChild = TabChild::GetFrom(aDocShell); - if (tabChild) { - aPresentationUrl = tabChild->PresentationURL(); - } - return; - } - } - - nsCOMPtr<nsILoadContext> loadContext(do_QueryInterface(aDocShell)); - nsCOMPtr<nsIDOMElement> topFrameElement; - loadContext->GetTopFrameElement(getter_AddRefs(topFrameElement)); - if (!topFrameElement) { - return; - } - - topFrameElement->GetAttribute(NS_LITERAL_STRING("mozpresentation"), aPresentationUrl); -} - /* static */ nsIDocShell* nsContentUtils::GetDocShellForEventTarget(EventTarget* aTarget) { diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h index e0c023fff..83ee41740 100644 --- a/dom/base/nsContentUtils.h +++ b/dom/base/nsContentUtils.h @@ -2680,12 +2680,6 @@ public: static void SetScrollbarsVisibility(nsIDocShell* aDocShell, bool aVisible); /* - * Return the associated presentation URL of the presented content. - * Will return empty string if the docshell is not in a presented content. - */ - static void GetPresentationURL(nsIDocShell* aDocShell, nsAString& aPresentationUrl); - - /* * Try to find the docshell corresponding to the given event target. */ static nsIDocShell* GetDocShellForEventTarget(mozilla::dom::EventTarget* aTarget); diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 79c889596..b4397d063 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -3102,14 +3102,6 @@ nsFrameLoader::ApplySandboxFlags(uint32_t sandboxFlags) // The child can only add restrictions, never remove them. sandboxFlags |= parentSandboxFlags; - // If this frame is a receiving browsing context, we should add - // sandboxed auxiliary navigation flag to sandboxFlags. See - // https://w3c.github.io/presentation-api/#creating-a-receiving-browsing-context - nsAutoString presentationURL; - nsContentUtils::GetPresentationURL(mDocShell, presentationURL); - if (!presentationURL.IsEmpty()) { - sandboxFlags |= SANDBOXED_AUXILIARY_NAVIGATION; - } mDocShell->SetSandboxFlags(sandboxFlags); } } @@ -3427,11 +3419,6 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext, rv = PopulateUserContextIdFromAttribute(attrs); NS_ENSURE_SUCCESS(rv, rv); - nsAutoString presentationURLStr; - mOwnerContent->GetAttr(kNameSpaceID_None, - nsGkAtoms::mozpresentation, - presentationURLStr); - nsCOMPtr<nsIDocShell> docShell = mOwnerContent->OwnerDoc()->GetDocShell(); nsCOMPtr<nsILoadContext> parentContext = do_QueryInterface(docShell); NS_ENSURE_STATE(parentContext); @@ -3459,8 +3446,7 @@ nsFrameLoader::GetNewTabContext(MutableTabContext* aTabContext, containingApp, showAccelerators, showFocusRings, - attrs, - presentationURLStr); + attrs); NS_ENSURE_STATE(tabContextUpdated); return NS_OK; diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index a1a0b15f9..5e08fdc20 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -1038,7 +1038,6 @@ GK_ATOM(predicate, "predicate") GK_ATOM(prefix, "prefix") GK_ATOM(preload, "preload") GK_ATOM(prerendered, "prerendered") -GK_ATOM(mozpresentation, "mozpresentation") GK_ATOM(preserve, "preserve") GK_ATOM(preserveSpace, "preserve-space") GK_ATOM(preventdefault, "preventdefault") diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp index e4b145d46..62de20763 100644 --- a/dom/canvas/ImageBitmap.cpp +++ b/dom/canvas/ImageBitmap.cpp @@ -930,7 +930,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData, const Maybe<IntRect>& aCropRect, ErrorResult& aRv) { // Copy data into SourceSurface. - dom::Uint8ClampedArray array; + RootedTypedArray<Uint8ClampedArray> array(RootingCx()); DebugOnly<bool> inited = array.Init(aImageData.GetDataObject()); MOZ_ASSERT(inited); @@ -952,13 +952,17 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData, // Create and Crop the raw data into a layers::Image RefPtr<layers::Image> data; + + // The data could move during a GC; copy it out into a local buffer. + uint8_t* fixedData = array.Data(); + if (NS_IsMainThread()) { data = CreateImageFromRawData(imageSize, imageStride, FORMAT, - array.Data(), dataLength, + fixedData, dataLength, aCropRect); } else { RefPtr<CreateImageFromRawDataInMainThreadSyncTask> task - = new CreateImageFromRawDataInMainThreadSyncTask(array.Data(), + = new CreateImageFromRawDataInMainThreadSyncTask(fixedData, dataLength, imageStride, FORMAT, diff --git a/dom/html/HTMLMenuElement.cpp b/dom/html/HTMLMenuElement.cpp index 6c096084a..a099a5289 100644 --- a/dom/html/HTMLMenuElement.cpp +++ b/dom/html/HTMLMenuElement.cpp @@ -137,9 +137,9 @@ HTMLMenuElement::ParseAttribute(int32_t aNamespaceID, const nsAString& aValue, nsAttrValue& aResult) { - if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type) { - bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable, - false); + if (aNamespaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::type && + Preferences::GetBool("dom.menuitem.enabled")) { + bool success = aResult.ParseEnumValue(aValue, kMenuTypeTable, false); if (success) { mType = aResult.GetEnumValue(); } else { diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index 5c5cf8d76..6cf4eb40c 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -7,12 +7,22 @@ #include "mozilla/BasicEvents.h" #include "mozilla/EventDispatcher.h" +#include "mozilla/Preferences.h" #include "mozilla/dom/HTMLMenuItemElementBinding.h" +#include "mozilla/dom/HTMLUnknownElement.h" #include "nsAttrValueInlines.h" #include "nsContentUtils.h" - -NS_IMPL_NS_NEW_HTML_ELEMENT_CHECK_PARSER(MenuItem) +nsGenericHTMLElement* +NS_NewHTMLMenuItemElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo, + mozilla::dom::FromParser aFromParser) { + RefPtr<mozilla::dom::NodeInfo> nodeInfo(aNodeInfo); + if (mozilla::Preferences::GetBool("dom.menuitem.enabled")) { + return new mozilla::dom::HTMLMenuItemElement(nodeInfo.forget(), aFromParser); + } else { + return new mozilla::dom::HTMLUnknownElement(nodeInfo.forget()); + } +} namespace mozilla { namespace dom { diff --git a/dom/html/test/browser_content_contextmenu_userinput.js b/dom/html/test/browser_content_contextmenu_userinput.js index 7d0387715..845ba718e 100644 --- a/dom/html/test/browser_content_contextmenu_userinput.js +++ b/dom/html/test/browser_content_contextmenu_userinput.js @@ -4,6 +4,9 @@ const kPage = "http://example.org/browser/" + "dom/html/test/file_content_contextmenu.html"; add_task(function* () { + yield SpecialPowers.pushPrefEnv({ + set: [["dom.menuitem.enabled", true]], + }); yield BrowserTestUtils.withNewTab({ gBrowser, url: kPage diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index 5c9c66e61..dcbb73840 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -1,4 +1,6 @@ [DEFAULT] +prefs = + dom.menuitem.enabled=true # only for test_bug617528.html support-files = 347174transform.xsl 347174transformable.xml diff --git a/dom/ipc/PTabContext.ipdlh b/dom/ipc/PTabContext.ipdlh index 72cd90e2a..62d6ec0f3 100644 --- a/dom/ipc/PTabContext.ipdlh +++ b/dom/ipc/PTabContext.ipdlh @@ -48,11 +48,6 @@ struct FrameIPCTabContext // Whether this TabContext should work in prerender mode. bool isPrerendered; - // The requested presentation URL. - // This value would be empty if the TabContext isn't created for - // presented content. - nsString presentationURL; - // Keyboard indicator state inherited from the parent. UIStateChangeType showAccelerators; UIStateChangeType showFocusRings; diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 182aa628b..caae91fa5 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -770,11 +770,6 @@ TabChild::NotifyTabContextUpdated(bool aIsPreallocated) if (aIsPreallocated) { nsDocShell::Cast(docShell)->SetOriginAttributes(OriginAttributesRef()); } - - // Set SANDBOXED_AUXILIARY_NAVIGATION flag if this is a receiver page. - if (!PresentationURL().IsEmpty()) { - docShell->SetSandboxFlags(SANDBOXED_AUXILIARY_NAVIGATION); - } } void diff --git a/dom/ipc/TabContext.cpp b/dom/ipc/TabContext.cpp index 66a279052..b313da0ff 100644 --- a/dom/ipc/TabContext.cpp +++ b/dom/ipc/TabContext.cpp @@ -190,12 +190,6 @@ TabContext::OriginAttributesRef() const return mOriginAttributes; } -const nsAString& -TabContext::PresentationURL() const -{ - return mPresentationURL; -} - UIStateChangeType TabContext::ShowAccelerators() const { @@ -215,8 +209,7 @@ TabContext::SetTabContext(bool aIsMozBrowserElement, mozIApplication* aAppFrameOwnerApp, UIStateChangeType aShowAccelerators, UIStateChangeType aShowFocusRings, - const DocShellOriginAttributes& aOriginAttributes, - const nsAString& aPresentationURL) + const DocShellOriginAttributes& aOriginAttributes) { NS_ENSURE_FALSE(mInitialized, false); @@ -248,7 +241,6 @@ TabContext::SetTabContext(bool aIsMozBrowserElement, mContainingAppId = containingAppId; mOwnApp = aOwnApp; mContainingApp = aAppFrameOwnerApp; - mPresentationURL = aPresentationURL; mShowAccelerators = aShowAccelerators; mShowFocusRings = aShowFocusRings; return true; @@ -261,7 +253,6 @@ TabContext::AsIPCTabContext() const mContainingAppId, mIsMozBrowserElement, mIsPrerendered, - mPresentationURL, mShowAccelerators, mShowFocusRings)); } @@ -285,7 +276,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams) bool isPrerendered = false; uint32_t containingAppId = NO_APP_ID; DocShellOriginAttributes originAttributes; - nsAutoString presentationURL; UIStateChangeType showAccelerators = UIStateChangeType_NoChange; UIStateChangeType showFocusRings = UIStateChangeType_NoChange; @@ -348,7 +338,6 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams) isMozBrowserElement = ipcContext.isMozBrowserElement(); isPrerendered = ipcContext.isPrerendered(); containingAppId = ipcContext.frameOwnerAppId(); - presentationURL = ipcContext.presentationURL(); showAccelerators = ipcContext.showAccelerators(); showFocusRings = ipcContext.showFocusRings(); originAttributes = ipcContext.originAttributes(); @@ -395,8 +384,7 @@ MaybeInvalidTabContext::MaybeInvalidTabContext(const IPCTabContext& aParams) containingApp, showAccelerators, showFocusRings, - originAttributes, - presentationURL); + originAttributes); if (!rv) { mInvalidReason = "Couldn't initialize TabContext."; } diff --git a/dom/ipc/TabContext.h b/dom/ipc/TabContext.h index 1507a0dc8..e0b6f0d96 100644 --- a/dom/ipc/TabContext.h +++ b/dom/ipc/TabContext.h @@ -125,12 +125,6 @@ public: */ const DocShellOriginAttributes& OriginAttributesRef() const; - /** - * Returns the presentation URL associated with the tab if this tab is - * created for presented content - */ - const nsAString& PresentationURL() const; - UIStateChangeType ShowAccelerators() const; UIStateChangeType ShowFocusRings() const; @@ -169,8 +163,7 @@ protected: mozIApplication* aAppFrameOwnerApp, UIStateChangeType aShowAccelerators, UIStateChangeType aShowFocusRings, - const DocShellOriginAttributes& aOriginAttributes, - const nsAString& aPresentationURL); + const DocShellOriginAttributes& aOriginAttributes); /** * Modify this TabContext to match the given TabContext. This is a special @@ -226,11 +219,6 @@ private: DocShellOriginAttributes mOriginAttributes; /** - * The requested presentation URL. - */ - nsString mPresentationURL; - - /** * Keyboard indicator state (focus rings, accelerators). */ UIStateChangeType mShowAccelerators; @@ -257,8 +245,7 @@ public: mozIApplication* aAppFrameOwnerApp, UIStateChangeType aShowAccelerators, UIStateChangeType aShowFocusRings, - const DocShellOriginAttributes& aOriginAttributes, - const nsAString& aPresentationURL = EmptyString()) + const DocShellOriginAttributes& aOriginAttributes) { return TabContext::SetTabContext(aIsMozBrowserElement, aIsPrerendered, @@ -266,8 +253,7 @@ public: aAppFrameOwnerApp, aShowAccelerators, aShowFocusRings, - aOriginAttributes, - aPresentationURL); + aOriginAttributes); } }; diff --git a/dom/media/webaudio/blink/ReverbInputBuffer.cpp b/dom/media/webaudio/blink/ReverbInputBuffer.cpp index 8221f8151..6b8e642d2 100644 --- a/dom/media/webaudio/blink/ReverbInputBuffer.cpp +++ b/dom/media/webaudio/blink/ReverbInputBuffer.cpp @@ -42,19 +42,20 @@ ReverbInputBuffer::ReverbInputBuffer(size_t length) void ReverbInputBuffer::write(const float* sourceP, size_t numberOfFrames) { - size_t bufferLength = m_buffer.Length(); - bool isCopySafe = m_writeIndex + numberOfFrames <= bufferLength; - MOZ_ASSERT(isCopySafe); - if (!isCopySafe) - return; + // m_writeIndex is atomic and checked by other threads, so only touch + // it at the start and end. + size_t index = m_writeIndex; + + size_t bufferLength = m_buffer.Length(); + size_t newIndex = index + numberOfFrames; - memcpy(m_buffer.Elements() + m_writeIndex, sourceP, sizeof(float) * numberOfFrames); + MOZ_RELEASE_ASSERT(newIndex <= bufferLength); - m_writeIndex += numberOfFrames; - MOZ_ASSERT(m_writeIndex <= bufferLength); + memcpy(m_buffer.Elements() + index, sourceP, sizeof(float) * numberOfFrames); - if (m_writeIndex >= bufferLength) - m_writeIndex = 0; + if (newIndex >= bufferLength) { + m_writeIndex = 0; + } } float* ReverbInputBuffer::directReadFrom(int* readIndex, size_t numberOfFrames) diff --git a/dom/media/webaudio/blink/ReverbInputBuffer.h b/dom/media/webaudio/blink/ReverbInputBuffer.h index 906021c0d..f51aa3091 100644 --- a/dom/media/webaudio/blink/ReverbInputBuffer.h +++ b/dom/media/webaudio/blink/ReverbInputBuffer.h @@ -30,6 +30,7 @@ #define ReverbInputBuffer_h #include "nsTArray.h" +#include "mozilla/Atomics.h" #include "mozilla/MemoryReporting.h" namespace WebCore { @@ -63,7 +64,7 @@ public: private: nsTArray<float> m_buffer; - size_t m_writeIndex; + mozilla::Atomic<size_t, mozilla::ReleaseAcquire> m_writeIndex; }; } // namespace WebCore diff --git a/dom/messagechannel/MessagePortParent.h b/dom/messagechannel/MessagePortParent.h index 4cbebe29b..23195c3a7 100644 --- a/dom/messagechannel/MessagePortParent.h +++ b/dom/messagechannel/MessagePortParent.h @@ -5,6 +5,7 @@ #ifndef mozilla_dom_MessagePortParent_h #define mozilla_dom_MessagePortParent_h +#include "mozilla/WeakPtr.h" #include "mozilla/dom/PMessagePortParent.h" namespace mozilla { @@ -12,7 +13,8 @@ namespace dom { class MessagePortService; -class MessagePortParent final : public PMessagePortParent +class MessagePortParent final : public PMessagePortParent, + public SupportsWeakPtr<MessagePortParent> { public: explicit MessagePortParent(const nsID& aUUID); @@ -40,6 +42,8 @@ public: const nsID& aDestinationUUID, const uint32_t& aSequenceID); + MOZ_DECLARE_WEAKREFERENCE_TYPENAME(MessagePortParent) + private: virtual bool RecvPostMessages(nsTArray<MessagePortMessage>&& aMessages) override; diff --git a/dom/messagechannel/MessagePortService.cpp b/dom/messagechannel/MessagePortService.cpp index c76d9382b..85d0d42e9 100644 --- a/dom/messagechannel/MessagePortService.cpp +++ b/dom/messagechannel/MessagePortService.cpp @@ -9,6 +9,7 @@ #include "mozilla/ipc/BackgroundParent.h" #include "mozilla/StaticPtr.h" #include "mozilla/Unused.h" +#include "mozilla/WeakPtr.h" #include "nsTArray.h" using mozilla::ipc::AssertIsOnBackgroundThread; @@ -59,7 +60,7 @@ public: { uint32_t mSequenceID; // MessagePortParent keeps the service alive, and we don't want a cycle. - MessagePortParent* mParent; + WeakPtr<MessagePortParent> mParent; }; FallibleTArray<NextParent> mNextParents; @@ -275,9 +276,13 @@ MessagePortService::CloseAll(const nsID& aUUID, bool aForced) data->mParent->Close(); } - for (const MessagePortServiceData::NextParent& parent : data->mNextParents) { - parent.mParent->CloseAndDelete(); + for (const MessagePortServiceData::NextParent& nextParent : data->mNextParents) { + MessagePortParent* const parent = nextParent.mParent; + if (parent) { + parent->CloseAndDelete(); + } } + data->mNextParents.Clear(); nsID destinationUUID = data->mDestinationUUID; diff --git a/dom/tests/mochitest/general/test_interfaces.html b/dom/tests/mochitest/general/test_interfaces.html index eb09f5962..5eb47d101 100644 --- a/dom/tests/mochitest/general/test_interfaces.html +++ b/dom/tests/mochitest/general/test_interfaces.html @@ -497,8 +497,6 @@ var interfaceNamesInGlobalScope = // IMPORTANT: Do not change this list without review from a DOM peer! "HTMLMenuElement", // IMPORTANT: Do not change this list without review from a DOM peer! - "HTMLMenuItemElement", -// IMPORTANT: Do not change this list without review from a DOM peer! "HTMLMetaElement", // IMPORTANT: Do not change this list without review from a DOM peer! "HTMLMeterElement", diff --git a/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js b/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js index 0b04971e3..c3d9a241d 100644 --- a/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js +++ b/dom/tests/mochitest/webcomponents/htmlconstructor_builtin_tests.js @@ -71,7 +71,6 @@ ['map', 'Map'], ['mark', ''], ['menu', 'Menu'], - ['menuitem', 'MenuItem'], ['meta', 'Meta'], ['meter', 'Meter'], ['nav', ''], diff --git a/dom/webidl/EventHandler.webidl b/dom/webidl/EventHandler.webidl index 484a8e95c..e7dc4931b 100644 --- a/dom/webidl/EventHandler.webidl +++ b/dom/webidl/EventHandler.webidl @@ -82,6 +82,7 @@ interface GlobalEventHandlers { attribute EventHandler onseeked; attribute EventHandler onseeking; attribute EventHandler onselect; + [Pref="dom.menuitem.enabled"] attribute EventHandler onshow; //(Not implemented)attribute EventHandler onsort; attribute EventHandler onstalled; diff --git a/dom/webidl/HTMLElement.webidl b/dom/webidl/HTMLElement.webidl index 815f4a3bd..cd1fd7d6a 100644 --- a/dom/webidl/HTMLElement.webidl +++ b/dom/webidl/HTMLElement.webidl @@ -49,10 +49,8 @@ interface HTMLElement : Element { attribute DOMString contentEditable; [Pure] readonly attribute boolean isContentEditable; - [Pure] + [Pure, Pref="dom.menuitem.enabled"] readonly attribute HTMLMenuElement? contextMenu; - //[SetterThrows] - // attribute HTMLMenuElement? contextMenu; [CEReactions, SetterThrows, Pure] attribute boolean spellcheck; diff --git a/dom/webidl/HTMLMenuElement.webidl b/dom/webidl/HTMLMenuElement.webidl index 1194226c5..dc9a78ae8 100644 --- a/dom/webidl/HTMLMenuElement.webidl +++ b/dom/webidl/HTMLMenuElement.webidl @@ -17,9 +17,9 @@ interface MenuBuilder; // http://www.whatwg.org/specs/web-apps/current-work/#the-menu-element [HTMLConstructor] interface HTMLMenuElement : HTMLElement { - [CEReactions, SetterThrows] + [CEReactions, SetterThrows, Pref="dom.menuitem.enabled"] attribute DOMString type; - [CEReactions, SetterThrows] + [CEReactions, SetterThrows, Pref="dom.menuitem.enabled"] attribute DOMString label; }; diff --git a/dom/webidl/HTMLMenuItemElement.webidl b/dom/webidl/HTMLMenuItemElement.webidl index f09104501..6005bd7d2 100644 --- a/dom/webidl/HTMLMenuItemElement.webidl +++ b/dom/webidl/HTMLMenuItemElement.webidl @@ -12,7 +12,7 @@ */ // http://www.whatwg.org/specs/web-apps/current-work/#the-menuitem-element -[HTMLConstructor] +[HTMLConstructor, Pref="dom.menuitem.enabled"] interface HTMLMenuItemElement : HTMLElement { [CEReactions, SetterThrows] attribute DOMString type; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 860bf8468..1f8b3b70c 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -6392,7 +6392,7 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking, if (aShrinking || aCollectChildren) { JS::PrepareForFullGC(aCx); - if (aShrinking) { + if (aShrinking && mSyncLoopStack.IsEmpty()) { JS::GCForReason(aCx, GC_SHRINK, JS::gcreason::DOM_WORKER); if (!aCollectChildren) { |