Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
merge mozilla-inbound to mozilla-central a=merge
Browse files Browse the repository at this point in the history
  • Loading branch information
BavarianTomcat committed Oct 8, 2015
2 parents d3711e3 + 3502d91 commit 634dc48
Show file tree
Hide file tree
Showing 335 changed files with 6,964 additions and 6,167 deletions.
2 changes: 1 addition & 1 deletion CLOBBER
Original file line number Diff line number Diff line change
Expand Up @@ -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 1193206 - Building with Android support library 23.0.1
Bug 1212764 - Clobber needed for bug 957911
11 changes: 11 additions & 0 deletions accessible/atk/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,13 @@ UpdateAtkRelation(RelationType aType, Accessible* aAcc,
while ((tempAcc = rel.Next()))
targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));

if (aType == RelationType::EMBEDS && aAcc->IsRoot()) {
if (ProxyAccessible* proxyDoc =
aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
targets.AppendElement(GetWrapperFor(proxyDoc));
}
}

if (targets.Length()) {
atkRelation = atk_relation_new(targets.Elements(),
targets.Length(), aAtkType);
Expand Down Expand Up @@ -1121,6 +1128,10 @@ GetInterfacesForProxy(ProxyAccessible* aProxy, uint32_t aInterfaces)
interfaces |= 1 << MAI_INTERFACE_SELECTION;
}

if (aInterfaces & Interfaces::ACTION) {
interfaces |= 1 << MAI_INTERFACE_ACTION;
}

return interfaces;
}

Expand Down
33 changes: 21 additions & 12 deletions accessible/generic/DocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1364,14 +1364,15 @@ DocAccessible::ProcessInvalidationList()
continue;
}

if (!child->Parent()) {
Accessible* oldParent = child->Parent();
if (!oldParent) {
NS_ERROR("The accessible is in document but doesn't have a parent");
continue;
}
int32_t idxInParent = child->IndexInParent();

// XXX: update context flags
{
Accessible* oldParent = child->Parent();
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(oldParent);
nsRefPtr<AccMutationEvent> hideEvent =
new AccHideEvent(child, child->GetContent(), false);
Expand All @@ -1385,21 +1386,29 @@ DocAccessible::ProcessInvalidationList()
FireDelayedEvent(reorderEvent);
}

bool isReinserted = false;
{
AutoTreeMutation mut(owner);
owner->AppendChild(child);

nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(owner);
nsRefPtr<AccMutationEvent> showEvent =
new AccShowEvent(child, child->GetContent());
FireDelayedEvent(showEvent);
reorderEvent->AddSubMutationEvent(showEvent);
isReinserted = owner->AppendChild(child);
}

MaybeNotifyOfValueChange(owner);
FireDelayedEvent(reorderEvent);
Accessible* newParent = owner;
if (!isReinserted) {
AutoTreeMutation mut(oldParent);
oldParent->InsertChildAt(idxInParent, child);
newParent = oldParent;
}

child->SetRepositioned(true);
nsRefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(newParent);
nsRefPtr<AccMutationEvent> showEvent =
new AccShowEvent(child, child->GetContent());
FireDelayedEvent(showEvent);
reorderEvent->AddSubMutationEvent(showEvent);

MaybeNotifyOfValueChange(newParent);
FireDelayedEvent(reorderEvent);

child->SetRepositioned(isReinserted);
}

mARIAOwnsInvalidationList.Clear();
Expand Down
10 changes: 2 additions & 8 deletions accessible/generic/OuterDocAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,8 @@ OuterDocAccessible::RemoteChildDoc() const
if (!tab)
return nullptr;

// XXX Consider managing non top level remote documents with there parent
// document.
const nsTArray<PDocAccessibleParent*>& docs = tab->ManagedPDocAccessibleParent();
size_t docCount = docs.Length();
for (size_t i = 0; i < docCount; i++) {
auto doc = static_cast<DocAccessibleParent*>(docs[i]);
if (!doc->ParentDoc())
return doc;
if (DocAccessibleParent* doc = tab->GetTopLevelDocAccessible()) {
return doc;
}

MOZ_ASSERT(false, "no top level tab document?");
Expand Down
17 changes: 17 additions & 0 deletions accessible/generic/RootAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,3 +716,20 @@ RootAccessible::HandleTreeInvalidatedEvent(nsIDOMEvent* aEvent,
aAccessible->TreeViewInvalidated(startRow, endRow, startCol, endCol);
}
#endif

ProxyAccessible*
RootAccessible::GetPrimaryRemoteTopLevelContentDoc() const
{
nsCOMPtr<nsIDocShellTreeOwner> owner;
mDocumentNode->GetDocShell()->GetTreeOwner(getter_AddRefs(owner));
NS_ENSURE_TRUE(owner, nullptr);

nsCOMPtr<nsITabParent> tabParent;
owner->GetPrimaryTabParent(getter_AddRefs(tabParent));
if (!tabParent) {
return nullptr;
}

auto tab = static_cast<dom::TabParent*>(tabParent.get());
return tab->GetTopLevelDocAccessible();
}
5 changes: 5 additions & 0 deletions accessible/generic/RootAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class RootAccessible : public DocAccessibleWrap,
*/
virtual void DocumentActivated(DocAccessible* aDocument);

/**
* Return the primary remote top level document if any.
*/
ProxyAccessible* GetPrimaryRemoteTopLevelContentDoc() const;

protected:
virtual ~RootAccessible();

Expand Down
4 changes: 4 additions & 0 deletions accessible/ipc/DocAccessibleChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ InterfacesFor(Accessible* aAcc)
interfaces |= Interfaces::SELECTION;
}

if (aAcc->ActionCount()) {
interfaces |= Interfaces::ACTION;
}

return interfaces;
}

Expand Down
1 change: 1 addition & 0 deletions accessible/ipc/ProxyAccessible.h
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,7 @@ enum Interfaces
TABLECELL = 32,
DOCUMENT = 64,
SELECTION = 128,
ACTION = 256,
};

}
Expand Down
10 changes: 6 additions & 4 deletions accessible/windows/msaa/AccessibleWrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -952,11 +952,13 @@ AccessibleWrap::accLocation(
if (xpAccessible->IsDefunct())
return CO_E_OBJNOTCONNECTED;

// TODO make this work with proxies.
if (xpAccessible->IsProxy())
return E_NOTIMPL;
nsIntRect rect;
if (xpAccessible->IsProxy()) {
rect = xpAccessible->Proxy()->Bounds();
} else {
rect = xpAccessible->Bounds();
}

nsIntRect rect = xpAccessible->Bounds();
*pxLeft = rect.x;
*pyTop = rect.y;
*pcxWidth = rect.width;
Expand Down
5 changes: 5 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1825,6 +1825,11 @@ pref("ui.key.menuAccessKeyFocuses", true);
pref("media.eme.enabled", true);
pref("media.eme.apiVisible", true);

// If decoding-via-gmp is turned on for <video>, default to using
// Adobe's GMP for decoding.
pref("media.fragmented-mp4.gmp.aac", 2);
pref("media.fragmented-mp4.gmp.h264", 2);

// Whether we should run a test-pattern through EME GMPs before assuming they'll
// decode H.264.
pref("media.gmp.trial-create.enabled", true);
Expand Down
52 changes: 18 additions & 34 deletions browser/base/content/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4977,10 +4977,6 @@ nsBrowserAccess.prototype = {
isTabContentWindow: function (aWindow) {
return gBrowser.browsers.some(browser => browser.contentWindow == aWindow);
},

canClose() {
return CanCloseWindow();
},
}

function getTogglableToolbars() {
Expand Down Expand Up @@ -6446,26 +6442,6 @@ var IndexedDBPromptHelper = {
}
};

function CanCloseWindow()
{
// Avoid redundant calls to canClose from showing multiple
// PermitUnload dialogs.
if (window.skipNextCanClose) {
return true;
}

for (let browser of gBrowser.browsers) {
let {permitUnload, timedOut} = browser.permitUnload();
if (timedOut) {
return true;
}
if (!permitUnload) {
return false;
}
}
return true;
}

function WindowIsClosing()
{
if (TabView.isVisible()) {
Expand All @@ -6476,19 +6452,27 @@ function WindowIsClosing()
if (!closeWindow(false, warnAboutClosingWindow))
return false;

// In theory we should exit here and the Window's internal Close
// method should trigger canClose on nsBrowserAccess. However, by
// that point it's too late to be able to show a prompt for
// PermitUnload. So we do it here, when we still can.
if (CanCloseWindow()) {
// This flag ensures that the later canClose call does nothing.
// It's only needed to make tests pass, since they detect the
// prompt even when it's not actually shown.
window.skipNextCanClose = true;
// Bug 967873 - Proxy nsDocumentViewer::PermitUnload to the child process
if (gMultiProcessBrowser)
return true;

for (let browser of gBrowser.browsers) {
let ds = browser.docShell;
// Passing true to permitUnload indicates we plan on closing the window.
// This means that once unload is permitted, all further calls to
// permitUnload will be ignored. This avoids getting multiple prompts
// to unload the page.
if (ds.contentViewer && !ds.contentViewer.permitUnload(true)) {
// ... however, if the user aborts closing, we need to undo that,
// to ensure they get prompted again when we next try to close the window.
// We do this on the window's toplevel docshell instead of on the tab, so
// that all tabs we iterated before will get this reset.
window.getInterface(Ci.nsIDocShell).contentViewer.resetCloseWindow();
return false;
}
}

return false;
return true;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/browser.xul
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
accesskey="&bookmarkAllTabs.accesskey;"
command="Browser:BookmarkAllTabs"/>
<menuitem id="context_closeTabsToTheEnd" label="&closeTabsToTheEnd.label;" accesskey="&closeTabsToTheEnd.accesskey;"
oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab, {animate: true});"/>
oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab);"/>
<menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
<menuseparator/>
Expand Down
5 changes: 0 additions & 5 deletions browser/base/content/chatWindow.xul
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,6 @@ chatBrowserAccess.prototype = {
isTabContentWindow: function (aWindow) {
return this.contentWindow == aWindow;
},

canClose() {
let {BrowserUtils} = Cu.import("resource://gre/modules/BrowserUtils.jsm", {});
return BrowserUtils.canCloseWindow(window);
},
};

</script>
Expand Down
27 changes: 19 additions & 8 deletions browser/base/content/sanitize.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
// -*- indent-tabs-mode: nil; js-indent-level: 4 -*-
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
Expand Down Expand Up @@ -567,17 +567,28 @@ Sanitizer.prototype = {
openWindows: {
privateStateForNewWindow: "non-private",
_canCloseWindow: function(aWindow) {
if (aWindow.CanCloseWindow()) {
// We already showed PermitUnload for the window, so let's
// make sure we don't do it again when we actually close the
// window.
aWindow.skipNextCanClose = true;
return true;
// Bug 967873 - Proxy nsDocumentViewer::PermitUnload to the child process
if (!aWindow.gMultiProcessBrowser) {
// Cargo-culted out of browser.js' WindowIsClosing because we don't care
// about TabView or the regular 'warn me before closing windows with N tabs'
// stuff here, and more importantly, we want to set aCallerClosesWindow to true
// when calling into permitUnload:
for (let browser of aWindow.gBrowser.browsers) {
let ds = browser.docShell;
// 'true' here means we will be closing the window soon, so please don't dispatch
// another onbeforeunload event when we do so. If unload is *not* permitted somewhere,
// we will reset the flag that this triggers everywhere so that we don't interfere
// with the browser after all:
if (ds.contentViewer && !ds.contentViewer.permitUnload(true)) {
return false;
}
}
}
return true;
},
_resetAllWindowClosures: function(aWindowList) {
for (let win of aWindowList) {
win.skipNextCanClose = false;
win.getInterface(Ci.nsIDocShell).contentViewer.resetCloseWindow();
}
},
clear: Task.async(function*() {
Expand Down
Loading

0 comments on commit 634dc48

Please sign in to comment.