diff --git a/CLOBBER b/CLOBBER index 42ce93bf5215..9ce28bea68ad 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,4 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Bug 1004726 requires a clobber for B2G Emulator builds +Bug 994964 apparently requires a clobber, unclear why diff --git a/accessible/src/base/Logging.cpp b/accessible/src/base/Logging.cpp index 249beace3a33..98a9456adc44 100644 --- a/accessible/src/base/Logging.cpp +++ b/accessible/src/base/Logging.cpp @@ -408,8 +408,7 @@ logging::DocLoad(const char* aMsg, nsIWebProgress* aWebProgress, LogDocInfo(documentNode, document); - nsCOMPtr webNav(do_GetInterface(DOMWindow)); - nsCOMPtr docShell(do_QueryInterface(webNav)); + nsCOMPtr docShell = window->GetDocShell(); printf("\n "); LogShellLoadType(docShell); printf("\n"); diff --git a/accessible/src/jsat/Utils.jsm b/accessible/src/jsat/Utils.jsm index 59775132b797..65f81877d6bf 100644 --- a/accessible/src/jsat/Utils.jsm +++ b/accessible/src/jsat/Utils.jsm @@ -151,8 +151,19 @@ this.Utils = { get AllMessageManagers() { let messageManagers = []; - for (let i = 0; i < this.win.messageManager.childCount; i++) - messageManagers.push(this.win.messageManager.getChildAt(i)); + function collectLeafMessageManagers(mm) { + for (let i = 0; i < mm.childCount; i++) { + let childMM = mm.getChildAt(i); + + if ("sendAsyncMessage" in childMM) { + messageManagers.push(childMM); + } else { + collectLeafMessageManagers(childMM); + } + } + } + + collectLeafMessageManagers(this.win.messageManager); let document = this.CurrentContentDoc; diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index e8624958d1f5..a82c4721db5e 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -946,6 +946,11 @@ pref("apz.enlarge_displayport_when_clipped", true); pref("apz.axis_lock_mode", 2); pref("apz.subframe.enabled", true); +// Overscroll-related settings +pref("apz.overscroll.enabled", false); +pref("apz.overscroll.snap_back_accel", "0.003"); +pref("apz.overscroll.snap_back_init_vel", "1"); + // This preference allows FirefoxOS apps (and content, I think) to force // the use of software (instead of hardware accelerated) 2D canvases by // creating a context like this: diff --git a/b2g/chrome/content/settings.js b/b2g/chrome/content/settings.js index 986563f51eb2..c0eee1993138 100644 --- a/b2g/chrome/content/settings.js +++ b/b2g/chrome/content/settings.js @@ -645,6 +645,7 @@ let settingsToObserve = { prefName: 'dom.browser_frames.useAsyncPanZoom', defaultValue: false }, + 'apz.overscroll.enabled': false, 'debug.fps.enabled': { prefName: 'layers.acceleration.draw-fps', defaultValue: false diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc index 07177c4bffeb..36cbd435be77 100644 --- a/browser/base/content/browser-sets.inc +++ b/browser/base/content/browser-sets.inc @@ -425,8 +425,8 @@ #ifdef XP_MACOSX -#endif -#ifdef XP_UNIX + +#elifdef XP_UNIX #endif diff --git a/browser/components/shell/src/nsWindowsShellService.cpp b/browser/components/shell/src/nsWindowsShellService.cpp index d3bb673cb68c..edbba2ddc8f0 100644 --- a/browser/components/shell/src/nsWindowsShellService.cpp +++ b/browser/components/shell/src/nsWindowsShellService.cpp @@ -915,24 +915,24 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement, nsAutoString style; switch (aPosition) { case BACKGROUND_TILE: - style.AssignLiteral("0"); - tile.AssignLiteral("1"); + style.Assign('0'); + tile.Assign('1'); break; case BACKGROUND_CENTER: - style.AssignLiteral("0"); - tile.AssignLiteral("0"); + style.Assign('0'); + tile.Assign('0'); break; case BACKGROUND_STRETCH: - style.AssignLiteral("2"); - tile.AssignLiteral("0"); + style.Assign('2'); + tile.Assign('0'); break; case BACKGROUND_FILL: style.AssignLiteral("10"); - tile.AssignLiteral("0"); + tile.Assign('0'); break; case BACKGROUND_FIT: - style.AssignLiteral("6"); - tile.AssignLiteral("0"); + style.Assign('6'); + tile.Assign('0'); break; } @@ -990,7 +990,7 @@ nsWindowsShellService::OpenApplication(int32_t aApplication) ::RegCloseKey(theKey); // Find the "open" command - application.AppendLiteral("\\"); + application.Append('\\'); application.Append(buf); application.AppendLiteral("\\shell\\open\\command"); diff --git a/content/base/src/Element.cpp b/content/base/src/Element.cpp index 724146d59098..707419957de6 100644 --- a/content/base/src/Element.cpp +++ b/content/base/src/Element.cpp @@ -2262,7 +2262,7 @@ Element::DescribeAttribute(uint32_t index, nsAString& aOutDescription) const value.Insert(char16_t('\\'), uint32_t(i)); } aOutDescription.Append(value); - aOutDescription.AppendLiteral("\""); + aOutDescription.Append('"'); } #ifdef DEBUG diff --git a/content/base/src/WebSocket.cpp b/content/base/src/WebSocket.cpp index 9ac2c1649b5e..7124bb2edfd8 100644 --- a/content/base/src/WebSocket.cpp +++ b/content/base/src/WebSocket.cpp @@ -992,7 +992,7 @@ WebSocket::ParseURL(const nsString& aURL) nsAutoCString filePath; rv = parsedURL->GetFilePath(filePath); if (filePath.IsEmpty()) { - filePath.AssignLiteral("/"); + filePath.Assign('/'); } NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_SYNTAX_ERR); diff --git a/content/base/src/nsCCUncollectableMarker.cpp b/content/base/src/nsCCUncollectableMarker.cpp index b677f4585a56..dac8dd961e05 100644 --- a/content/base/src/nsCCUncollectableMarker.cpp +++ b/content/base/src/nsCCUncollectableMarker.cpp @@ -93,6 +93,56 @@ MarkUserDataHandler(void* aNode, nsIAtom* aKey, void* aValue, void* aData) } } +static void +MarkChildMessageManagers(nsIMessageBroadcaster* aMM) +{ + aMM->MarkForCC(); + + uint32_t tabChildCount = 0; + aMM->GetChildCount(&tabChildCount); + for (uint32_t j = 0; j < tabChildCount; ++j) { + nsCOMPtr childMM; + aMM->GetChildAt(j, getter_AddRefs(childMM)); + if (!childMM) { + continue; + } + + nsCOMPtr strongNonLeafMM = do_QueryInterface(childMM); + nsIMessageBroadcaster* nonLeafMM = strongNonLeafMM; + + nsCOMPtr strongTabMM = do_QueryInterface(childMM); + nsIMessageSender* tabMM = strongTabMM; + + strongNonLeafMM = nullptr; + strongTabMM = nullptr; + childMM = nullptr; + + if (nonLeafMM) { + MarkChildMessageManagers(nonLeafMM); + continue; + } + + tabMM->MarkForCC(); + + //XXX hack warning, but works, since we know that + // callback is frameloader. + mozilla::dom::ipc::MessageManagerCallback* cb = + static_cast(tabMM)->GetCallback(); + if (cb) { + nsFrameLoader* fl = static_cast(cb); + EventTarget* et = fl->GetTabChildGlobalAsEventTarget(); + if (!et) { + continue; + } + static_cast(et)->MarkForCC(); + EventListenerManager* elm = et->GetExistingListenerManager(); + if (elm) { + elm->MarkForCC(); + } + } + } +} + static void MarkMessageManagers() { @@ -107,52 +157,8 @@ MarkMessageManagers() } nsIMessageBroadcaster* globalMM = strongGlobalMM; strongGlobalMM = nullptr; + MarkChildMessageManagers(globalMM); - globalMM->MarkForCC(); - uint32_t childCount = 0; - globalMM->GetChildCount(&childCount); - for (uint32_t i = 0; i < childCount; ++i) { - nsCOMPtr childMM; - globalMM->GetChildAt(i, getter_AddRefs(childMM)); - if (!childMM) { - continue; - } - nsCOMPtr strongWindowMM = do_QueryInterface(childMM); - nsIMessageBroadcaster* windowMM = strongWindowMM; - childMM = nullptr; - strongWindowMM = nullptr; - windowMM->MarkForCC(); - uint32_t tabChildCount = 0; - windowMM->GetChildCount(&tabChildCount); - for (uint32_t j = 0; j < tabChildCount; ++j) { - nsCOMPtr childMM; - windowMM->GetChildAt(j, getter_AddRefs(childMM)); - if (!childMM) { - continue; - } - nsCOMPtr strongTabMM = do_QueryInterface(childMM); - nsIMessageSender* tabMM = strongTabMM; - childMM = nullptr; - strongTabMM = nullptr; - tabMM->MarkForCC(); - //XXX hack warning, but works, since we know that - // callback is frameloader. - mozilla::dom::ipc::MessageManagerCallback* cb = - static_cast(tabMM)->GetCallback(); - if (cb) { - nsFrameLoader* fl = static_cast(cb); - EventTarget* et = fl->GetTabChildGlobalAsEventTarget(); - if (!et) { - continue; - } - static_cast(et)->MarkForCC(); - EventListenerManager* elm = et->GetExistingListenerManager(); - if (elm) { - elm->MarkForCC(); - } - } - } - } if (nsFrameMessageManager::sParentProcessManager) { nsFrameMessageManager::sParentProcessManager->MarkForCC(); uint32_t childCount = 0; diff --git a/content/base/src/nsContentAreaDragDrop.cpp b/content/base/src/nsContentAreaDragDrop.cpp index 259367d146c1..1e8719f4d7dd 100644 --- a/content/base/src/nsContentAreaDragDrop.cpp +++ b/content/base/src/nsContentAreaDragDrop.cpp @@ -406,8 +406,7 @@ DragDataProducer::Produce(DataTransfer* aDataTransfer, // if set, serialize the content under this node nsCOMPtr nodeToSerialize; - nsCOMPtr webnav = do_GetInterface(mWindow); - nsCOMPtr dsti = do_QueryInterface(webnav); + nsCOMPtr dsti = mWindow->GetDocShell(); const bool isChromeShell = dsti && dsti->ItemType() == nsIDocShellTreeItem::typeChrome; diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index c701c7d21f6f..e0233caa8da4 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -5053,8 +5053,12 @@ nsContentUtils::CheckForSubFrameDrop(nsIDragSession* aDragSession, } nsIDocument* targetDoc = target->OwnerDoc(); - nsCOMPtr twebnav = do_GetInterface(targetDoc->GetWindow()); - nsCOMPtr tdsti = do_QueryInterface(twebnav); + nsPIDOMWindow* targetWin = targetDoc->GetWindow(); + if (!targetWin) { + return true; + } + + nsCOMPtr tdsti = targetWin->GetDocShell(); if (!tdsti) { return true; } @@ -5896,7 +5900,7 @@ nsContentUtils::FlushLayoutForTree(nsIDOMWindow* aWindow) for (; i < i_end; ++i) { nsCOMPtr item; docShell->GetChildAt(i, getter_AddRefs(item)); - nsCOMPtr win = do_GetInterface(item); + nsCOMPtr win = item->GetWindow(); if (win) { FlushLayoutForTree(win); } diff --git a/content/base/src/nsCopySupport.cpp b/content/base/src/nsCopySupport.cpp index cfa9d1dbbfa2..e0f4dfee37be 100644 --- a/content/base/src/nsCopySupport.cpp +++ b/content/base/src/nsCopySupport.cpp @@ -637,7 +637,7 @@ nsCopySupport::FireClipboardEvent(int32_t aType, int32_t aClipboardType, nsIPres if (!nsContentUtils::IsSafeToRunScript()) return false; - nsCOMPtr docShell = do_GetInterface(piWindow); + nsCOMPtr docShell = piWindow->GetDocShell(); const bool chromeShell = docShell && docShell->ItemType() == nsIDocShellTreeItem::typeChrome; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index bcbacf773dfb..bb7f9de68257 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -2970,7 +2970,7 @@ nsIDocument::GetLastModified(nsAString& aLastModified) const } else { // If we for whatever reason failed to find the last modified time // (or even the current time), fall back to what NS4.x returned. - aLastModified.AssignLiteral("01/01/1970 00:00:00"); + aLastModified.AssignLiteral(MOZ_UTF16("01/01/1970 00:00:00")); } } @@ -4572,10 +4572,10 @@ nsDocument::GetWindowInternal() const // the docshell, the outer window might be still obtainable from the it. nsCOMPtr win; if (mRemovedFromDocShell) { - nsCOMPtr requestor(mDocumentContainer); - if (requestor) { - // The docshell returns the outer window we are done. - win = do_GetInterface(requestor); + // The docshell returns the outer window we are done. + nsCOMPtr kungfuDeathGrip(mDocumentContainer); + if (mDocumentContainer) { + win = mDocumentContainer->GetWindow(); } } else { win = do_QueryInterface(mScriptGlobalObject); @@ -7362,8 +7362,7 @@ nsIDocument::AdoptNode(nsINode& aAdoptedNode, ErrorResult& rv) do { nsPIDOMWindow *win = doc->GetWindow(); if (win) { - nsCOMPtr node = - do_QueryInterface(win->GetFrameElementInternal()); + nsCOMPtr node = win->GetFrameElementInternal(); if (node && nsContentUtils::ContentIsDescendantOf(node, adoptedNode)) { rv.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR); @@ -9173,16 +9172,16 @@ nsIDocument::GetReadyState(nsAString& aReadyState) const { switch(mReadyState) { case READYSTATE_LOADING : - aReadyState.AssignLiteral("loading"); + aReadyState.AssignLiteral(MOZ_UTF16("loading")); break; case READYSTATE_INTERACTIVE : - aReadyState.AssignLiteral("interactive"); + aReadyState.AssignLiteral(MOZ_UTF16("interactive")); break; case READYSTATE_COMPLETE : - aReadyState.AssignLiteral("complete"); + aReadyState.AssignLiteral(MOZ_UTF16("complete")); break; default: - aReadyState.AssignLiteral("uninitialized"); + aReadyState.AssignLiteral(MOZ_UTF16("uninitialized")); } } @@ -10986,7 +10985,7 @@ IsInActiveTab(nsIDocument* aDoc) if (!rootItem) { return false; } - nsCOMPtr rootWin = do_GetInterface(rootItem); + nsCOMPtr rootWin = rootItem->GetWindow(); if (!rootWin) { return false; } diff --git a/content/base/src/nsFrameLoader.cpp b/content/base/src/nsFrameLoader.cpp index 64da57c2e147..224bdd45411b 100644 --- a/content/base/src/nsFrameLoader.cpp +++ b/content/base/src/nsFrameLoader.cpp @@ -653,9 +653,9 @@ static void FirePageHideEvent(nsIDocShellTreeItem* aItem, EventTarget* aChromeEventHandler) { - nsCOMPtr internalDoc = do_GetInterface(aItem); - NS_ASSERTION(internalDoc, "What happened here?"); - internalDoc->OnPageHide(true, aChromeEventHandler); + nsCOMPtr doc = aItem->GetDocument(); + NS_ASSERTION(doc, "What happened here?"); + doc->OnPageHide(true, aChromeEventHandler); int32_t childCount = 0; aItem->GetChildCount(&childCount); @@ -695,10 +695,10 @@ FirePageShowEvent(nsIDocShellTreeItem* aItem, } } - nsCOMPtr internalDoc = do_GetInterface(aItem); - NS_ASSERTION(internalDoc, "What happened here?"); - if (internalDoc->IsShowing() == aFireIfShowing) { - internalDoc->OnPageShow(true, aChromeEventHandler); + nsCOMPtr doc = aItem->GetDocument(); + NS_ASSERTION(doc, "What happened here?"); + if (doc->IsShowing() == aFireIfShowing) { + doc->OnPageShow(true, aChromeEventHandler); } } @@ -1156,8 +1156,8 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther, return NS_ERROR_NOT_IMPLEMENTED; } - nsCOMPtr ourWindow = do_GetInterface(ourDocshell); - nsCOMPtr otherWindow = do_GetInterface(otherDocshell); + nsCOMPtr ourWindow = ourDocshell->GetWindow(); + nsCOMPtr otherWindow = otherDocshell->GetWindow(); nsCOMPtr ourFrameElement = ourWindow->GetFrameElementInternal(); @@ -1411,9 +1411,11 @@ nsFrameLoader::Destroy() } // Let our window know that we are gone - nsCOMPtr win_private(do_GetInterface(mDocShell)); - if (win_private) { - win_private->SetFrameElementInternal(nullptr); + if (mDocShell) { + nsCOMPtr win_private(mDocShell->GetWindow()); + if (win_private) { + win_private->SetFrameElementInternal(nullptr); + } } if ((mNeedsAsyncDestroy || !doc || @@ -1677,7 +1679,7 @@ nsFrameLoader::MaybeCreateDocShell() mDocShell->SetChromeEventHandler(chromeEventHandler); - // This is nasty, this code (the do_GetInterface(mDocShell) below) + // This is nasty, this code (the mDocShell->GetWindow() below) // *must* come *after* the above call to // mDocShell->SetChromeEventHandler() for the global window to get // the right chrome event handler. @@ -1686,7 +1688,7 @@ nsFrameLoader::MaybeCreateDocShell() nsCOMPtr frame_element = mOwnerContent; NS_ASSERTION(frame_element, "frame loader owner element not a DOM element!"); - nsCOMPtr win_private(do_GetInterface(mDocShell)); + nsCOMPtr win_private(mDocShell->GetWindow()); nsCOMPtr base_win(do_QueryInterface(mDocShell)); if (win_private) { win_private->SetFrameElementInternal(frame_element); @@ -1878,14 +1880,15 @@ nsFrameLoader::GetWindowDimensions(nsRect& aRect) return NS_ERROR_FAILURE; } - nsCOMPtr parentAsWebNav = - do_GetInterface(doc->GetWindow()); - - if (!parentAsWebNav) { + nsCOMPtr win = doc->GetWindow(); + if (!win) { return NS_ERROR_FAILURE; } - nsCOMPtr parentAsItem(do_QueryInterface(parentAsWebNav)); + nsCOMPtr parentAsItem(win->GetDocShell()); + if (!parentAsItem) { + return NS_ERROR_FAILURE; + } nsCOMPtr parentOwner; if (NS_FAILED(parentAsItem->GetTreeOwner(getter_AddRefs(parentOwner))) || @@ -2052,14 +2055,15 @@ nsFrameLoader::TryRemoteBrowser() return false; } - nsCOMPtr parentAsWebNav = - do_GetInterface(doc->GetWindow()); - - if (!parentAsWebNav) { + nsCOMPtr parentWin = doc->GetWindow(); + if (!parentWin) { return false; } - nsCOMPtr parentAsItem(do_QueryInterface(parentAsWebNav)); + nsCOMPtr parentAsItem(parentWin->GetDocShell()); + if (!parentAsItem) { + return false; + } //