Skip to content

Commit

Permalink
Merge: cyberfox 52.0b7 with cyberfox 52.0b6
Browse files Browse the repository at this point in the history
  • Loading branch information
InternalError503 committed Feb 28, 2017
1 parent 3f7c407 commit ad43916
Show file tree
Hide file tree
Showing 164 changed files with 6,305 additions and 3,630 deletions.
10 changes: 8 additions & 2 deletions accessible/generic/Accessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2141,8 +2141,14 @@ Accessible::RemoveChild(Accessible* aChild)
"Illicit children change");

int32_t index = static_cast<uint32_t>(aChild->mIndexInParent);
MOZ_ASSERT(mChildren.SafeElementAt(index) == aChild,
"A wrong child index");
if (mChildren.SafeElementAt(index) != aChild) {
MOZ_ASSERT_UNREACHABLE("A wrong child index");
index = mChildren.IndexOf(aChild);
if (index == -1) {
MOZ_ASSERT_UNREACHABLE("No child was found");
return false;
}
}

aChild->UnbindFromParent();
mChildren.RemoveElementAt(index);
Expand Down
28 changes: 6 additions & 22 deletions browser/app/blocklist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2143,16 +2143,12 @@
<versionRange maxVersion="13.0.0.302" minVersion="13.0.0.302" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="p1495" os="Linux">
<match exp="" name="name"/>
<match exp="libflashplayer\.so" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="24.0.0.186" minVersion="23.0.0.207" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="p1420" os="">
<match exp="" name="name"/>
<pluginItem blockID="p1420">
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="23.0.0.205" minVersion="23.0.0.185" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down Expand Up @@ -2206,9 +2202,7 @@
<versionRange maxVersion="*" minVersion="0"/>
</pluginItem>
<pluginItem blockID="p1419" os="Linux">
<match exp="" name="name"/>
<match exp="libflashplayer\.so" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="11.2.202.643" minVersion="11.2.202.637" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down Expand Up @@ -2465,10 +2459,8 @@
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="18.0.0.232" minVersion="18.0.0.204" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="p1274" os="">
<match exp="" name="name"/>
<pluginItem blockID="p1274">
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="22.0.0.211" minVersion="22.0.0.192" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down Expand Up @@ -2579,10 +2571,8 @@
</targetApplication>
</versionRange>
</pluginItem>
<pluginItem blockID="p1494" os="">
<match exp="" name="name"/>
<pluginItem blockID="p1494">
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="24.0.0.186" minVersion="23.0.0.207" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down Expand Up @@ -2650,10 +2640,8 @@
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="18.0.0.352" minVersion="18.0.0.343" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="p160" os="">
<match exp="" name="name"/>
<pluginItem blockID="p160">
<match exp="NPSWF32\.dll" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="10.2.9999" minVersion="0" severity="0" vulnerabilitystatus="1">
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
Expand Down Expand Up @@ -2821,10 +2809,8 @@
<pluginItem blockID="p28">
<match exp="NPFFAddOn.dll" name="filename"/>
</pluginItem>
<pluginItem blockID="p1421" os="Linux">
<match exp="" name="name"/>
<pluginItem blockID="p1421">
<match exp="libflashplayer\.so" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="23.0.0.207" minVersion="11.2.202.643" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down Expand Up @@ -3020,10 +3006,8 @@
<infoURL>https://get.adobe.com/reader</infoURL>
<versionRange maxVersion="15.006.30174" minVersion="15.006.30174" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
<pluginItem blockID="p1422" os="">
<match exp="" name="name"/>
<pluginItem blockID="p1422">
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
<match exp="" name="description"/>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
<versionRange maxVersion="23.0.0.207" minVersion="23.0.0.205" severity="0" vulnerabilitystatus="1"/>
</pluginItem>
Expand Down
3 changes: 3 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1501,6 +1501,9 @@ pref("browser.migrate.automigrate.enabled", false);
pref("browser.migrate.automigrate.daysToOfferUndo", 4);
pref("browser.migrate.automigrate.ui.enabled", true);

pref("browser.migrate.chrome.history.limit", 0);
pref("browser.migrate.chrome.history.maxAgeInDays", 0);

// Enable browser frames for use on desktop. Only exposed to chrome callers.
pref("dom.mozBrowserFramesEnabled", true);

Expand Down
41 changes: 23 additions & 18 deletions browser/base/content/aboutNetError.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
const event = new CustomEvent("AboutNetErrorResetPreferences", {bubbles:true});
document.dispatchEvent(event);
});
addAutofocus("prefResetButton", "beforeend");
}

function setupAdvancedButton(allowOverride) {
Expand Down Expand Up @@ -217,6 +218,7 @@
initPageCertError();
return;
}
addAutofocus("errorTryAgain");

document.body.className = "neterror";

Expand Down Expand Up @@ -344,6 +346,7 @@
document.dispatchEvent(event);
});

addAutofocus("openPortalLoginPageButton");
setupAdvancedButton(true);

addDomainErrorLinks();
Expand All @@ -362,6 +365,7 @@
host.textContent = document.location.hostname;
}

addAutofocus("returnButton");
setupAdvancedButton(true);

document.getElementById("learnMoreContainer").style.display = "block";
Expand Down Expand Up @@ -391,6 +395,22 @@
addDomainErrorLinks();
}

/* Only do autofocus if we're the toplevel frame; otherwise we
don't want to call attention to ourselves! The key part is
that autofocus happens on insertion into the tree, so we
can remove the button, add @autofocus, and reinsert the
button.
*/
function addAutofocus(buttonId, position = "afterbegin") {
if (window.top == window) {
var button = document.getElementById(buttonId);
var parent = button.parentNode;
button.remove();
button.setAttribute("autofocus", "true");
parent.insertAdjacentElement(position, button);
}
}

/* Try to preserve the links contained in the error description, like
the error code.
Expand Down Expand Up @@ -621,32 +641,17 @@
</div>

<div id="certErrorAndCaptivePortalButtonContainer" class="button-container">
<button id="returnButton" class="primary" autocomplete="off" autofocus="true">&returnToPreviousPage.label;</button>
<button id="openPortalLoginPageButton" class="primary" autocomplete="off" autofocus="true">&openPortalLoginPage.label;</button>
<button id="returnButton" class="primary" autocomplete="off">&returnToPreviousPage.label;</button>
<button id="openPortalLoginPageButton" class="primary" autocomplete="off">&openPortalLoginPage.label;</button>
<div class="button-spacer"></div>
<button id="advancedButton" autocomplete="off" autofocus="true">&advanced.label;</button>
<button id="advancedButton" autocomplete="off">&advanced.label;</button>
</div>
</div>

<div id="netErrorButtonContainer" class="button-container">
<button id="errorTryAgain" class="primary" autocomplete="off" onclick="retryThis(this);">&retry.label;</button>
</div>

<script>
// Only do autofocus if we're the toplevel frame; otherwise we
// don't want to call attention to ourselves! The key part is
// that autofocus happens on insertion into the tree, so we
// can remove the button, add @autofocus, and reinsert the
// button.
if (window.top == window) {
var button = document.getElementById("errorTryAgain");
var parent = button.parentNode;
button.remove();
button.setAttribute("autofocus", "true");
parent.appendChild(button);
}
</script>

<!-- UI for option to report certificate errors to Mozilla. Removed on
init for other error types .-->
<div id="certificateErrorReporting">
Expand Down
11 changes: 8 additions & 3 deletions browser/base/content/browser-fxaccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var gFxAccounts = {

_initialized: false,
_inCustomizationMode: false,
_cachedProfile: null,

get weave() {
delete this.weave;
Expand Down Expand Up @@ -124,9 +125,9 @@ var gFxAccounts = {
case "fxa-migration:state-changed":
this.onMigrationStateChanged(data, subject);
break;
case this.FxAccountsCommon.ONPROFILE_IMAGE_CHANGE_NOTIFICATION:
this.updateUI();
break;
case this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION:
this._cachedProfile = null;
// Fallthrough intended
default:
this.updateUI();
break;
Expand Down Expand Up @@ -301,6 +302,9 @@ var gFxAccounts = {
if (!userData || !userData.verified || !profileInfoEnabled) {
return null; // don't even try to grab the profile.
}
if (this._cachedProfile) {
return this._cachedProfile;
}
return fxAccounts.getSignedInUserProfile().catch(err => {
// Not fetching the profile is sad but the FxA logs will already have noise.
return null;
Expand All @@ -310,6 +314,7 @@ var gFxAccounts = {
return;
}
updateWithProfile(profile);
this._cachedProfile = profile; // Try to avoid fetching the profile on every UI update
}).catch(error => {
// This is most likely in tests, were we quickly log users in and out.
// The most likely scenario is a user logged out, so reflect that.
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/newtab/newTab.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div id="newtab-search-form">
<div id="newtab-search-icon"/>
<input type="text" name="q" value="" id="newtab-search-text"
aria-label="&contentSearchInput.label;" maxlength="256" dir="auto"/>
aria-label="&contentSearchInput.label;" maxlength="256"/>
<input id="newtab-search-submit" type="button"
title="&contentSearchSubmit.tooltip;"/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ add_task(function* checkCaptivePortalCertErrorUI() {
"Captive portal error page UI is visible.");

info("Clicking the Open Login Page button.");
doc.getElementById("openPortalLoginPageButton").click();
let loginButton = doc.getElementById("openPortalLoginPageButton");
is(loginButton.getAttribute("autofocus"), "true", "openPortalLoginPageButton has autofocus");
loginButton.click();
});

let portalTab = yield portalTabPromise;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ add_task(function* checkReturnToAboutHome() {
yield ContentTask.spawn(browser, null, function* () {
let doc = content.document;
let returnButton = doc.getElementById("returnButton");
is(returnButton.getAttribute("autofocus"), "true", "returnButton has autofocus");
returnButton.click();
});
yield pageshowPromise;
Expand Down
5 changes: 4 additions & 1 deletion browser/base/content/test/general/browser_aboutNetError.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ add_task(function* checkReturnToPreviousPage() {

let pageshowPromise = promiseWaitForEvent(browser, "pageshow");
yield ContentTask.spawn(browser, null, function* () {
content.document.getElementById("prefResetButton").click();
let doc = content.document;
let prefResetButton = doc.getElementById("prefResetButton");
Assert.equal(prefResetButton.getAttribute("autofocus"), "true", "prefResetButton has autofocus");
prefResetButton.click();
});
yield pageshowPromise;

Expand Down
3 changes: 3 additions & 0 deletions browser/base/content/test/general/browser_fxaccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ add_task(function* test_verifiedUserEmptyProfile() {
// we first fetch the profile. We want them both to fire or we aren't testing
// the state we think we are testing.
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 2);
gFxAccounts._cachedProfile = null;
configureProfileURL({}); // successful but empty profile.
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
Expand All @@ -135,6 +136,7 @@ add_task(function* test_verifiedUserEmptyProfile() {

add_task(function* test_verifiedUserDisplayName() {
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 2);
gFxAccounts._cachedProfile = null;
configureProfileURL({ displayName: "Test User Display Name" });
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
Expand All @@ -150,6 +152,7 @@ add_task(function* test_verifiedUserDisplayName() {
add_task(function* test_verifiedUserProfileFailure() {
// profile failure means only one observer fires.
let promiseUpdateDone = promiseObserver("test:browser_fxaccounts:updateAppMenuItem", 1);
gFxAccounts._cachedProfile = null;
configureProfileURL(null, 500);
yield setSignedInUser(true); // this will fire the observer that does the update.
yield promiseUpdateDone;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* 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/. */

function test() {
waitForExplicitFinish();

ok(PopupNotifications, "PopupNotifications object exists");
ok(PopupNotifications.panel, "PopupNotifications panel exists");

setup();
}

var tests = [
// Test that for persistent notifications,
// the secondary action is triggered by pressing the escape key.
{ id: "Test#1",
run() {
this.notifyObj = new BasicNotification(this.id);
this.notifyObj.options.persistent = true;
showNotification(this.notifyObj);
},
onShown(popup) {
checkPopup(popup, this.notifyObj);
EventUtils.synthesizeKey("VK_ESCAPE", {});
},
onHidden(popup) {
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked");
ok(this.notifyObj.secondaryActionClicked, "secondaryAction was clicked");
ok(!this.notifyObj.dismissalCallbackTriggered, "dismissal callback wasn't triggered");
ok(this.notifyObj.removedCallbackTriggered, "removed callback triggered");
}
},
// Test that for non-persistent notifications, the escape key dismisses the notification.
{ id: "Test#2",
*run() {
yield waitForWindowReadyForPopupNotifications(window);
this.notifyObj = new BasicNotification(this.id);
this.notification = showNotification(this.notifyObj);
},
onShown(popup) {
checkPopup(popup, this.notifyObj);
EventUtils.synthesizeKey("VK_ESCAPE", {});
},
onHidden(popup) {
ok(!this.notifyObj.mainActionClicked, "mainAction was not clicked");
ok(!this.notifyObj.secondaryActionClicked, "secondaryAction was not clicked");
ok(this.notifyObj.dismissalCallbackTriggered, "dismissal callback triggered");
ok(!this.notifyObj.removedCallbackTriggered, "removed callback was not triggered");
this.notification.remove();
}
},
// Test that the space key on an anchor element focuses an active notification
{ id: "Test#3",
*run() {
this.notifyObj = new BasicNotification(this.id);
this.notifyObj.anchorID = "geo-notification-icon";
this.notifyObj.addOptions({
persistent: true
});
this.notification = showNotification(this.notifyObj);
},
*onShown(popup) {
checkPopup(popup, this.notifyObj);
let anchor = document.getElementById(this.notifyObj.anchorID);
anchor.focus();
is(document.activeElement, anchor);
EventUtils.synthesizeKey(" ", {});
is(document.activeElement, popup.childNodes[0].button);
this.notification.remove();
},
onHidden(popup) { }
},
];
Loading

0 comments on commit ad43916

Please sign in to comment.